Announcement

Collapse
No announcement yet.

Trying to verify equations for 2-segment leg swing.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Trying to verify equations for 2-segment leg swing.

    Hello Everyone,

    I am not sure that this is the right forum for this question. Perhaps someone can direct me to a more appropriate discussion group, researcher or prosthetics manufacturer that works in this area. Maybe this question is more aligned with research on Passive Dynamic Running.

    With the help of Mathcad I was able to derive the equations of motion for a two-segment Winter-type leg under the influence a linear hip torque and the h&v GRFs. The leg is treated as a non-uniform double compound pendulum. The resulting equations are huge.

    I would like to verify that the equations give the right swing leg behavior when I run them through my RK4 algorithm, but I can’t seem to find a second independent solution to the same problem.

    Does anyone know where I might find another source for an algebraic expression for the motion of a 2-segment leg?

    Ted Andresen
    St. Petersburg, FL
    tjacmc@aol.com

  • #2
    Re: Trying to verify equations for 2-segment leg swing.

    Ted,

    Wolfram Alpha has a nice page about the passive double pendulum: http://www.wolframalpha.com/input/?i=double+pendulum. Scroll down to see the equations of motion. The equations are not huge, but they get larger if you solve for the two angular accelerations symbolically.

    With the equations in the form that first comes out of Lagrange's equations, it is easy to add joint moments \((M_1,M_2)\) and ground reaction force \((Fx,Fy)\). The point where the GRF is applied has coordinates x and y which are functions of the angles:

    \(x = L_1 sin\theta_1 + L_2 sin\theta_2\)
    \(y = ...\)

    Derive the partial derivatives of these expressions with respect to theta1 and theta2.

    \(\frac{\mathrm{d}x}{\mathrm{d}\theta_1} = L_1 cos\theta_1 \)
    ...

    Similarly, joint moments are applied to the joint angles \(\varphi_1 = \theta_1\) and \(\varphi_2 = \theta_2 - \theta_1\). The partial derivatives are \(\frac{\mathrm{d}\varphi_1}{\mathrm{d}\theta_1} = 1, \frac{\mathrm{d}\varphi_1}{\mathrm{d}\theta_2} = 0, \frac{\mathrm{d}\varphi_2}{\mathrm{d}\theta_1} = -1, \frac{\mathrm{d}\varphi_2}{\mathrm{d}\theta_2} = 1\).

    On the right hand side of the two Lagrange's equations, replace the zeros by the virtual work done during unit virtual displacements in theta1 and theta2, respectively:

    \( ... = M_1 \frac{\mathrm{d}\varphi_1}{\mathrm{d}\theta_1} + M_2 \frac{\mathrm{d}\varphi_2}{\mathrm{d}\theta_1} + F_x \frac{\mathrm{d}x}{\mathrm{d}\theta_1} + F_y \frac{\mathrm{d}y}{\mathrm{d}\theta_1}\)
    \( ... = M_1 \frac{\mathrm{d}\varphi_1}{\mathrm{d}\theta_2} + M_2 \frac{\mathrm{d}\varphi_2}{\mathrm{d}\theta_2} + F_x \frac{\mathrm{d}x}{\mathrm{d}\theta_2} + F_y \frac{\mathrm{d}y}{\mathrm{d}\theta_2}\)

    This is how that is usually done in robot dynamics.

    Ton van den Bogert
    Last edited by Ton van den Bogert; September 10, 2019, 02:14 PM.

    Comment


    • #3
      Re: Trying to verify equations for 2-segment leg swing.

      Hi Ton,

      Thank you for responding to my post. Coming from industry, I was not fully aware of the approach you outlined. I like the virtual work idea. I’ll have to play with that. For now, I am locked into the complete Lagrangian with a Newton-Raphson controller advancing the equations (EOM’s) through an RK4 algorithm.

      Thanks for the heads-up on WolframAlpha. I am more familiar with Mathematica. I gave several seminars on it. It has a very useful command for outputting algebraic expressions directly into C or FORTRAN.

      I wish it was not so, but the 2-segment Winter leg cannot be represented as a simple double or even a compound double pendulum with uniform segments.

      Using Winter’s terminology, the thigh and foot-shank segments have CM/length ratios (0.433 and 0.606 versus 0.5) and Radii of Gyration/length ratios (0.323 and 0.416 and versus 0.288) that differ from the uniform compound pendulum. This turns it into a non-uniform double compound pendulum. I could not find any literature where the EOM’s for the non-uniform compound double pendulum were offered.

      A few truth models and home experiments have convinced me that the EOM’s that Mathcad generated are okay.

      Sincerely,

      Ted

      Comment


      • #4
        Re: Trying to verify equations for 2-segment leg swing.

        Yes, I noticed also that if you google the double pendulum, you always see the version with point masses, rather than rigid bodies with mass and moment of inertia.

        Furtunately, I just did this last semester in my class, so here are the equations of motion for a double pendulum with two rigid bodies.

        The angles are q1 (the angle between horizontal and link 1) and q2 (the angle between link 1 and link 2). The posture q1=pi/2 and q2=0 represents an inverted pendulum. The posture q1=-pi/2 and q2=0 represents a vertically hanging pendulum. You are interested in the swing phase, so q1 will oscillate around -pi/2. The joint moments are on the right hand side (tau1 and tau2). These would be zero if you want to simulate a passive swing, but you may want to use a passive elastic model to generate tau2 so that the knee won't hyperextend.

        Each segment has properties mass m, moment of inertia I, length L, and center of mass position d. d is the distance from center of mass to the joint that is closest to the fixed pivot, so use 0.433*L for the thigh, etc.

        I derived these equations from Lagrange's equation and verified them by using Autolev to generate Kane's equations. The results were the same.

        doubpend.png
        To use these equations, you must solve the 2x2 linear system for the two angular accelerations and give those to the differential equation solver.

        Ton

        Comment


        • #5
          Re: Trying to verify equations for 2-segment leg swing.

          Hi Ton,

          I really like what you did. I carried the anthropometrics into the deviation. I should have done as you and included them in the moments of inertia. That would have cut the clutter in my EOM’s.

          I don’t see where the horizontal acceleration (vGRF/BM) enters the EOM’s.

          I didn’t mention it, but I work in the moving CM frame in the running gait cycle.

          There’s no gravity acting on the swing leg during the first part of the aerial phase; just hip torque. During stance the swing leg experiences the v&h accelerations generated by the SMM along with the hip torque. After stance, it’s hip torque alone through retraction up to FS.

          Newton-Raphson searches for a hip torque that gets the swing leg from TO through the stance phase to the next FS. Currently, I am trying not to use knee torque, but that may not work because – as you pointed out – the knee may hyperextend.

          Ted

          Comment


          • #6
            Re: Trying to verify equations for 2-segment leg swing.

            I did not include the GRFs. This would be an extra term on the right hand side: A(q1,q2)' * F.

            F is the GRF vector (Fx,Fy) applied to the "ankle" of the pendulum. A is the 2x2 Jacobian matrix [dx/dq1 dx/q2 ; dy/dq1 , dy/dq2] where x and y are the coordinates of the ankle as a function of the joint angles q1 and q2. A' is the transpose of A.

            I will just do one of these matrix elements:
            x = L1*cos(q1) + L2*cos(q1+q2)
            so matrix element A11 = dx/dq1 = -L1 * sin(q1)

            This is how external forces are usually represented in dynamic models of robotic manipulators.

            If you use this model for the stance phase, the dynamics will not be quite right. You have a hip that can't accelerate. Maybe OK, to represent the huge inertia of the upper body. And you have an ankle that is pushed around by the GRF and not constrained in any way. It will be hard to get good movements.

            For stance phase, you can actually use the same 2-link model but turn it upside down to make an inverted pendulum, with ankle attached to the ground and hip free to move. Then you do not need GRF as input. You have to be careful to adjust the mass properties etc to represent the upside down leg. You may have to add upper body mass to the endpoint of the pendulum (which is now the hip).

            Ton

            Comment


            • #7
              Re: Trying to verify equations for 2-segment leg swing.

              Hi Ton,

              What you have given me is very helpful. I only have one other request. Could you post the Lagrangian that you used to generate the equations of motion (EOM) in the doublepend.png file?

              I use a different approach than the one you outlined. I use the EOMs in the moving CM, not Lab, frame. It undergoes 2-D accelerations, so V contains a contribution for hGRF/BM.

              The EOM’s are advanced by an RK4 algorithm governed by a Newton-Raphson (NR) controller. The controller searches for a hip torque that drives the swing leg from its TO to its FS during the other leg’s stance phase.

              I gave a talk on the NR controller at a recent MAA meeting. If you think that others would benefit from understanding how it works, let me know and I’ll post an explanation. It’s very powerful. I have used it for decades.

              Ted

              Comment


              • #8
                Re: Trying to verify equations for 2-segment leg swing.

                I have the equations for the double inverted pendulum with rigid bodies and an external force, but I used Newtonian formalism: http://nbviewer.ipython.org/github/d...Dynamics.ipynb.

                The equations of motion for a double pendulum with rigid bodies are shown in http://www.cs.berkeley.edu/~pabbeel/...rake-Aug09.pdf and http://www.astro.umd.edu/~adhabal/Re..._and_Chaos.pdf. However, they are around a fixed point, not around the moving CM.

                Marcos
                Last edited by Marcos Duarte; April 10, 2015, 08:26 PM.

                Comment


                • #9
                  Re: Trying to verify equations for 2-segment leg swing.

                  Hi Marcos,

                  Thank you. That is precisely what I needed. I wanted to make sure I wasn’t overlooking any terms.

                  The moving CM frame is pretty easy. It gets its h&v accelerations from the SM model.

                  I think I’m correct in reasoning that there is no gravity inside the CM frame between the swing leg TO and the stance leg FS. Then hip torque alone pulls the legs together.

                  When stance begins h&v GRF/BM first appear. Just as vertical acceleration can be included in the potential energy as vGRF(t)/BM*y, there is a similar term for hGRF(t)/BM*x. After stance hip torque works alone.

                  Ted

                  Comment

                  Working...
                  X