LINEAR-QUADRATIC CONTROL OF A TWO-WHEELED ROBOT

Similar documents
Automatic Control II Computer exercise 3. LQG Design

Contents. PART I METHODS AND CONCEPTS 2. Transfer Function Approach Frequency Domain Representations... 42

Control Systems Lab - SC4070 Control techniques

ADAPTIVE MPC BASED ON PROBABILISTIC BLACK-BOX INPUT-OUTPUT MODEL

4F3 - Predictive Control

D(s) G(s) A control system design definition

LQ Control of a Two Wheeled Inverted Pendulum Process

Optimal Polynomial Control for Discrete-Time Systems

Design, realization and modeling of a two-wheeled mobile pendulum system

TRAJECTORY CONTROL OF A TWO- WHEELED ROBOT

Neural Network Control of an Inverted Pendulum on a Cart

FU REASONING INFERENCE ASSOCIATED WIT GENETIC ALGORIT M APPLIED TO A TWO-W EELED SELF-BALANCING ROBOT OF LEGO MINDSTORMS NXT

Robust LQR Control Design of Gyroscope

Algorithm for Multiple Model Adaptive Control Based on Input-Output Plant Model

Here represents the impulse (or delta) function. is an diagonal matrix of intensities, and is an diagonal matrix of intensities.

QUICK AND PRECISE POSITION CONTROL OF ULTRASONIC MOTORS USING ADAPTIVE CONTROLLER WITH DEAD ZONE COMPENSATION

MEAM 510 Fall 2011 Bruce D. Kothmann


Cross-Coupling Control for Slippage Minimization of a Four-Wheel-Steering Mobile Robot

EEE582 Homework Problems

Linear State Feedback Controller Design

Application of Neural Networks for Control of Inverted Pendulum

MEAM 510 Fall 2012 Bruce D. Kothmann

Modeling and Model Predictive Control of Nonlinear Hydraulic System

SAMPLE SOLUTION TO EXAM in MAS501 Control Systems 2 Autumn 2015

Predictive Control of Gyroscopic-Force Actuators for Mechanical Vibration Damping

Mathematical Modeling and Dynamic Simulation of a Class of Drive Systems with Permanent Magnet Synchronous Motors

Optimal control and estimation

Linear System Theory. Wonhee Kim Lecture 1. March 7, 2018

EMBEDDED CONTROLLER BUILDING FOR BALL AND BEAM SYSTEM USING OPTIMAL CONTROL SYNTHESIS

Model Identification and Attitude Control Scheme for a Micromechanical Flying Insect

DESIGN OF ROBUST CONTROL SYSTEM FOR THE PMS MOTOR

EECE Adaptive Control

Comparison of Feedback Controller for Link Stabilizing Units of the Laser Based Synchronization System used at the European XFEL

Overview of the Seminar Topic

Suppose that we have a specific single stage dynamic system governed by the following equation:

Subject: Optimal Control Assignment-1 (Related to Lecture notes 1-10)

ACTIVE VIBRATION CONTROL PROTOTYPING IN ANSYS: A VERIFICATION EXPERIMENT

Lego Segway Project Report

Department of Electrical and Computer Engineering. EE461: Digital Control - Lab Manual

Thermal error compensation for a high precision lathe

An Adaptive LQG Combined With the MRAS Based LFFC for Motion Control Systems

State Regulator. Advanced Control. design of controllers using pole placement and LQ design rules

MIMO analysis: loop-at-a-time

Evaluation Performance of PID, LQR, Pole Placement Controllers for Heat Exchanger

MODELLING ANALYSIS & DESIGN OF DSP BASED NOVEL SPEED SENSORLESS VECTOR CONTROLLER FOR INDUCTION MOTOR DRIVE

Numerical atmospheric turbulence models and LQG control for adaptive optics system

APPLICATION OF ADAPTIVE CONTROLLER TO WATER HYDRAULIC SERVO CYLINDER

Identification and Control of Mechatronic Systems

Double Inverted Pendulum (DBIP)

FUZZY LOGIC CONTROL Vs. CONVENTIONAL PID CONTROL OF AN INVERTED PENDULUM ROBOT

EXPLICIT CHARACTERIZATION OF A CLASS OF PARAMETRIC SOLUTION SETS

Modeling of Hydraulic Control Valves

Real-Time Implementation of a LQR-Based Controller for the Stabilization of a Double Inverted Pendulum

EE 4443/5329. LAB 3: Control of Industrial Systems. Simulation and Hardware Control (PID Design) The Torsion Disks. (ECP Systems-Model: 205)

