16.1 Inertia Wheel Pendulum Description

The inertia wheel pendulum at the noninverted position

Inertia wheel pendulum
The IWP was introduced by Spong et al. [2], and aside from its academic applications it is also widely used for research purposes as a workbench for nonlinear controllers [2–11].
-
q 1 is the pendulum angular position.
-
q 2 is the wheel angular position.
-
m 1 is the pendulum mass.
-
m 2 is the wheel mass.
-
τ is torque applied at the wheel.
-
l c1 is the location of the pendulum’s center of mass.
-
l 1 is the pendulum’s length.
-
I 1 is the pendulum’ inertia when rotating around its center of mass.
-
I 2 is the wheel inertia (plus the motor rotor inertia).
-
g is the gravity acceleration.
-
R is the motor armature resistance.
-
L is the motor armature inductance.
-
k b and k m are the motor counter electromotive force constant and the motor torque constant.
-
u and i stand respectively, for voltage applied at the motor armature terminals and the electric current through the motor armature.



In this chapter it is shown that solution of the swing up problem requires the use of nonlinear control techniques because the IWP has a nonlinear model. Although nonlinear, the model of this mechanism is straightforward enough to design a control strategy using simple ideas. One important objective in including this control problem is to introduce the reader, using a basic example, to nonlinear control systems techniques.
16.2 Mathematical Model









![$$\displaystyle \begin{aligned} \begin{array}{rcl} D\left[\begin{array}{cc} \ddot q_1\\ \ddot q_2 \end{array}\right]&+& \left[\begin{array}{cc} \overline{m}g\sin{(q_1)}\\ 0 \end{array}\right]= \left[\begin{array}{cc} 0\\ \tau \end{array}\right],{}\\ D= \left[\begin{array}{cc} d_{11} & d_{12}\\ d_{21} & d_{22} \end{array}\right]&=& \left[\begin{array}{cc} {m_1l_{c1}^2+m_2l_{1}^2+I_{1}+I_{2}} & {\ \ I_{2}}\\ {I_{2}} & {\ \ I_{2}} \end{array}\right]. \end{array} \end{aligned} $$](/epubstore/G/V-M-Guzman/Automatic-Control-With-Experiments/OEBPS/images/454499_1_En_16_Chapter/454499_1_En_16_Chapter_TeX_Equ3.png)



16.3 Swing Up Nonlinear Control
A controller is designed in this section
to take the pendulum to its inverted unstable configuration, i.e.,
to any of the points or
. It will be explained later why the
wheel position and velocity are not taken into account during the
time interval when this task is performed.







Level surfaces of V in (16.8)




What has been computed is known as the
time derivative of V along the
trajectories of (16.7) [12]. This means that
(16.9)
represents the values that takes as the pendulum in
(16.7) moves
under the effect of the external torque τ 1. For instance, if
τ 1 = 0 then
, according to (16.9), which means that
the pendulum’s energy V
remains constant as the pendulum moves. This is very important for
our purposes. From the knowledge of the pendulum’s initial position
and velocity
, it is possible to know the initial
value of the pendulum’s energy
. As
because τ 1 = 0 then, as time grows,
the pendulum moves only on points representing the level surface
where
, which are shown in Fig. 16.3. Arrows on the level
surfaces represent the sense of the pendulum’s movement. These
senses of movement are easy to determine. The state vector of a
simple pendulum is defined as
. The variable
is a vector indicating where the
state y moves to. Notice that
the horizontal component of
, i.e.,
, points to the right as long as the
pendulum velocity
is positive. This suffices to
determine the sense of the arrows on the level surfaces of
V .












