MPC Control and LQ Optimal Control of A Two-Link Robot Arm: A Comparative Study†

This study examined the control of a planar two-link robot arm. The control approach design was based on the dynamic model of the robot. The mathematical model of the system was nonlinear, and thus a feedback linearization control was first proposed to obtain a linear system for which a model predictive control (MPC) was developed. The MPC control parameters were obtained analytically by minimizing a cost function. In addition, a simulation study was done comparing the proposed MPC control approach, the linear quadratic (LQ) control based on the same feedback linearization, and a control approach proposed in the literature for the same problem. The results showed the efficiency of the proposed method.


Introduction
In recent years, the control of manipulator robots has been the subject of much research, due to the robots' increasingly frequent use in dangerous or inaccessible environments, where human beings can hardly intervene [1,2]. These robot models are highly nonlinear which makes the control strategy very difficult. Several approaches to controlling manipulator robots are proposed in the literature. In [3], a robust control for a manipulator robot with two degrees of freedom was developed to take into account the uncertainties in the electrohydraulic servo systems. In [4], a robust control approach that allowed for friction in the model was developed to control a manipulator robot with two degrees of freedom. In [5], a coordinated fuzzy control approach was developed for a manipulator robot with actuator hysteresis and motion constraints. In addition, to reduce the harmful effects from unknown nonlinearities, an adaptive control scheme was introduced. In [6], a feed-forward neural network was developed to find a solution to the inverse kinematics problem of a planar manipulator robot with three degrees of freedom needed for generating desired trajectories in Cartesian space. In [7], a hybrid control approach for a three-link robot arm was developed. The proposed strategy of control was composed of two controllers: an independent joint controller, designed in the configuration space, and a sliding mode controller that enforced desired dynamics for the tracking error projections onto the Frenet-Serret frame. In [8], a robust control approach with constraints for an industrial robot manipulator was developed. First, the trajectory was generated, then a control based on the optimization concept was Machines 2018, 6, 37 2 of 14 determined to follow the generated trajectory. In [9], the control of a manipulator robot using unit dual quaternions based on a kinematic model was developed. In [10], a tracking control approach using a manipulator robot with six degrees of freedom (6-DOF) was proposed. In [11], a time-optimal trajectory for robot systems was proposed using a convex optimization approach. In [12], a minimum-time control approach of the Acrobot was developed. The control strategy consisted of using a direct search algorithm for finding an optimal trajectory for the robot. In [13], an adaptive control was developed for the robot arm with LQ performance. The dynamics of the robot were highly nonlinear and the robot parameters were all assumed unavailable. In [14], a robust optimal adaptive sliding mode control using a disturbance observer was developed and tested on the robot arm. The control gains were adjusted on-line by the observer to compensate for the unknown time-varying disturbances.
In [15], three nonlinear predictive control approaches for controlling a planar two-link vertical manipulator robot were developed: an adaptive nonlinear model predictive control (nMPC) approach, a proportional-integral-derivative (PID)-based nMPC (PIDnMPC) approach, and a novel simplified nMPC (SnMPC) approach. In [16], a nonlinear model predictive control of a manipulator robot mounted on an unmanned satellite was proposed. This control consisted of two modules: a trajectory planning module (based on a trajectory optimization algorithm) and a model predictive controller. In [17], a comparative study between a generalized predictive control and a fuzzy supervisory control of a flexible single-link robot arm was proposed. In [18], a model predictive control with constraints of a flexible-link mechanism was developed. This control approach was tested on a four-link closed loop planar mechanism lying on the horizontal plane driven by a torque-controlled electric actuator. In [19], a nonlinear model predictive control of a free-flying space robot was developed and the performance of the proposed control was compared with that of a sliding mode control. In [20], a reactive constraint-based control approach was developed for controlling a mobile manipulator so it could reach its goal and avoid unknown and unpredictable obstacles. The robot's trajectory was calculated on-line by using the model predictive method. In [21], a nonlinear predictive control structure in real-time for the visual servoing of a manipulator robot was proposed. The proposed control approach was designed to solve tasks assigned to robot manipulators with an eye-in-hand configuration. In [22], a single-input neuronal generalized predictive control approach for controlling a manipulator robot with six degrees of freedom was proposed. In [23], a model predictive control with constraints of a flexible-link manipulator robot was proposed, in order to eliminate the problem of vibration.
In contrast to the above-mentioned works, this paper presents a combination of a feedback linearization control and an MPC control approach of a two-link robot arm. The control approach design was based on the dynamic model of the robot. Since the model of the robot was nonlinear, a feedback linearization control was developed in the first step to obtain a linear system connecting so-called synthetic control signals to the respective joint angles. Next, based on the obtained linear model, a model predictive control approach was developed. The proposed solution was therefore a type of nonlinear cascade controller that was very easy to tune. In order to show the efficiency of the proposed approach, a comparative study was performed with the LQ optimal control approach and a control approach proposed in the literature for the two-link robot arm. This paper is organized as follows. First, in Section 2, a description of the planar two-link robot arm is provided, along with its dynamic model. Then, in Section 3, the control approach for controlling the robot from an initial configuration to the final configuration using an MPC approach is presented. A linear quadratic optimal control approach is developed and the comparative study is addressed in Section 4. Finally, simulation results are presented in Section 5.

