Kinematic constraints for double pendulum

117 views
Skip to first unread message

Luuk Vos

unread,
Jun 21, 2022, 4:11:18 PM6/21/22
to CasADi
Hi,

We've been working on a program that tries to minimize the net moments in a double pendulum while moving to a desired final position. The base of the double pendulum is fixed at (0,0) and the endpoint of the double pendulum is constrained to only move in the y-direction. The equations are formulated such that input force (F3x) is needed to enforce the constraint on the endpoint.

We have checked our expressions of the equations of motion in a passive (without input moments) forward simulation. We checked the constraint violation and the energetics of the system and in a forward simulation model these seem to check out fine.

However, when we try to run an optimal control optimization for this particular problem, we encounter the error: "Not enough degrees of freedom". Which seems to result from the equality constraint of the endpoint (line 91 92 in run_casadi_double_pendulum).

Thus our question is: how should we implement this kinematic constraint on a double pendulum in Casadi?

Attached is the program we wrote to tackle this problem and the script Ab_double_pendulum_F3x which defines our equations of motion.

Kind regards,
Roeland and Luuk
run_casadi_double_pendulum.m
Ab_double_pendulum_F3x.m

Bruno M L

unread,
Jul 15, 2022, 2:32:24 PM7/15/22
to CasADi
Hi!

I think you could try defining your system as a DAE and not a ODE. This constraint that you want to do could be an algebraic variable. Maybe it will work, I dont know.

Good luck!

Reply all
Reply to author
Forward
0 new messages