-
If V < V 0 then
and energy V increases.
-
If V > V 0 then
and energy V decreases.
-
If V = V 0, then
and energy V remains at V 0.
Then, it is ensured that the pendulum
energy V reaches the required
value to arrive at one of the points or
. Furthermore, the energy remains at
that value until one of these points is reached. Now, analyze what
happens if
. Notice that the pendulum is at rest
under this condition. However, the only way for
to be true for ever is q 1 = 0, because it is only
there that the pendulum may remain at rest. Hence, it is necessary
to slightly hit the pendulum at the beginning to force it to
abandon the configuration
.
The previous analysis ensures that the pendulum reaches the inverted unstable configuration if, from the downward stable configuration, the pendulum is slightly hit to start it moving. It is not difficult to realize that none of the above results change if sat(V − V 0) is used in controller (16.10) instead of sign(V − V 0). The controller in (16.10), (16.11), has its roots in the ideas reported in [13].
On the other hand, it is important to stress that, once the inverted unstable configuration is reached, the controller (16.10) does not ensure that the pendulum stays at such a configuration. This requires another controller to be designed that must be put to work when the pendulum is very close to the inverted unstable configuration. This means that the controller in (16.10) must be disconnected from that time on. In the next section, a controller is designed solving the second part of the control problem: pendulum balancing at the inverted unstable configuration.
Finally, notice that nothing has been said on the wheel position and velocity during the pendulum swing-up stage. As the wheel is symmetrical and homogeneous, then the wheel position does not matter. On the other hand, although the wheel velocity increases in an unknown manner during this time interval, the velocity is finite at the moment when the pendulum reaches the inverted unstable configuration; hence, the balancing controller must just regulate the wheel velocity at the value that this variable has when this controller begins to work.
Example 16.1






-
If V < V 0 then
and energy V increases.
-
If V > V 0 then
and energy V decreases.
-
If V = V 0 then
and energy V remains at V 0.


16.4 Balancing Controller
![$$\displaystyle \begin{aligned} x=\left[\begin{array}{cccc} x_1\\ x_2\\ x_3 \end{array}\right]= \left[\begin{array}{cccc} q_1\\ \dot{q}_1\\ \dot{q}_2 \end{array}\right],{} \end{aligned} $$](/epubstore/G/V-M-Guzman/Automatic-Control-With-Experiments/OEBPS/images/454499_1_En_16_Chapter/454499_1_En_16_Chapter_TeX_Equ14.png)
![$$\displaystyle \begin{aligned} \begin{array}{rcl} \left[\begin{array}{cc} \ddot q_1\\ \ddot q_2 \end{array}\right]&=&D^{-1}\left\{ -\left[\begin{array}{cc} \overline{m}g\sin{(q_1)}\\ 0 \end{array}\right]+ \left[\begin{array}{cc} 0\\ \tau \end{array}\right]\right\},{} \end{array} \end{aligned} $$](/epubstore/G/V-M-Guzman/Automatic-Control-With-Experiments/OEBPS/images/454499_1_En_16_Chapter/454499_1_En_16_Chapter_TeX_Equ15.png)
![$$\displaystyle \begin{aligned} \begin{array}{rcl} D^{-1}&=& \left[\begin{array}{cc} \overline{d}_{11} & \overline{d}_{12}\\ \overline{d}_{21} & \overline{d}_{22} \end{array}\right]= \frac{1}{d_{11}d_{22}-d_{12}d_{21}} \left[\begin{array}{cc} d_{22} & -d_{12}\\ -d_{21} & d_{11} \end{array}\right]. {} \end{array} \end{aligned} $$](/epubstore/G/V-M-Guzman/Automatic-Control-With-Experiments/OEBPS/images/454499_1_En_16_Chapter/454499_1_En_16_Chapter_TeX_Equ16.png)

