I've been wrestling with this problem for about a week now, as a part of a year-long project. We're designing a controller for a specific reactor based on a model. After looking at this for a while, I still can't get this to work - so I would really appreciate it if I can get some help.
One of the published literature reviews that we've based heavily upon lists a PID controller into each separate components instead of a combined equation, like so:
$$ \begin{cases} P(n)=K_p[G(n)-target] \\I(n)=I(n-1)+\frac{K_p}{T_I}[G(n)-target]\\D(n)=K_pT_D\frac{dG}{dt}(n)\end{cases} $$
Simply combining the three components into the PID controller output: $$ PID(n)=P(n)+I(n)+D(n) $$
And from here, the author adds an additional layer of state feedback on top of the PID signal to get the final controller output applied on the system.
$$ \begin{cases} Q(n)=K_0R(n-1)+K_1Q(n-1)-K_2Q(n-2)\\R(n)=(1+\gamma)PID(n)-\gamma Q(n-1)\end{cases} $$
And R is the final "controller output." Here, the \$K_p\$ is the process gain, \$T_I\$ and \$T_D\$ are the integral and derivative gains, \$K_0, K_1\$ and \$K_2\$ are "gains" tuned for the state-feedback (immutable), and \$\gamma\$ is a constant, 0.5. \$G(n)\$ is the system state, \$Q(n)\$ is an estimated state that affects the model dynamics, and \$R(n)\$ is the actual final output that is sent to the plant.
I was trying to first convert the whole thing to a single controller transfer function, but I was told that simply adding them together won't work.
I was also tasked with finding a discrete state space representation of this controller. For this, I tried to change the \$\frac{dG}{dt}(n)\$ into \$G(n)-G(n-1)\$ to get rid of that issue.
Next, I tried to define a new state variable for the \$Q(n)\$ so that the \$Q(n-1)\$ and \$Q(n-2)\$ could be converted into first order.
I then tried to substitute the values into the PID controller, to get the \$G(n)\$ as the state variable. These efforts were all based on recommendations by my professor.
However, I'm still very much stuck, as I've been blindly following his directions without an overall vision to works on it. I thought it would be a simple matter of Tustin transformation - oh, how I was very wrong...
I'm quite frustrated, as after a week-long effort, I'm still stumped by what appears to be a simple problem.
If possible, may I humbly ask for your help on these two specific questions?
- Convert this controller into a single controller transfer function (as typically seen in any transfer function representation, i.e. \$G(s)=\frac{1}{s+1}\$)
- Convert this controller into a discrete state space representation, leaving the sampling rate as a variable?