State-Constrained Sub-Optimal Tracking Controller for Continuous-Time Linear Time-Invariant (CT-LTI) Systems and Its Application for DC Motor Servo Systems

: In this paper, we propose an analytic solution of state-constrained optimal tracking control problems for continuous-time linear time-invariant (CT-LTI) systems that are based on model-based prediction, the quadratic penalty function, and the variational approach. Model-based prediction is a concept taken from model-predictive control (MPC) and this is essential to change the direction of calculation for the solution from backward to forward. The quadratic penalty function plays an important role in deriving the analytic solution since it can transform the problem into a form that does not have inequality constraints. For computational convenience, we also propose a sub-optimal controller derived from the steady-state approximation of the analytic solution and show that the proposed controller satisﬁes the Lyapunov stability. The main advantage of the proposed controller is that it can be implemented in real time with a lower computational load compared to the implicit MPC. Finally, the simulation results for a DC motor servo system are shown and compared with the results of the direct multi-shooting method and the implicit MPC to verify the e ﬀ ectiveness of the proposed controller.


Introduction
Recently, interest has been increasing in control systems that require limitations on the state of the target system. For example, optimal trajectory control for industrial robots [1,2], which limits the workspace for co-work between humans and machines, and optimal powertrain control for hybrid vehicle systems [3][4][5], which has limitations on battery capacity, have become more critical to industry. For analytical and computational convenience, the target system for industrial purposes is often linearized, therefore several studies on linear optimal controllers with state constraints were performed. However, these studies imply large computational loads that make it difficult to implement in real time. The following section explains why these computational loads are caused.

Solutions and Their Approximations of the Optimal Control Problems
Assume that the target system is a continuous-time linear time-invariant (CT-LTI) system as follows: where x(t) is the state of the system, u(t) is the input of the system, and y(t) is the output of the system. Let the tracking error e(t) be e = r − y, where r(t) is the reference for the output. Then, the linear-quadratic tracking (LQT) problem can be expressed as follows [6][7][8]: where Q and R are positive definite matrices weighting for the tracking error and the input, J is the cost function, t 0 is the initial time, and t f is the final time. Assume that pair (A, B) is controllable and pair A, C y is observable. Then, by the Lagrange multiplier method [6][7][8] and the variational approach (Theorem A1), the LQT problem (4) can be transformed into a problem of finding solutions of the Riccati equation with boundary conditions and an auxiliary dynamic equation related to the reference. The Riccati equation and the auxiliary dynamic equation can be derived as follows: where P(t) and g(t) are the solutions to be determined. These solutions are usually calculated in the backward direction in time or by using iterations since A − BR −1 B T P, which is the system matrix of the closed-loop system, must have all the negative real parts of the eigenvalues. However, if there are no constraints on the input and the state, it is well known in control engineering that the solutions of the equations can be approximated to their steady-state values, and the solutions become independent of the time. In the case of input constraints alone, the optimal input can be determined by Pontryagin's minimum principle [6][7][8][9]. In general, the solutions determined by Pontryagin's minimum principle are closely related with the solutions of the Equations (5) and (6) and have a form simple enough to be implemented on modern microcontrollers. On the other hand, if there are inequality constraints on the state, the problem statement (4) is not valid, therefore it must be redefined as follows: where C h and w are time-invariant parameters of the inequality constraints. The vector inequality In this case, the problem related to the direction of the calculation is hard to avoid.
Since the problem (7) is difficult to solve exactly, many kinds of research were proposed to solve this problem approximately. The first group of research consists of numerical approaches including dynamic programming methods [6,10,11] or direct and indirect methods [11][12][13]. In general, these methods discretize the target system and apply numerical methods. Since this procedure does not change the direction of the calculation, most of these methods need backward calculations or iterations for all the time steps. The second group of research comprises model-predictive control (MPC) methods including implicit MPC [14][15][16][17] and explicit MPC [18][19][20]. The main difference from the first group is that time-forward calculation is possible since this method predicts the optimal states and inputs of the target system for a short time ahead. However, this method also requires repetitive calculations for the predictions, and the precision of the calculation decreases if the time length of the prediction is not long enough, therefore it still requires many computations in general. To reduce the computational load, explicit MPC was proposed. For explicit MPC design, methods dividing the state space are essential, but the results of these methods are not easy to analyze in practice [21] since they are based on numerical iterations. In summary, the computational problem of the state-constrained optimal tracking control is that the direction of the exact computation for the solution is a time-backward calculation which leads to increasing computational loads.

