Simulate Conveyor Belt Model

What the Example Represents

This example model uses a few blocks in the library to simulate a simple machine with feedback control. You will see how SimMechanics™ features build upon standard Simulink® features to model a mechanical system.

The example model simulates a conveyor belt loading mechanism. A simple controller (not shown), with a sensor and an actuator, guides the mechanism with a saturation limit and anti-windup logic for the applied torque. You can adjust the controller and set the stopping point for the pusher.

Conveyor Loader Mechanism

What the Example Illustrates

The conveyor mechanism example illustrates some important SimMechanics features:

  • Representing bodies and degrees of freedom with Body and Joint blocks, respectively

  • Using SimMechanics blocks with normal Simulink blocks

  • Feeding Simulink signals to and from SimMechanics blocks with Actuator and Sensor blocks, respectively

  • Encapsulating groups of blocks into subsystems

  • Visualizing and animating a mechanism by its component bodies

    Caution    You might want to make modifications to this example model. To avoid errors,

    • Do not attempt to connect Simulink signal lines directly to SimMechanics blocks other than Actuators and Sensors.

    • Keep the collocation of the Body coordinate system origins on either side of each assembled Joint to within assembly tolerances.

      Saving modified example models in a different folder from the examples is recommended.

The following figure shows a detailed schematic of the conveyor belt loading mechanism.

Opening the Model

To get started quickly with the conveyor example model, follow either of these steps:

  • Enter mech_conveyor at the MATLAB® command line.

  • If you are working with the MATLAB Help browser, click the model name mech_conveyormech_conveyor here.

The Block Diagram Model

The block diagram model opens in a model window.

What the Model Contains

Here are some critical features of the model:

  • Ignore the Position Controller, Joint Sensor, and Joint Actuator blocks for a moment. Note that the loading mechanism follows the tree of bodies and joints shown in the figure, Conveyor Loader Mechanism:

    • There are four rotating link bodies and one sliding pusher body, as well as three ground points on the immobile mounting represented by Ground blocks. Double-click the Body and Ground blocks to see their dialog boxes.

    • The pusher slides and the links rotate relative to one another and to the ground points on the mounting. There are seven apparent degrees of freedom (DoFs) in the system, represented by seven Joints, but the geometry constrains the motion to one actual DoF. Double-click the Revolute blocks to see how rotational DoFs are expressed in their dialog boxes.

    • The Prismatic block expresses the linear motion of Pusher relative to Ground_2. The Revolute block expresses the angular motion of Link4 (the crank of the whole mechanism) relative to Ground_1.

  • The Joint Sensor detects the position of Pusher via the Prismatic block. The Joint Actuator applies torque to Link4 via the Revolute block. Double-click the Sensor and Actuator blocks to view how the mechanical motions and forces/torques are transformed into Simulink signals.

  • The Position Controller subsystem converts the Pusher position information into a feedback signal to actuate Revolute and thus Link4. You can open the Position Controller block to view this subsystem, which is made of normal Simulink blocks.

  • The Reference Position block gives you control over the stopping position of the pusher by modulating the control signal that actuates Revolute. Maintaining the initial pusher position requires a fixed torque on Revolute.

  • Open the Scope block. You can view both the Pusher position in millimeters (mm) relative to Ground_2 as the Measured Position plot and the torque in newton-meters (N-m) applied to Link4 relative to Ground_1 as the Torque plot.

Running the Model

You can now run the model as it is when you first open it:

  1. In the Simulation menu, select Configuration Parameters. The Configuration Parameters dialog box appears. Select the Solver node:

    1. The preset Stop time is inf, so the simulation keeps running once you start it. You should leave it at inf and stop the simulation manually the first few times you run it.

      Later you can apply a finite stop time (in seconds) if you want.

    2. Leave the Solver options entries at default values and close the box.

  2. From the Simulation menu, select Start. In Microsoft Windows®, you can also click the Start button in the model window toolbar.

    The measured position of the pusher and the torque applied to maintain that position start and remain essentially constant in the Scope plots. The applied torque is adjusted to maintain the initial pusher position.

  3. To see greater detail at the simulation start, stop the simulation before the time passes 20 seconds and zoom in on the Scope plots.

Modifying the Model

Here is a modification of the example you can try. It illustrates the simple controller that you can adjust to change the motion of the pusher.

To make these modifications, it is best to close and restart the example.

Changing the Pusher Reference Position

The Reference Position block is actually a Simulink Slider Gain block (from the Simulink Math Library) and controls where the pusher comes to rest.

You can adjust the Reference Position block to change where the pusher stops:

  1. Open the Reference Position block. You see an adjustable slider to set the position of the pusher's rest point.

  2. Enter values in the Low and High fields to set the lower and upper limits of the allowed slider range. The defaults in this example are 0 and 0.2, with implied units of meters (m).

  3. Enter a value in the central field to set the pusher stopping point, which you can also adjust by clicking and dragging the slider between the lower and upper limits. The default is 0 (meters).

You can apply changes to the reference position to the simulation in two ways:

  • Reset the Reference Position block first, then start the example. You see the pusher trajectory track differently now, toward the new stopping point.

    For example, resetting the Reference Position to 0.1 and restarting the example produces these Scope plots, with Autoscale and zooming applied. The asymptotic measured position now tends to 100 mm (0.1 m), and the torque applied to keep the pusher there has changed:

  • Start the example with the Reference Position block open and move the slider up and down as the simulation runs. Watch the Scope. The measured position and necessary torque change to follow the new reference position.

Visualizing and Animating the Model

Another modification you can make illustrates a powerful SimMechanics feature, visualization of a mechanism and animation of its simulated motion.

You can visualize and animate the conveyor mechanism by opening the SimMechanics visualization window. This window lets you display the bodies in two standard abstract forms:

Convex Hulls

First try visualizing the conveyor with bodies displayed as convex hulls:

  1. From the Simulation menu, select Configuration Parameters. The Configuration Parameters dialog box appears.

  2. Select the SimMechanics node. In the Visualization area, select the Display machines after updating diagram and Show animation during simulation check boxes.

  3. Leave the other defaults as they are and close the dialog. From the Edit menu, select Update Diagram.

    A SimMechanics visualization window appears, displaying the conveyor at rest in its initial state.

    The bodies are displayed in the default geometry, as convex hulls. The bodies and Body coordinate system axis triads are also displayed as defaults.

  4. Change Reference Position to a nonzero value such as 0.1 or 0.2.

  5. Restart the simulation. The window animates the conveyor in motion. You can compare this motion to the plots in the scope.

  6. Click a body in the visualization window. In the model window, the corresponding Body block is highlighted in red. The block name appears at the lower left of the visualization window.

  7. Examine the visualization window menus and tool bar.

    Here, you can reconfigure the display properties: bodies, Body CS axis triads, colored fill-in body surface patches connecting Body CSs on the same body, and viewpoint orientation.

  8. Leave the visualization window open for the next set of steps.

Equivalent ellipsoids

Now visualize the conveyor with bodies displayed as ellipsoids:

  1. From the Model menu in the menu bar, select Body Geometries > Ellipsoids, so that a check mark appears beside the menu entry.

    The display in the visualization window changes. The conveyor appears at rest in its initial state but with the bodies displayed as equivalent ellipsoids.

  2. Restart the simulation. The viewer now animates the conveyor in motion.

  3. Use the menus to experiment with the visualization settings. The toolbar contains most of these functions as well.

  4. While the animation is running, open the Reference Position block and move the slider up and down. In addition to what you can see in the Scope plots, the window directly animates the pusher trajectory in space as the mechanism responds to your adjustment.

Was this topic helpful?