The PID and 2DOF control of the integral system - influence of the 2DOF parameters and practical implementation

The article deals with the issue of using the Two Degree of Freedom (2DOF) PID controller to control an integral system and investigates by the simulation and experimental measurement what influence it has on the course of the control process compared to standard PID controller. The controlled plant is represented by the DC electric motor with worm gear and its output shaft rotation angle. The article studies the effect of the added parameters of the 2DOF controller on the dynamics of the closed-loop control. The influence of these parameters is then evaluated using the quality of feedback control criteria ITAE. The paper studies how the overshoot of the controlled variable during the setpoint step is eliminated using 2DOF control theory. The overshoot is caused due to an aggressive tuning of the controller to eliminate the disturbance effect on the controlled variable of the integral plants with dead zones.


Introduction
In the industrial environment today, the position control of various devices is a crucial task. We are increasingly encountering requirements to improve the accuracy and efficiency of production processes, where it is necessary to replace the positioning to the limit switches with feedback control to achieve optimal conditions for the technology. This task thus very often leads to integral system control, often with nonlinear properties, as described in the paper. 1 The typical approach for the feedback control is using the PD controller. [2][3][4] There is no permanent control deviation for linear integral systems such as pneumatic, electric, or hydraulic systems unless there are non-linearities like static friction. PID control can lead to removing the permanent control deviation in such systems. [5][6][7] However, the PID control may not always be ideal for this task, leading to overshoots and unwanted slip and slide effects. Therefore, it is often beneficial to use other algorithms that can handle the problem better. One such option is to use the PID controller algorithm with two degrees of freedom (2DOF). [8][9][10][11][12][13] Two Degree of Freedom PID controllers add setpoint weights for the proportional and derivative term of the algorithm to ensure that the effect of the disturbance is quickly eliminated while suppressing overshoot when tracking the setpoint. 8,9 The degree of freedom of a controller is defined as the number of closed-loop transfer functions that can be tuned independently, [14][15][16][17][18] which provides additional options for tuning the controller regarding change of setpoint or disturbance value.
Active disturbance rejection control, which uses the extended state observer [19][20][21] or the Disturbance observer, 22,23 can be used as an alternative. For both of these methods, we are required to create the inverse model of the plant. The simplification of the 2DOF controller is that the filter is applied to the setpoint signal and depends on already known PID parameters only. Due to that, the implementation of the 2DOF is also possible without the need for detailed knowledge about the plant. 2DOF controller can be tuned manually or by quantitative methods as 9,24 based on reducing the criteria described in Chapter 6. of this paper. Another option is also the combination of the 2DOF controller with the disturbance observer. 25 The same technique can also be used with other types of feedback loop control as Fuzzy control, which offer us the option to design the response properties based on expert experience, State controller, which allow us to design the control system based on the full state feedback, or Fractional PID control where the derivation and integration terms of PID controller are exchanged with the fractional-order integration and derivation term which leads to tackle the problem of dead zones nonlinearities in integral systems. 26 For both methods, the additional filter can be added to alternate the setpoint signal. However, the quantitative design of the filter for non-PID control is then based on Metaheuristic optimization algorithms. 27 The implementation of the 2DOF filter was published before in ref. 28, where traditional 2DOF is modified to 2DOF with an internal model for timedelay processes. The combination of the 2DOF and Fractional PID controller design was then published in ref. 29. In the scope of this paper, we will focus on the traditional 2DOF PID Controller, where the design, implementation, and comparison between the numerical simulations and actual single-chip computer implementation.

Description of the system
The integral system (see Figure 1) is a DC motor with a worm gear, where the controlled variable is the angle of rotation of the output shaft. A resistance sensor provides the measurement in a potentiometric setup. The Arduino Nano microcontroller was used as a model control system to cooperate with an external AD converter and an adapting electronic board.
The action variable is realized via a DC motor driver (Pololu Simple High-Power Motor Controller 18v15, see Figure 2 and Figure 3) using a PWM signal and H-bridge direction switching as a response to the controller output. The MOSFET switching carrier frequency of the driver is 25 kHz. All the parameters of the driver are configurable through the USB port and dedicated software.
The output signal is an analog value in the range of 0-5 V processed by a 12-bit AD converter. The range of the angle of rotation of the output shaft is approximately 0-230°.
By its physical nature, the system itself exhibits nonlinearities, some of which are compensated by the algorithm, such as the initial insensitivity of the motor to the input signal caused by friction and nonlinear excitation of the motor coils. This behavior is relatively suppressed by the offset of the input signal to previously experimentally measured values. Other nonlinearities of the system were neglected for this work and considered in the identification of the system by selecting the most suitable system parameters.
Arduino nano was chosen as a suitable microcontrollerbased control system to control this plant. Its main advantages are the possibility of fast and simple programming, easy portability of code to other similar boards, the possibility of programming from the MATLAB/Simulink environment while maintaining a low-cost concept, and easy implementation into existing hardware, unlike e.g., general PIC MCU. 30 The described block diagram of the control system can be seen in Figure 2. Figure 3 shows the electronics implementation of the experiment.