Dynamic Model
A planar two-link robot arm can be presented as depicted in Figure 1, where θ i , L i , and M i {i = 1, 2} are respectively the joint angle, the length, and the mass of the first link (i = 1) and the second link (i = 2). The gravitational acceleration is denoted by g. (1) Figure 1. Two-link robot arm.
Taking into account Equation (1), the total kinetic energy of the two-link robot arm is given by the following Equation (2) and the potential energy is given by the following Equation (3): To find the robot motion equations, we use the formalism of Lagrange: With Lagrangian L, we can solve the Euler-Lagrange equation which relies on the partial derivative of kinetic and potential energies of mechanical systems to compute the equations of motion, defined as follows: where L and   T 12 are respectively the Lagrangian of the motion and the torque vector.
Developing Equation (5), the dynamic model of a robotic arm with two degrees of freedom (DOF) can be rewritten in the following form [24]: where: is the vector of joint variables; is the vector of applied torques (control input); is a vector of gravity torques; The calculation of the dynamic model of this robot is based on the kinetic and potential energies. The tip of the second link is computed using the direct geometric model (DGM) as: . (1) Taking into account Equation (1), the total kinetic energy of the two-link robot arm is given by the following Equation (2): , (2) and the potential energy is given by the following Equation (3): U = M 1 gL 1 cos(θ 1 ) + M 2 g(L 1 cos(θ 1 ) + L 2 cos(θ 1 + θ 2 )) .
To find the robot motion equations, we use the formalism of Lagrange: With Lagrangian L, we can solve the Euler-Lagrange equation which relies on the partial derivative of kinetic and potential energies of mechanical systems to compute the equations of motion, defined as follows: where L and τ = τ 1 τ 2 T are respectively the Lagrangian of the motion and the torque vector. Developing Equation (5), the dynamic model of a robotic arm with two degrees of freedom (DOF) can be rewritten in the following form [24]: where: is the vector of joint variables; is the vector of applied torques (control input); is a vector of gravity torques;   represents the vector of Coriolis and centrifugal forces; is the inertia matrix with the following elements:

Controller Design
In this section, the development of a predictive control of a robotic arm with two DOF is presented. In that regard, we consider the nonlinear dynamic model given by Equation (6) that is also multivariable (with two control inputs and two controlled outputs). Although it is possible to design the nonlinear controllers for such systems directly, we here propose a two-step design where a feedback linearization control is developed first to make the system linear. Once the linear model was obtained, a model predictive control is designed in the next step. The final implementation of the controller can be seen as nonlinear multivariable cascade controller.

