Introduction:
In Simulink, a rigid body tree represents a system of connected bodies, where each body has a fixed
shape and mass distribution. These bodies are connected through joints, allowing for motion and
interaction between them. Rigid body trees are commonly used in robotics, biomechanics, and
mechanical systems modeling.
To implement a rigid body tree in Simulink, you typically follow these steps:
Modeling the Bodies: Each body in the system needs to be modeled with its geometry and
mass distribution. This can be done using Simulink blocks such as Solid blocks or Custom
blocks with equations representing the body's dynamics.
Defining Joints: Define joints to connect the bodies. Joints specify the relative motion allowed
between connected bodies. Simulink provides blocks for various types of joints like revolute,
prismatic, and spherical joints.
Assembly: Connect the bodies using the defined joints to create the rigid body tree structure, also use
rigid transforms for proper shifting of frames.
Applying Forces and Constraints: Apply external forces, torques, or constraints to simulate
the behavior of the rigid body tree under specific conditions. This could involve adding force
inputs, sensor feedback, or other control signals.
Simulation and Analysis: Run simulations to analyze the behavior of the rigid body tree under
different scenarios. You can analyze motion, forces, energy, etc., to understand the system's
dynamics.
Once the file is saved you will see the name changed from untitled to the name of file
which we saved here in our case it is changed to ‘Lab4Robot’.
Next let’s start building the robot we need the solver configuration, which contains the
solver settings for the robot, we can locate it from simscape<utilities<Solver configuration
or directly by double clicking on the screen and typing solver configuration.
After dragging it on the working space you can place it there we won’t change its setting
and let it go with the default settings.
Next we need to locate the mechanism configuration as if we don’t put ti the model
uniform gravity will be not same and it won’t work as discussed in lab [Link] can find it
again by typing or by path simscape<multibody<utilities<mechanism configuration.
Now drag and drop it also on the workspace and let it go with the default settings also.
Coming towards the last of the three must have things to initialize the robot we have the
world frame, as it will serve for the global reference frame for the rest of the bodies
frame when we start putting mor frames and ultimately bodies in the robot.
It can be located from the path simscape<multibody<frames and transforms<world frame
or again you can use the shortcut by double clicking on the screen and directly searching
for it by typing its name.
Now drag and drop it also let it go with the default settings.
Forming the Base:
For forming the base we need to have rigid transform for making a local coordinate frame
for the base with reference to the world frame we can locate it from the path of world frame
and drop it on the workspace. And connect the circuit as shown below.
Next step is to bring a body element for base lets take it as cylinder from the path
simscape<multibody<body elements<cylindrical solid , drag it and place it on the
screen.
By default it is not in good position for connecting you cane connect it but it will make a
mess of circuit for ease lets flip it to the other side for a neat circuit right click on the block
and you can do the following as shown below:
Now connect it and base is ready just need to define the parameters of lengths etc.
Double click on the base and give values as shown below and also graphics and hit apply.
Now double click on the rigid transform and give half the reading of the body element z
axis so that we can properly set frame at the middle of body else it will stay and world
frame.
Now run the file and you will see the following result and your base is successfully created:
Link 1:
For link1 bring the following elements as done before just one new thing is the joint which is
revolute and can be found from joints in multibody. Keep 2 rigid transform one before the joint and
one after it, the later one will be used for positioning of the body element which in this case is solid
brick and the former frame is for the proper framing of the joint itself. Connect them in the
following fashion:
Now for proper alignment of brick also do the same as done with the cylinder element for the base,
flip it across so that we have a neat circuit at the end.
Define the values and graphics for the link 1 body as shown below:
Now double click on the 1st rigid transform, the one before the joint and give it value sum
of the half of the length of z of the base and half the value of z of link 1.
For 2nd rigid transform we need to give it the value in x which is half of the length of link 1.
Once Done the following arrangement should be finalized .
Click on the run button and you can see the results for link1
Link 2:
Just copy and paste the link 1 elements and change values for convenience as shown below :
Connect the elements and make the following circuit:
Now change the dimesnions of the link and graphics as shown below and to visualize
beffore running you can use F5 key for it as done in link 1.
Now as we are moving frames in x axis so give half the length on link 1 to make the joint
at the far end side of link 1 and put this value in rigid transform 1.
In Rigid Transform 2 give the value of half the length of link 2 for proper positioning
at middle of the body element 2.
Now following circuit is finalized for link 2.
Run the circuit and following results are drawn for robot up to link 2 with 2 revolute joints yet.
End Effector:
For end effector we replace the revolute with the fixed joint or weld joint and copy paste the previous
link and change values as shown in the following pictures:
Now Give the following readings to the end effector element and adjust the graphics:
Give the half reading of x of link 2 in the rigid transform 1 for proper positioning of the weld joint.
In Rigid Transform 2 give half the length of the end effector x axis value for proper positioning of
body’s frame.
Following is the final circuit of the robot now :
Upon running following are the result for the robot.
Result: