# Knowledge base: Warsaw University of Technology

Back

## Control system design for inverted pendulum based on Arduino Mega

### Wojciech Stanisław Wiśniewski

#### Abstract

The paper presents the problem of swinging-up and stabilizing an inverted pendulum. An algorithm based on the energy method was used to lift the pendulum, and a linear quadratic controller (LQR) was used to stabilize the pendulum in the vertical upright position. The work was carried out on a real laboratory stand consisting of two guides and a table with a pendulum. The drive was provided by a DC motor, whose torque was transferred to the trolley via a V-belt. The Arduino Mega microcontroller was used to collect information about the state of the pendulum system and to control the engine. The motor was controlled by pulse width modulation (PWM). The linear position of the trolley and the pendulum swing angle were measured using incremental encoders. In the first stage of work, a mathematical model of the pendulum was derived based on the forces acting on the pendulum and the trolley. The model uses the simplified Coulomb friction model. To enable the use of a given model on a real stand, the viscous friction coefficient and the relationship between the filling of the engine control signal and the force applied at a given moment to the pendulum trolley were determined. The next step was to implement the pendulum swinging-up algorithm. The energy control method of swinging-up the pendulum consists of providing such a control signal that causes the fastest possible increase of the energy of the pendulum, until reaching the vertical upper position. Tests have been conducted that show how particular coefficients in used swing-up algorithm influence swing-up process. The pendulum was stabilized in an upper vertical position by linear-quadratic regulator (LQR). The settings were selected on the basis of observations during experiments using the MATLAB environment. It was checked how the system reacts to introduced disturbances and a change in the given linear position of the trolley at given settings. This was to prepare the LQR controller for operation with the pendulum swing-up algorithm. The last part of the work checked the operation of the system with combined swing-up and stabilization algorithms with settings selected in previous stages. Attention was paid to the pendulum's angular velocity at the time of switching between the algorithms and to the pendulum's deflection angles during its stabilization process by the regulator. For the needs of the work, a computer program was written to communicate with the microcontroller. It allowed changing parameters in the control algorithms and visualization of the system state variable charts, i.e. the trolley's linear position, trolley's linear speed, pendulum swing and pendulum's angular velocity.
Diploma type
Engineer's / Bachelor of Science
Diploma type
Engineer's thesis
Author
Wojciech Stanisław Wiśniewski (FM) Wojciech Stanisław Wiśniewski,, Faculty of Mechatronics (FM)
Title in Polish
Supervisor
Jakub Możaryn (FM/IACR) Jakub Możaryn,, The Institute of Automatic Control and Robotics (FM/IACR)Faculty of Mechatronics (FM)
Certifying unit
Faculty of Mechatronics (FM)
Affiliation unit
The Institute of Automatic Control and Robotics (FM/IACR)
Study subject / specialization
, Automatyka i Robotyka (Automation and Robotics)
Language
(pl) Polish
Status
Finished
Defense Date
17-12-2019
Issue date (year)
2019
Reviewers
Jakub Możaryn (FM/IACR) Jakub Możaryn,, The Institute of Automatic Control and Robotics (FM/IACR)Faculty of Mechatronics (FM) Maciej Przybylski (FM/IACR) Maciej Przybylski,, The Institute of Automatic Control and Robotics (FM/IACR)Faculty of Mechatronics (FM)
Keywords in Polish
Keywords in English
inverted pendulum, linear-quadratic controller, LQR, swing – up, energy based control, Arduino
Abstract in Polish
File
• File: 1
AR_1st_276782.pdf
Request a WCAG compliant version
Local fields
Identyfikator pracy APD: 36713

Uniform Resource Identifier
https://repo.pw.edu.pl/info/bachelor/WUT9ec70a4532b743b4a9834d33249cd576/
URN
urn:pw-repo:WUT9ec70a4532b743b4a9834d33249cd576

Confirmation
Are you sure?