Motion Control of Inverted Pendulum Robots Using a Kalman Filter Based Disturbance Observer

Lecture 9. Introduction to Kalman Filtering. Linear Quadratic Gaussian Control (LQG) G. Hovland 2004

Course Outline. Higher Order Poles: Example. Higher Order Poles. Amme 3500 : System Dynamics & Control. State Space Design. 1 G(s) = s(s + 2)(s +10)

MATH4406 (Control Theory) Unit 6: The Linear Quadratic Regulator (LQR) and Model Predictive Control (MPC) Prepared by Yoni Nazarathy, Artem

Stable Limit Cycle Generation for Underactuated Mechanical Systems, Application: Inertia Wheel Inverted Pendulum

Inverted Pendulum: State-Space Methods for Controller Design

Robust Model Predictive Control

Design and Comparison of Different Controllers to Stabilize a Rotary Inverted Pendulum

H-infinity Model Reference Controller Design for Magnetic Levitation System

PREDICTIVE COMPUTED-TORQUE CONTROL OF A PUMA 560 MANIPULATOR ROBOT. Victor M. Becerra, Steven Cook and Jiamei Deng

Design of Nonlinear Control Systems with the Highest Derivative in Feedback

Control System Design

IDEMPOTENT ELEMENTS OF THE ENDOMORPHISM SEMIRING OF A FINITE CHAIN

THE REACTION WHEEL PENDULUM

4F3 - Predictive Control

MODELLING ANALYSIS & DESIGN OF DSP BASED NOVEL SPEED SENSORLESS VECTOR CONTROLLER FOR INDUCTION MOTOR DRIVE

System Identification Using a Retrospective Correction Filter for Adaptive Feedback Model Updating

Exponential Controller for Robot Manipulators

Robust Optimal Sliding Mode Control of Twin Rotor MIMO System

1 Kalman Filter Introduction

Feedback Control of Linear SISO systems. Process Dynamics and Control

EL1820 Modeling of Dynamical Systems

Design of Fuzzy Logic Control System for Segway Type Mobile Robots

CONTROL OF ROBOT CAMERA SYSTEM WITH ACTUATOR S DYNAMICS TO TRACK MOVING OBJECT

Optimal and Robust Tuning of State Feedback Controller for Rotary Inverted Pendulum

MS-E2133 Systems Analysis Laboratory II Assignment 2 Control of thermal power plant

Exam. 135 minutes, 15 minutes reading time

EL2520 Control Theory and Practice

Autonomous Mobile Robot Design

LQG/LTR CONTROLLER DESIGN FOR ROTARY INVERTED PENDULUM QUANSER REAL-TIME EXPERIMENT

NONLINEAR PATH CONTROL FOR A DIFFERENTIAL DRIVE MOBILE ROBOT

Übersetzungshilfe / Translation aid (English) To be returned at the end of the exam!

APPLICATION OF ONTOLOGIES AND SEMANTIC WEB FOR FACILITATION OF ECOLOGY

Lecture 6 Classical Control Overview IV. Dr. Radhakant Padhi Asst. Professor Dept. of Aerospace Engineering Indian Institute of Science - Bangalore

A NEW APPROACH TO THE PERTURBATION ANALYSIS FOR DISCRETE H SYNTHESIS PROBLEMS * Andrey S. Yonchev, Mihail M. Konstantinov, Petko P.

Course of lab activities on control theory based on the Lego NXT

Identification of a Chemical Process for Fault Detection Application

Chapter 13 Digital Control

EECS C128/ ME C134 Final Wed. Dec. 15, am. Closed book. Two pages of formula sheets. No calculators.

MEMS Gyroscope Control Systems for Direct Angle Measurements

Inertia Identification and Auto-Tuning. of Induction Motor Using MRAS

Online Model Predictive Torque Control for Permanent Magnet Synchronous Motors

Matlab-Based Tools for Analysis and Control of Inverted Pendula Systems

Position Control Using Acceleration- Based Identification and Feedback With Unknown Measurement Bias

A Comparative Analysis of Repetitive and Resonant Controllers to a Servo-Vision Ball and Plate System

Transcription:

