Professional Documents
Culture Documents
We will first control the torque of the DC motor. Then, we will integrate this actuator (controlled DC
motor) into the cart + pendulum system and we will control the full system.
Equations
(2.1.1)
(2.1.2)
(2.1.3)
Parameters:
: Moment of inertia of the motor ( )
: Damping of the mechanical system ( )
: Electromotive force constant ( )
: Motor coil resistance ( )
: Motor coil inductance ( )
Inputs:
: Applied voltage ( )
Outputs:
: Motor current ( )
: Motor shaft angular speed ( )
: Motor shaft angular position ( )
(2.1.4)
We define a Differential equations system from the equations above:
(2.1.5)
Conversions to a state-space form or a transfer function are easy with the new DynamicSystems
package of Maple 12:
State-space system:
(2.1.6)
Voltage Input
1
0
0 1 2 3 4 5
Output: current measurement
1
0
1 2 3 4 5
The sample time of the data measurements is:
0.001 (2.2.1)
We use now the Control[Identify] command to identify the system. The parameters of this
command specify a transfer function with a first order numerator and a second order denominator.
We get as a result the identified parameters of this transfer function, the covariance matrix of
these parameters and the identified system.
Number of iterations: 96
Relative convergence: 0.000992
Relative error: 0.035616
(2.2.2)
(2.2.3)
We can compare the result of the identification with the measured data. We can see that when the
structure of the model is well-known, defining this structure in the identification command helps
this identification. In particular, the definition of a second order system filters the noise.
1
Output
0
1 2 3 4 5
Time [s]
measurement simulation
(2.2.4)
(2.2.5)
Continuous system:
(2.2.6)
(2.2.7)
(2.2.8)
(2.2.9)
0
0 1 2 3 4 5
t
Bode diagram:
Freq [rad/s] Freq [rad/s]
Magnitude [dB]
Phase [deg.]
We want a settling time of about (see Control[PID]). Since we want a proper controller, we use
the option in order to get a controller with a filtered derivative, although we could get
also a result without this derivative term.
(2.4.1)
In this case, is not computed automatically but the function lets you choose the best value for it:
(2.4.2)
y1
0
0 1 2
t
(3.1)
(3.2)
(4.1.1)
(4.1.2)
(4.1.3)
(4.1.4)
Linearization
In order to design a controller, we need to linearize the system.
We linearize around , , and (small movements)
(4.2.1)
We define the numerical values:
(4.2.3)
Open-loop simulation
0
1
t
As we can see, the system is unstable. We can also see it by computing the eigenvalues of the
state matrix A:
(4.2.4)
Equations
We associate the 2 systems (the inverted pendulum and the controlled DC motor) in serie:
(5.1.1)
(5.1.2)
(5.1.3)
Open-loop simulation
0
1
t
(5.2.2)
Now we can plot the result of the closed-loop simulation:
1
0
2 4 6 8 10
t
Custom design
(5.3.1.1.1)
(5.3.1.1.2)
0
2 4 6 8 10
t
Automatic design
We want a settling time of about
(5.3.1.2.1)
(5.3.1.2.2)
0
2 4 6 8 10
t
Observer
Since we are not able to measure any component of the state vector, we need to estimate this
state vector from the measurements.
Here, we measure only the cart position to compute the observer gain:
Association of the state feedback controller and the observer
The final controller is the association of the state feedback controller and the observer:
0
2 4 6 8 10
t
Custom design
(5.4.1.1.1)
(5.4.1.1.2)
1
0
5 10 15 20 25
t
Automatic design
We want the weighting matrices to be computed automatically, so we define only the
desired settling time in the Control[LQR] command:
(5.4.1.2.1)
(5.4.1.2.2)
1
0
2 4 6 8 10
t
Kalman filter
Since we are not able to measure any component of the state vector, we need to estimate this
state vector from the measurements.
Here, we measure the cart position and the angle of the pendulum. We compute a Kalman
filter in order to estimate the states of the system.
We use the Control[Kalman] command in order to compute the Kalman filter gain :
0
2 4 6 8 10
t