# An Approach for Setting Parameters for Two-Degree-of-Freedom PID Controllers
## 2 The Related Tuning Methods  
### The Desired Dynamics Equation (DDE) Method  
Consider the transfer function given by:  
\[G_{p}(s)=\frac{\sum\limits_{i=0}^{r}b_{i}s^{i}}{\sum\limits_{j=0}^{n}a_{j}s^{ j}} \tag{1}\]  
where \(a_{j}\) and \(b_{i}\) are unknown parameters. It can be transformed to the following state space form:  
\[\left\{\begin{array}{l}\dot{z}_{1}=z_{2}\\ \dot{z}_{2}=f\Big{(}z_{1},z_{2},\cdots,z_{n},u,\dot{u}_{i},\cdots,u^{(r)}\Big{)} +lu\\ y=z_{1}\end{array}\right. \tag{2}\]where \(u,\dot{u},\cdots,u^{(r)}\) are the plant input and its derivatives; \(y\) is the plant output; \(z_{1},z_{2},\cdots,z_{n}\) are the system states; \(l\) is a proper positive constant number; and \(f\Big{(}z_{1},z_{2},\cdots,z_{n},u,\dot{u},\cdots,u^{(r)}\Big{)}\) is the total disturbance.  
The desired dynamic equation is as follows:  
\[\frac{Y(s)}{R(s)}=\frac{h_{0}}{s^{2}+h_{1}s+h_{0}} \tag{3}\]  
To reach Equation (3), the corresponding control law should be:  
\[u=\left[-h_{0}(z_{1}-y_{r})-h_{1}z_{2}-\hat{f}\right]/l \tag{4}\]  
where \(h_{0}\) and \(h_{1}\) are the coefficient of the desired dynamic and are determined by the requirements of the control system; and \(\hat{f}\) is the estimation of total disturbance \(f\Big{(}z_{1},z_{2},\cdots,z_{n},u,\dot{u},\cdots,u^{(r)}\Big{)}\).  
To obtain the estimation of total disturbance \(\hat{f}\), the following disturbance observer is used.  
\[\left\{\begin{array}{l}\hat{f}=\xi+kz_{2}\\ \dot{\xi}=-k\xi-k^{2}z_{2}-klu\end{array}\right. \tag{5}\]  
where \(k\) is the coefficient of the disturbance observer and indicates the speed of tracking disturbance; and \(\xi\) is an intermediate variable.  
Equation (5) structures a disturbance observer. Equation (4) offers the control law to achieve the desired dynamic Equation (3). The disturbance observer estimates the total disturbance and compensates the systems to be the desired dynamic in real time and dynamically.  
By substituting Equations (2), (3) and (5) into Equation (4), we can obtain  
\[u=\frac{(h_{0}+kh_{1})e+kh_{0}\int edt+(h_{1}+k)\dot{e}-kh_{1}y_{r}}{l} \tag{6}\]  
where \(y_{r}\) is the target value; and \(e\) is the error between the plant output and the target value. The detailed derivation is shown in Appendix A.  
From Equation (6), we can obtain the two-degree-of-freedom PID controller parameters,  
\[\left\{\begin{array}{l}k_{p}=(h_{0}+kh_{1})/l\\ k_{i}=kh_{0}/l\\ k_{d}=(h_{1}+k)/l\\ b=kh_{1}/l\end{array}\right.. \tag{7}\]  
The corresponding two-degree-of-freedom PID controller structure is shown in Figure 1.  
When the desired dynamic equation is as follows:  
\[\frac{Y(s)}{R(s)}=\frac{h_{0}}{s+h_{0}}, \tag{8}\]  
Figure 1: Two-degree-of-freedom proportional-integral-derivative (PID) controller structure.  
we can analogously obtain the two-degree-of-freedom PID controller parameters,  
\[\left\{\begin{array}{l}k_{p}=\left(h_{0}+k\right)/l\\ k_{i}=kh_{0}/l\\ b=k/l\end{array}\right.. \tag{9}\]  
In general, the DDE endows the 2-DOF PID controller parameters with clear physical meaning, which makes some of the parameters specified and then decreases the number of unknown parameters. Moreover, the model error is imposed into the total disturbance and is compensated, so the precise model is not necessary.