Outline and Scope of the Paper
In this paper, we propose an analytic solution of state-constrained optimal tracking control problems for CT-LTI systems that are based on the model-based prediction, the quadratic penalty method, and the variational approach in Section 2. The model-based prediction is a concept taken from MPC, and this is essential to change the direction of the calculation for the solution from backward to forward. The quadratic penalty method plays an important role in deriving the analytic solution since it can transform the problem into a form that does not have inequality constraints. For computational convenience, we also propose a sub-optimal controller derived from the steady-state approximation of the analytic solution, and show that the proposed controller satisfies the Lyapunov stability in Section 3. Finally, the simulation results for a DC motor servo system are shown and compared with the results of the direct multi-shooting method and implicit MPC to verify the effectiveness of the proposed controller in Section 4.

Analytic Solution of State-Constrained Optimal Tracking Problems
In this section, we describe the analytic solution of state-constrained optimal tracking problems. This solution can be derived by using the model-based prediction, inequality constraints using prediction, the quadratic penalty function, and the variational approach.

Model-Based Prediction
Suppose that the target system is equal to (1), then a model-based prediction with a fixed time interval τ can be written as follows [16,22]: x τ (t) = x(t + τ|t) = e Aτ x(t) + t+τ t e A(t+τ−η) Bu(η)dη (8) Assume that the time interval τ is short enough to consider the input as a constant. Then, we can approximate (8) asx where The calculation of the above matrices is described in [22] (pp. 114-117) and this can be performed by using c2d MATLAB ® command, etc.

Inequality Constraints Using Prediction
Assume that the left sides of the inequality constraints are where Since (11) should be valid at all times, the following inequalities also should be valid: where Then, (11) and (12) can be rewritten by using (13) as follows:

Quadratic Penalty Function
Suppose that the penalty function p i of the inequality constraint h i ≤ 0 is where and q i > 0 is the weight for α i [23,24]. As shown in Figure 1, the meaning of the penalty function is the violation costs of the inequality constraint.
Appl. Sci. 2020, 10, x FOR PEER REVIEW 5 of 18 The quadratic penalty function is defined as the sum of the penalty functions: where The quadratic penalty function is defined as the sum of the penalty functions: Appl. Sci. 2020, 10, 5724 , and the diag function is defined as

Variational Approach
By using the Lagrange multiplier method and the penalty function method [23,24], Problem (7) can be transformed into the following problem: where λ(t) is the Lagrange multiplier. Let the Hamiltonian function of (17) be and Then, substituting (13) into (19) yields By Corollary A1, the following equations hold: Let Then, the optimal input is

Analytical Solution of the Problem
The following procedure is the same method used in the derivation of the Riccati Equation (5) and the auxiliary dynamic Equation (6) [7,8].
Theorem 1. Assume that the costate is proportional to the state. Then, the costate can be written as where P(t) and g(t) are values to be determined. Then, the following dynamic equations hold: where Proof. By differentiating (26) Substituting (1), (25), and (26) into (31) yieldṡ Since the left sides of (21) and (32) are equal, the right sides of (21) and (32) are also equal. Therefore, Substituting (25) and (26) into (33) yields Since (34) should be valid for all the states, Equations (27) and (28) hold.

