I'm trying to create a simple model of a body which will then be later controlled. However, I am running into trouble when I'm connecting both legs to the body.
What I have done is that I have built the model starting with the left foot, attached to the world frame, and then up to the torso. I ended up duplicating one of the legs and attached it again the the world frame and the torso, effectively closing the "loop". However, I get the following error message when trying to run the simulation.
'untitled/Right Leg/Hip/Revolute Joint' has a degenerate mass distribution on its follower side.
I have a feeling this has to do with the fact that both legs are attached to the torso and to the world frame.
If I let the legs dangle from the torso by attaching the torso to the world frame directly, then it works. But I need the legs to be attached to a "ground/floor"
What would be the correct way to model this so that I can later actuate the joints?
I believe you need three connections between your robot and the floor:
A contact force between the left foot and the floor
A contact force between the right foot and the floor
A virtual connection that lets you specify the initial height of the torso above the floor.
The virtual connection to specify the initial height above the floor is usually done with a 6-DOF Joint. It doesn't constrain anything, but lets you specify initial position, orientations, and velocity of the torso.
The contact force can be done with a hard stop, but I would recommend you look at this library on the MATLAB Central File Exchange:
https://www.mathworks.com/matlabcentral/fileexchange/47417-simscape-multibody-contact-forces-library
This will allow you to model contact between the feet and the floor, as well as friction which will enable the robot to walk. The force you need is the Face to Plane contact force.
Give it a try and see what you think.
--Steve
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With