![$$\displaystyle \begin{aligned} \begin{array}{rcl} \dot{x}=f(x,\tau)= \left[\begin{array}{c} x_2\\ -\overline{d}_{11}\overline{m}g\sin{(x_1)}+\overline{d}_{12}\tau \\ -\overline{d}_{21}\overline{m}g\sin{(x_1)}+\overline{d}_{22}\tau \end{array}\right]. {} \end{array} \end{aligned} $$](/epubstore/G/V-M-Guzman/Automatic-Control-With-Experiments/OEBPS/images/454499_1_En_16_Chapter/454499_1_En_16_Chapter_TeX_Equ17.png)
![$$\displaystyle \begin{aligned} \left[\begin{array}{c} x_2^*\\ -\overline{d}_{11}\overline{m}g\sin{(x_1^*)}+\overline{d}_{12}\tau^* \\ -\overline{d}_{21}\overline{m}g\sin{(x_1^*)}+\overline{d}_{22}\tau^* \end{array}\right]= \left[\begin{array}{c} 0\\ 0\\ 0 \end{array}\right]. {} \end{aligned} $$](/epubstore/G/V-M-Guzman/Automatic-Control-With-Experiments/OEBPS/images/454499_1_En_16_Chapter/454499_1_En_16_Chapter_TeX_Equ18.png)


![$$\displaystyle \begin{aligned} \frac{\overline{m}g}{\overline{d}_{12}\overline{d}_{22}} \left[\overline{d}_{11}\overline{d}_{22}-\overline{d}_{21}\overline{d}_{12}\right]\sin{(x_1^*)}=0. {} \end{aligned} $$](/epubstore/G/V-M-Guzman/Automatic-Control-With-Experiments/OEBPS/images/454499_1_En_16_Chapter/454499_1_En_16_Chapter_TeX_Equ21.png)





![$$\displaystyle \begin{aligned} \begin{array}{rcl} \dot z&=&Az+Bw,{}\\ {}A&=&\left.\dfrac{\partial f(x,\tau)}{\partial x}\right|{}_{\stackrel{x^*}{\tau^*}}= \left.\left[\begin{array}{ccc} \dfrac{\partial f_1}{\partial x_1} & \dfrac{\partial f_1}{\partial x_2} & \dfrac{\partial f_1}{\partial x_3} \\ {}\dfrac{\partial f_2}{\partial x_1} & \dfrac{\partial f_2}{\partial x_2} & \dfrac{\partial f_2}{\partial x_3} \\ {}\dfrac{\partial f_3}{\partial x_1} & \dfrac{\partial f_3}{\partial x_2} & \dfrac{\partial f_3}{\partial x_3} \\ {}\end{array}\right]\right|{}_{\stackrel{x^*}{\tau^*}}= \left[\begin{array}{ccc} 0 & 1 & 0 \\ {}\overline{d}_{11}\overline{m}g & 0 & 0 \\ {}\overline{d}_{21}\overline{m}g & 0 & 0 \end{array}\right],\\ {}B&=&\left.\dfrac{\partial f(x,\tau)}{\partial \tau}\right|{}_{\stackrel{x^*}{\tau^*}}= \left.\left[\begin{array}{c} \dfrac{\partial f_1}{\partial \tau}\\ {}\dfrac{\partial f_2}{\partial \tau}\\ {}\dfrac{\partial f_3}{\partial \tau} \end{array}\right]\right|{}_{\stackrel{x^*}{\tau^*}}= \left[\begin{array}{c} 0\\ {}\overline{d}_{12}\\ {}\overline{d}_{22}\\ {}\end{array}\right], \end{array} \end{aligned} $$](/epubstore/G/V-M-Guzman/Automatic-Control-With-Experiments/OEBPS/images/454499_1_En_16_Chapter/454499_1_En_16_Chapter_TeX_Equ25.png)


![$$\displaystyle \begin{aligned} \begin{array}{rcl} \dot z&=&Az+\mathcal{B}u,{} \\ \mathcal{B}&=& \left[\begin{array}{c} 0\\ \overline{d}_{12}\\ \overline{d}_{22}\\ \end{array}\right]\frac{k_m}{R}. \end{array} \end{aligned} $$](/epubstore/G/V-M-Guzman/Automatic-Control-With-Experiments/OEBPS/images/454499_1_En_16_Chapter/454499_1_En_16_Chapter_TeX_Equ28.png)