State-Constrained Sub-Optimal Tracking Controller
Exact solutions of (27) and (28) have to be calculated in the backward direction in time, and this is not proper for real-time implementations. Therefore, in this section, we propose a sub-optimal controller that is stable and proper for real-time implementations.
The sub-optimal controller is implemented by calculating (35)- (38), but α τ is needed in these calculations. Since α x indicates current violations of the state constraints and α τ indicates possible violations of the state constraints that occur in a moment, α τ can be identified approximately by the following procedure: 1.
Identify α x using current state values and calculate Q x = diag α x T .
Calculate (9) using the result of step 3.

5.
Identify α τ using the result of step 4.
Since α x has limited values (zero or a fixed value for each element), offline calculation results for lower computational loads can be used in step 2. The sub-optimal controller requires the following procedure in addition to the above procedure.
Since α τ also has limited values, step 7 can be performed offline. The main advantage of this procedure is that the total computation time of the procedure is limited to a fixed upper boundary. In the case of offline calculations of steps 2 and 7, it is obvious that the total computation load of the proposed controller is lower than that of the implicit MPC.

Stability of the Proposed Controller
By the matrix inversion lemma [25,26], Therefore, the following equations hold: These equations show that Q 2 is positive semi-definite since Q is positive definite and Q x , Q τ are positive semi-definite or null. Assume that pair is observable since C y is different from C h in general and suitable A d may be selected by changing τ. Then, Equation (35) can be rewritten as Appl. Sci. 2020, 10, 5724 8 of 17 Substituting (36)-(38) into (1) and applying r = 0 and w = 0 yieldṡ Therefore, it is concluded that the closed-loop system is stable by the Lyapunov stability theorem [27,28] if the observability condition is satisfied.

Model Modification for Input Smoothing
The input generated by the proposed controller may have severe vibration that is not found in numerical solutions. To mitigate this, we propose a modification of the plant model including a low pass filter before the input as shown in Figure 2. (44) Therefore, it is concluded that the closed-loop system is stable by the Lyapunov stability theorem [27,28] if the observability condition is satisfied.

Model Modification for Input Smoothing
The input generated by the proposed controller may have severe vibration that is not found in numerical solutions. To mitigate this, we propose a modification of the plant model including a low pass filter before the input as shown in Figure 2.
Then, the problem (7) should be changed as follows: minimize e,u,u where R is the weight for u. Since this problem can be solved by using the same methods described in Sections 2 and 3, we omit a detailed description of the solution.

