I am doing inverse dynamics in Matlab simmechanics in which position and orientation will be input to the end effector. But it shows error as below.
Error originates in Mechanical block rob33/Subsystem2/Subsystem1/Custom Joint. The coordinate systems attached to this joint must lie on the prismatic axis (for 1 axis) or in the plane of the prismatic axes (for 2 axes). If joint has no prismatic axes, the attached coordinate systems must be collocated, within tolerances.
In subsystem1, I used custom joint to give orientaion input. Susystem1 model and custom joint block parameters is given below figure.
Parameters of link1-1 and parallel constaints is given in below figure.
I solved this problem by seeing below image from internet. This image explain the constraints in coordinate system in simulink.
As I have custom joint (in between ground and link 1-1) with R1R2R3 joints so body1 CS and body2 CS should coincident.
To do this, I copy CS3 of link1-1 and paste it into CS of ground.
SimMechanics isn't an "inverse dynamics" engine, it's not an inverse kinematics engine, it's a "forward dynamics" or just "dynamics" engine. You provide link dimensions, inertias, and joint constraints. Then you provide either an applied force or an applied motion, SimMechanics propagates those forces (or equivalent forces, in the even of applied motions) through your model, and you get an output that shows what your system does in the presence of those forces.
Each joint or link has an input location ("Base") and an output locations ("Follower"). Links have inertias and fixed transforms between base and follower, joints have no inertias and obviously have variable transforms between base and follower.
Each system has one and only one ground. This provides your zero-reference.
So, reading your first diagram from left to right, you have a "Root Ground", a welded base, then you start building your robot with joint, link, joint, link, etc.
Eventually you get to "Link 4-1", which I'm assuming is supposed to be an end effector.
Here's where you get into trouble - you tie some coordinate frame from the end effector to "Subsystem1" by attaching it to the follower (output) of a pair of parallel constraints.
Those parallel constraints are attached to the follower of a link, which is the follower of a custom joint, which is attached to ground!
You have made a closed loop, starting and ending at a ground connection.
The problem with this is that SimMechanics seems to be especially terrible at solving for initial conditions. If your starting/default orientation for the revolute joints and those linkages doesn't result in an end effector pose that exactly matches the starting/default orientation for the custom joint and the subsystem1 link, then you get this error because the difference in pose matching results in a separated joint somewhere - typically where you tie back to ground. This is in Subsystem, where the ground connection attaches to custom joint 1, which is where you're getting the error.
It looks like maybe you're trying to do inverse kinematics by creating a "puppet" - you provide a position and an orientation and rely on the SimMechanics solver to find the joint angles that allow the arm to reach that pose. Again, the problem here is if you start with a set of initial conditions where your initial input pose doesn't correspond to your initial robot pose.
You could also get this error if you use your input pose to drive the arm to an unreachable subspace. At that point, the arm "locks up," the input continues to move, and in one time step a joint separates somewhere and you hit a "not coincident" error like this again.
My suggestion would be to check the default orientation of the arm by commenting out the input subsystem1 code (highlight, right click, and choose "comment out). Then uncomment the input, comment out the robot arm (except the end effector, of course), and see if the end effector is in the same position. If it's not, there's your problem. Adjust your default input/robot joint angles as required to get the two to mesh.
Not the answer you're looking for? Browse other questions tagged inverse-kinematics matlab simulation simulator or ask your own question.