Feedback Linearization Control
The main idea of this technique is to transform the nonlinear dynamics of the system to a completely or partially linear one, so that linear control approaches can be applied to stabilize it [25,26]. In this study, the control approach with feedback linearization was developed for a dynamic model of the two-link robot arm given by Equation (6). In order to do so, the authors differentiated the output Y until the control input τ appeared. In this case, the control input τ appeared in the second derivative of the output Y. This implied that the relative degree of the system was two. The second derivative of Y can be derived from Equation (6) and is given as: where is a synthetic control vector to this linear double-integrator system. Next, they had to find the relation between the synthetic control and the actual control torque. This feedback linearization control law is obtained from Equation (7) and is given by: Applying the control law given by Equation (8) to the nonlinear system given by Equation (6), the dynamic model of the manipulator robot with two DOF, becomes a linear double-integrator system. The relative degree was equal to two. This meant that by using the control law Equation (8), a complete linearization of the nonlinear system Equation (6) was achieved and a linear system for each joint variable was obtained. These two linear systems can be described in the transfer-function form: where s denotes the independent variable of the Laplace transform. Based on the feedback linearization given in this subsection, a model predictive control for the two-link robot arm was developed, which is the goal of the next subsection.

Model Predictive Control
In the case of a robot arm with two DOF and after application of the feedback linearization Equation (8) to the nonlinear system (6), the authors obtained the following two decoupled linear systems: .. (10) The system (10) can be easily stabilized by using a proportional-derivative (PD) controller given by the following Equation (11): where θ 1d θ 2d T is a vector of the desired joint variables. Note that the PD controller's gain is infinite at high frequencies, which makes it physically not realizable. To limit the gain at high frequencies, the PD controller is usually implemented as a phase lead compensator or some other filtering technique is applied. The closed loop system exhibits the behavior of a second order system. The gains k 1 and k 2 can be chosen as: where w 0 is a natural frequency and ζ is a damping factor. Using the gains given by Equation (12), we obtain a large field of the second order system poles. The objective of the proposed MPC control is to select a part of this domain that optimized the cost function. This last proposal will be defined and detailed later. Now, we will develop an MPC controller (see [27][28][29]) for the first link of the robot arm. The MPC controller for the second link of the robot arm will be developed in the same way as the first. Assuming where h is the horizon time of the prediction, and using Equation (10), the following prediction model is obtained [30]: Next, given the reference angle of the first link θ 1d (constant), the proposed one-horizon time quadratic cost function for stabilizing the system is defined by: where e 1 (t + h) = θ 1d − θ 1 (t + h) is the predicted angle error, and is the predicted velocity error. The horizon time h and the weight ρ are both positive real constants (control parameters) to be determined later. The criterion J is completed by introducing the prediction model (13) into (14). The idea of the proposed control law is to find the constant v 1 that minimizes the criterion J. This is done by choosing v 1 that makes the partial derivative ∂J ∂v 1 equal to 0. The obtained solution with the control gains given by is not constant in the time interval [t, t + h] as assumed initially, but the proposed control law was nonetheless based on this solution. In addition, a more general control law is obtained if the reference value for the angle is allowed to change. Furthermore, the feed-forward and the feed-back gains that are not necessarily constant are assumed. Therefore, the following control law is proposed: The block diagram of the closed-loop system can be presented as depicted in Figure 2, where θ 1d and θ 2d are respectively the reference joint angle of the first and the second link of the robot. As the feedback linearization completely decouples the control of the first and the second joint (see Equation (15)), different parameters can in general be used for both control loops. However, the authors chose to use the same controller for the second joint as the one proposed for the first joint: Machines 2018, 6, x FOR PEER REVIEW 6 of 14 is not constant in the time interval   , t t h + as assumed initially, but the proposed control law was nonetheless based on this solution. In addition, a more general control law is obtained if the reference value for the angle is allowed to change. Furthermore, the feed-forward and the feed-back gains that are not necessarily constant are assumed. Therefore, the following control law is proposed: The block diagram of the closed-loop system can be presented as depicted in Figure 2, where 1d  and 2d  are respectively the reference joint angle of the first and the second link of the robot.
As the feedback linearization completely decouples the control of the first and the second joint (see Equation (15)), different parameters can in general be used for both control loops. However, the authors chose to use the same controller for the second joint as the one proposed for the first joint: Concerning the system response, the control goal was that the joint angles follow their references with dynamics of the second order system given by the following transfer function ( ) , where  is a damping factor and 0 w is a natural frequency. Using the MPC controller given by Equation (15) to stabilize the system (10), the transfer function of the whole closed-loop is given by: Taking into account Equations (16) and (19) and the dynamics of the second order system, the following is obtained: From Equation (21), the weight factor is: Substituting Equation (22) into Equation (20), he following second order equation is obtained: where h is the variable to look for. Bu writing Concerning the system response, the control goal was that the joint angles follow their references with dynamics of the second order system given by the following transfer function w 2 0 / s 2 + 2ζw 0 s + w 2 0 , where ζ is a damping factor and w 0 is a natural frequency. Using the MPC controller given by Equation (15) to stabilize the system (10), the transfer function of the whole closed-loop is given by: Taking into account Equations (16) and (19) and the dynamics of the second order system, the following is obtained: From Equation (21), the weight factor is: Substituting Equation (22) into Equation (20), he following second order equation is obtained: where h is the variable to look for. Bu writing Equation (23) becomes: The solutions, are real if and only if 4ζ 2 − 2 ≥ 0 ⇔ ζ ≥ √ 2/2 . To obtain a positive weight factor ρ, from Equation (22), λ 2 1,2 < 2 is required: It was known that 4ζ 2 − 2 ≥ 0 (for real solutions) and, therefore, a larger solution would never satisfy this inequality. Therefore, only the smaller solution was kept. It was very easy to verify that outcome: After choosing a design parameter ζ = 0.9 and selecting an appropriate natural frequency w 0 , the authors determine the parameter h from Equations (24) and (26). With the horizon time defined, they used Equation (22) to determine the weight factor ρ. The closed-loop performance of the system was computed for each selected value of the natural frequency w 0 . and the results are summarized in Table 1 where: • the natural frequency w 0 is the chosen design parameter; • the horizon time h and the weight factor ρ are obtained using the above described procedure; Minτ i {i = 1, 2} and Maxτ i {i = 1, 2} are the minimum and the maximum of the respective applied torques; the settling time t θ i r±5% {i = 1, 2} corresponds to the times needed for the joint angles to settle within the band (±5%) of the final value; • D θ i {i = 1, 2} are the overshoots of the joint angles (in %) when a step change is applied to its reference; • and i ∈ {1, 2} is the index of the joint. After analyzing Table 1, it was observed that the horizon time h had an influence on the variation range of the control signals (robot torques): short horizon time implied a large variation range of the robot torques.

