What I am trying to do is to derive the equations of motion of a lever balance like the one in the picture
As can be seen the lever balance has achieved an static balance position, nevertheless it is not horizontal since its mass distribution will not allow it. Diagram of the system can be observed in next figure:
Where:
$T_{1} = m_{1}*g*r_{1}*cos(\theta)$
$T_{2} = m_{2}*g*r_{2}*cos(\theta)$
$T_{d} = d\dot{\theta}$
I defined the differential equation as:
$J\ddot{\theta} = \frac{1}{J}*(m_{1}*r_{1}*g*cos(\theta) - m_{2}*r_{2}*g*cos(\theta) - d*\dot{\theta})$
And implemented it on Matlab by using ODE45:
clc;clear all
tspan = 0:0.01:200; %Time span
x0 = [deg2rad(0);0]; %Initial state
r1 = 0.03; % distance from pivot to m1 (m)
r2 = 0.02; % distance from pivot to m2 (m)
m1 = 0.02; % mass of m1(Kg)
m2 = 0.02; % mass of m2(Kg)
J = (m1(r1^2)) + (m2(r2^2)); % Moment of innertia
d = 0.01; % damping coeficcient
[t,x,U] = ode45(@(t,x)diffEq_simple2(x,J,r1,r2,m1,m2,d),tspan,x0);
xd = rad2deg(x);
theta = xd(:,1);
plot(t,theta);
axis([0 max(t) -180 180])
grid on;
function dx = diffEq_simple2(x,J,L1,L2,m1,m2,d)
g = 9.8;
dx(1) = x(2);
dx(2) = (1/J)(m1L1gcos(x(1)) - m2L2gcos(x(1)) - dx(2));
dx = dx';
end
After plotting the results of angle $\theta$ I get this:
It doesnt matter which value I assign to r2 or r1, the angle $\theta$ will rotate to the correct direction but will always converge to 90 degrees, which it is not correct, I was hopping the model to oscillate a bit but converge to a different value each time I change the value or r1,r2,m1 or m2, but it always converges to 90 degrees. Is my ode wrong derived ? which is the correct method to derive the equation of motion for a lever balance?