Theory of the 2DOF PID controller
Our control system aims to calculate the correct control signal to the input of the plant described above. For the control, we are going to use the linear feedback controller. All the signals will be presented in the complex domain using the Laplace transform, whose definition is:  The primary method for controlling the plant state Y(s) is the Proportional-Integral-Derivative (PID) (based on Proportional, Integral, and Derivative terms) controller. The control loop diagram can be seen in Figure 4. This method uses the feedback from the control signal Y(s), which is then compared with the wanted (setpoint) signal W(s). The error signal can be calculated as: Using the controller described by the transfer function: where U(s) is the control action signal which is the input to the controlled plant. The control plant transfer function describes the dynamics of the plant: where the V(s) is the disturbance. Usually, during the design phase of the controller design, we set the expectation for the closed control loop to be: The transfer function of the setpoint to the output is equal to one.
The transfer function of the disturbance to the output is zero.
Due to the physical property of the mechanical system, this expectation cannot be implemented as every state contain some dynamics, and the system cannot create the corresponding control signal against the future unknown disturbance V(s).
The difference between the standard PID controller and 2DOF PID controller will be presented on the plant, which was described above, and the experimental identification (described in the next chapter) lead to the transfer function: where k 1 is the plant gain, and T 1 is the time constant due to inertia.
First, let us describe the property of the PID controller whose transfer function is: where k P is the controller gain, and it is equal to the proportional (position) feedback, T I is the integral constant of the controller, and the k P /T I is equal to the integration of the control error whose function is to obtain Y(s) = W(s) in the steady state. The last term is the derivative term containing the controller's derivative constant T D , where k P Á T D is equal to the derivation (velocity) feedback. The 2DOF controller has a similar structure. The only difference is the filter with the two constants b and c. Thanks to these parameters, we can control the influence of the setpoint variable compared to the output variable. The 2DOF controller can be described with the equation: If the b = 1 and c = 1, then the 2DOF controller is equivalent to the common PID controller. If the b = 0 and c = 0 then the filter is fully active. We can divide this controller into two blocks-the common PID controller and a separate filter. A final diagram can be seen in Figure 5. Then the transfer function of the filter is: The transfer function of the setpoint to the output is equal to: From this equation, we can see that using the conventional PID controller, we obtain two complex conjugated zeros. Their effect can be canceled using the 2DOF controller when b ¼ 0 and c ¼ 0. If we set b and c to different non-zero or non-one, the zero can be altered.
If we use the substitution: which is the transfer function of the proportional system, we obtain the transfer function from the setpoint to the output: The first term does not depend on any of the b or c parameters, the second term is the first derivation of the first term, and the influence can be controlled by the parameter b, and the third term is the second derivation of the first term and can be controlled by the parameter c. If b or c is negative, it can lead to the undershoot. b parameter can be used to make the system response to the step setpoint change more aggressive. Parameter c will have only a minimal influence on the dynamics of the system response to the step setpoint change. Visible differences will be noticeable right after the step setpoint change.
The transfer function of the disturbance to the output is equal to: As you can see, in the steady state G vy ðsÞ ¼ 0. Also, this transfer function is not affected by the 2DOF parameters b and c. The 2DOF PID controller used for the experimental verification in this paper is done by single chip computer implementation. 31

