Docsity

Control de Robotas Biciclo Invertido: Diseño de un Controlador PID Backstepping, Apuntes de Sistemas de Control

Toggle sidebar
bg1
A PID Backstepping Controller For Two-Wheeled Self-Balancing Robot
Nguyen Gia Minh Thao )1( , Duong Hoai Nghia )2( , Nguyen Huu Phuc (3)
Faculty of Electrical and Electronics Engineering
HoChiMinh city University of Technology (HCMUT)
HoChiMinh city, VietNam
(1) ngmthao@hcmut.edu.vn , (2) dhnghia@hcmut.edu.vn, (3) nhphuc@hc mut.edu.vn
Abstract – This paper present s a method to design and control a
two-wheeled self-balancing robot and it focus on hardware
description, sig nal processing, discrete Kalman filter algor ithm,
system modelling and PID backstepping controller design. In the
system, signals from angle sensors are filtered by a discrete
Kalman filter bef ore being fed to the P ID backstepping controller.
The objectives of the proposed controller are to stabilize the robot
while try to keep the motion of robot to track a reference signal.
The proposed PID backstepping controller has three control l oops,
in which the first l oop uses a backsteppi ng controller to maintain
the robot at equili brium, the second lo op uses a PD controller t o
control the position of robot and the last uses a PI controller to
control the motion direction. Simulations and ex perimental
results show that the proposed control system has good
performances in terms of quick response, good balance, stability .
Keywords – Two wheeled self-balancing robot, Discrete Kalman
filter, Backstepping control, PID control, Embedded system.
I. INTRODUCTION
Two-wheeled self-balancing robot is a multi-variable and
uncertain nonlinear system [1],[2],[7],[8], so that the
performance of the robot depends heavily on the signal
processing and the control method in use. In recent years, the
number of researches on backstepping control have increased
[4],[5],[6]. The backstepping approach provides a powerful
design tool for nonlinear system in the pure feedback and strict
feedback forms. So it is of great interest and feasible to use
backstepping approach to design a compatible controller for
two-wheeled self-balancing robot when the mathematical
model of robot is identified.
The designed two-wheeled self-balancing robot is given in
Figure 1. Signals from angle sensors are filtered by a discrete
Kalman filter before being fed to the PID Backstepping
controller. The purposes of the controller are to stabilize the
robot and keep the motion of the robot to track a reference
signal. The proposed PID Backstepping controller has three
control loops (Figure 7). The first loop is a nonlinear controller
based on backstepping approach, it maintains the tracking
error of the pitch angle at zero. The second loop uses a PD
controller to control the position of the robot, and the last loop
uses a PI controller to control the direction of motion.
The remainder of this paper is organized as follows.
Section II describes hardware and sensor signals processing of
the designed robot. Section III presents the discrete Kalman
filter algorithm. Section IV shows the mathematical model of
the robot. Section V presents the method to design the
proposed PID Backstepping controller. Section VI shows the
simulation results and experimental results of the proposed
control system. Section VII includes conclusions and direction
of future development of this project. Section VIII is the list of
reference documents used for this paper.
II. HARDWARE DESCRIPTION
A. Hardware of the Designed Robot [10], [11], [12]
Figure 1 and Figure 2 show the prototype design of the
robot. The designed robot has an aluminum chassis, two
24V-30W DC-Servo motors for actuation, an accelerator and a
gyroscope for measuring pitch angle and angular velocity of
the body of robot, two incremental encoders built in motors for
measuring the position of the wheels. Two serial 12V-3.5Ah
batteries make a 24V-3.5Ah power which supplies energy for
two DC-Servo motors. Another 12V-1.5Ah battery supplies
energy for the central control module. Some operations of the
robot (upright and balance, moving forward, moving backward,
turning left, turning right,…) which can be controlled fro m
buttons on the central control module or the RF remote
control.
Signals processing and control algorithm are embedded in
a two-core micro-controller (MCU) MC9S12XDP512 which is
a 16-bit MCU of FreeScale.
Figure 1. The prototype two-wheeled self-balancing robot
Figure 2. Hardware description
B. Sensor Signals Processing [1]
The angle sensor module includes an accelerator and a
gyroscope, two incremental encoders which provide full state
pf3
pf4
pf5

Vista previa parcial del texto

¡Descarga Control de Robotas Biciclo Invertido: Diseño de un Controlador PID Backstepping y más Apuntes en PDF de Sistemas de Control solo en Docsity!

A P ID B ackstepping C ontroller F or Two-Wheeled S elf-B alancing R obot

Nguyen Gia Minh Thao (^1 ), Duong Hoai Nghia (^2 ), Nguyen Huu Phuc ( 3 ) Faculty of Electrical and Electronics Engineering HoChiMinh city University of Technology (HCMUT) HoChiMinh city, VietNam (1) (^) [email protected] , (2) (^) [email protected], (3) (^) [email protected]

Abstract – This paper presents a method to design and control a two-wheeled self-balancing robot and it focus on hardware description, signal processing, discrete Kalman filter algorithm,

system modelling and PID backstepping controller design. In the system, signals from angle sensors are filtered by a discrete Kalman filter before being fed to the PID backstepping controller.

The objectives of the proposed controller are to stabilize the robot while try to keep the motion of robot to track a reference signal. The proposed PID backstepping controller has three control loops,

in which the first loop uses a backstepping controller to maintain the robot at equilibrium, the second loop uses a PD controller to control the position of robot and the last uses a PI controller to

control the motion direction. Simulations and experimental results show that the proposed control system has good

performances in terms of quick response, good balance, stability.

Keywords – Two wheeled self-balancing robot, Discrete Kalman filter, Backstepping control, PID control, Embedded system.

I. I NTRODUCTION

Two-wheeled self-balancing robot is a multi-variable and

uncertain nonlinear system [1],[2],[7],[8], so that the

performance of the robot depends heavily on the signal

processing and the control method in use. In recent years, the

number of researches on backstepping control have increased

[4],[5],[6]. The backstepping approach provides a powerful

design tool for nonlinear system in the pure feedback and strict

feedback forms_._ So it is of great interest and feasible to use

backstepping approach to design a compatible controller for

two-wheeled self-balancing robot when the mathematical

model of robot is identified.

The designed two-wheeled self-balancing robot is given in

Figure 1. Signals from angle sensors are filtered by a discrete

Kalman filter before being fed to the PID Backstepping

controller. The purposes of the controller are to stabilize the

robot and keep the motion of the robot to track a reference

signal. The proposed PID Backstepping controller has three

control loops ( Figure 7 ). The first loop is a nonlinear controller

based on backstepping approach, it maintains the tracking

error of the pitch angle at zero. The second loop uses a PD

controller to control the position of the robot, and the last loop

uses a PI controller to control the direction of motion.

The remainder of this paper is organized as follows.

Section II describes hardware and sensor signals processing of

the designed robot. Section III presents the discrete Kalman

filter algorithm. Section IV shows the mathematical model of

the robot. Section V presents the method to design the

proposed PID Backstepping controller. Section VI shows the

simulation results and experimental results of the proposed

control system. Section VII includes conclusions and direction

of future development of this project. Section VIII is the list of

reference documents used for this paper.

II. H ARDWARE D ESCRIPTION

A. Hardware of the Designed Robot [10], [11], [12]

Figure 1 and Figure 2 show the prototype design of the robot. The designed robot has an aluminum chassis, two 24V-30W DC-Servo motors for actuation, an accelerator and a gyroscope for measuring pitch angle and angular velocity of the body of robot, two incremental encoders built in motors for measuring the position of the wheels. Two serial 12V-3.5Ah batteries make a 24V-3.5Ah power which supplies energy for two DC-Servo motors. Another 12V-1.5Ah battery supplies energy for the central control module. Some operations of the robot (upright and balance, moving forward, moving backward, turning left, turning right,…) which can be controlled from buttons on the central control module or the RF remote control. Signals processing and control algorithm are embedded in a two-core micro-controller (MCU) MC9S12XDP512 which is a 16-bit MCU of FreeScale.

Figure 1. The prototype two-wheeled self-balancing robot

Figure 2. Hardware description

B. S ensor Signals Processing [1]

The angle sensor module includes an accelerator and a gyroscope, two incremental encoders which provide full state

of the robot ( Figure 3 ). Signals from accelerator sensor and

gyroscope sensor are being fed to the Kalman filter (presented

in Section III).

Figure 3. Sensor signals processing

III. D ISCRETE K ALMAN F ILTER

The Kalman filter estimates a process by using a form of

feedback control [3]. The filter estimates the process state at

some times and then obtains feedback in the form of (noise)

measurements. The equations of discrete Kalman filter can be

decomposed into two groups: Time Update equations and

Measurement Update equations, as shown in Figure 4.

The time update equations use the current state and error

covariance estimates to obtain the estimates for the next time

step ( Table I ). The measurement update equations use the

current measurements to improve the estimates which obtained

from the time update equations ( Table II ).

Figure 4. The discrete Kalman filter algorithm

T ABLE I. T IME UPDATE E QUATIONS Project the state ahead

x ˆ (^) k Ax ˆ k (^) 1 Buk

− = (^) − + (1)

Project the error covariance ahead

1

T Pk APk A Q − = (^) − + (2)

T ABLE II. M EASUREMENT UPDATE E QUATIONS Compute the Kalman gain

T T^1 K (^) k Pk H H Pk H R − − − = + (3)

Update estimate with measurement zk

x ˆ (^) k x ˆ (^) k K (^) k ( zk Hx ˆ k )

− −

Update the error covariance

Pk (^) ( I K Hk ) Pk

−

The parameters of discrete Kalman filter are as follows

[ ]

0 0 0 yr

1 0 0.001 0 ; ; 1 0 0 1 0 0.

initial

angle A B X R g o

P Q H

Figure 5 shows that the angle measurement filtered by Kalman Filter is better than the unfiltered angle measurement.

Figure 5. Comparision between filtered and unfiltered angle measurement

IV. M ATHEMATICAL M ODEL OF T HE R OBOT

The coordinate system of robot is shown in Figure 6 , we use the Newton’s Second Law of motion to identify the mathematical model of robot [1], [7], [8], [9].

Figure 6. Free body diagram of the chassis and the wheels

  • For the left wheel of robot (same as the right wheel).

M (^) W x W (^) L = HTL − HL (6)

M (^) W y W (^) L = VTL − VL − M (^) W g (7)

J WL θ W L = C L − H TLR

x WL (^) = θWL R (9)

J WL = M WLR (10)

  • For the body of robot.

sin W^ WR

L B B

x x

x L θ

yB = − L (^) ( 1 − c os θ B ) (12)

M x B  B^ = H L + HR (13)

Define the virtual control α such that (^) lim (^) t →∞ e t 1 ( ) = 0 , as

α = k e 1 1 (^) + c z 1 1 (^) + x  1 ref (20)

where k 1 , c 1 are positive contants and z 1 = e 1 ( τ ) d τ

∫

.

Step 1b : The first Lyapunov function is defined as

1 2 2 1 1 1

c V = z + e (21)

The derivation of V 1 :

V  1^ = c z z 1 1  1 + e e 1 1 (^) = c z e 1 1 1 (^) + e e 1 1 = e 1 (^) ( c z 1 1 (^) + e  1 ) (22)

Step 2a : Define the error between the virtual control α and

input x 2 of (19.2) as e 2 = α− x 2

(19.1) is rewritten as (^) x  1 (^) = α− e 2 (^) = k e 1 1 (^) + c z 1 1 (^) + x  1 (^) ref − e 2 (23)

From (23), we have e  1^ = x  1 ref − x  1^ = − k e 1 1 − c z 1 1 + e 2 (24)

The derivation of e 2 :

( ) ( (^ )^ (^ )^ (^ ) )

( ) (^ )^ (^ )^ (^ )

2 2

1 1 1 1 1 1 1 2 1 2 1 1

1 1 1 1 1 2 1 1 1 1 1 2 1 2 1 1 2 1 1 1 1 1 1 1 2 1 1 1 2 1 2 1 1

ref

ref

ref

e x

k e c e x f x f x x g x C

k k e c z e c e x f x f x x g x C

c k e k c z k e x f x f x x g x C

θ

θ

θ

=α −

= + + − + +

(25) Substituting (24) into (22), we obtain

( (^ ) )

2 V 1 (^) = e 1 (^) c z 1 1 (^) − k e 1 1 (^) + c z 1 1 (^) + e 2 (^) = − k e (^) 1 1 (^) + e e 1 2

Step 2b : The second Lyapunov function is defined as

2 2 1 2

V = V + e (27)

Compute the derivation of V 2 as

2 V 2 (^) = V 1 (^) + e e 2 2 (^) = − k e (^) 1 1 (^) + e e 1 2 (^) + e e 2 2

For making V  2 definite negative, we choose e  2 as

e  2 = − k e 2 2 − e 1 ; with k 2 ≥ 0 (29)

Substituting (29) into (28), we obtain 2 2 V 2 (^) = − k e 1 1 (^) − k e 2 2 < 0

From (25), (29) we have the equation of control signal as

( ) (^ )^ (^ )^ (^ )

( )

2 1 1 1 1 2 2 1 1 1 1 1 1 2 1 2

1 1

1 c k e k k e k c z x (^) ref f x f x x , C g x

θ

(31)

C. Position Controller Design. [11], [12]

In this control loop, a PD controller is designed to control

the position of the robot ( Figure 8 ).

Figure 8. PD-controller for position scheme

When the robot uprights and doesn’t move ( (^) θ (^) ref = 0 ), the

reference position equals zero ( xref = 0 ).

If the reference pitch angle doesn’t equal zero, the robot

will move forward ( (^) θ ref > 0 ) or move backward ( (^) θ ref < 0 ). In

this operation, the position PD controller isn’t used.

D. Rotation Controller Design. [11]

In this control loop, a PI controller is designed to control the direction of motion ( Figure 9 ).

Figure 9. PI-controller for rotation scheme

When the robot doesn’t move, or moves forward, or moves backward (doesn’t turn left-right), the reference yaw angle equals zero ( δ (^) ref = 0 ).

The control signal from the Rotation controller combines with the control signals from the Balance controller and Position Controller to make two separately control signals for left and right wheels ( Figure 10 ).

Figure 10. The scheme of control signals for two DC-Servo motor

VI. S IMULATIONS , E XPERIMENTAL R ESULTS

A. Simulations

The parameters of the robot are defined in Table III. Both the pitch angle and the position of the robot are shown simultaneously in Figure 11 , Figure 12 , Figure 13 , Figure 14. In these figures, the graph of pitch angle [deg] is the top graph, the graph of position [m] is the bottom graph and the horizontal axis is time [sec].

  • The robot maintains at equilibrium and doesn’t move.

( θ ref = 0 [deg], xref = 0 [m])

Figure 11 shows the response of the robot with small

initial pitch angle ( θ 0 = 5 [deg]), and Figure 12 shows

the response of the robot with large initial angle ( (^) θ 0 = 25 [deg]). Both the angle ( θ ) and the position

of robot ( x ) converge to zero for two initial

conditions.

Figure 11. The robot maintains at equilibrium with small initial pitch angle ( (^) θ 0 = 5 [deg])

Figure 12. The robot maitains at equilibrium with large initial pitch angle ( (^) θ 0 = 25 [deg])

  • The robot tracks a reference pitch angle , θ ref ≠ 0 [deg].

Figure 13 shows the response of robot with positive

reference pitch angle ( θ (^) ref = 5 [deg]). In this

condition, the robot moves forward, so that the PD-controller for position isn’t used (KP =0 ; K (^) D =0).

Figure 13. The robot tracks a reference pitch angle ( (^) θ ref = 5 [deg])

  • The robot moves to the set position ( (^) xref = 2 [m])

Figure 14. The robot moves to the new position which is at the distance of two mets.

B. Experimental Results

  • Parameters of the proposed PID Backstepping controller are shown in Table IV.

T ABLE IV. P ARAMETERS OF THE P ID B ACKSTEPPING CONTROLLER Controller Parameters Backstepping – Balance k 1 = 110.5; k 2 = 21.4; c 1 = 3 PD – Position K (^) P = 60 ; K (^) D = 7. PI – Rotation K (^) P = 47.5 ; K (^) I = 5

  • The robot is in equilibrium and doesn’t move.

( θ ref = 0 [deg], xref = 0 [m])

Figure 15 shows the experimental result that the designed robot is in equilibrium. In this operation, the Backstepping controller for balance and the PD controller for position are active. The pitch angle of robot ( θ ) is regulated under 1.1 [deg], and the

position of robot ( x ) is regulated under 0.04 [m].

Figure 15. A experimental result that the designed robot is in equilibrium

  • The robot maintains at equilibrium with an external

disturbance. ( θ (^) ref = 0 [deg])

Figure 16 shows the response of the designed robot when it is affected by a external disturbance. The robot still maintains at equilibrium and the pitch angle of robot is regulated after 1.5[sec]. The Backstepping controller for balance is active and the PD controller for position isn’t active. So, when the robot is affected by an external disturbance, the robot moves forward to regulate the pitch angle. Finally, the robot is balanced in the new position.

Figure 16. The designed robot maintains at equilibrium when it is affected by a external disturbance