# Mechanical Dynamics, pendulum Lagrangian

**1. The problem statement, all variables and given/known data**

I’m trying to describe the mechanical dynamics of a spherical robot, with one pendulum attached to a shaft inside the sphere.

This article shows the somehow the same setup, I’m trying to accomplish: http://ift.tt/NGf57l. It’s the figure on page 9. I’m kinda unsure how to relate the kinetics of the pendulum, in order to get the correct answer.

My generalized coordinates are two angles: α and θ. α is the angle of the rotational frame attached to the sphere, with respect to the world frame. θ is the rotation of the pendulum with with respect to the rotating frame of the sphere. γ is the angle of the pendulum with respect to the fixed frame (world frame) which is expressed as γ = α – θ.

Mp = Mass of pendulum.

Ms = Mass of sphere.

L = length of pendulum arm.

R = Radius of sphere.

G = gravitional constant (in m/s^2).

Kp = Kinetic energy of pendulum

Ks = Kinetic energy of sphere

**2. Relevant equations**

I assume there is a translation of the pendulum in the positive y axis, which is also known to be the kinetic energy of the pendulum. The linear velocity ha been rewritten in terms of angles.

Kp = 1/2*Mp*L^{2}*(α – θ)^{2}

There sphere is a combination of the rotational and translating energy.

Ks = 1/2*Ms*R^{2}*α_dot^{2} + 1/2*I*α_dot^{2}.

The potential is only related to the pendulum.

U = Mp*g*L*cos(α_dot – θ_dot)

**3. The attempt at a solution**

To get the equations of motion, I used the lagrangian equation. The result was stored in an (2 x 2)(2 x 1) = (2 x 1) matrices, giving for second order differential equations (two for each generalized coordinate). Refractoring these to two 1st order ODE’s, and using the MATLAB ode45 function to solve, a graph of the system was found.

The pendulum is positioned at angle of -pi/4, without any internal torque applied, so only the gravitional force is the cause of the motion. The result seems somehow correct, howver it’s only the angle θ, which is changing, whereas the angle of the pendulum with respect to the rotating frame is always zero, which should not be the case. So I assume kinetic energy of my pendulum is wrong.

I’ve seen others taking the components of the y and z axis respectivlity so:

Tp = 1/2*Mp*(y_dot * R*θ_dot*sinθ)^{2} + 1/2*Mp*(r*θ_dot*cosθ)^{2}.

Where θ in this case describes the angle of the pendulum with respect to the fixed frame.

Hope someone can help me to figure out, if the kinetic energy of the pendulum is completely off.

http://ift.tt/1nQshYg

## Leave a comment