Доклади на Българската академия на науките Comptes rendus de l Académie bulgare des Sciences Tome 67, No 8, 2014 SCIENCES ET INGENIERIE Automatique et informatique Dedicated to the 145th Anniversary of the Bulgarian Academy of Sciences LINEAR-QUADRATIC CONTROL OF A TWO-WHEELED ROBOT Tsonio Slavov, Jordan Kralev, Petko Petkov (Submitted on June 19, 2014) Abstract In this paper we present the design and experimentation of a control system of two-wheeled robot which implements a Linear-Quadratic Regulator (LQR) for vertical stabilization and a proportional-integral (PI) controller of the robot rotation around the vertical axis. Due to the lack of accurate analytical robot model, the control system design is done by using a model built with the aid of an identification procedure. Two discrete-time Kalman filters of 17th order and of 2nd order are implemented to estimate the plant state in presence of several noises. A software in MATLAB /Simulink environment is developed for generation of control code which is embedded in the Texas Instruments Digital Signal Controller TMS320F28335. Results from the simulation of the closed-loop system as well as experimental results obtained during the real implementation of the controller designed are given. Key words: real-time control, two-wheeled robot, LQR control, embedded system, digital signal processor 1. Introduction. Two-wheeled robots have several applications which make them interesting from theoretical and practical point of view. The most popular commercial product, built on the idea of self balancing two-wheeled robot is the Segway Personal Transporter (PT), produced by Segway Inc., USA [ 1 ]. Some of the Segway PTs have maximum speed of 20 km/h and can travel as far as 38 km on a single battery charge. The self-balancing two-wheeled robot NXTway-GS [ 2 ], built on the basis of the LEGO Mindstorms NXT developer kit, is widely used in education. Also, the telepresence and video conferencing two-wheeled robot Double [ 3 ] is recently very popular. The research presented in this paper is done under Project No 142PD0008-08 funded by the Scientific and Research Unit of the Technical University of Sofia. 1153

The two-wheeled robots have dynamics which is similar to the inverted pendulum dynamics so that they are inherently unstable and should be stabilized around the vertical position using a control system. Linear-quadratic or proportional-integral-derivative (PID) control laws are usually implemented in order to achieve vertical stabilization and desired position in the horizontal plane [ 4 ]. In this paper we present the design and experimentation of a control system of two-wheeled robot which implements a Linear-Quadratic Regulator for vertical stabilization and a proportional-integral controller of the robot rotation around the vertical axis. Due to the lack of accurate analytical robot model, the control system design is done by using a model built with the aid of an identification procedure. Two discrete-time Kalman filters of 17th order and of 2nd order are implemented to estimate the plant state in presence of several noises. A software in MATLAB /Simulink environment is developed for generation of control code which is embedded in the Texas Instruments Digital Signal Controller TMS320F28335. Results from the simulation of the closed-loop system as well as experimental results obtained during the real-time implementation of the controller designed are given. The experimental results confirm the efficiency of the technical solution implemented. 2. Plant description. The general view of the two-wheeled robot in selfbalancing mode is shown in Fig. 1a. The robot is equipped with two servo drives for actuation, micro-electromechanical (MEM) inertial sensor ADIS16350 for measuring the angular velocities φ and ψ of robot body in the vertical plane and around the vertical axis, respectively, quadrature encoders for measuring the position of the wheels and a digital signal controller Texas Instruments TMS320F28335 implementing a discrete real-time stabilization algorithm with sampling period T 0 = 0.005 s. The robot balancing is achieved by rotating the wheels in appropriate direction. The computation of control actions to both DC brushed drive motors is realized in single precision on the basis of signals from the gyro sensor measuring the angular rate (and, after integration, the tilt angle φ) and signals from rotary encoders measuring the wheels rotation angles. The control of the DC motors is executed by Pulse Width Modulated (PWM) signals. Since the gyroscope measurements are subject to bias, random walk and noise, the body tilt angle and the wheel angles are estimated by using a 17th order Kalman filter. Additional 2nd order Kalman filter is used to estimate the yaw angle ψ. 3. Controller design. The block-diagram of the two-wheeled robot control system is shown in Fig. 1b. With respect to the stabilization in upper equilibrium state and to the control of forward-backward motion, the robot is described by Auto Regressive Moving Average with external input (ARMAX) and Box-Jenkins (BJ) discrete-time models. The ARMAX model of 7th order with structure parameters na = 7, nb = 7, nc = 7, nk = 3 describes the link between the control 1154 Ts. Slavov, J. Kralev, P. Petkov

a b Fig. 1. a) Two-wheeled robot in self-balancing mode, b) Block-diagram of the control system

a b c Fig. 3. a) Tracking position reference, b) Body angle variation, c) Tracking yaw angle reference

