# An Approach for Setting Parameters for Two-Degree-of-Freedom PID Controllers
## 1 Introduction  
The proportional-integral-derivative (PID) controller, which is by far the most common control algorithm, is widely used in the industry due to its simplicity and ease of tuning [1; 2]. It is well-known that PID controllers can be implemented in two forms: single-degree-of-freedom (1-DOF) PID and two-degree-of-freedom (2-DOF) [3]. Because the design of the control system can be seen as a multi-objective optimization [4], and because there is a trade-off between the setpoint response and the load disturbance attenuation in the 1-DOF PID structure [5; 6], the 2-DOF PID structure was proposed [7]. Due to its superiority, the 2-DOF PID has drawn great attention from many researchers, and a great number of tuning methods have been proposed, such as the dominant poles method [8; 9], the internal model control (IMC) [10; 11; 12], the gain-phase margin method (GPM) [13], the maximum sensitivity method [14; 15], the desired dynamic equation method (DDE) [16; 17; 18], etc. The tuning method proposed is an improvement of the DDE method. The DDE is a 2-DOF tuning method based on the desired dynamic, disturbance estimate, and disturbance compensation. The DDE method has the following advantages. On the one hand, it endows the controller parameters with physical meanings [19; 20], because it can build the equivalent relationship between the 2-DOF PID structure and the Tornambe controller (TC) [21] structure, which is characterized by clear physical meanings. On the other hand, due to the equivalent relationship between the 2-DOF PID structure and the TC, the DDE makes the parameter settings of the 2-DOF PID not dependent on a precise model [22; 23]. The nature of the TC is that a disturbance observer estimates the total disturbance andthen dynamically compensates it; therefore, the model error can be seen as an internal disturbance that is estimated and then compensated. However, the major drawback of the DDE method is that the stability margin cannot be guaranteed. So, we propose using the generalized frequency method (GFM) in addition to the DDE method, because this DDE-GFM can guarantee both the desired dynamic and the stability margin [24]. The GFM can guarantee the stability margin by limiting the closed-loop poles to a stability sector area in the left half-plane. What is more, it can not only accurately guarantee the specified stability margin by only one parameter but also calculate the controller parameter directly and analytically, whereas \(M_{\rm{s}}\) (the maximum sensitivity) and GPM cannot realize these two purposes simultaneously. In addition, the GFM has been used to set single-degree-of-freedom PID parameters [25]. Thus, the GFM has been chosen to be the stability margin criterion. In [24; 25], the GFM builds the relationship between the controller parameters and the stability margin. Moreover, it is known that the DDE method builds the relationship between the 2-DOF PID and the TC, and the TC builds the relationship between the controller parameters and the desired dynamic. So, the desired dynamic, represented as the controller parameters \(h_{0}\) and \(h_{1}\), and the stability margin, represented as the controller parameter \(m\), can be specified. Then, a contour, characterized by the same \(m\), \(h_{0}\), and \(h_{1}\), is obtained. In the contour, an appropriate work point is derived to calculate the controller parameters. Finally, an appropriate work point to calculate the controller parameters can be obtained. This is the principle of the DDE-GFM. The tuning steps of the DDE-GFM are briefly shown as follows. It is known that the parameters of the 2-DOF PID \(\left(k_{p},k_{i},k_{d},b\right)\) have been converted into the parameters of the TC \(\left(h_{0},h_{1},k,l\right)\) according to the DDE. Firstly, \(h_{0}\), \(h_{1}\), and \(m\) are specified based on the desired dynamic and the stability margin, then \(k\) and \(l\) are converted into \(1/l\) and \(k/l\). Next, the contour is depicted in the \(\left(k/l,1/l\right)\) plane, restraining the stability margin with the GFM.