Lagrangian: Inverted telescoping pendulum (robot leg)

  • Context: Graduate 
  • Thread starter Thread starter garethpriede
  • Start date Start date
  • Tags Tags
    Lagrangian Pendulum
Click For Summary

Discussion Overview

The discussion revolves around the application of Lagrangian mechanics to model the dynamics of an inverted telescoping pendulum, specifically in the context of a robot leg that changes length while transitioning between states. Participants explore the mathematical formulation of the Lagrangian, the effects of friction, and control strategies for maintaining balance during the rocking motion of the robot.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant describes a system where a mass on a lever rises towards the vertical on a frictionless pivot, questioning the correctness of their Lagrangian formulation and whether energy from extending the leg should be included.
  • Another participant challenges the assumption of a frictionless pivot, suggesting practical alternatives like using a position sensor for control instead of a mathematical model.
  • A later reply emphasizes the need for a solid mathematical foundation for control system design, indicating that simplifications are necessary but should not compromise the model's integrity.
  • One participant proposes using the parallel-axis theorem to account for the mass-moment of inertia, suggesting this could address the missing terms in the Lagrangian formulation.
  • Another participant introduces the concept of modeling friction using Rayleigh dissipation, indicating how to incorporate frictional forces into the Lagrangian framework.
  • One participant elaborates on the robot's intended motion, describing a rocking mechanism between legs and the control of leg length to maintain balance, while expressing a desire for a non-linear model of the system.
  • A participant provides a detailed mathematical approach to the Lagrangian, including the position vector and kinetic and potential energy expressions, while noting that only the leg length is actuated.

Areas of Agreement / Disagreement

Participants express differing views on the assumptions made regarding friction and the necessity of a frictionless pivot. There is no consensus on the best approach to model the system or the completeness of the initial Lagrangian formulation, indicating multiple competing views remain.

Contextual Notes

Participants acknowledge limitations in their models, such as the exclusion of friction in the initial discussions and the need for further experimental validation of the dynamics involved. The complexity of the system, particularly with variable leg length and the dynamics of the robot's motion, adds to the challenges of creating an accurate model.

Who May Find This Useful

This discussion may be of interest to robotics engineers, control system designers, and students studying dynamics and Lagrangian mechanics, particularly those focusing on non-linear systems and robotic motion control.

garethpriede
Messages
6
Reaction score
0
Hi, hopefully someone can check my logic.

I have a lever with a mass on top which is rising towards the vertical on a frictionless pivot. The length of the lever can change. (In reality this is a robot rocking onto a foot and straightening its leg). The intention is to bring the lever to a halt at the vertical by continuously controlling the length.

I've been trying to use the Langrangian, but I'm not sure if I've captured the variables correctly.

x is the length of the leg, theta is the angle from the vertical (so 0 is upright). (I hope my latex paste comes out ok)

L=T-V \\
L=\left[\frac{1}{2}m\omega^{2}+\frac{1}{2}m\dot{x}^{2}\right]-mgxcos(\theta) \\
L=\frac{1}{2}m(x^{2}\dot{\theta}^{2}+\dot{x}^{2})-mgxcos(\theta)\\
\frac{d}{dt}\frac{\partial L}{\partial\dot{\theta}}=\frac{\partial L}{\partial\theta}\\
m\dot{x}^{2}\ddot{\theta}=mgxsin(\theta)\\
\frac{d}{dt}\frac{\partial L}{\partial\dot{x}}=\frac{\partial L}{\partial x}\\
m\ddot{x}=mx\dot{\theta}^{2}+mgsin(\theta)

What worries me is the first partial derivative, something seems to be missing. Do I need to account for the energy involved in extending the leg?

Then if you don't mind a mini part 2, if the pivot has friction, can I still use the Lagrangian (I assume not, but perhaps it's just an extra coefficient somewhere)
 
Physics news on Phys.org
garethpriede said:
I have a lever with a mass on top which is rising towards the vertical on a frictionless pivot. The length of the lever can change. (In reality this is a robot rocking onto a foot and straightening its leg).
Welcome to PF, Garethpriede.
If reality is involved, why on Earth would you assume a frictionless pivot?
I have no idea about anything mathematical; I don't even know what a "Lagrangian" is, other than in reference to a Lagrange orbital point.
I can't help wondering, though, why you can't just use a position sensor even as simple as a potentiometer to simply measure the leg position. That's how I'd do it, but I'm no genius. There are a lot of heavy-duty engineers and physicists here who can deal with the question in the way that you are hoping for. Unfortunately, I'm not one of them. :smile:
 
Hi, thanks for the welcome :)

I have sensors etc so I know what's happening in reality. But I need to design the control system and that requires some maths. Even if I'm making some simplifications, I need a solid base to start on. I saw quite a few other posts on solving Lagrangians, and even for pendulums and pendulums on springs, so I was hoping someone would see the "obvious flaw" in my derivation.
 
Ah, I see. Hmm... Fred Garvin was one of the PF experts in control systems, but I haven't seen anything from him in a long time. I think that Brewnog is very knowledgeable in the field as well, and definitely Astronuc. I'm sure that one or more of them can set you up.
 
Sorry but the Latex code not coming out was really bugging me!

<br /> L=T-V<br />

then

<br /> L=\left[\frac{1}{2}m\omega^{2}+\frac{1}{2}m\dot{x}^{2}\right]-mgxcos(\theta)<br />

then

<br /> L=\frac{1}{2}m(x^{2}\dot{\theta}^{2}+\dot{x}^{2})-mgxcos(\theta)\\<br />

then

<br /> \frac{d}{dt}\frac{\partial L}{\partial\dot{\theta}}=\frac{\partial L}{\partial\theta}\\<br />

