# An Approach for Setting Parameters for Two-Degree-of-Freedom PID Controllers
## 2 The Related Tuning Methods
### Setting PID Controllers Parameters  
In this subsection, first a set of tuning equations is derived, and then, controller parameters are analyzed. Finally, the steps of the tuning method are given. For the control system in Figure 1, its stability is determined by the closed-loop characteristic equation:  
\[1+\big{(}k_{p}+k_{i}/s+k_{d}s\big{)}\,G_{p}(s)=0. \tag{10}\]  
Substitute \(s=-m\omega+j\omega\) into Equation (10), define \(G_{p}(-m\omega+j\omega)=M_{0}(m,\omega)e^{j\varphi_{0}(m,\omega)}\), and compare the real and imaginary parts; the following equation is obtained  
\[\left\{ \begin{array}{l}k_{p}=-\frac{1}{M_{0}(m,\omega)}\Bigg{[}\begin{array} []{c}m\sin\varphi_{0}(m,\omega)\\ +\cos\varphi_{0}(m,\omega)\end{array}\Bigg{]}+2m\omega k_{d}\\ k_{i}=\omega\big{(}1+m^{2}\big{)}\Big{[}\omega k_{d}-\frac{1}{M_{0}(m,\omega )}\sin\varphi_{0}(m,\omega)\Big{]}\end{array} \right. \tag{11}\]  
Under certain \(m\), Equation (11) structures a marginal stability surface with various \(\omega\). The marginal stability surface divides the \(\big{(}k_{p},k_{i},k_{d}\big{)}\) space into two parts: meeting stability margin and not meeting stability margin. Employing the following variable substitution,  
\[\left\{ \begin{array}{l}p=1/l\\ q=k/l\end{array} \right., \tag{12}\]  
Equation (7) is expressed as  
\[\left\{ \begin{array}{l}k_{p}=h_{0}p+h_{1}q\\ k_{i}=qh_{0}\\ k_{d}=ph_{1}+q\\ b=qh_{1}\end{array} \right.. \tag{13}\]  
Substitute Equation (13) into Equation (11), and the following equation is obtained  
\[\left\{ \begin{array}{l}(h_{1}-2m\omega)q+(h_{0}-2m\omega h_{1})p\\ =-\frac{m\sin\varphi_{0}(m,\omega)+\cos\varphi_{0}(m,\omega)}{M_{0}(m,\omega) }\\ \big{[}h_{0}-\omega^{2}\big{(}1+m^{2}\big{)}\big{]}q-\omega^{2}\big{(}1+m^{2} \big{)}h_{1}p\\ =-\frac{\omega\big{(}1+m^{2}\big{)}\sin\varphi_{0}(m,\omega)}{M_{0}(m,\omega) }\end{array} \right.. \tag{14}\]  
Figure 3: The relation between the maximum sensitivity \(M_{\rm s}\) and the attenuation index \(m\) in Nyquist plots. Under certain \(h_{0}\), \(h_{1}\), \(m\) and \(\omega\), Equation (14) becomes a linear equation. Then, if its Jacobian determinant \(J\) is nonsingular, it has a unique local solution \((q,p)\). Under various \(\omega\) and certain \(h_{0}\), \(h_{1}\) and \(m\), Equation (14) has a unique local solution curve \((q(\omega),p(\omega))\) (i.e., marginal stability curve). The marginal stability curve divides the \((q,p)\) plane into two parts: meeting stability margin and not meeting stability margin. The curve is the contour. Then, once an appropriate work point in the contour is obtained, the controller parameters can be calculated. The method of choosing a work point is shown after the analysis of the parameter \(k\), because the parameter \(k\) can influence the choosing method. Next, the function of the controller parameters \((h_{0},h_{1},m,k)\) is analyzed, and the method for obtaining them is shown. \(h_{0}\) and \(h_{1}\) are coefficients of the desired dynamic equation. They are chosen based on the requirements of control system, such as settling time, overshooting, and so on. Because the desired dynamic equation is a second-order system, \(h_{0}\) and \(h_{1}\) can be calculated according to the second-order system, as follows:  
\[h_{1}=2\zeta\omega_{n}=8/t_{sd},\,h_{0}=h_{1}^{2}/4\zeta^{2}. \tag{15}\]  
where \(t_{sd}\) is the desired settling time; \(\zeta\) is the damping of desired dynamic system; and \(\omega_{n}\) is the natural frequency of desired dynamic system. In order to make the overshooting as small as possible and make the settling time as short as possible, \(\zeta=1\) is chosen. Considering the error between the actual dynamic and the desired dynamic, Equation (15) becomes  
\[h_{1}=\frac{8\,\sim 25}{t_{sd}},\,h_{0}=h_{1}^{2}/4. \tag{16}\]  
The stability margin increases with the increasing of the attenuation index \(m\). It is well-known that there is a trade-off between performance and robustness [26; 27]. Therefore, choosing an appropriate \(m\) is important to avoid the conflict with both \(h_{0}\) and \(h_{1}\).