Feedback control of inverted pendulum using Raspberry pi microcontroller and arduino uno
Loading...
Date
2018-05
Authors
Leslie Kneoh, Yen Sing
Journal Title
Journal ISSN
Volume Title
Publisher
Abstract
The inverted pendulum is a complex system, widely studied in many areas due
to its complexity and non-linearities. Since the inverted pendulum is inherently
unstable, it provides an interesting laboratory experiment for students to perform and
can be easily linked to real-world applications such as rocket and Segway self-balancing electric vehicle. This thesis presents a low-cost inverted pendulum system
for the students to swing up and control the inverted pendulum in upright position.
The controlling in inverted pendulum is studied in the Arduino programming with the
usage of Raspberry Pi microcontroller. The control system consists of two parts,
which are swing up control and upright balance control. Swing up control swings the
pendulum to upright position and upright balance control stabilizes the pendulum in
upright position, resisting from a step of disturbances. Modern control techniques-Proportional, Integral and Derivative (PID) controller is used to reduce the errors to
the desired set points in order to perform swing up control and upright balance control.
The algorithms for controlling the motor and the encoder are built to perform their
respective functions. Then, all algorithms are combined to perform closed-loop system
as the angles from the pendulum’s encoder act as feedback system to alter the duty
cycle of motor corresponding to the set point. After that, the role of different PID
parameters is discussed with the subsequent comparison between different parameters
used for PID controllers. The final tuned PID value for stable upright control is
Kp=12.5, Ki=6 and Kd=50 meanwhile PID value for swing up control is Kp=0.15,
Ki=0.005 and Kd=5. The tuning of PID value is based on trial and error method by
adjusting to different values to see the effects on the pendulum. The implementation
of Arduino UNO to control the inverted pendulum system is successful as the
pendulum can perform swing up and upright balance control respectively with
correctly tuned PID parameters.