mpc NEW DONE
mpc NEW DONE
6, June 2022
Thang Le Tran
Controls, Automation in Production and Improvement of Technology Institute Hanoi, Vietnam
Email: [email protected]
Abstract—Navigation is an essential problem for self- obstacles, where the robot's moving space is limited,
propelled robots, in which the orbital control system plays a omnidirectional robots are commonly used in indoor
decisive role in the robot's behavior and navigating the robot environments such as factories, warehouses, laboratories.
to move in space. This paper presents the tutorial approach
for the design and construction of the Nonlinear Model Therefore, the increasingly advanced wheel structure has
Predictive Control controller for the four-wheeled Omni been researched and manufactured to help the robot move
robot in the orbital tracking problem. The designed flexibly in all directions. The Omni wheel is a popular
controller is implemented in the navigation stack system for omnidirectional wheel used for mobile robotic
the robot to follow the specified trajectory smoothly and applications in the home. The Omni wheel has a series of
avoid collision with surrounding obstacles simultaneously. free-moving rollers centrally mounted and perpendicular
The results are presented in both theory and simulation cases
owing to the ROS platform to illustrate the validity and
to the wheel. Therefore, in addition to the ability to rotate
effectiveness of the method for the trajectory tracking around the axis, the Omni wheel can slide to help the robot
problem combined with the navigation stack system. Besides move more flexibly [1], [2].
the advantage of the designed navigation stack is also Nonlinear Model Predictive Control (NMPC), referred
demonstrated through comparison with the TEB planner. to as the receding horizon control, is an optimization-based
time-domain method for the closed-loop control of the
Index Terms—Nonlinear Model Predictive Control (NMPC),
nonlinear system. The primary advantage of NMPC is that
Omni robot, trajectory tracking, navigation, Robot
Operating System (ROS) it can explicitly handle system constraints in the control
process, which are generally neglected in traditional
methods [3]-[7]. However, most mechanism systems
I. INTRODUCTION always exit many different constraints due to the limited
capacity of actuators, the conditions of surrounding
Currently, mobile robotics is one of the most extensive environments, or some economic considerations. As in
research fields and becoming more popular in the industry. traditional linear MPC, NMPC computes control actions at
Mobile robots can move automatically in many different each control interval using a combination of model-based
environments. In an indoor environment with many
where
cos − sin 0 vx h
xk +1 = xk + ( R1 + 2R2 + 2R3 + R4 )
H 2 = sin cos
0 ; u = v y (5) 6 (10)
0 tk +1 = tk + h
0 1
Considering a sampling period ℎ, a sampling instant 𝑘
From (4) the robot, the state will be achieved through and applying the 4th order Runge-Kutta approximation to
integrals (4), we obtain the discrete-time model for robot motion.
x (t ) The individual slopes at each point are defined as:
x = y ( t ) vx cos − v y sin
( t )
R1 = f ( xk , u ) = vx sin + v y cos (11)
x (t ) +
0 (v
x ( t ) cos ( t ) − v y ( t ) sin ( t ) ) dt (6)
= y ( t0 ) +
(v x ( t ) sin ( t ) + v y ( t ) cos ( t ) ) dt
h
R2 = f xk + R1 , u
2
( t0 ) + ( t ) dt
h h
vx cos + 2 − v y sin + 2
The angle of the robot is always limited in range
(12)
− , . So, we always normalize the angle by: h h
= vx sin + + v y cos +
2 2
+
= − 2 (7)
2
Each wheel of a mobile robot is always limited to a
h
limited speed. Therefore, the linear velocity and angular R3 = f xk + R2 , u
velocity of the robot are also limited. Define the speed 2
constraints of the robot: h h
vx cos + 2 − v y sin + 2
vx , v y vmax
(13)
(8) h h
max = vx sin + + v y cos +
2 2
B. Discretization
The continuous nonlinear control system in the equation
(4) can be expressed as:
R4 = f ( xk + hR3 , u )
x = f ( x (t ) , u (t )) (9)
vx cos ( + h ) − v y sin ( + h )
(14)
where x ( t ) 3
and u ( t ) 3
are the 3-dimensional = vx sin ( + h ) + v y cos ( + h )
states and 3-dimensional control vectors.
In this paper, a Runge-Kutta approach is used to obtain
the state at the next time step xk +1 . Runge-Kutta methods Based on (11-14) the equation (10) is as follow:
are a class of methods to integrate ODE. In this case, a 4th h
order Runge-Kutta method is employed. It approximates xk +1 = xk + ( R1 + 2 R2 + 2 R3 + R4 )
6
the solution to a differential equation in (9), with initial
condition x ( t0 ) = x0 . The order of the Runge-Kutta hvx hv y
−
6 6
method refers to the number of approximations of the slope xk (15)
hv hv y
= yk + x +
with a one-time step. The slope at the start point and
endpoint are defined by R1 and R4 . The slopes at the two 6 6
k
midpoints are R2 and R3 [16]. h
To determine an approximation of xk +1 , a weighted
average of the slopes at R1 , R2 , R3 , R4 is used. The
The matrix form of (15) is as follow:
midpoint slopes are weighted twice as much as the start
and endpoint. The xk +1 is obtained as follow:
f ( x ) − r xiQ2 + uiQ2
linearity, including non-linearity in the constraints. The
main idea of SQP is that it solves in each iteration an + i −1 , ui −1
i =1 i =0
inequality constrained QP obtained by linearizing the
objective and constraints functions. Hence, to apply the BN uN −1 + C N Q2 N + x0Q2 (36)
SQP method, at time instant, the objective cost function N −1 N −1
in (24) is linearized to have the following form: + Bi ui −1 + Ci Q2 + u 2
iQ
J ( x, u ) J ( x ( k ) , u ( k ) ) + u J ( x ( k ) , u ( k ) ) ( u − u ( k ) ) i =1 i =0
= u Hu + 2u M + N
T T
( u − u ( k ) ) 2u J ( x ( k ) , u ( k ) ) ( u − u ( k ) )
1 T (31)
+
2 With
B1T QB1 + R 0 0
In which, the Jacobian u2 J is calculated as follow:
0 B2 QB2 + R
T
0
T H =
J J J
u J = ... =G (32)
u0 u1 uN −1 BNT QBN + R
0 0
B1T QC1 0 0
In the case of the objective function expressed as in (24),
0 B2T QC 2 0
we have: M = (37)
J f ( xi , ui ) 0
= 2 e xiT+1Q + 2 Rui (33) 0 BNT QC N
ui ui
N
N = x0Q2 + C T
i QCi
Considering the Hessian u2 J , because the objective i=1
function has the nonlinear least-square form, the Gauss- According to the Gauss-Newton Hessian approximation,
Newton Hessian approximation with linear convergence the matrix H is used as the estimated value of the Hessian
property can be employed instead of exact value to avoid u2 J . Therefore, using the SQP method, the QP is
complicated computation. We have:
reformulated as follows:
2 2 min J SQP ( u ) = G ( u − u ( k ) )
xi − r xi = f ( xi −1 , ui −1 ) − r xi u
Q Q (38)
( u − u ( k )) H ( u − u ( k ))
1 T
+
f T ( xi −1 ( k ) , ui −1 ( k ) )
2
2
+f ( xi −1 ( k ) , ui −1 ( k ) ) ( ui −1 − ui −1 ( k ) ) Subject to
(34)
− r xi Du d (39)
Q
2 Remark 1: Let Ω be the set of indices i for which the
= Bi ui −1 + Ci Q ith element of vector Du − d equals zero, then Ω
= uiT−1 BiT QBi u + 2uT BiT QCi + CiT QCi , i 1, N includes indices of active constraints. Denote Ω be the
vector obtained by taking all the ith row of vector i Ω .
with The Lagrange function can be established as follow:
L ( u, λ )
= Du − d 0 (42)
λ
λ0 (43) For the tracking problem, we set the sample time is
dt = 0.2 (s) and the initial position of the robot is
λT ( Du − d ) = 0 (44)
x0 = ( 0,0,0 ) , and design the described path like the
T
1 ( m/s ) Figure 2. Tracked trajectories
umax = −umin = 1 ( m/s ) (47) Fig. 3 shows that the robot’s linear and angular
( rad/s ) velocities track the target while the constraints are satisfied.
4 The velocities, in the beginning, are upper bound until they
approach the desired path; they converge to the velocities B. Simulation Using ROS and Gazebo
that track the reference path. In this section, the simulations are conducted based on
the Gazebo simulator. The visualization is performed by
using Rviz to obtain the results. According to [21], [22],
the weight matrices chosen must be positive. Thus, in this
simulation, we choose the prediction horizon N = 30 and
weight matrices:
100 0 0 10 0 0
QN = Q = 0 100 0 , R = 0 10 0
(49)
0 0 0.5 0 0 5
error = ( xr − x )2 + ( yr − y )2 (50)
ROS is integrated with Gazebo simulation software. The comparison between NMPC and TEB was
The environment in Gazebo is optimized so that the performed to evaluate the performance of the Navigation
physical conditions are most similar to the actual stack-based NMPC. The global path is generated based on
environment. To simulate the behavior of the robot, the the A* planner and used as the robot's desired trajectory.
Omni robot model and the simulated environment were The robot has an initial position xr = 0 , yr = 0 and
built to evaluate the quality of navigation using the moves to the target position xg = 5 , yg = −5 .
proposed controller. The robot model and environment are
shown in Fig. 8. The white pixel presented the movable space. The black
The diagram of the Navigation stack-based NMPC is pixel presented the wall, and the gray pixels presented the
shown in Fig. 9. In which, node /gazebo_gui represents unknown space in the map. According to Fig. 10, the red
Gazebo simulator, node /gazebo represents physical path is the global path navigated to the target position. The
environment and robot; node /joint_state_publisher and yellow path is the local path designed from the NMPC
/robot_state_publisher represent robot states in the RViz controller. Besides, the local path of the TEB shown in the
visualization tool; node /ekf_slam is used to locate the blue line is added to consider the movement trend of the
robot in the environment; node /map_server represents the robot at the same time to compare the local path of the
map obtained by the robot during the previous mapping; proposed navigator with the TEB. As shown in Fig. 10, the
node /move_base aggregates information from the map, local path of the NMPC navigator is always asymptotic to
robot, and target location to create a trajectory, and node the global path, while the local path of the TEB tends to be
/mpc_navigation is the node deployed to perform the skewed out. Because NMPC considers the Omni robot's
trajectory tracking task. The NMPC is substituted for the kinematic model, NMPC can make optimal predictions to
TEB controller in robot control. As can be seen in Fig. 9, follow the global path. And TEB is designed for many
the NMPC node receives the local path signal from TEB robot models, so its navigability is more limited than the
and outputs the control signal to the robot. proposed navigator.
AUTHOR CONTRIBUTIONS
Hiep Do Quang, Cuong Nguyen Manh and Toan
Nguyen Nhu designed the proposed algorithm; Hiep Do
Quang and Thang Le Tran implemented and conducted the
experiment; Toan Nguyen Nhu and Nam Bui Duy wrote
the paper; Cuong Nguyen Manh and Tien Ngo Manh
reviewed the paper.
ACKNOWLEDGMENT
This research was funded by Vietnam's national project
“Research, develop an intelligent mobile robot using
different types of sensing technology and IoT platform, AI,
Figure 10. Navigation paths of the robot using NMPC and implemented in radioactive environment monitoring
application” of the CT1187 Physics development program
in the period 2021-2025.
REFERENCES
[1] K. V. Ignatiev, M. M. Kopichev, and A. V. Putov. “Autonomous
omni-wheeled mobile robots,” in Proc. 2nd International
Conference on Industrial Engineering, Applications and
Manufacturing (ICIEAM), 2016, pp. 1–4.
[2] M. Emam and A. Fakharian. “Path following of an omnidirectional
four-wheeled mobile robot,” in Proc. Artificial Intelligence and
Robotics (IRAN OPEN), 2016, pp. 36–41.
[3] S. Wang, et al., “Trajectory tracking control for mobile robots using
reinforcement learning and PID,” Iranian Journal of Science and
Technology, Transactions of Electrical Engineering, pp. 1059–
1068, 2020.
[4] Z. Yuan, et al. “Trajectory tracking control of a four mecanum
Figure 11. Record navigation paths of the robot wheeled mobile platform: An extended state observer-based sliding
mode approach,” in Proc. IET Control Theory & Applications, 2019,
The robot's data under the direction of the two pp. 415–426.
[5] N. T. Binh, et al., “An adaptive backstepping trajectory tracking
navigators were recorded to compare the performance of control of a tractor-trailer wheeled mobile robot,” International
the two navigators. Fig. 11 shows the tracked path of the Journal of Control, Automation, and Systems, pp. 465–473, 2019.
robot based on the NMPC and TEB navigators. According [6] Kim, Duyen Ha Thi, et al. “Adaptive control for uncertain model of
to Fig. 11, the robot's trajectory by using the NMPC omni-directional mobile robot based on radial basis function neural
network,” International Journal of Control, Automation and
navigator is asymptotic to the global path. Because the Systems, pp. 1-13, 2021.
TEB Navigator is used for various robot models, and the [7] K. D. H. Thi, et al., “Trajectory tracking control for four-wheeled
proposed navigator is designed for the Omni robot model, omnidirectional mobile robot using Backstepping technique
the capabilities of the NMPC navigator are better. In aggregated with sliding mode control,” in Proc. First International
Symposium on Instrumentation, Control, Artificial Intelligence, and
addition, TEB is optimized in terms of robot travel time, Robotics (ICA-SYMP), 2019, pp. 131–134.
and NMPC is optimized for tracking. Thus, the robot's [8] C. Wang, et al., “Trajectory tracking of an omnidirectional wheeled
trajectory using the proposed navigator has a better ability mobile robot using a model predictive control strategy,” Applied
to follow the global path, while TEB will make priority Sciences, p. 231, 2018.
[9] Ĩ. Moreno-Caireta, E. Celaya, and L. Ros, “Model predictive control
moves to the destination, so it can be seen that the robot for a mecanum-wheeled robot navigating among obstacles,” IFAC-
trajectory with the TEB navigator separates from the Papers On-Line, pp. 119–125, 2021.
global path and moves towards the destination. [10] K. Kanjanawanishkul, “MPC-Based path following control of an
omnidirectional mobile robot with consideration of robot
constraints,” Advances in Electrical and Electronic Engineering, pp.
V. CONCLUSION 54–63, 2015.
[11] J. Inthiam and C. Deelertpaiboon, “Self-localization and navigation
This paper has designed and built a trajectory tracking of holonomic mobile robot using Omni-directional wheel
control system for the four-wheeled omnidirectional odometry,” in Proc. TENCON 2014 - 2014 IEEE Region 10
mobile robot based on NMPC. In addition, Navigation Conference, 2014, pp. 1–5.
stack-based NMPC is also constructed to replace TEB in [12] H. D. Quang, et al., “Mapping and navigation with four-wheeled
omnidirectional mobile robot based on robot operating system,” in
trajectory tracking control. The controller is built based on Proc. International Conference on Mechatronics Robotics and
the kinematic model of the robot. The obtained results Systems Engineering (MoRSE), 2019, pp. 54–59.
show the effectiveness of the NMPC controller in tracking [13] H. D. Quang, T. N. Manh, C. N. Manh, D. P. Tien, M. T. Van, K.
and the navigation problem. N. Tien, and D. N. Duc, “An approach to design navigation system
for omnidirectional mobile robot based on ROS,” International
Journal of Mechanical Engineering and Robotics Research, pp.
CONFLICT OF INTEREST 1502-1508, 2020.
The authors declare no conflict of interest.
[14] K. Xu, et al., “Design and implementation of a ROS-based Thang Le Tran graduated with a PhD in
autonomous navigation system,” in Proc. IEEE International Engineering in System Analysis, Control and
Conference on Mechatronics and Automation (ICMA), 2015, pp. Information Processing from the Taganrog
2220–2225. Insitute of Technology, Southern University -
[15] B. Cybulski, A. Wegierska, and G. Granosik, “Accuracy Russian Federation in 2008. Currently a
comparison of navigation local planners on ROS-based mobile researcher at Controls, Automation in
robot,” in Proc. 12th International Workshop on Robot Motion and Production and Improvement of Technology
Control (RoMoCo), 2019, pp. 104–111. Institute, Hanoi, Vietnam. The main research
[16] G. Campagne, “A nonlinear model predictive control based evasive direction is to design embedded control system,
manoeuvre assist function,” Master thesis, Delft University of stable control and intelligent control.
Technology, 2019.
[17] Z. Li, et al., “Trajectory-tracking control of mobile robot systems Tien Ngo Manh, graduated Engineering
incorporating neural-dynamic optimized model predictive Degree in automatic control at Hanoi
approach,” IEEE Transactions on Systems, Man, and Cybernetics: University of Science and Technology (HUST)
Systems, pp. 740–749, 2016. from 1996-2001. He received his Doctor’s
[18] Y. Ding, Z. Xu, J. Zhao, K. Wang, and Z. Shao, “Embedded MPC Degree in electrical engineering at HUST in
controller based on interior-point method with convergence depth 2014. Now, he works at the Institute of Physics,
control,” Asian Journal of Control, vol. 18, pp. 2064–2077, 2016. Vietnam Academy of Science and Technology.
[19] B. Houska, H. J. Ferreau, and M. Diehl, “An auto-generated real- His main research areas include process control,
time iteration algorithm for nonlinear MPC in the microsecond adaptive control, fuzzy logic and neural
range,” Automatica, pp. 2279–2285, 2011. network control, Robotics, electro-optical
[20] J. Nocedal and S. J. Wright, Numerical Optimization, Springer, system, image processing.
1999.
[21] Z. Yongjie and U. Ozguner, “Constrained model predictive control
for nonholonomic vehicle regulation problem,” IFAC Proceedings, Cuong Nguyen Manh, graduated Engineering
vol. 41, 2008, pp. 9552-9557. Degree in Control Engineering and Automation
[22] K. Felipe, et al., “Mobile robot trajectory tracking using model at Hanoi University of Science and Technology
predictive control,” in Proc. IEEE Latin-American Robotics (HUST), 2020. Now, he is a Master student at
Symposium, 2005. HUST, research engineer at Institute of Physics,
[23] M. P. Pablo, et al., “Global and local path planning study in a ROS- Vietnam Academy of Science and Technology,
Based research platform for autonomous vehicles,” Journal of and robotics engineer at VinAI Research. His
Advanced Transportation, pp. 1-10, 2018. main research area includes adaptive control,
[24] C. Roesmann, W. Feiten, T. Woesch, F. Hoffmann, and T. Bertram, optimal control, fuzzy logic and neural network
“Trajectory modification considering dynamic constraints of control, and robot operating system
autonomous robots,” in Proc. ROBOTIK 2012; 7th German programming for robotics.
Conference on Robotics, 2012, pp. 1-6.
Toan Nguyen Nhu graduated from Hanoi
University of Science and Technology,
Copyright © 2022 by the authors. This is an open access article Vietnam. He is now a master’s student at Hanoi
distributed under the Creative Commons Attribution License (CC BY- University of Science and Technology,
NC-ND 4.0), which permits use, distribution and reproduction in any Vietnam. His interests includes intelligent
medium, provided that the article is properly cited, the use is non- control, optimal control, machine learning for
commercial and no modifications or adaptations are made. robotic systems