![$$C=[\mathcal {B}|A\mathcal {B}|A^2\mathcal {B}]$$](/epubstore/G/V-M-Guzman/Automatic-Control-With-Experiments/OEBPS/images/454499_1_En_16_Chapter/454499_1_En_16_Chapter_TeX_IEq53.png)





Finally, it is important to say that the constant c introduced in (16.24) takes the value of the wheel velocity at the time when the controller (16.30) starts to work. As this velocity may take any value, it is instrumental that c can be defined as any real constant.
16.5 Prototype Construction and Parameter Identification


Inertia wheel pendulum
Simple parameters
Symbol |
Description |
Value |
Units |
---|---|---|---|
l 1 |
Metal sheet length |
0.117 |
m |
a sol |
Metal sheet width |
0.0254 |
m |
m sol |
Metal sheet mass |
0.016 |
Kg |
m car |
Actuator stator mass |
0.03 |
Kg |
m sop |
Tachometer holder mass |
0.01375 |
Kg |
m rot |
Actuator rotor mass |
0.02 |
Kg |
r rot |
Actuator rotor radius |
0.00915 |
m |
m rue |
Wheel mass |
0.038 |
Kg |
r rue |
Wheel radius |
0.0189 |
m |
R |
Armature resistance |
4.172 |
Ohm |
L |
Armature inductance |
0.0009 |
H |
k b |
Counter electromotive force constant |
0.00775 |
Vs/rad |
k m |
Torque constant |
0.00775 |
Nm/A |
![$$\displaystyle \begin{aligned} m_1=m_{sol}+m_{car}+m_{sop}=0{.}05975\ \mathrm{[Kg]}.{} \end{aligned} $$](/epubstore/G/V-M-Guzman/Automatic-Control-With-Experiments/OEBPS/images/454499_1_En_16_Chapter/454499_1_En_16_Chapter_TeX_Equ31.png)
![$$\displaystyle \begin{aligned} l_{c1}=\frac{m_{sol}\frac{l_{1}}{2}+m_{car}l_{1}+m_{sop}l_{1}}{m_1}=0{.}10133\ \mathrm{[m]}.{} \end{aligned} $$](/epubstore/G/V-M-Guzman/Automatic-Control-With-Experiments/OEBPS/images/454499_1_En_16_Chapter/454499_1_En_16_Chapter_TeX_Equ32.png)

The balance principle to compute l c1

![$$\displaystyle \begin{aligned} I^*=\frac{1}{12}m_{sol}(a_{sol}^2+l_1^2)=0{.}0000191122\ \mathrm{[Kg m}^2\mathrm{]}.{} \end{aligned} $$](/epubstore/G/V-M-Guzman/Automatic-Control-With-Experiments/OEBPS/images/454499_1_En_16_Chapter/454499_1_En_16_Chapter_TeX_Equ34.png)
![$$\displaystyle \begin{aligned} I_{1}=I^*+m_{sol}\left(l_{c1}-\frac{l_1}{2}\right)^2=0{.}000048463\ \mathrm{[Kg m}^2\mathrm{]}. \end{aligned}$$](/epubstore/G/V-M-Guzman/Automatic-Control-With-Experiments/OEBPS/images/454499_1_En_16_Chapter/454499_1_En_16_Chapter_TeX_Equj.png)

![$$\displaystyle \begin{aligned} I_{rue}=\frac{1}{2}m_{rue}r_{rue}^2=0{.}000006787\ \mathrm{[Kg m}^2\mathrm{]}.{} \end{aligned} $$](/epubstore/G/V-M-Guzman/Automatic-Control-With-Experiments/OEBPS/images/454499_1_En_16_Chapter/454499_1_En_16_Chapter_TeX_Equ36.png)

