Professional Documents
Culture Documents
Inverted Pendulum Controle
Inverted Pendulum Controle
Inverted Pendulum Controle
(m)
(b)
0.9 kg
0.1 kg
0 N/m/sec
(l)
23.5
(I)
Transfer function
P_cart = (((I+m*l^2)/q)*s^2 - (m*g*l/q))/(s^4 + (b*(I + m*l^2))*s^3/q - ((M +
m)*m*g*l)*s^2/q - b*m*g*l*s/q)
P_pend = (m*l*s/q)/(s^3 + (b*(I + m*l^2))*s^2/q - ((M + m)*m*g*l)*s/q b*m*g*l/q)
State-Space
A = [0
1
0
0;
0 -(I+m*l^2)*b/p (m^2*g*l^2)/p 0;
0
0
0
1;
0 -(m*l*b)/p
m*g*l*(M+m)/p 0];
B=[
0;
(I+m*l^2)/p;
0;
m*l/p];
C = [1 0 0 0;
0 0 1 0];
D = [0;
0];
1.5
T o: x
Am plitude
0.5
0
0.05
T o: phi
0.04
0.03
0.02
0.01
0
0.1
0.2
0.3
0.4
0.5
0.6
Time (seconds)
0.7
0.8
0.9
50
x
phi
45
40
35
30
25
20
15
10
0.5
1.5
2.5
Pid control
An impulse response of the PID compensated system is shown in following figure.
The
impulse response of the compensated system is shown in the figure. when
Kp = 1
Ki = 1
Kd = 1
C = pid(Kp,Ki,Kd)
T = feedback(P_pend,C)
As it is cleared from both the Matlab and simulink waveforms that it is exponential
growing function, so which means that the system is unstable
An impulse response of the PID compensated system is shown in following figure.
The
impulse response of the compensated system is shown in the figure. when
Kp = 22;
Ki = 0.01;
Kd = 30;
C = pid(Kp,Ki,Kd);
T = feedback(P_pend,C);
t=0:0.01:10;
Response of Pendulum Position to an Impulse Disturbance under PID Control: Kp = 22, Ki = 0.01, Kd = 30
0.025
0.02
Amplitude
0.015
0.01
0.005
-0.005
10
Time (seconds)
As it is cleared from both the waveforms that the system is now stable having
settling time less than 9sec and overshoot less than 5%, means that our required
design criteria is achieved.
0.4
0.3
0.2
0.1
0
-0.1
-0.2
-0.3
-0.4
-0.8
-0.6
-0.4
-0.2
0.2
0.4
0.6
0.8
After simulation, selecting a Point on Root Locus waveform to find the value of k
which appears in the command window. After Selection of a point on root locus
waveform, Step response waveform and pole-zero map waveform of the
compensated system will appear.
4
3
2
1
0
-1
-2
-3
-4
-5
-4
-3
-2
-1
Let's also examine the locations of the system's open-loop poles and zeros so that
we may begin to think about how to draw the root locus branches into the left-half
plane.
8
6
4
2
0
-2
-4
-6
-8
-20
-15
-10
-5
-1
Examining the above root locus helps us to determine whether or not our given
requirements can be met. Specifically, since it is desired that the settling time of the
system be less than 5 seconds
-3
x 10 Response of Pendulum Angle to an Impulse Disturbance under PID Control
Amplitude
-1
-2
-3
0.5
1.5
2.5
Time (seconds)
Here we examine thar the cart become stable in 2sec but over shoot is very high .
25
20
Amplitude
15
10
-5
-10
Time (seconds)
LQR controller :
-3
-0.1
-0.2
0.5
1.5
2.5
3.5
4.5
0.1
x 10
4
-2
5
The curve in green represents the pendulum's angle in radians, and the curve in
blue represents the cart's position in meters. As we see, this plot is not satisfactory.
The pendulum and cart's overshoot appear fine, but their settling times need
improvement and the cart's rise time needs to be reduced.
-5
x 10
10
-1
-2
-3
0.5
1.5
2.5
3.5
4.5
The above result has become find after changing the values of Q
-2
5
-3
x 10
-3
-0.05
-0.1
0.5
1.5
2.5
3.5
4.5
0.05
x 10
2
-1
5
Conclusion:
Although an inverted pendulum model is simple to design and run simulation in
theory, practical implementation of the real circuit was difficult to match to the
simulation results, since most of the time simulations are related to near ideal
situations.
There were many non-idealities that had to be considered when
implementing the actual circuit, such as by-passing, noise reduction and oscillations
etc. Without correcting these problems, it would not be possible to build a circuit
that satisfies specific controlling needs.