Experimental identification of the integral plant
By direct identification with the step input signal, data describing the properties of the controlled system were obtained.
The measurement was performed by applying an input signal of 50% of the maximum range to the system input, and the step response of the system to this signal was recorded (see Figure 6). In the figure, the value of the output variable is normalized to the maximal angle of the rotation range. The same normalization is also used in the following paragraphs.
By processing the input data and normalizing the signals, the system's transfer function was obtained in the form of an integration system with first-order inertia. G S ðsÞ ¼ 1 0:3039s ð0:0603s þ 1Þ ¼ 3:2906 s ð0:0603s þ 1Þ (17) Closed loop control A control system was designed for the plant (system) described by (17) based on the previous theory. The PID controller parameters were tuned using the numeric optimization method, and they are listed in Table 1.
The experimental measurement was performed as a response to a step change of setpoint from the beginning of the measurement. At time t = 15 s, there was a step change of disturbance in front of the plant. The exact process was numerically simulated in the MATLAB /Simulink environment, where the identified system was controlled by a 2DOF controller with action variable limitation (see Figure 7). The parameters (weights) of the input filter were selected from the whole range 0-1 and measured and simulated with the step of 0.2. The disturbance is simulated by the software drop of action variable voltage on the input of the plant. The results of the measurements and simulations are plotted in Figure 8. 6,7 According to the results, the influence of the b parameter is significantly greater than the c parameter when tracking the setpoint in the form of the step. Proved also by the simulation, the b parameter suppresses the effect of proportional term and eliminates the overshoot of the control process while the response to a disturbance step remains unchanged.   The effect of the individual terms according to (13) and (14) are shown in Figure 9. We split the three terms into separate courses that give the overall control system response using the same basic PID tunable parameters and b = 0.4 and c = 0.8.

Quality of feedback control
Multiple methods can be used to evaluate the quality of the feedback control. As it was described earlier, one of the expectations of the closed-loop control is that the transfer function of the setpoint to the output is equal to one. That also means that the error should be zero. For physical systems, we want the system error to minimize as fast as possible.
As an example, we can choose one of these criteria for evaluating the setpoint step change response course: · Integral of Absolute Error (IAE) · Integral of Squared Error (ISE) · Integral of Time multiplied by Absolute Error (ITAE) where a lower number means a faster control process. All these methods can be used for both non-oscillating and oscillating processes. The disadvantage of IAE and ITAE is that it cannot be calculated as a derivative of a zero-crossing for absolute value is not defined. Therefore, these methods can be calculated only numerically. The ISE is defined, but the oscillating processes have a lower error than nonoscillating processes. These methods are usually used for the quantitative methods of calculating the control variables as published in 9,24 . We calculated the ITAE in this article. Numerical simulation is then compared to the measurements. The calculated results for different parameters b and c can be seen in tables: measurements in Table 2 (ITAE) and    numerical simulations in Table 3 (ITAE). Both the tables are plotted in the surface graph in Figure 10 and Figure 11 (simulated). As we can see from the results, the differences between the simulation and measurements containing small nonlinearities are neglectable. The parameter c has only a tiny influence on the quality, while lowering the b parameter slows down the response. The response to the disturbance is not affected by the 2DOF controller parameters as stated above.
Using an input 2DOF filter, suppression of the overshoot of the control process course is achieved, while without it, the control process course shows an overshoot of approximately 7% at a given setting.

Conclusion
The paper shows that using the 2DOF controller, we obtain more flexibility in designing the final desired system response. The theory was implemented into the Arduinobased control system experimentally identified and controlled by the 2DOF PID controller.
The transfer function for setpoint tracking and the reaction of the output to the disturbance was calculated for the integral system with the first-order inertia. The closedloop control using the typical PID controller contains two zeros, which for the integral system makes the response more aggressive from the beginning after the setpoint step change. That leads to fast elimination of the disturbance change but causes an overshoot. This behavior can be suppressed using the 2DOF PID controller, where these zeros can be canceled by setting the b and c parameters to lower values. Using the b or c parameters, we can also design the dynamics of setpoint tracking without affecting the behavior of the closed-loop control system to the disturbances.
The measurement and simulation proved that the overall influence of the b parameter is considerably more dominant when tracking the setpoint value. According to the criteria used to evaluate the quality of the control process, you can conclude that the settling time is not significantly extended (if we consider a sufficiently narrow tolerance band). However, the setpoint step function response overshoot is suppressed, which can be very important for some dynamic systems. Depending on the settings of the 2DOF filter parameters, we can then achieve an overshoot-free course while maintaining the same settling time. In the case of the particular system used, this setting is around the value 0.8-0.9 for parameter b.

Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.

Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This work was supported by the European Regional Development