|On this page…|
In closed-loop systems, joints and constraints must be mutually compatible. For example, in a four-bar linkage, all revolute joints must spin about parallel axes. If one of the joints spins about a different axis, assembly fails and the model does not simulate.
To simplify the troubleshooting process, SimMechanics™ provides Model Report. This tool helps you pinpoint the joints and constraints that caused assembly to fail. Once you identify these joints and constraints, you can then determine which of their frames to correct—and how to correct them.
In this example, you identify the assembly error source in an aiming mechanism model using Model Report. Then, using Mechanics Explorer, you determine how to correct that error source. The sm_dcrankaim_assembly_with_error featured example provides the basis for this example.
To open the model, at the MATLAB® command line, enter sm_dcrankaim_assembly_with_error. The model opens in a new window.
The figure shows a schematic of the system that the model represents. This system contains four rigid bodies, labeled A-D. These rigid bodies connect in a closed loop via four joints, labeled Ri, Ro, Rg, and Pg. When connected to each other, these components form a system with one degree of freedom.
The model represents the components of this system using blocks. Each block represents a physical component. A World Frame block provides the ultimate reference frame in the model. The figure shows the block diagram that the model uses to represent the double-crank aiming mechanism.
To represent the rigid bodies, the model contains four subsystem blocks, labeled Rigid Body A-D. Each subsystem contains one Solid block and multiple Rigid Transform blocks. The Solid block provides geometry, inertia, and color to the rigid body subsystem. The Rigid Transform blocks provide the frames that you connect the joints to. A Reference Frame block identifies the ultimate reference frame in the subsystem block.
The model labels the rigid body subsystem blocks Rigid Body A-D. To examine the block diagram for a rigid body subsystem, right-click the subsystem block and select Mask > Look Under Mask. The figure shows the block diagram for Rigid Body A.
To represent the joints, the model contains four joint blocks. Three joints provide one rotational degree of freedom between a pair of rigid bodies. You represent each of these joints with a Revolute Joint block. A fourth joint provides one translational degree of freedom between a pair of rigid bodies. You represent this joint with a Prismatic Joint block. The model labels the revolute joint blocks Ro, Rg, and Ri, and the prismatic joint block Pg.
As the model name suggests, this model contains an error. The error prevents the model from assembling successfully, which causes simulation to fail. To update the model and investigate the assembly error:
On the Simulink® menu bar, select Simulation > Update Diagram.
Mechanics Explorer opens with a static display of your model in its initial state. Because the model contains an assembly error, SimMechanics issues an error message. Ignore that message for now.
The Mechanics Explorer utility contains a Model Report tool which identifies the status of joints and constraints. Use the Model Report utility to determine if joints and constraints have successfully assembled. The report also provides information on the configuration of joints and constraints. To see the report:
On the Mechanics Explorer menu bar, select Tools > Model Report.
The model report opens in a new window. The top section of this window identifies the assembly status of the model as a whole. Because assembly failed, the assembly status for this model is Unassembled. Because the source of the assembly error is a joint block, the assembly status for joints is "Unable to assembly all joints".
To identify the joint block that caused assembly fail, examine the model report Joints tab. A red square identifies the problematic joint—Pg. This joint did not assemble, and the model report provides neither position nor velocity information for that joint.
The error message that SimMechanics issued during model update identifies position violation as the root cause of assembly failure. This suggests that the frames which joint Pg connects to are improperly aligned. To confirm this hypothesis, check the orientation of these frames in Mechanics Explorer.
In the Mechanics Explorer tree view pane, click joint Pg.
In the Mechanics Explorer visualization pane, examine the position and orientation of the highlighted frames. These are the frames that appear in turquoise blue.
The two frames are offset along the Z axis. Because joint Pg provides a translational degree of freedom along the Z axis, this offset is valid. However, the follower frame has a different orientation than the base frame. It contains a rotation angle of 90 degrees about the common Z axis with respect to the base frame. Because joint Pg provides no rotational degrees of freedom, this rotation angle is invalid. This angle prevents the two joint frames from aligning correctly, causing assembly to fail.
To correct the assembly error, you must change the orientation of either base or follower joint frames. In this example, you change the orientation of the follower frame so that the model can assemble successfully. To change the orientation of this frame:
Right-click the Rigid Body C subsystem block and select Mask > Look Under Mask.
Double-click the Slide Frame Transform block and select the new parameter values that the table provides.
|Rotation > Pair 2 > Follower||+X|
|Rotation > Pair 2 > Base||+Y|
You can now simulate the model. On the Simulink menu bar, select Simulation > Run. Mechanics Explorer opens with a dynamic display of your model. The figure shows this display. Rotate, pan, and zoom to explore.
You can use the Model Report tool to verify the assembly status. To do this, on the Mechanics Explorer menu bar, select Tools > Model Report. The model report opens in a new window. Check that the assembly status icon for the model and its joints is a green square. The green square indicates that assembly has been successful.
Save the model as aiming_mechanism in a convenient folder. In a subsequent example, you prescribe a joint trajectory using this model.