I have been trying to implement a controller for a plant with a Cortex M3 microcontroller.
On the road to implementing a digital controller, some questions have come up that I couldn't answer from the books and papers.
First and foremost, when they are about to calculate the actuation, why do they forget to add the previous actuation?
I mean that they use the following formulation:
$$I[k] = I_f*I[k-1]+e[k]$$ $$u[k]=K_p⋅e[k]+K_i.I[k]+K_d(e[k]−e[k−1])$$
Instead of this one:
$$u[k]=u[k-1]+K_p⋅e[k]+K_i.I[k]+K_d(e[k]−e[k−1])$$
Where \$I_f\$ is the forgetting factor, by which I mean when someone uses the first formulation, he or she neglects that if the actuation is omitted, why should an actuator work?
The second problem is system model identification.
Nearly 99.99 percent of the plants on Earth are not supposed to be LTI but NLTV, so dynamic model calculation should be in order.
Suppose that one can measure the output by sensors and that one knows the actuation that forced to the actuator, what remains is the actuator input calculation. The same scenario of the previous problem happened to me. Almost all of the text I have found tried to calculate the output instead of the calculation of the actuator input. I don't understand why they don't consider the case when the states are measurable. No matter what is the type of controller (PID, MPC, adaptive, robust, non-linear.)
In the case of PID, suppose previous input and output data are available. One uses LS or RLS on each time interval regardless of being converged and finds a model as follows:
$$ y(k) = z^T(k)\theta(k) + \zeta(k)$$
In another formulation:
$$ A(z)Y(z)=B(z)U(Z)$$
How should the formulation be changed in other to use the controller? Moreover, how should the controller coefficient be calculated?
What I mean is to avoid a large calculation since the computation power is not as much as when using Matlab with power to calculate matrices.