Linear Quadratic Optimal Control
As in Section 3.2, the linear system given by Equation (10) was considered to determine a linear quadratic (LQ) optimal control [31][32][33][34] for the two-link robot arm.
The error e i between the actual angle θ i and the desired angle θ id is defined as: The desired angle θ id {i = 1, 2} is constant. Differentiating the Equation (29) twice, the following equation is obtained: .. .
If a a single decoupled linear system is considered: ..
The state space representation of the system (31) is given by: where: e 1 T ∈ R n is a state vector; • ϑ ∈ R m is the output vector; • v 1 is the synthetic control of the first joint of the robot; If the objective cost function is considered: where: • and R is a positive constant.
The objective cost function is minimized using the following linear quadratic optimal control: where: P = P 1 P 2 P 2 P 3 is the solution to the following so-called Riccati Equation: PA The solution of the Riccati Equation (35) is: Therefore, the linear quadratic optimal control v 1 = −v * 1 is given by the following control law: Note that the control law for the second joint is obtained following the same steps.
The block diagram of the closed-loop system resembled the one depicted in Figure 2-they only differed in the leftmost box that implemented the MPC control Equation (17) in one case and the LQ optimal control given by Equation (37) in the other.
Using the control law given by Equation (37), the system performance was computed for different values of R and they are summarized in Table 2. Comparing Tables 1 and 2, the authors noticed that, using the proposed model predictive control approach, a better system performance was obtained than by using the LQ optimal control approach. Using an MPC control approach, a fast convergence of the joint variables to the desired angles was obtained and the convergence was without overshooting. In addition, they noticed that by using the MPC control and the LQ optimal control, a better system performance was obtained than by using the PID control approach presented by David and Robles [24]. Furthermore, the mathematical development of the proposed LQ optimal control approach was only valid in the case where the desired angle was a constant or was ramp-like. The proposed MPC control approach, however, was valid for any desired angle.

