Design of DC motor position tracking system based on LQR

In order to realize the accurate tracking of the desired position by the DC motor position tracking system, a control method of the DC motor position tracking system based on LQR was proposed. Based on the modeling of the DC motor position tracking system, the stability, controllability and observability of the system are analyzed. Then, the LQR optimal control theory and the design process of the controller are introduced, and the output angular position of the DC motor is taken as the control object, and several common control methods are compared with the controller algorithm designed in this paper through MATLAB software. Experimental results show that the designed controller algorithm can track the desired position, and the system also has the characteristics of short adjustment time, small overshoot and high tracking accuracy.


Introduction
In recent years, the DC motor position tracking system has been widely used in some fields of automatic control systems such as various machine tool processing, missile guidance, radar control, etc. [1]. The machining accuracy and work efficiency of machine tools and other equipment depend on the performance of various aspects of the DC motor position tracking system. Therefore, highperformance position tracking systems had always attracted the attention of scholars in the control field. At present, the control applied to the position tracking system mainly includes fuzzy adaptive PID control [2][3][4][5], iterative learning control [6][7][8], and fractional-order control [9][10][11].
Literature [2] adopts the control strategy of introducing fuzzy control into PID control for the pneumatic servo system. Literature [3,4] adopts the fuzzy adaptive PID control strategy to control the servo tracking system, which improves the performance of the position tracking system. Literature [5] proposed a new method combining predictive fuzzy control and neural network to be applied to the pneumatic servo system and achieved satisfactory results. Literature [6] proposed a model-based iterative learning control strategy for tracking control of permanent magnet synchronous motor servo system. In reference [7], the optimal control iterative learning algorithm is added on the basis of feedforward and feedback two-degree-of-freedom control, which effectively improves the tracking performance of the overall trajectory. Literature [8] adopts a second-order closed-loop PD iterative learning control algorithm as the position control strategy for the permanent magnet synchronous motor position servo system. Literature [9] designed a fractional sliding mode controller based on exponential arrival law to control pneumatic position servo system. Literature [10] proposed an electro-hydraulic servo system position control method based on a fractional controller to track the desired position and improve the control accuracy. Literature [11] comparatively studied the control of the speed and position of the DC motor by the fractional PI and PD controllers. The performance of the above control methods of position tracking has achieved good results, but there are still some shortcomings such as complex control algorithms and difficulty in implementation.
Linear-quadratic optimal control uses the state space method to establish performance evaluation indicators, which can make the controlled system obtain superior performance, and the linearquadratic optimal control problem is the theoretical basis of many problems [12][13][14]. It can reflect the changing laws of all the state variables of the system and can solve this kind of complex problem in combination with the initial state and internal movement of the system, so it has always attracted attention. Therefore, in order to achieve accurate tracking down the actual position of the DC motor position tracking system, this paper combines the optimal control theory to analyze and control the DC motor position tracking system. According to the composition of DC motor has established the mathematical model of the tracking system, and the stability, controllability and observability of the system were analyzed by using MATLAB, and then design an optimal controller based on quadratic form and simulated the system. The designed optimal controller has the advantages of small overshoot, short adjustment time and rise time, and high position tracking accuracy.

Overview of armature controlled DC motor position tracking system
The servo control system is used to control a certain state of the controlled object, so that it can automatically, continuously and accurately reproduce the change law of the input signal of the control system [15]. The machinery manufacturing industry is one of the most widely used industries for servo control systems, and the motion control of various CNC machine tools relies on various servo control systems. The servo control system is also called the position tracking control system, and its reference input is an arbitrary time function whose changing law is unknown. The task of the tracking control system is to make the controlled quantity change according to the same law and keep the error with the input signal within the specified range. The servo control systems are widely used in the military, such as missile tracking control systems, radar monitoring systems, etc. As the servo motor of the power system of the servo control system, its function is to convert the input voltage signal into the angular displacement or the angular velocity output of the shaft, and it is a classic automatic control system.
The control signal is added to the armature winding, and the size and direction of the rotor speed are controlled by changing the size and polarity of the control signal, and this method is called armature control. When the DC servo motor performs armature control, the armature winding is the control winding, and the control voltage U is directly added to the armature winding for control. Since the excitation current is constant, also the magnetic field  in the motor is constant. When the armature winding to add a control signal, an armature current a I is generated, and  interacts with a I to generate torque. When the armature voltage a U increases, the speed n increases. When the armature voltage a U decreases, the speed n decreases. When the armature voltage a U is equal to 0, the speed n is also equal to 0. It has good controllability. When the armature voltage changes polarity, the motor reverses.

