SimMechanics    

Modeling Actuators

The SimMechanics Sensors & Actuators library provides a set of Actuator blocks that enable you to apply time-dependent forces and motions to bodies, joints, and drivers.

You can use Actuator blocks to perform the following tasks:

In general, actuators can apply any combination of forces and motions to a machine provided that

Actuating a Body

You can use actuators to apply forces and/or torques, but not motions, to bodies. (You can apply motions to a body indirectly, using Joint Actuators. See Applying Motions to Bodies following.)

To actuate a body:

  1. If there is not already an unused Connector Port available for the Actuator, create a Body CS port on the Body for the Actuator. See the Body block reference if you need to learn how.

  2. Drag a Body Actuator block from the Sensors & Actuators library into your model and connect its output port to a Body CS port on the Body.
  3. Open the Actuator's dialog box.
  4. Choose to apply a force or torque to the body:
  5. Select the coordinate system used to specify the applied torque from the Using reference coordinate system list.
  1. The list allows you to choose either the World CS or the Body CS of the port to which you attached the Actuator.

  1. Create vector signals that specify the value of the applied torque and force at each time step.
  1. You can use any Simulink source block (for example, an Input port or a Sine Wave block) or combination of Simulink blocks to create the Body Actuator signal. You can also use the output of a Sensor block connected to the Body as input to the Sensor, thereby creating a feedback loop. Such loops are useful for modeling springs and dampers (see Modeling Sensor-Actuator Feedback.)

  1. Connect the force and/or torque signal to the input port of the Actuator.
  1. If you are applying both a force and a torque to the body, connect the force and torque signals to the inputs of a two-input Mux block. Then connect the output of the Mux block to the input of the Actuator.

Body Actuator Example: Pure Kinetic Friction

The mech_ballistic_kin_fric model in the Demos library provides an example of how to implement pure kinetic friction. This type of friction is a continuous force that depends on a body's motion relative to a medium (such as air), as well as on physical characteristics of the body. Kinetic friction, unlike "stiction," involves no "sticking" or locking of motion, and the friction is not discontinuous. While you could use the Joint Stiction Actuator, this is not necessary. This model applies air friction or drag to a projectile with a Body Actuator.

Open the Air Drag subsystem. If you double-click the block, a mask dialog box opens asking for the drag coefficient Cd. If you right-click the block and select Look under mask, the subsystem itself appears:

The Air Drag subsystem computes the air friction according to a standard air friction model. (See the Aerospace Blockset documentation for more information.) The drag always opposes the projectile's motion and is proportional to the product of the air density, the projectile's cross-sectional area, and the square of its speed.

Run the model with the default drag coefficient (zero). The XY Graph window opens to plot the parabolic path of the projectile. Now open the Air Drag dialog again and experiment with different drag coefficients Cd. Start with small values such as Cd = 0.05. For a rigid sphere, Cd is two. The effect of the drag is dramatic in that case.

Applying Motions to Bodies

The Body Actuator block cannot actuate a Body with motion signals. But you can construct such body motion actuators with a combination of other blocks. See Joint Actuator Example: Body Driver.

Actuating a Joint

You individually actuate each of the prismatic and revolute primitives of an assembled joint. You can apply

To actuate a prismatic or revolute joint primitive of an assembled joint:

  1. Create an Actuator port on the Joint block for the primitive (see Creating Actuator and Sensor Ports on a Joint).
  2. Drag a Joint Actuator or Joint Stiction Actuator from the Sensors & Actuators library into your model and connect its output port to the Actuator port on the Joint.
  1. The remaining steps in this procedure apply to the creation of a standard Joint Actuator. For information on creating a stiction actuator, which applies classical Coulombic friction to a prismatic or revolute joint, see the Joint Stiction Actuator block reference page.

  1. Open the Joint Actuator's dialog box.
  2. Select the primitive you want to actuate from the Connected to primitive list on the dialog box.
  3. Select the type of actuation you want to apply, either Generalized forces or Motion.
  4. If you are actuating a prismatic primitive:
  5. If you are actuating a revolute primitive:
  6. Click OK to apply your choices and dismiss the dialog box.
  1. Each joint primitive that you motion-actuate is lost as a true degree of freedom in your machine. That is because the DoF can no longer respond freely to externally applied forces or torques. See Counting Degrees of Freedom.

  1. Create a signal that specifies the applied force, torque, or motions at each time step.
  1. You can use any Simulink source block or any combination of blocks to create the actuator signal. You can also connect the output of a Sensor block attached to the Joint to the Actuator input, thereby creating a feedback loop. You can use such loops to model springs and dampers attached to the joint.

    A force or torque signal must be a scalar signal. A motion signal must be a 1-D array signal comprising three components: position, velocity, and acceleration. The directionality of the joint determines the response of the follower to the sign of the actuator signal (see Joint Directionality).

  1. Connect the Actuator signal to the Actuator port on the Joint.