![$$\displaystyle \begin{aligned} I_{rot}=\frac{1}{2}m_{rot}r_{rot}^2=0{.}000000837225\ \mathrm{[Kg m}^2\mathrm{]}.{} \end{aligned} $$](/epubstore/G/V-M-Guzman/Automatic-Control-With-Experiments/OEBPS/images/454499_1_En_16_Chapter/454499_1_En_16_Chapter_TeX_Equ38.png)
![$$\displaystyle \begin{aligned} m_2=m_{rot}+m_{rue}=0{.}058\ \mathrm{[Kg]}.{} \end{aligned} $$](/epubstore/G/V-M-Guzman/Automatic-Control-With-Experiments/OEBPS/images/454499_1_En_16_Chapter/454499_1_En_16_Chapter_TeX_Equ39.png)
![$$\displaystyle \begin{aligned} I_{2}=I_{rue}+I_{rot}=0{.}0000076242\ \mathrm{[Kg m}^2\mathrm{]}.{} \end{aligned} $$](/epubstore/G/V-M-Guzman/Automatic-Control-With-Experiments/OEBPS/images/454499_1_En_16_Chapter/454499_1_En_16_Chapter_TeX_Equ40.png)

It is worth saying that the tachometer mass is considered as a part of the tachometer holder mass and the effect of the tachometer rotor is neglected when computing I 2. This is because it has a mass less than 0.0001[Kg] and a radius less than 0.001 [m]. On the other hand, the screws holding the dice, the dice itself, and the incremental encoder shaft are neglected when computing the inertia I 1. This is because the addition of these masses is less than 0.008[kg] and, more importantly, they are placed at the point where the pendulum hangs up, which reduces strongly their inertial effects. Finally, the mass of the electric wires and the plastic pipe used to couple the tachometer to the wheel were also neglected.
Example 16.2




MATLAB/Simulink diagram for the inertia wheel pendulum

16.6 Controller Implementation










The control strategy to swing up and to balance the IWP is to employ (16.42) until (16.44) is satisfied and, from that time on, turn off (16.42) and turn on (16.43). This task is performed using the Microchip PIC18F4431 microcontroller. It is explained next how this is done. This part is not intended to present a detailed explanation on how this microcontroller works, but merely a basic description of how this microcontroller is employed to implement the control strategy (16.42), (16.43), (16.44).
The complete code used to program the microcontroller is presented at the end of this chapter. The microcontroller PIC18F4431 [16] works at 40 MHz as maximal clock frequency. In this chapter, a 11-MHz crystal is used. Five programmable input–output ports, three 16-bit timers, one 8-bit timer (employed to fix the sample period T s = 0.01[s]), and nine 10-bit analog/digital channels (the tachometer voltage enters through channel 0), are available. There are also eight 14-bit PWM channels among which CCP1 is programmed to work with 8 bit to deliver voltage to be applied to the actuator (PM brushed DC motor).






Control system electric diagram
The wheel velocity is measured using a tachometer model
34PC. It is a miniature PM brushed DC motor used in cell phones as
a buzzer. Voltage delivered by the tachometer is low-pass filtered
using the RC circuit shown in
Fig. 16.8. It
was found that this tachometer delivers 0.58[V] when the wheel
velocity is maximal, i.e., 1634 [rad/s]. It was assumed that this
voltage is proportional at any other intermediate velocity. To
improve the resolution of this velocity measurement, the tension
divider connected to pin 4 (see Fig. 16.8) was employed to fix
at 3.8372[V] the minimal value of the analog range of the
analog/digital converter channel 0 (the maximal value is fixed at
5[V]). On the other hand, the tachometer is series connected to
another tension divider, such that, when the tachometer is at rest,
i.e., when
, voltage at channel 0 is
(5-3.8372)/2+3.8372=4.4186[V]. Notice that variations of about
0.58[V], i.e., 1634[rad/s], are allowed upward and downward from
the middle point of the converter analog range. Hence, when
[rad/s] the analog/digital converter
delivers the count 1023 = 210 − 1 (the AD converter is
10-bit) and when
[rad/s] the analog/digital converter
delivers the count 1023∕2 = 511. Counts smaller than 511 represent
negative velocities
. According to this information, the
wheel velocity is computed as follows. The instruction
“vel=read-adc()-511” assigns to the variable “vel” the code
corresponding to the wheel velocity, whereas the instructions
“q2_p=(signed long)vel” and “q2_p=3.2039*q2_p” assign to variable
“q2_p” a value that is numerically equal to the wheel velocity
in radians/second, the sign included.
Notice that the constant 3.2039=1634/510[(rad/s)/count] represents
the measurement system gain.
With this information, any of the expressions in (16.42) or (16.43) are computed. The resulting variable u is sent to the microcontroller PWM as described in the following.


