Four-bar mechanism

OpenSim Moco is a software toolkit to solve optimal control problems with musculoskeletal models defined in OpenSim using the direct collocation method.
POST REPLY
User avatar
dani mendez
Posts: 24
Joined: Tue Aug 07, 2018 1:40 am

Four-bar mechanism

Post by dani mendez » Tue Aug 18, 2020 9:09 am

Hello, I want to carry out the kinematic and inverse dynamic study of a four-bar mechanism. The mechanism is made up of 3 movable bars and 1 fixed, and I use 3 joints and 1 point on line constraint.
The mechanism has a degree of freedom and when performing the kinematic study at constant speed for the input bar I obtain a non-zero acceleration (something that does not make sense) and if I perform the inverse dynamic study the results are not coherent because opensim omits the constraint . I was wondering if this problem can be solved in opensim-moco, I am trying with MocoInverse but not getting the speedups as a result. Somebody could help me?. Can it be solved with Opensim or Opensim-Moco? I am trying to solve this simpler problem to understand how opensim works before using it in a musculoskeletal model.
Thank you
Attachments
Four bar mechanism.jpg
Four bar mechanism.jpg (49.5 KiB) Viewed 1368 times

User avatar
Nicholas Bianco
Posts: 1051
Joined: Thu Oct 04, 2012 8:09 pm

Re: Four-bar mechanism

Post by Nicholas Bianco » Tue Aug 18, 2020 1:42 pm

Hi Dani,

Moco does support kinematic constraints, but MocoInverse specifically assumes that the kinematics that you input already obey any kinematic constraints in the model. If you're kinematics do obey the kinematic constraints, MocoInverse will compute constraint forces that would be necessary to enforce the constraint.

How are you computing the acceleration for the input bar? For example, your actuator could be moving at a constant speed, but if the bar is rotating points on the bar will be accelerating.

-Nick

User avatar
dani mendez
Posts: 24
Joined: Tue Aug 07, 2018 1:40 am

Re: Four-bar mechanism

Post by dani mendez » Wed Aug 19, 2020 10:44 am

Hello Nicholas, first of all thank you for your reply.

The mechanism has 1 degree of freedom, that allows me to enter the movement using a single link and the others move accordingly.
As input I use an angular velocity of 1 rad / s constant, which means that the angular acceleration must be 0, but MocoInverse only offers me the results of position and velocity of the joints and I would like to also obtain the accelerations. Is it possible to obtain the accelerations?
Thank you

User avatar
Christopher Dembia
Posts: 506
Joined: Fri Oct 12, 2012 4:09 pm

Re: Four-bar mechanism

Post by Christopher Dembia » Wed Aug 19, 2020 11:06 am

Dani,

I'm curious: could you describe why you want to use MocoInverse (prescribing a given motion) rather than MocoStudy (predicting a new motion)?

If you provided the motion, you may already know the accelerations. Where is the input motion from?

You could do a prescribed-motion forward simulation to compute accelerations, but this is pretty much the same as doing finite differences (or taking the derivative of a spline fit to your motion) on your own.

User avatar
dani mendez
Posts: 24
Joined: Tue Aug 07, 2018 1:40 am

Re: Four-bar mechanism

Post by dani mendez » Fri Aug 21, 2020 2:58 am

Hi Christopher,

My ultimate goal is to study a passive arm exoskeleton, the problem I have is that when trying to analyze the moments of the joints I get unexpected results because Opensim seems to bypass the constraints when performing the inverse dynamics.
To better understand how Opensim works, I am testing the simplest mechanism that I can think of (the 4 bars) which includes a constrain to close the mechanism. This mechanism has 1 degree of freedom and behaves like a rocker handle. I have created my own trc file indicating the position of the input bar at different instants of time (setting a constant angular velocity for the crank) and I want to obtain the velocity and acceleration position of the rest of the bars to check if I get the correct results. Can I solve this kind of problem with Opensim Moco? Is it better to use MocoStudy? or should I use Forward dynamics?
Thank you very much.

User avatar
Christopher Dembia
Posts: 506
Joined: Fri Oct 12, 2012 4:09 pm

Re: Four-bar mechanism

Post by Christopher Dembia » Fri Aug 21, 2020 9:45 am

Thanks for those details.
I have created my own trc file indicating the position of the input bar at different instants of time (setting a constant angular velocity for the crank) and I want to obtain the velocity and acceleration position of the rest of the bars to check if I get the correct results.
It seems that you used Inverse Kinematics to obtain the values of all generalized coordinates. Inverse Kinematics obeys your kinematic constraints, but accelerations are not an output of Inverse Kinematics. If you want accelerations, I would prescribe the motion of any one single coordinate in your model and perform a forward simulation. The values of the remaining coordinates should be determined by the kinematic constraint. Alternatively, because the Inverse Kinematics solution already obeys the kinematic constraints, you could prescribe the values of all coordinates and remove the kinematic constraint.
Can I solve this kind of problem with Opensim Moco? Is it better to use MocoStudy? or should I use Forward dynamics?
For the verification you're performing now, I don't think Moco is necessary. Regarding what tool you should use once you move on to your scientific question regarding an exoskeleton, all of Moco's tools could potentially work for you.

Unlike MocoInverse, MocoStudy and MocoTrack will enforce the kinematic constraint. Forward simulations will also enforce kinematic constraints.

POST REPLY