Step 1 : Modeling of Inverted Pendulum system (on a motorized wheel / Hovercraft)
The system consists of an inverted pendulum mounted to a motorized wheel (or a hoverboard). This system
is unstable without control, that is, the pendulum will simply fall over if the wheel is not moved to balance
it. The objective of the control system is to balance the inverted pendulum by applying a force to the wheel,
attached to the pendulum.
We will consider a two-dimensional problem where the pendulum is constrained to move in the vertical
plane shown in the figure.
For this system, the control input is the external force 𝐹 that moves the wheel horizontally and the outputs
are the angular position of the pendulum 𝜃 and the horizontal position of the wheel 𝑥 which implies that the
system is a single-input, multi-output (SIMO). Thus, The System needs to be analyzed by State-Space
Analysis.
Fig 1: Modeling of Inverted Pendulum system Fig 2: Free Body Diagram of Inverted Pendulum system
Let’s assume
1. 𝑀 be the mass of the motorized wheel,
2. 𝑚 be the mass, and 𝐼 be moment of Inertia of the pendulum,
3. 𝐿 be the length of the rod of pendulum,
4. 𝑁𝐴 & 𝑁𝐵 be the Horizontal and Vertical components of net force applied by the wheel to pendulum,
which will in-turn lead to a Normal force on the wheel, with same magnitude and opposite direction.
Horizontal Force Balance on wheel,
𝐹 = 𝑁 𝐴 + 𝑀𝑥̈ (1)
Horizontal Force Balance on Pendulum,
𝑑2
𝑁𝐴 = 𝑚 ( 𝑥 + 𝐿 𝑠𝑖𝑛(𝜃) )
𝑑𝑡 2
⇒
𝑑2
𝑁𝐴 = 𝑚𝑥̈ + 𝑚𝐿 ( 𝑠𝑖𝑛(𝜃) ) (2)
𝑑𝑡 2
Vertical Force Balance on Pendulum,
𝑁𝐵 = 𝑚𝑔 (3)
Put (2) into (1),
𝑑2
𝐹 = 𝑀 + 𝑚 𝑥̈ + 𝑚𝐿 ( 𝑠𝑖𝑛(𝜃) ) (4)
𝑑𝑡 2
Torque balance at center of pendulum,
𝐼𝜃̈ = 𝑁𝐵 𝑠𝑖𝑛 𝜃 × 𝐿 − 𝑁𝐴 𝑐𝑜𝑠 𝜃 × 𝐿
Put (2) & (3) into above,
𝑑2
𝐼𝜃̈ = 𝑚𝑔 𝑠𝑖𝑛 𝜃 × 𝐿 − ( 𝑚𝑥̈ + 𝑚𝐿 ( 𝑠𝑖𝑛(𝜃) ) ) × 𝑐𝑜𝑠 𝜃 × 𝐿 (5)
𝑑𝑡 2
It is desired to keep 𝜃 as small as possible, and, Ideally, under the Influence on controller, the value of 𝜃
must be very small. Thus, we can assume the the same (i.e., the value of 𝜃 must be very small), which
implies following approximations:
a) 𝑠𝑖𝑛 𝜃 ≈ 𝜃
b) 𝑐𝑜𝑠 𝜃 ≈ 1
Rewrite (4) & (5)
⇒ 𝐹 = 𝑀 + 𝑚 𝑥̈ + 𝑚𝐿𝜃̈ (6)
⇒ 𝐼𝜃̈ = 𝑚𝑔𝐿𝜃 − 𝑚𝐿 2 𝜃̈ − 𝑚𝐿𝑥̈
or 𝐼 + 𝑚𝐿 2 𝜃̈ = 𝑚𝑔𝐿𝜃 − 𝑚𝐿𝑥̈ (7)
1
For ease in calculation , Let 𝐾 = and solve for 𝑥̈ and 𝜃̈
(𝑀+𝑚 )𝐼 +𝑚𝑀𝐿 2
⇒ 𝑥̈ = 𝐾𝑚𝑔𝐿 𝑚 + 𝑀 𝜃 − 𝐾𝑚𝐿 𝐹
⇒ 𝜃̈ = − 𝐾𝑚2 𝑔𝐿 2 𝜃 + 𝐾𝑚2 𝐿 2 + 1 𝐹
The Matrix Representation for above set of equations can be given as
𝑥̇ 0 1 0 0 𝑥 0
𝑥̈ 0 0 𝐾𝑚𝑔𝐿 𝑚 + 𝑀 0 𝑥̇ − 𝐾𝑚𝐿
̇𝜃 = 0 0 0 1 𝜃
+
0
𝐹 (8)
𝜃̈ 0 0 − 𝐾𝑚2 𝑔𝐿 2 0 𝜃̇ 𝐾𝑚2 𝐿 2 + 1
As mention above, 𝑥 and 𝜃 are the System Outputs
𝑥
𝑥 𝑥̇
= 1 0 0 0 (9)
𝜃 0 0 1 0 𝜃
𝜃̇
Hence, for the above State-Space System, Matrix 𝐴, 𝐵 and 𝐶 are as follows:
0 1 0 0 0
0 0 𝐾𝑚𝑔𝐿 𝑚 + 𝑀 0 − 𝐾𝑚𝐿 1 0 0 0
𝐴 = , 𝐵 = , and 𝐶 =
0 0 0 1 0 0 0 1 0
0 0 − 𝐾𝑚2 𝑔𝐿 2 0 𝐾𝑚2 𝐿 2 + 1