Sensors

Use the Sensors tool to sense an event during simulation and to define a response to that event

Create Sensors

  1. From the Project Browser, select the system to which the sensor is to be added.
  2. Right-click on a system in the Project Browser and select Add > Control Entity > Sensor from the context menu.
    OR
    Right-click on a sensor folder in the Project Browser and select Add Sensor from the context menu.
    OR
    From the Model ribbon, click the Sensors icon.
    The Add Sensor dialog is displayed.
  3. Specify a label for the sensor.
  4. Specify a variable name for the sensor.
    By default, variables names of entities in MotionView follow a certain convention. For example, all sensor entities have a variable name starting with “sen_”. This is the recommended convention to follow when building models in MotionView since it has many advantages in model editing and model manipulation.
  5. Click OK to close the window or Apply to continue creating entities.
    Once a sensor entity has been added to the model, the panel for the sensor will automatically be displayed in the panel area.

Edit Sensors

Define the Signals of Sensors

The Signal tab allows you to define the event within the simulation that will trigger the sensor response.

  1. If the Sensors panel is not currently displayed, select the desired sensor by clicking on it in the Project Browser or in the modeling window.
    The Sensors panel is automatically displayed.
  2. Select an option from the Expr: drop-down menu.
  3. Define the properties associated with your choice.
    If Linear is chosen, enter a constant value of displacement, velocity, or acceleration..
    If Curve is chosen:
    1. Select AKIMA, CUBIC, LINEAR, or QUINTIC as the interpolation method.
    2. Enter a value under Independent variable.
      The independent variable should be specified in Templex syntax.
    3. Resolve the curve by double-clicking the Curve collector and selecting a curve from the Select a Curve dialog.
      Note: To use a curve, you first need to define a curve (using the Curves panel) which represents the behavior of the sensor.
    If Spline3D is chosen:
    1. Select AKIMA, CUBIC, LINEAR , or QUINTIC under as the method of interpolation.
    2. Specify an expression for Independent variable X and Independent variable Z.
    3. Resolve the 3D spline by double-clicking on the Spline3D collector and selecting a Spline3D entity from the Select a Spline3D dialog.
      Note: To use a Spline3D entity, you first need to define a spline using the Spline3D panel.
    If Expression is chosen, enter a solver expression for displacement, velocity, or acceleration.

Use User-Defined Properties for a Sensor

If desired, define the sensor equation using the User-Defined tab, which will allow you to specify the properties of the equation using user subroutines.

  1. From the Signal tab, click the User-defined properties check box.
    The Signal tab automatically updates.
  2. Define the user subroutine.
    1. Provide an expression with the USER solver function with parameters being passed to the user subroutine.
    2. Alternatively, activate the Use local file and function name check box to specify a local file where the subroutine code can be accessed by the solver.
      If this option is not specified, MotionSolve will search for a subroutine following its user subroutine loading rules.
    3. Select a function type from the drop-down menu.
    4. Select the local file for the subroutine.
      The type of file to be specified will depend on the selected function type. For example, if DLL/SO is selected, you can specify a file with a .dll extension (for Windows) or an .so extension (for Linux).
    5. Specify the function name in the subroutine that defines the entity, or accept the default name provided by MotionView.

Define the Comparisons of Sensors

The Compare To tab allows you to define the value that the current signal will be compared to.

  1. Click the Compare To tab.
  2. Enter a value to compare the signal against in the Value text box.
  3. Enter a value in the Error text box to specify the tolerance applied to the value to create a numerical bandwidth.
  4. Select one of options for triggering a response.
    Option Description
    Signal is greater than VALUE - ERROR Select to make the response trigger when the signal is greater than the value.
    Signal is less than VALUE + ERROR Select to make the response trigger when the signal is less than the value.
    Abs(Signal) is less than or equal to VALUE + ERROR Select to make the response trigger when the signal is near equal to the value.

Define the Responses of Sensors

The Response tab allows you to specify the action (or actions) the solver should take when the signal is within the Compare To range.

  1. Click the Response tab.
  2. Click any of the check boxes to activate the response.
    Option Description
    Halt simulation The simulation will stop when the sensor is triggered.
    Restart simulation The simulation will start when the sensor is triggered.
    Print to output Results will be written to the output files when the sensor is triggered
    Evaluate expression Evaluate the expression provided when the sensor is triggered.
    New output step Activating this option allows you to provide a value which will result in the solver using a new output step from that point forward.
    Integration step size Reset the integration step size when the sensor is triggered.
    Return to command file Read the next command when the sensor is triggered.
    New pivot sequence Reset the pivot sequence for the solver when the sensor is triggered.
    Export state variable vector Write the state information to a file when the sensor is triggered
  3. If Evaluate expression is chosen, more options become available. From the first drop-down menu, select USER and enter a user expression, or select EXPR, select a type from the second drop-down menu and define the corresponding properties.
    If Linear is chosen, enter a constant value of displacement, velocity, or acceleration..
    If Curve is chosen:
    1. Select AKIMA, CUBIC, LINEAR, or QUINTIC as the interpolation method.
    2. Enter a value under Independent variable.
      The independent variable should be specified in Templex syntax.
    3. Resolve the curve by double-clicking the Curve collector and selecting a curve from the Select a Curve dialog.
      Note: To use a curve, you first need to define a curve (using the Curves panel) which represents the behavior of the sensor.
    If Spline3D is chosen:
    1. Select AKIMA, CUBIC, LINEAR , or QUINTIC under as the method of interpolation.
    2. Specify an expression for Independent variable X and Independent variable Z.
    3. Resolve the 3D spline by double-clicking on the Spline3D collector and selecting a Spline3D entity from the Select a Spline3D dialog.
      Note: To use a Spline3D entity, you first need to define a spline using the Spline3D panel.
    If Expression is chosen, enter a solver expression for displacement, velocity, or acceleration.