Simulation Results
In order to illustrate the efficiency of the proposed MPC controller, a simulation study and the comparison with the LQ optimal control approach were performed. For each approach, the authors selected the corresponding parameters so that the maximum torque was strictly less than and as close as possible to 100 Nm. This last condition was met in the case of the LQ optimal control approach for R = 1/150 with a max(|τ 1 |) 97 Nm. The same condition was met in the case of the MPC control approach for (h = 0.1961 (s) and ρ = 0.0312) with a max(|τ 1 |) 97 Nm.
For simulation purposes, the authors assumed that the mass and the length of the first and the second links of the robot arm were M i=(1,2) = 1(kg) and L i=(1,2) = 1(m), respectively. The initial and the desired orientations of the first and the second links of the robot arm were θ 1 (0) = −π/2, θ 2 (0) = π/2, θ 1d = π/2 and θ 2d = −π/2, respectively. According to the selected parameters of the two proposed approaches of control, the gains of the MPC controller were k 1 = 12.25; k 2 = 6.30, and the gains of the LQ optimal controller were k 1 = 12.24; k 2 = 4.94. Figure 3a represents the trajectory of the end effector of the robot arm with the final position of both joints depicted. Figure 3b presents a zoom image of the end-effector of the robot in its final position. The trajectory (full line) computed using the MPC control is observed arriving directly to the goal, unlike the trajectory (dotted-line) computed using the LQ control. Figure 5a and 5b show the comparison between the robot torques 2 τ and 1 τ , respectively, that have been obtained, using the MPC control and the LQ optimal control. It is observed that by using the MPC control approach, the energy consumption is lower than by using the LQ optimal control. Figures 6a and 6b depict the robot synthetic controls 2 v and 1 v given by Equation (15). As can be seen, the synthetic controls reach zero when the end-effector of the robot reaches its objective. The convergence of the joint-angle errors 2 e and 1 e of the two-link robot arm towards zero using the two proposed approaches of control are depicted in Figure 7a and 7b, respectively.    Figure 4a,b represent the comparison between the convergence of the joint angles θ 2 and θ 1 , respectively, to their reference values, using the MPC control and the LQ control. It is observed that the MPC control approach results in a fast and asymptotic convergence of both joint variables and without overshooting. observed that the MPC control approach results in a fast and asymptotic convergence of both joint variables and without overshooting. Figure 5a and 5b show the comparison between the robot torques 2 τ and 1 τ , respectively, that have been obtained, using the MPC control and the LQ optimal control. It is observed that by using the MPC control approach, the energy consumption is lower than by using the LQ optimal control. Figures 6a and 6b depict the robot synthetic controls 2 v and 1 v given by Equation (15). As can be seen, the synthetic controls reach zero when the end-effector of the robot reaches its objective. The convergence of the joint-angle errors 2 e and 1 e of the two-link robot arm towards zero using the two proposed approaches of control are depicted in Figure 7a and 7b, respectively.      Figure 5a,b show the comparison between the robot torques τ 2 and τ 1 , respectively, that have been obtained, using the MPC control and the LQ optimal control. It is observed that by using the MPC control approach, the energy consumption is lower than by using the LQ optimal control.    Figure 6a,b depict the robot synthetic controls v 2 and v 1 given by Equation (15). As can be seen, the synthetic controls reach zero when the end-effector of the robot reaches its objective.   The convergence of the joint-angle errors e 2 and e 1 of the two-link robot arm towards zero using the two proposed approaches of control are depicted in Figure 7a,b, respectively.

Conclusion
This article proposes a novel MPC control approach for a two-link robot arm with two degrees of freedom. The technique consisted of linearizing a nonlinear dynamic model of the robot by using a feedback linearization control. Next, based on the obtained linear model, an MPC controller was developed that was tuned by choosing the parameters h and ρ . In order to demonstrate the effectiveness of the proposed approach, the authors performed a comparative study with the LQ control approach. From the results obtained and presented in this article, it can be stated that the proposed MPC control approach gives a better system performance than the LQ optimal control approach. In addition, both proposed approaches (MPC control and LQ control) give a better system performance than the PID control technique proposed by David and Robles [24]. In the future, the authors plan to test the proposed MPC control on a real robot, to verify this method's robustness.