Mathematical model of armature controlled DC motor
In order to make the analysis more intuitive and effective, it is necessary to establish the mathematical model of the DC motor [16][17][18]. The armature-controlled DC motor system is shown in Figure 1.
The dynamic equation can be written from the mechanical properties: Write the inverse electromotive force equation from the torque balance column on the motor shaft: where: a L is the armature inductance; a R is the armature resistance; m K is the torque constant of the motor; J is the total moment of inertia on the motor shaft; e K is the electromotive force constant of the motor (determined by the structure of the motor);  is the motor Angular displacement;  is the angular velocity of the motor; a i is the armature current. Therefore, the transfer functioned structure diagram is as follows: Ignoring the load torque L T , assuming that i  is approximately constant, that is, the tracking command changed rate is 0. From Figure 2, the open-loop (in the dashed box) transferred function of the armature-controlled DC motor system is: 3 a x i  , the following differential equations can be obtained: where the parameters The parameters of an armature-controlled DC motor are as follows:

System controllability, observability and stability
To realize the optimal control of the motor position tracking system, the controllability, observability, and stability of the established motor dynamic system must be analyzed. The controllability is judged by judging whether the controllability matrix is full rank [19], and the controllability discriminant matrix of the system is obtained by the formula (6): Since 0 m K  , it can be seen from the discriminant matrix M of controllability that M is full rank, so the system is controllable.
The observability is judged by judging whether the observability matrix is full rank [19], and the system observability discriminant matrix is obtained by the formula (6): Since 0 m K  , it can be seen from the observability discrimination matrix N that N is full rank, so the system is observable.
Determine the stability by judging whether the eigenvalues of the system matrix A all have negative real parts [19].
The eigenvalues of the system matrix A are: 1  , their real parts are all nonpositive, so the system is stable.

Design of LQR optimal controller
Optimal control refers to finding an allowable control under given constraints, so that the given system performance index reaches the extreme value. For the controlled dynamic system, find the optimal control plan for a kind of allowed control plan, so that the movement towards the system is transferred from the initial state to the target state, and the performance index of the system is optimized. If the system is linear, the optimal control problem is a linear-quadratic problem [20]. The linear quadratic optimal control problem is a common optimal control system design method.
Because the system is controllable, considerable and stable, the angular displacement  of the DC motor is used as the control variable. Based on the basic control idea of LQR, a physical quantity u are selected as the optimal feedback control law, which can quickly to transfer the system from an unbalanced state to a position near the equilibrium state or a zero equilibrium positioned in the time region 0 [ , ] t  and make a given performance indexed function Get the minimum value. The performance index of the linear-quadratic optimal control problem of the DC servo motor system can be expressed as [20]:

MATLAB simulation analysis
According to the established DC motor model and the optimal controller designed, the rationality and related performance of the DC motor position tracking system under optimal control are verified by MATLAB software simulation. The optimal control state feedback gain matrix is obtained by using the LQR function built-in MATLAB simulation software, namely [ , , ] ( , , , ) K P r lqr A B Q R  , where A and B are known from the above. By adjusting the weights of the weighting matrices Q and R , the input quantity and the state quantity can be balanced, and the desired system response can be obtained. In the simulation, select the weight coefficients 1  In order to test the feasibility of the optimal controller designed in this paper, MATLAB software was used to simulate and compare the controller designed in this paper with several common controllers. Figure 3 is the step tracking curve of the system without a controller, and Figure 4 is the step tracking curve of the system with the optimal controller. It can be seen from Figure 4 that the DC servo motor system with the optimal controller has better position tracking performance under unit step signals. Compared with Figure 3, the output of the system under unit step signals is convergent. That is, the system is stable and can track changes in position in real time.    Figure 6 is the step tracking curve of the system under the fractional PID controller. Although the system has better tracked performance under traditional PID and fractional PID control, there will be a large overshoot; The DC servo motor system under the LQR optimal controller not only has better tracking performance, but also has a small overshoot. Therefore, the effectiveness of the LQR-based DC motor position tracking system designed in this paper is verified.

Conclusion
In this paper, a mathematical model of the DC motor position tracking system is established, and the performance of the DC motor is analyzed. Combined with the linear-quadratic optimal control theory, a DC motor position tracking system based on the LQR control method is designed. MATLAB simulation software is used to simulate the angular position, angular velocity and control quantity of the designed system, and compare with several common control methods. It can be seen from the simulation results that the DC servo motor can track the given position signal well under the optimal controller designed, and the system has the advantages of short adjustment time, small overshoot and high position tracking accuracy.