Assume that we have a state space model of a real system e.g mass-spring system.
$$\dot x = Ax + Bu$$
Then we want to implement this in a micro controller. The controller has a sampling rate of $h = 1$. So we turn our state model to a discrete one.
$$x(k+1) = A_d x(k) + B_d u(k)$$
Then we find our control law $L$:
$$u = -Lx(k) + r$$
Where $r$ is our reference vector.
Let's do this in an example. I going to use only MATLAB-code with Matavecontrol library.
First I create my model and discrete model.
sys = ss(0, [0 1; -2 -0.5], [0; 1], [1 0]); % SS-model with delay 0
h = 1; % Sampling rate
sysd = c2d(sys, h); % Discrete SS-model
Q = [1 0; 0 2];
R = 1;
Then I create a discrete state feedback and do a step simulation.
Ld = lqr(sysd, Q, R); % Find the control law
sysdlqr = reg(sysd, Ld); % Create the state feedback system
step(sysdlqr, 20); % Simulate the system with a step signal
The result looks like:
Quite good!
Not I will use that control law the the time continuous model.
syslqr1 = reg(sys, Ld); % Use the same control law but with the SS-model
figure(2);
step(syslqr1, 20); % Do a nother step simulation
The result looks like:
Not so good. To much over shoot.
Now I will create a control law from the time continuous model.
Ls = lqr(sys, Q, R); % Create a time continous control law
syslqr2 = reg(sys, Ls); % Use the control law with the SS-model
figure(3);
step(syslqr2, 20); % Do a nother step simulation
Very good. Looks like the discrete one.
Question
What's the point of creating a discrete control law for time continuous process? I can buy the argument to use a discrete control law with a time continuous process if it's going to handle about Model Predictive Controller - they need a discrete model to predict the future.
Today, micro controllers are really fast. So tell me why I should use discrete control laws when time continuous control law works good too?



Usually when actuating a continuous system with a digital controller the control input $u$ is constant between sample times (this is also what
c2dassumes if the method of discretization is not specified). So even though at the start of the sampling time the same state information is available to both controller, the discrete controller effectively considers the effect of keeping that input constant during one sampling period, while for the continuous state feedback it assumes that the control input also changes continuously.But if during one sample time the state does not change much, they are roughly equivalent. This happens when the closed and open-loop poles are significantly above the sample frequency. This also holds for other discretization methods as well. For example when considering your continuous system and cost matrices $Q$ and $R$, then in the figure below you can see the 2-norm of the difference between the $K$ matrices obtained from continuous and discrete LQR for different discretization methods as a function of the sample frequency. From that figure you can see that the 2-norm goes to zero as the sample frequency goes to infinity (or the sample time goes to zero) for all used methods with the exception of the matched poles method.
Another way of comparing continuous and discrete systems is to use the same $K$ matrix and quadratic Lyapunov function for both and compare the resulting derivative of the Lyapunov function. So find a stabilizing $K$ for the continuous system, for example with LQR or pole placement, and a Lyapunov $V(x) = x^\top P\,x$ function which satisfies
$$ P\,(A - B\,K) + (A - B\,K)^\top P = -Q, $$
with $Q$ semi-positive definite. The derivative of the Lyapunov function for the continuous system is then simply $\dot{V}(x) = -x^\top Q\,x$. For the discretized system the derivative of the Lyapunov function can be approximated with
$$ \dot{V}(x) \approx x^\top \underbrace{\left[\frac{(A_d - B_d\,K)^\top P\,(A_d - B_d\,K) - P}{h}\right]}_{-Q_d}\,x. $$
Using again your system then the resulting 2-norm of $Q - Q_d$ for different discretization methods as a function of the sample frequency can be seen in the figure below. From that figure you can again see that the 2-norm goes to zero as the sample frequency goes to infinity for all used methods with again the exception of the matched poles method.