Case Study: Application for DC Motor Servo Systems
In this section, to help readers understand how to apply the proposed controller, we show an application of the proposed controller for DC motor servo systems. For precision control of DC motor servo systems, studies including MPC [29], data-driven [30], fuzzy [31], neural network [32], cascade control [33], and the digital twin-based optimization [34] were introduced recently. However, except for MPC, these studies did not consider the state constraints; therefore, we compare MPC and the proposed controller for performance verification. The parameters of the target motor are shown in Table 1. The target motor is a 24 V DC brushed gear motor and its rated torque is 2.94 Nm. Then, the state equation of the target system iṡ x 1 is the motor current, x 2 is the angular speed of the motor, and x 3 is the angular position of the motor. Let β = 1000, then the modified plant model is d dt where Let τ = 0.001, then the parameters for the prediction can be calculated as The optimal tracking problem is minimize x,u,u where In this case, has full rank, therefore the closed-loop system is stable. Available values of P s in the cases of Q τ = 0 are shown in Table 2. The weight for α x is 10000 10000 0.001 0.001 T and P s was calculated by the MATLAB ® care function. Since the weight for α τ is 100 100 10 10 T and similar calculations can be performed in the cases of Q τ 0, the proposed controller can be implemented by these results. Figure 3 shows the simulation results with r = π and x(0) = 0 without changing w. The proposed controller was implemented by using Simulink ® blocks and the ode2 (Heun) fixed-step solver was used for the simulation. The step size was set at 10µs for smooth results. To verify the performance of the proposed controller, we also implemented an implicit MPC by using MATLAB ® Model Predictive Control Toolbox TM software. A numerical method based on the direct multi-shooting method implemented by using CasADi software [35] was chosen for comparison since it is close to the optimal solution. The sampling time used in both the numerical method and the implicit MPC was set to 100 µs since lower sampling time causes larger computational loads. The prediction and control horizon of the MPC is set to (100, 10). Table 2. Examples of the solutions of (34).
0.08 0.02 6.50 0.01 0.08 0.02 6.50 0.01 As shown in Figure 3a-c, the trajectory of the proposed controller and that of the numerical method are very similar, therefore it can be said that the proposed controller is well-approximated. On the other hand, the implicit MPC has different trajectories between 0.2 and 0.4 s though the constraints are maintained. In Figure 3d-e, it seems that the trajectory of the proposed controller has a delay compared to that of the numerical method, but the delay is small enough to be neglected. Since the steady-state LQT controller has similar delay properties [36], it is assumed that the cause of this phenomenon is the steady-state approximation.
package for ARM ® Cortex ® -R processors. For comparison, simulations were also performed at the same sampling time in Figure 5. The experimental and simulation results have similar trends in Figure 5, but the experimental results have severe vibrations and performance degradations. Since the real motor has nonlinearities and frictions, it seems that these uncertainties are related to the performance degradations.    Figure 4 are the same as those used in Figure 3. These results show that the inequality constraints are maintained, and this leads to the conclusion that the proposed controller does not seems sensitive to r or w. The results of the implicit MPC in Figure 4a-c also differ from these of other methods therefore it is concluded that the implicit MPC differs from the optimal solution.      Figure 5 are the same as those used in Figure 3. Texas Instruments LAUNCHXL2-570LC43 and BOOSTXL-DRV8323RS (Dallas, TX, USA) are used to control the target motor, and they are shown in Figure 6b. The target motor is equipped with an incremental encoder as shown in Figure 6a, and the encoder has resolutions of 0.0879 degrees. The controller was designed to have sampling time of 100 µs, implemented by using Simulink ® blocks, and converted to C code by using Embedded Coder ® software and Embedded Coder ® support package for ARM ® Cortex ® -R processors. For comparison, simulations were also performed at the same sampling time in Figure 5. The experimental and simulation results have similar trends in Figure 5, but the experimental results have severe vibrations and performance degradations. Since the real motor has nonlinearities and frictions, it seems that these uncertainties are related to the performance degradations.

Discussion
In this paper, we proposed a sub-optimal tracking controller that does not need numerical iterations or backward calculations for state-constrained optimal tracking problems. The main advantage of the proposed controller is that it can be implemented in real time with a lower computational load compared to the implicit MPC. Though there is a delay compared to the results of the numerical method, the simulation results show that the proposed controller has acceptable performance. However, the proposed controller needs to be verified through more application cases including industrial robots, hybrid vehicles, or other control systems. For future work, the proposed controller may be extended to discrete-time systems. Therefore, studies related to the discrete-time optimal tracking controller based on the proposed method are worth researching. In particular, the controller may be applied to path tracking control for autonomous vehicles [37,38], which have recently been the subject of much research.

Discussion
In this paper, we proposed a sub-optimal tracking controller that does not need numerical iterations or backward calculations for state-constrained optimal tracking problems. The main advantage of the proposed controller is that it can be implemented in real time with a lower computational load compared to the implicit MPC. Though there is a delay compared to the results of the numerical method, the simulation results show that the proposed controller has acceptable performance. However, the proposed controller needs to be verified through more application cases including industrial robots, hybrid vehicles, or other control systems. For future work, the proposed controller may be extended to discrete-time systems. Therefore, studies related to the discrete-time optimal tracking controller based on the proposed method are worth researching. In particular, the controller may be applied to path tracking control for autonomous vehicles [37,38], which have recently been the subject of much research.