16.7 Experimental Results


Pendulum position as the inverted unstable configuration is reached

Wheel velocity

Voltage applied to the motor

Pendulum evolution on the plane (phase plane)

Energy evolution as the inverted unstable configuration is reached
In Fig. 16.9, it is observed how the pendulum oscillates with ever-growing amplitude until the position q 1 = −π is reached with zero velocity at t ≈ 14[s] and the pendulum stays there from that time on. In Fig. 16.10, it is observed that the wheel velocity remains constant at 380[rad/s] from t ≈ 17[s] on. It is interesting to point out that the wheel velocity is commanded to be regulated at c ≈ 150[rad/s], which is the wheel velocity at t ≈ 14[s], i.e., when the controller (16.43) starts to work. The difference between c and the final wheel velocity 380[rad/s] is due to friction present at the wheel shaft, which has not been taken into account during the design stage.
In Fig. 16.11, the control signal
u is shown. Note that this
variable saturates most of the time during the swing-up stage
(t < 14[s]). This is the
reason why saturation and sign functions are used in the controller
(16.42). In
fact, ε 0 = 0.024 is
chosen so that with this value and the factor , u saturates at ± 13[V].
In Fig. 16.12, it is shown how
the pendulum evolves on the plane defined in Fig. 16.3, Sect. 16.3. It is clear that,
comparing both figures, the pendulum moves such that its energy
V increases (see also Fig.
16.13) until
V = V 0 = 0.2519. Note that
V reaches such a value as
t ≈ 11[s], but the pendulum is
balanced until t ≈ 14[s]. This
demonstrates that energy is regulated at V = V
0 until the point is reached. It is clear that the
pendulum also passes close to the point
at t ≈ 13[s] but it is not balanced, perhaps
the condition in (16.44) was not satisfied at that time, i.e.,
the pendulum did not pass close enough to such a point.

The inertia wheel pendulum balancing at the inverted unstable configuration
16.8 PIC18F4431 Microcontroller Programming

Flow diagram for PIC18F4431 microcontroller programming when used to control an inertia wheel pendulum
16.9 Summary
In this chapter, another underactuated nonlinear system has been presented: the inertia wheel pendulum. The mathematical model has been obtained and two controllers have been used to solve two different control problems: swing-up and balancing. The balancing control problem has been solved using a linear state feedback controller, whereas the swing-up control problem has been solved using a nonlinear controller. This has been done to introduce the reader to the study of nonlinear control systems. All parameters of the mechanism have been identified and the complete control system has been tested in experiments. A detailed description of the mechanism construction has also been presented.
16.10 Review Questions
- 1.
Why is the inertia wheel pendulum an underactuated mechanism?
- 2.
Why must the IWP oscillate several times before reaching the inverted configuration?
- 3.
What is the corner frequency in [rad/s] and [Hz] of the tachometer resistor–capacitor filter shown in Fig. 16.8?
- 4.
Why does the amplitude of voltage in Fig. 16.11 remain between 13[V] and -13[V] when the swing-up task is performed?