Full Library / Algorithmic / Analog / event generator / LevelCrossingDetector
Block Name: LevelCrossingDetector
- public class LevelCrossingDetector
- extends VisualSim.actor.TypedAtomicActor
- implements VisualSim.simulators.ct.kernel.CTStepSizeControlActor, VisualSim.simulators.ct.kernel.CTEventGenerator
An event detector that converts continuous signals to discrete events when the continuous signal crosses a level threshold.
The direction parameter can constrain the actor to detect only rising or falling transitions. It has three possible values, "rising", "falling", and "both", where "both" is the default.
When the trigger equals the level threshold (within the specified errorTolerance), this actor outputs a discrete event with value defaultEventValue if useEventValue is selected. Otherwise, the actor outputs a discrete event with the value as the level threshold.
This actor controls the step size such that level crossings never occur during an integration. So, this actor is only used in Continuous-Time domain.
defaultEventValue
public VisualSim.data.expr.Parameter defaultEventValue
- A parameter that specifies the value of output events if the useEventValue parameter is checked. By default, it contains a DoubleToken of 0.0.
direction
public VisualSim.data.expr.StringParameter direction
- A parameter that can be used to limit the detected level crossings to rising or falling. There are three choices: "falling", "rising", and "both". The default value is "both".
errorTolerance
public VisualSim.data.expr.Parameter errorTolerance
- The parameter of error tolerance of type double. By default, it contains a DoubleToken of 1e-4.
level
public VisualSim.data.expr.Parameter level
- The parameter that specifies the level threshold. By default, it contains a DoubleToken of value 0.0. Note, a change of this parameter at run time will not be applied until the next iteration.
output
public VisualSim.actor.TypedIOPort output
- The output port. The type is at least the type of the defaultEventValue parameter.
trigger
public VisualSim.actor.TypedIOPort trigger
- The trigger port. Single port with type double.
useDefaultEventValue
public VisualSim.data.expr.Parameter useDefaultEventValue
- The parameter that indicates whether to use the default event value.
_level
protected double _level
- The level threshold this actor detects.
Created with the Personal Edition of HelpNDoc: Easily create iPhone documentation