# Digital modelling of Inverted Pendulum on a cart

1. May 2, 2012

### meiskaustubh

I am pursuing bachelor in engineering.i have a case study involving the stabilization of an inverted pendulum about it's unstable equilibrium point.

My problem is that I have to digitalize my system before i can implement it.
Can anyone tell me how to digitalize the system.

2. May 2, 2012

### meiskaustubh

my system model is of the form y = f(x) + g(x) * u.
the system is an underactuated 4th order system with the states as the cart position(x1) and velocity(x3) and the pendulum position(x2) and velocity(x4).
the control law 'u' consist of 3 parts.the first part contains log term and signum term,the second contains signum,log and exponential terms and the 3rd is a linear controller.

for specific expressions.
Len=.4;
V = 2;
ksu = 1.63;
kcw = 2.3;
kvw = 5;
kem = 6;
n = 1.05;
E = .5*((M + m)*x3^2 + 2*m*l*cos(x2)*x3*x4 + m*l^2*x4^2) + m*g*l*(cos(x2) - 1);
E0 = 0;
ucw = kcw*sign(x1)*log(1-abs(x1)/Len);
uvw = kvw*sign(x3)*log(1 - abs(x3)/V);
uem = kem*(exp(abs(E - n*E0)) - 1)*sign(E - E0)*sign(x4*cos(x2));

u1 = -ksu*sign(x4*cos(x(2))) + ucw
u2 = ucw + uvw + uem
u3 = k*x