Joint Actuator Example: Body Driver

The mech_body_driver model in the Demos library illustrates the use of Joint Actuators to create a custom driver.

The Body Driver subsystem accepts an 18-component signal that feeds the coordinates, velocities, and accelerations for all six relative DoFs between Body and Body1. The subsystem uses a Bushing block that contains three translational and three rotational primitives to represent the relative DoFs.

You can modify the body driver to move only one of the bodies, thereby creating a motion actuator. To move Body1 relative to World, for example, remove the blocks Body and Weld and connect the subsystem Body Driver directly to Ground.

Joint Stiction Actuator Example: Mixed Static and Kinetic Friction

The mech_dpen_sticky model in the Demos library illustrates a driven double pendulum, with "sticky" friction or stiction applied to both revolute joints with the Joint Stiction Actuator block.

Open the unmasked Joint1 or Joint2 Stiction Model blocks (marked in yellow) to view the subsystems:

Each Stiction subsystem contains a Joint Stiction Actuator block (marked in orange) that requires static and kinetic friction coefficients via their respective blocks. For either revolute, an angular velocity threshold, specified through the block dialog, determines if a joint locks. Once locked, the joint cannot move until a combination of forces reaches a threshold specified by the Forward Stiction Limit or Reverse Stiction Limit.

Run the model with different kinetic and static friction coefficients and different velocity thresholds. View the results in the Scope blocks and through a visualization window. You can find more details on how stiction works in SimMechanics by consulting the Joint Stiction Actuator block reference page.

Actuating a Driver

Actuating a Driver allows you to specify the time dependence of the rheonomic constraint applied by the Driver.

To actuate a Driver:

  1. Create an additional Connector Port on the Driver for the Actuator.
  1. Create the additional port in the same way you create an additional Driver port on a Joint (see Creating Actuator and Sensor Ports on a Joint).

  1. Drag an instance of a Driver Actuator from the Sensors & Actuators library into your model.
  2. Connect the Actuator's output port to the Actuator port on the Driver.
  3. Create a signal that specifies the time dependence of the Driver constraint.
  4. Connect the actuation signal to the input port of the Driver Actuator.

Specifying Initial Positions and Velocities

The Joint Initial Condition Actuator (JICA) block allows you to specify the initial positions and velocities of unactuated joints and hence the bodies attached to them. You can use JICA blocks to

Using JICA Blocks

Specifying initial conditions on a joint is similar to actuating a joint. In fact, you can think of specifying initial conditions as a special kind of actuation: one that occurs only once at the beginning of simulation. That is why the JICA block resides in the Sensors & Actuators library.

You must specify initial conditions separately for each desired translational and rotational DoF by connecting each corresponding prismatic and revolute primitive to a JICA. (You cannot specify ICs for weld and spherical primitives.)

To specify the initial velocity and/or position of a joint primitive:

  1. Drag a JICA block from the Sensors & Actuators library and drop it into your model window.
  2. Create an additional Connector Port on the Joint block containing the primitive whose initial condition you want to specify.
  3. Connect the Connector Port on the JICA block to the new Connector Port on the Joint block.

  1. Open the JICA block's dialog box.
  2. Select the primitive you want to actuate from the Connected to primitive list.
  3. Enter the initial velocity of the primitive, relative to the Body CSs attached to the Joint, in the Initial velocity field.
  4. Select the velocity units from the list to the right of the Initial velocity field.
  5. Enter the initial position vector of the primitive, relative to the Body CSs attached to the Joint, in the Initial position field.
  6. Click Apply or OK.

JICA Example: A Simple Pendulum

Open mech_spen from the Demos library, then open the Sensors & Actuators library. Follow the steps from the preceding section, Using JICA Blocks, to connect and configure one Joint Initial Condition Actuator block to the Revolute block. This Joint contains only one primitive, R1, which the Actuator automatically selects by default in this case.

Set the initial conditions in two ways and compare the resulting simulations in the Scope:

  1. First set the Initial position (angle) to 60 deg, which is 60o down from the left horizontal (30o left and up from vertically down), and the Initial velocity to 0 deg/s.
  2. Run the simulation for one second. Note in Scope that the initial angle (yellow curve) is displaced upward to 60o, while the initial velocity (purple curve) still starts at zero.

  3. Now reset the Initial velocity to 30 deg/s, leaving the Initial position (angle) at 60 deg.
  4. Rerun the simulation for one second. Note in Scope that the initial angle is still displaced upward to 60o, but the initial velocity is also displaced upward to 30o/sec.

The joint directionality is assigned in mech_spen so that the positive rotation axis is the +z-axis. Looking from the front, positive rotation swings down and right, counterclockwise.


  Modeling Constraints and Drivers Modeling Sensors