I built a model of a robot joint with torsional elasticity connecting a rigid beam in simscape multibody. In the model, I used 2 revolute joints to act as the 2 rotational degrees of motor and torsional elasticity, which are coaxial, just like the real physical model. When the motor joint is supplied with actuation，ie. calculating the forward kinematics and dynamics, the simulation runs well.
But a singularity error occurred when I tried to calculate the inverse dynamics. I set the motor joint's 2 actuation items both as automatically calculated, the elastic joint's actuation torque as none and motion as auto, provided desired motion to the beam's end tip. In such a case, the inverse dynamics model has one unique solution in the real physical model if the initial condition is set, and the solution also exists in other simulation environment like Modelica. However, in the simscape multibody, the inverse dynamics cannot be calculated. I guess it's because the inverse kinematics is calculated first and singularity problem occurred.
So is there any way to calculate the inverse dynamics of the above model? After all, the joint elasticity is a important property to the robot model, especially in some high speed motion control problems. Thanks a lot!
The model I built and error message can be seen as below, the .slx file is also attached.