signal u and the rate φ, while the BJ model of 3rd order with structure parameters nb = 3, nf = 3, nc = 3, nd = 3, nk = 1 gives the link between the rates φ and θ = ( θ L + θ R )/2 where θ L and θ R are the angular velocities of left and right wheels, respectively. The ARMAX and BJ nominal models are represented in the state space as (1) (2) x φ(k + 1) = A φx φ(k) + B φu(k) + J φν φ(k), φ(k) = C φx φ(k) + H φν φ(k), x Θ(k + 1) = A Θx Θ(k) + B Θu(k) + J Θν Θ(k), Θ(k) = C Θx Θ(k) + H Θν Θ(k), where x φ, x Θ are state vectors with dimensions 9 and 6, respectively, ν φ, ν Θ are discrete-time white gaussian noises with variances D φ = D Θ = 1, and A φ, B φ, J φ, C φ, H φ, A Θ, B Θ, J Θ, C Θ, H Θ are constant matrices with corresponding dimensions containing the model parameters. The noises ν φ, ν Θ are obtained during the identification procedure and reflect the uncertainty in the model found. These noises are represented as models with input multiplicative uncertainty which are used in the analysis in frequency range. The non-measurable wheels angle is described by (3) Θ(k + 1) = Θ(k) + T 0 Θ(k) = Θ(k) + T0 C Θx Θ(k) + T 0 H Θν Θ(k). It is also appropriate to include the equations (4) x φi (k + 1) = x φi (k) T 0 φ(k) (5) x i (k + 1) = x i (k) + T 0 (r Θ (k) Θ(k)), where r Θ is the wheels reference angle. These equations allow to compute approximations of the discrete-time integrals of φ and tracking error r Θ Θ, respectively. Both integrals are used in the design of linear-quadratic regulator which ensures efficient stabilization in the vertical plane and zero steady-state tracking error. In this way we obtain the full plant equations of 18th order in the form (6) x(k + 1) = Ax(k) + Bu(k) + Jν(k), y(k) = Cx(k) + Hν(k), where x = [x Ṫ φ xṫ Θ Θ x φi x i ] T, y = [ φ Θ Θ φ] T, v = [v φ v Θ] T and the matrices A, B, J, C, H are obtained combining equations (1) (5). The controller design is done to minimize the quadratic performance index (7) J(u) = [x(k) T Qx(k) + u(k) T Ru(k)], k=0 Compt. rend. Acad. bulg. Sci., 67, No 8, 2014 1155

where Q and R are positive definite matrices chosen to ensure acceptable transient response of the closed-loop system. The optimal control which minimizes (7) in respect to the system (6) is given by [ 5 ] (8) u(k) = Kx(k), where the optimal feedback matrix K is determined by (9) K = (R + B T P B) 1 B T P A and the matrix P is the positive definite solution of the discrete-time matrix algebraic Riccati equation (10) A T P A P A T P B(R + B T P B) 1 B T P A + Q = 0. The matrix K is computed by the function dlqr of MATLAB. Let the matrix K be partitioned according to the dimensions of x φ, x Θ, Θ, x φi, x i as K = [K φ K Θ K Θ K φi K xi ]. Since the state x(k) of system (6) is not accessible, the optimal control (8) is implemented as (11) u(k) = K φˆx φ(k) K Θˆx Θ(k) K Θ ˆΘ(k) K φi ˆx φi (k) K xi ˆx i (k), where ˆx φ(k), ˆx Θ(k) are estimates of x φ(k) and x Θ(k), respectively, and (12) ˆx φi (k + 1) = ˆx φi (k) T 0 ˆ φ(k), ˆx i (k + 1) = ˆx i (k) + T 0 (r Θ (k) ˆΘ(k)) are estimates of x φi (k) and x i (k), respectively. The estimates ˆ φ(k) = C φˆx φ(k) and ˆΘ(k) are obtained by a Kalman filter. The gyroscope under consideration contains a significant noise φ g which is modeled by the additional equation (13) φg (k + 1) = φ g (k) + J g ν g (k), where ν g is a white gaussian noise with unit variance and the coefficient J g is determined experimentally to obtain a good estimate of φ as J g = 0.0001. Combining equations (1), (2), (3), and (13), the Kalman filter is designed for the system (14) (15) x f (k + 1) = A f x f (k) + B f u(k) + J f ν f (k), y f (k) = C f x f (k) + H f ν f (k), where x f = [x Ṫ φ xṫ Θ Θ φ g] T, y f = [ φ Θ Θ φ g ] T, ν f = [ν φ ν Θ ν g ] T 1156 Ts. Slavov, J. Kralev, P. Petkov

