- Thiết kế bộ điều khiển mô hình Ballbot dùng NMPC Nonlinear Model Predictive Control - Mô phỏng và đánh giá kết quả.. In addition, a Nonlinear Model Predictive Control NMPC is designe
Trang 1TRƯỜNG ĐẠI HỌC BÁCH KHOA
-
NGUYỄN HỮU THÂN
MÔ HÌNH HÓA VÀ THIẾT KẾ BỘ ĐIỀU KHIỂN
Trang 2TRƯỜNG ĐẠI HỌC BÁCH KHOA –ĐHQG -HCM Cán bộ hướng dẫn khoa học: PGS.TS Bùi Trọng Hiếu
(Ghi rõ họ, tên, học hàm, học vị và chữ ký) Cán bộ chấm nhận xét 1: TS Phan Tấn Tùng
(Ghi rõ họ, tên, học hàm, học vị và chữ ký) Cán bộ chấm nhận xét 2: PGS.TS Nguyễn Phùng Hưng
(Ghi rõ họ, tên, học hàm, học vị và chữ ký) Luận văn Thạc sĩ được bảo vệ tại Trường Đại học Bách Khoa, ĐHQG Tp HCM ngày 21 tháng 12 năm 2017
Thành phần Hội đồng đánh giá luận văn Thạc sĩ gồm:
(Ghi rõ họ, tên, học hàm, học vị của Hội đồng chấm bảo vệ luận văn thạc sĩ)
1 PGS.TS Nguyễn Tấn Tiến
2 TS Phùng Trí Công
3 TS Phan Tấn Tùng
4 PGS.TS Nguyễn Phùng Hưng
5 PGS.TS Nguyễn Duy Anh
Xác nhận của Chủ tịch Hội đồng đánh giá LV và Trưởng Khoa quản lý chuyên ngành sau khi luận văn đã được sửa chữa (nếu có)
Trang 3Tp HCM, ngày 10 tháng 07 năm 2017
NHIỆM VỤ LUẬN VĂN THẠC SĨ
Họ và tên học viên : NGUYỄN HỮU THÂN Phái : Nam
Ngày, tháng, năm sinh: 16/07/1992 Nơi sinh: Bình Định
Chuyên ngành: Kỹ thuật Cơ điện tử
2- NHIỆM VỤ LUẬN VĂN:
- Nghiên cứu tổng quan về robot một bánh hình cầu (Ballbot)
- Mô hình hóa hệ thống Ballbot
- Thiết kế bộ điều khiển mô hình Ballbot dùng NMPC (Nonlinear Model Predictive Control)
- Mô phỏng và đánh giá kết quả
3- NGÀY GIAO NHIỆM VỤ: 10-07-2017
4- NGÀY HOÀN THÀNH NHIỆM VỤ: 04-12-2017
5- HỌ VÀ TÊN CÁN BỘ HƯỚNG DẪN (Ghi đầy đủ học hàm, học vị):
PGS TS Bùi Trọng Hiếu
Nội dung và đề cương Luận văn Thạc sĩ đã được Hội Đồng Chuyên Ngành thông qua
CÁN BỘ HƯỚNG DẪN CHỦ NHIỆM BỘ MÔN KHOA QL CHUYÊN NGÀNH (Họ tên và chữ ký) QUẢN LÝ CHUYÊN NGÀNH (Họ tên và chữ ký)
(Họ tên và chữ ký)
PGS TS Bùi Trọng Hiếu
Trang 4conducted from the simulation was created in the thesis are not found from any other research
Ho Chi Minh City, December 2017
Trang 5while I was doing this thesis
Firstly, I would like to send my gratefulness to Prof.Dr Bui Trong Hieu who is
my supervisor for this thesis Whenever I had trouble with my thesis, he always gave
me some helpful suggestion to overcome the problem Moreover, his professional and friendly way of support made me more confident to complete this thesis
Many thanks to all the lecturers who gave the lecture to me The knowledge that
I was studied was very useful That made me do this thesis easier
Finally, I would like to thank all of my friends and family members who always believed in me and supported me to complete this thesis
Ho Chi Minh City, December 2017
Trang 6by rolling the ball, and it can work flexibility and freely in narrow areas In this paper,
a model of the Ballbot is derived from Langrange method In addition, a Nonlinear Model Predictive Control (NMPC) is designed for the planar model to control the behavior of the Ballbot Computer simulations are conducted for illustration of the effectiveness of the propose control method
Trang 71.1 Background and Motivation 1
1.2 Thesis Objectives 3
1.3 Thesis Contributions 3
1.4 Structure of the thesis 3
CHAPTER 2 MATHEMATICAL MODEL FOR THE PLANAR SYSTEM 5
2.1 Model description 5
2.2 Assumptions 5
2.3 Model in the YOZ plane 6
2.4 Modeling in the XOY plane 13
CHAPTER 3 CONTROLLER DESIGN 18
3.1 The Principle of Nonlinear Model Predictive Control 18
3.2 NMPC Mathematical Formulation 20
3.3 Parameters choice 23
3.4 Advantages and Disadvantages of NMPC 23
3.5 Apply NMPC to the Ballbot 24
3.5.1 Moving from point to point without obstacle 24
3.5.2 Moving from Point to Point with an obstacle 26
CHAPTER 4 SIMULATION RESULTS 27
4.1 Point to Point 27
4.2 Point to Point with an obstacle 31
CHAPTER 5 CONCLUSIONS AND FUTURE WORKS 37
5.1 Conclusions 37
5.2 Future Works 37
REFERENCES 38
APPENDIX 39
A Torque conversions 39
B Matlab Code 42
B.1 Main program 42
B.2 NMPC design 44
B.3 NMPC law 45
B.4 nlcon 46
C Stability of NMPC 47
D The 21stInternational Conference on Mechatronics Technology Paper……… 49
Trang 8LIST OF FIGURES
Figure 1.1: Driving Mechanism of CMU Ballbot [1] 1
Figure 1.2: The structure of the second kind of Ballbot [2] 2
Figure 1.3: Driving Mechanism of TGU Ballbot [3] 2
Figure 2.1: Three planar models 5
Figure 2.2: Sketch of the planar model 6
Figure 2.3: Sketch of the planar model with the contact point 8
Figure 2.4: Planar model in XOY plane 13
Figure 3.1: The principle of NMPC 19
Figure 3.2: Piecewise constant input signal 21
Figure 3.3: Block diagram of the NMPC 25
Figure 4.1: Simulation of 𝜑𝑥 and 𝜑𝑦 27
Figure 4.2: Simulation of 𝜗𝑥 and 𝜗𝑦 28
Figure 4.3: Control input 𝑇𝑥 and 𝑇𝑦 28
Figure 4.4: The trajectory of Ballbot 29
Figure 4.5: The trajectory at the destination 29
Figure 4.6: Simulation of 𝜗𝑧 30
Figure 4.7: Control input 𝑇𝑧 30
Figure 4.8: Control input in the real system 31
Figure 4.9: Simulation of 𝜑𝑥 and 𝜑𝑦 32
Figure 4.10: Simulation of 𝜗𝑥 and 𝜗𝑦 32
Figure 4.11: Control input 𝑇𝑥 and 𝑇𝑦 33
Figure 4.12: The trajectory of Ballbot 33
Figure 4.13: The comparison between the trajectory of Ballbot without and with obstacle 34
Figure 4.14: Simulation of 𝜗𝑧 34
Figure 4.15: Control input 𝑇𝑧 35
Figure 4.16: The comparison of T1 35
Figure 4.17: The comparison of T2 36
Figure 4.18: The comparison of T3 36
Figure A.1: Torque and tangential forces generated by the real actuating system 39
Trang 9LIST OF TABLES
Table 2.1: The parameters of Ballbot 7 Table 2.2: The parameters of Ballbot in XOY plane 13
Trang 10CHAPTER 1 INTRODUCTION 1.1 Background and Motivation
Ballbot is a mobile robot consist of a body balancing on a spherical wheel The spherical wheel can make the robot move in any directions The concept of it is very similar to an inverted pendulum
There are two kinds of Ballbot The first one uses driving roller for operator Take CMU Ballbot [1], which is illustrated in figure 1, for instance, two perpendicular driving rollers are used, each driven by a DC servomotor through a belt Opposite each driving roller, two spring-loaded idling rollers are used to locate the ball [1] On the other hand, the second kind uses the omni-directional wheels The structure of it
is shown in figure 2 [2] There are two main parts of this kind: the driving body and driven ball The driving body is composed of the driving mechanism, the attitude acquisition, the wireless transmission, the battery and the motor drive, etc The driving mechanism is composed of electric motor and the omni-directional wheels [2]
Figure 1.1: Driving Mechanism of CMU Ballbot [1]
Trang 11Figure 1.2: The structure of the second kind of Ballbot [2]
Figure 1.3: Driving Mechanism of TGU Ballbot [3]
TGU [3] is one example for the second kind The use of stepper motors in the TGU system allow for precise control, and remove the need of an encoder, which is required for the servomotors used in the CMU system Furthermore, this also reduces the complexity of the driving circuit This, however, comes at a computational cost
to controller, which is much more complicated for the three-wheel drive
This thesis focus on the second kind There are a lot of controllers based on different theories apply to the second kind of Ballbot The paper [2] uses Fuzzy self-adjusting PID, while the LQR controller is applied for [4] and [5] However, all of the theories above have to linearization the nonlinear equations This thesis uses the Nonlinear Model Predictive Control (NMPC), which is not needed to linearization to design a controller for Ballbot Moreover, it can deal with the input saturation as well
Trang 12as the constraints of the state It also suitable for the optimal problems that I want to overcome in this thesis
1.2 Thesis Objectives
This thesis has three purposes:
Firstly, three planar models in XOY, XOZ, and YOZ are illustrated by using Lagrange method Then, a mathematical model of the Ballbot is created based on those three
The second task is design a controller for the model which is made in the first part In this thesis, the Nonlinear Model Predictive Control is used The NMPC is designed for two different goals The first task is control Ballbot to move from a point to another while minimizing the cost function The second task is a little bit more complicated An obstacle is put on the way of Ballbot Therefore, it need to avoid the obstacle while moving to the destication
After designing the controller, I need to be tested by either simulation or experiment In this thesis, the controller is only implemented to a simulation environment to test the Ballbot’s behaviors
1.3 Thesis Contributions
Apply a new control theory to the Ballbot
Looking for a new application for NMPC
1.4 Structure of the thesis
The thesis can be divided into five chapters The first one is Introduction The second chapter is Mathematical model for planar system which is about how to
conduct the mathematical model of the Ballbot After that I studied about NMPC and
Trang 13how it can apply to the Ballbot in Design Controller The results are discussed in Simulation Results, followed by Conclusions and Future Works
Trang 14CHAPTER 2 MATHEMATICAL MODEL FOR THE
PLANAR SYSTEM 2.1 Model description
The three-dimensional system is divided into three planar models where each can be described in two degree of freedom (DoF):
1 DoF for the rotation of the ball
1 DoF for the rotation of the body
Figure 2.1: Three planar models [4]
The propulsion system is modelled as one virtual wheel which is not the same position and does not have the same speed as the omniwheels in the real system Therefore, conversions are needed
2.2 Assumptions
In the planar system model, three planar models are treated as three independent model It means there is no coupling effect among three of them Two of them (the model in XOZ plane and YOZ plane) are very similar to each other The third one
Trang 15which is shown on the right side of the Figure 2 describes the rotation about the axis
z-The system is assumed to consist of three rigid bodies: the ball, the virtual wheel and the body Additionally, these assumptions are made:
The contact points between the ball and the ground and between the wheels and the ball are assumed to be free of slippage
The friction is neglected except for the rotation of the ball on the ground around the z-axis
We assume that the Ballbot consist of three rigid bodies: the Body, the actuating Wheel and the Ball
Figure 2.2: Sketch of the planar model [4]
2.3 Model in the YOZ plane
The model in XOZ plane and YOZ plane are similar to each other, so we can model the Ballbot in YOZ plane and use it for the other The left side of the Figure 2 shows the parameters of the Ballbot in the YOZ plane The description of the parameters is in the Table 2 The value of them is based on the physical model in [4]
Trang 16Table 2.1: The parameters of Ballbot [4]
𝑚𝐾/kg Mass of the Driven Ball 2.29
𝑚𝑊/kg Mass of the Omni-Directional Wheel 3
𝑟𝐾/m Radius of the Driven Ball 0.125
𝑟𝑊/m Radius of the Omni-Directional
𝑟𝐴/m Radius of the Body (Cylinder) 0.1
𝑙/m Gravity Center Height of the Body 0.339
Θ𝐾/kg.m2 Inertia of the Ball 0.00239
Θ𝑊/ kg.m2 Inertia of the Omni-Directional
Θ𝐴/ kg.m2 Rotation Inertia of the Body 4.76
𝜑𝑥 The orientation of the ball
𝜗𝑥 The orientation of the body
To conduct the equation of motion in YOZ plane, we use the Lagrange method The following steps are needed:
Compute kinetic and potential energy of all the rigid bodies as a function
of minimal coordinates
Write non-potential forces as a function of minimal coordinates
Solve the Lagrange equation for the second order derivative equation of the minimal coordinates
The minimal coordinates in YOZ plane are chosen as below
Trang 17The binding equation for 𝜓𝑥 is derived by equating the velocities in the contact point between the ball and the actuating wheel
Figure 2.3: Sketch of the planar model with the contact point [4]
𝑣𝐵 = [
0𝑥̇𝐾0] + [
𝜑̇𝑥00] × [
0(𝑟𝐾+ 𝑟𝑊) 𝑠𝑖𝑛𝜗𝑥(𝑟𝐾+ 𝑟𝑊) 𝑐𝑜𝑠𝜗𝑥
] + [
−𝜓̇𝑥00] × [
0
−(𝑟𝐾+ 𝑟𝑊) 𝑐𝑜𝑠𝜗𝑥 𝜗̇𝑥(𝑟𝐾 + 𝑟𝑊) 𝑠𝑖𝑛𝜗𝑥 𝜗̇𝑥
Trang 18From one of two equation above, the 𝜓̇𝑥 can be solved as below
Trang 19with 𝑓𝑁𝑃 is the non-potential forces of the Ballbot
Each part of equation (2.20) is computed as below
𝛿𝑇
𝛿𝜑𝑥̇ = (𝑚𝐾 𝑟𝐾
𝑟𝑊2 ) + 𝑚𝐴 𝑟𝐾2) 𝜑̇𝑥+ + (𝑟𝐾 𝑐𝑜𝑠𝜗𝑥(𝑚𝑊 (𝑟𝐾+ 𝑟𝑊) + 𝑚𝐴 𝑙) − 𝛩𝑊.𝑟𝐾
Trang 20𝐶2] and Gravitational forces 𝐺(𝑞) = [𝐺𝐺1
2] are:
𝑀11= (𝑚𝑡𝑜𝑡+𝛩𝑊
𝑟𝑊2 ) 𝑟𝐾2+ 𝛩𝐾 (2 30)
Trang 21𝑟𝑊 + 1)0
Trang 22010
2.4 Modeling in the XOY plane
Figure 2.4: Planar model in XOY plane [4]
Table 2.2: The parameters of Ballbot in XOY plane [4]
𝛼 Angle between bottom of the Wheel
and the center of the Ball 40
0
𝑟𝐾/m Radius of the Driven Ball 0.125
𝑟𝑊/m Radius of the Omni-Directional
Trang 23Θ𝐾/kg.m2 Inertia of the Ball 0.00239
Θ𝑊,𝑥𝑦/ kg.m2 Inertia of the Omni-Directional
Θ𝐴,𝑥𝑦/ kg.m2 Rotation Inertia of the Body 0.092
𝜑𝑧 The orientation of the ball
𝜗𝑧 The orientation of the body
The minimum coordinates are used as below
Trang 24with 𝑓𝑁𝑃 is the non-potential forces of the Ballbot
Each part of equation (2.55) is computed as below
The forces apply to the Ballbot on XOY plane
From the actuators
Trang 26Equation for the motion solve for 𝑇𝑓
𝑇𝑓 =𝑇𝑧 𝑟𝐾 𝑠𝑖𝑛𝛼 (𝑟𝑊 𝛩𝐴,𝑥𝑦 − 𝑟𝐾 𝛩𝑊,𝑥𝑦 𝑠𝑖𝑛𝛼)
𝛩𝑊,𝑥𝑦 𝑟𝐾2 𝑠𝑖𝑛2𝛼 + 𝑟𝑊2 𝛩𝐴,𝑥𝑦 (2 72)
Trang 27CHAPTER 3 CONTROLLER DESIGN 3.1 The Principle of Nonlinear Model Predictive Control
Nonlinear model predictive control (NMPC) is one of the most general and flexible approaches to control nonlinear systems based on optimization method Consider a MIMO system
{𝑥̇ = 𝑓(𝑥, 𝑢)
𝑦 = 𝑥 (3 1)
where 𝑥 ∈ ℝ𝑛 is the state, 𝑢 ∈ ℝ𝑛 𝑢 is the control input and 𝑦 ∈ ℝ𝑛𝑦 is the output
of interest It is assumed that the state is measured with the sampling time 𝑇𝑆
A prediction 𝑥̂(𝜏) of the state over the interval [𝑡, 𝑡 + 𝑇𝑃] is obtained by integration () 𝑇𝑃 ≥ 𝑇𝑆 is called the prediction horizon
At a time 𝜏 ∈ [𝑡, 𝑡 + 𝑇𝑃], the predicted state is the function of the initial state 𝑥(𝑡) and the input signal
𝑥̂(𝜏) ≡ 𝑥̂(𝜏, 𝑥(𝑡), 𝑢(𝑡: 𝜏)) (3 2)
where 𝑢(𝑡: 𝜏) denotes the input signal in the interval [𝑡, 𝜏]
Typically, the input signal is assumed constant after a certain time 𝑇𝐶, called the control horizon
𝑢(𝜏) = 𝑢(𝑡 + 𝑇𝐶), 𝜏 ∈ [𝑡 + 𝑇𝐶, 𝑡 + 𝑇𝑃] (3 3)
where 0 ≤ 𝑇𝑆 ≤ 𝑇𝐶 ≤ 𝑇𝑃
Trang 28Figure 3.1: The principle of NMPC [7]
At each time 𝑡 = 𝑡𝑘 = 𝑘 𝑇𝑆, 𝑘 = 0,1,2, … we look for an input signal 𝑢∗(𝑡: 𝜏) such that the predicted state
𝑥̂(𝜏, 𝑥(𝑡), 𝑢(𝑡: 𝜏)) has a desired behavior for 𝜏 ∈ [𝑡, 𝑡 + 𝑇𝑃] It means the input signal 𝑢∗(𝑡: 𝑡 + 𝑇𝑃)
is chosen as one minimizing the following objective function
‖ ‖𝑋 are the weighted norms and their integrals are signal norms
The term ‖𝑥̃𝑃(𝑡 + 𝑇𝑃)‖𝑄2 gives further importance to the final tracking error The term ‖𝑢(𝜏)‖𝑅2 allows us to manage the trade-off between performance and command activity
We have some constraints
Trang 29 𝑥̂(𝜏) satisfies the model equation (3.1) It means
𝑢(𝜏) ∈ 𝑈𝐶, ∀𝜏 ∈ [𝑡, 𝑡 + 𝑇𝑃] (3 11)
𝑢(𝜏) = 𝑢(𝑡 + 𝑇𝐶), 𝜏 ∈ [𝑡 + 𝑇𝐶, 𝑡 + 𝑇𝑃] (3 12)
where 0 ≤ 𝑇𝑆 ≤ 𝑇𝐶 ≤ 𝑇𝑃 𝑇𝑆 is the sampling time, 𝑇𝐶 is the control horizon and
𝑇𝑃 is the prediction horizon