then

<br /> m\dot{x}^{2}\ddot{\theta}=mgxsin(\theta)\\<br />

and

<br /> \frac{d}{dt}\frac{\partial L}{\partial\dot{x}}=\frac{\partial L}{\partial x}\\<br />

then

<br /> m\ddot{x}=mx\dot{\theta}^{2}+mgsin(\theta)<br />

Isn't the energy of a rotating system
<br /> E_{rot} = \frac{1}{2}I\omega^{2}<br />

You can use the parallel-axis theorem to work out the mass-moment of inertia and I'm pretty damn sure that it will be a function of your x variable, that will probably create the missing extending arm term your missing.

I'm interested how your going to control this - are you going to go for a state-space control of the pendulum ?
 
Last edited:
If you want to add in friction you can model it using Reyleigh dissipation, basically the frictional terms appear as extra forces, so you get:

\frac{d}{dt}\frac{\partial L}{\partial\dot{q}_{i}}-\frac{\partial L}{\partial q_{i}}=Q_{i}-D_{i}\dot{q_{i}}

Here Q_i are the external applied forces for that i'th degree of freedom and D_i\dot{q_i} are the friction terms you require.

Sounds like a really fun problem :)

Are you sure that is the right way to model the problem? Is the robot leg bending to change length?

Can you please submit a diagram so that we can see the degrees of freedom?

Lastly, if all that you can control is the length of the leg you're going to have a tough time to stabilise the system in the upright condition. Some work was done on stabilising an inverted pendulum using only movements that are parrallel to the length of the pendulum but that requires really high frequency pulsing.
 
Last edited:
thanks for the reply, sorry for the delay in my reply.

to provide some more input, I want a robot to rock sideways from leg to leg. So at t=0, the robot is balanced on the left leg with the right leg in the air and the legs are splayed by about 10degrees. It then starts to fall to the right until it lands on the right leg. Its momentum keeps it moving and it rises up on the right leg until it runs out of energy. It then falls back to the left again and repeats. There are losses in the ankle joint and the landing collision, so eventually the rocking comes to a halt.

In order to overcome the losses and also to control the rocking frequency, i control the length of the landing leg (or you could call it the pivot leg) while the robot is rising and slowing down.

i'm not interested in the dynamics while the robot is falling or with the collision, i only want to model what happens as the robot is rising on the pivot leg with a continuously changing leg length. so I can model this as an inverted pendulum with all the mass at the tip, having some initial angular velocity and some initial angle with the vertical.

my first practical attempt is quite simple, I shorten the landing leg by a fixed amount to ensure there's enough angular velocity to keep the robot moving, then shortly afterwards, as soon as I have enough data to calculate the resulting angular velocity, I lengthen the leg once by some amount to stop it rocking too far (which I calculate using conservation of angular momentum, but that isn't the focus of this post)

This results in a very rough controller which does work at keeping the robot rocking indefinitely, but without any insight into the frequency etc, and without the mathematical model to continuously control the leg length.

So I've been trying to get a full non-linear model of the system, but my maths isn't up to it. It looks like a similar problem to the classical inverted-pendulum-on-a-cart problem, but without the cart and with a variable pendulum length. I'm happy to ignore the friction in the joint for now, I can determine it experimentally later, as a first go I just need to model the effect of leg length.

Any help is greatly appreciated.
 
Im assuming a point mass at the tip of an extendable rod, angle is zero when the rod is upright, the x direction is along the horizontal and y direction is along the vertical.

Let the position vector be r(t)=[x,y]

r(t)=[x(t)-l(t)sin\theta(t),\, l(t)cos\theta(t)]

Therefore
T=1/2m\dot{r(t)}\bullet\dot{r(t)}

Note: this is the vector dot product of \dot{r(t)} with itself.

V=mgl(t)cos(\theta(t))

Now the Lagragian is
L=T-V
and you do exactly what we did before with the Lagrangian for each of the variables
x(t),\theta(t), l(t)
but only l(t) is actuated.

Hence you'll get

\frac{d}{dt}\frac{\partial L}{\partial \dot{x}}-\frac{\partial L}{\partial x}=0

\frac{d}{dt}\frac{\partial L}{\partial \dot{l}}-\frac{\partial L}{\partial l}=F_l

\frac{d}{dt}\frac{\partial L}{\partial \dot{\theta}}-\frac{\partial L}{\partial \theta}=0

where F_l is the force you apply to lengthen or shorten the leg.

I hope that's the sort of thing you were looking for :smile:
 
Last edited:
As an aside, the other leg (i.e. the one not being balanced on) will enter the model as a stray (constant) torque in the \theta co-ordinate, so you'll probably need to include it to model the dynamics correctly.

Lastly, you are probably only interested in the dynamics in the \theta co-ordinate only so you can neglect the other two equations if you assume that l(t) moves to its controlled value much much faster than \theta(t) changes.

Hence you have

\frac{d}{dt}\frac{\partial L}{\partial \dot{\theta}}-\frac{\partial L}{\partial \theta}=\tau_s

where \tau_s is the stray torque I mentioned earlier
 
Last edited:
  • #10
Thankyou very much, that makes much better sense now. That's exactly what I was hoping to find out.
 
  • #11
My pleasure :smile:

I've thought about some further refinements where you make the stray torque depend on the angle of the leg if you want to.

\frac{d}{dt}\frac{\partial L}{\partial \dot{\theta}}-\frac{\partial L}{\partial \theta}=\tau_s(\theta)

Good luck!
Let us know how it goes ^^
 

Similar threads

  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 2 ·
Replies
2
Views
839
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
6
Views
2K
  • · Replies 76 ·
3
Replies
76
Views
7K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 24 ·
Replies
24
Views
2K