and A f, B f, J f, C f, H f are matrices of corresponding dimensions. A 17th order discrete-time Kalman filter for the system (14) is obtained as (16) ˆx f (k+1) = A f ˆx f (k) + B f u(k) + K f (y f (k+1) C f B f u(k) C f A f ˆx f (k)), ŷ f (k) = C f ˆx f (k). The filter matrix K f is determined as (17) K f = D f C T f (C f D f C T f + 10 5 ) 1, where the matrix D f is obtained as the positive semi-definite solution of the discrete-time matrix algebraic Riccati equation (18) A f D f A T f D f A f D f C T f (C f D f C T f + 10 5 ) 1 C f D f A T f + J f D νf J T f = 0 and the matrix D νf = I 3 is the variance of the noise ν f. Note that in equations (17)), (18) the variance of the zero output noise in (16) is taken equal to 10 5 to avoid singularity of the corresponding matrix. The matrix K f is computed by the function kalman of MATLAB. The quantity ˆ φ(k) which is used in computation of the estimate (12), is obtained from (19) ˆ φ(k) = φ(k) ˆ φg (k), where ˆ φg (k) is the last element of the state estimate ˆx f. The Bode plot of the closed-loop system obtained for the uncertain plant is shown in Fig. 2a. It is seen that the system tracks accurately references with frequencies up to 1 rad/s. In Figure 2b we present the structured singular value (µ) [ 8 ] corresponding to the robust stability of the closed-loop system. Since the value of µ is less than a) b) Fig. 2. a) Bode plot of the uncertain closed-loop system, b) Robust stability of the system Compt. rend. Acad. bulg. Sci., 67, No 8, 2014 1157

one for all frequencies, the closed-loop system achieves robust stability for the plant uncertainty determined during the identification procedure. A PI controller of the angular motion around the vertical axis is also designed. Since the yaw angular velocity ψ is measured by a gyroscope of the same type as the gyro used to measure the tilt rate, a second order Kalman is designed to produce sufficiently accurate estimate ˆψ of the yaw angle. 4. Experimental results. A simulation scheme of the control system and a specialized software in MATLAB /Simulink environment is developed to implement the control code. With the aid of Simulink Coder [ 6 ] and Code Composer Studio, a code is generated from this software which is embedded in the Texas Instruments Digital Signal Controller TMS320F28335 [ 7 ]. Several experiments with the controllers designed are performed and comparison with the simulation results is done. The experimental results obtained during the real-time robot control and the corresponding simulation results are given in Fig. 3. It is seen from Fig. 3a and b that the wheels track accurately the reference and the robots keeps well its vertical position. The usage of ˆψ(k) instead of ψ(k) ensures exact rotation of the robot around the vertical axis, while there is an increasing with the time bias in the measured value of ψ(k) due to the integration of the gyro noise (Fig. 3c). REFERENCES [ 1 ] Segway Personal Transporters. Bedford, NH, 2012. http://www.segway.com [ 2 ] Yamamoto Y. NXTway-GS (Self-Balanced Two-Wheeled Robot Controller Design). http://www.mathworks.com/matlabcentral/fileexchange/ [ 3 ] Double Robotics. Sunnyvale, CA, 2014. http://www.doublerobotics.com [ 4 ] Chan R. P. M., K. A. Stol, C. R. Halkyard. Annual Reviews in Control, 37, 2013, 89 103. http://dx.doi.org/10.1016/j.arcontrol.2013.03.004 [ 5 ] Goodwin G. C., S. F. Graebe, M. E. Salgado. Control System Design. Upper Saddle River, NJ, Prentice Hall, 2001, ISBN 9780139586538. [ 6 ] The MathWorks, Inc. Simulink Coder. Natick, MA, 2013. Available from: http: //www.mathworks.com/products/datasheets/pdf/simulink-coder.pdf [ 7 ] Spectrum Digital, Inc. ezdsptmf28335 Technical Reference, 2007. Available from: http://c2000.spectrumdigital.com/ezf28335/docs/ezdspf28335c_ techref.pdf [ 8 ] Gu D.-W., P. H. Petkov, M. M. Konstantinov. Robust Control Design with MATLAB, 2nd ed. London, Springer-Verlag, 2013. Department of Systems and Control Technical University of Sofia 8, St. Kliment Ohridski Blvd 1756 Sofia, Bulgaria e-mail: ts slavov@tu-sofia.bg 1158 Ts. Slavov, J. Kralev, P. Petkov