# Stability of a discrete-time closed-loop

I modeled a dynamic system like so:

$$\dot{y} = au,$$

i.e. as an integrator.

Every $$T = 0.1$$ seconds, the measurement is updated and remains constant in between. This motivated me to model it as a discrete-time system using zero-order hold:

$$\int_t^{t+T} \dot{y} \; \text{dt} = y_{k+1} - y_k = au_kT= au(t) \int_{t}^{t+T} \text{dt},$$

where $$u(t) = u_k = \text{const.}$$ if $$t \in [t_k, t_k + T)$$.

By means of looking at the input-output behavior, I determined parameter $$a = 2$$ (omitting engineering units).

Next, I normalized the system equation:

$$y_{k+1} \cdot \frac{y_{ref}}{y_{ref}} = y'_{k+1} \cdot y_{ref} = y'_k \cdot y_{ref} + 0.2 u'_k \cdot u_{ref} = y_k \cdot \frac{y_{ref}}{y_{ref}} + 0.2 u_k \cdot \frac{u_{ref}}{u_{ref}}.$$

By choosing the reference values ($$y_{ref} = 3$$, $$u_{ref} = 1$$), I end up with

$$y'_{k+1} = y'_k + \frac{2}{30} \cdot u'_k.$$

As control law, I choose a P-controller, i.e. proportional feedback

$$u'_k = P \cdot (y'_{ref} - y'_k).$$

Inserting the control law yields the closed-loop system dynamics

$$y'_{k+1} = y'_k \cdot (1 - \frac{2}{30}P) + \frac{2}{30}Py'_{ref}.$$

From the stability criterion of a discrete-time system (absolute value of coefficient of $$y'_k$$ smaller $$1$$), I would expect every choice of $$P \in (0, 30)$$ to render the system stable.

But it turns out that choosing $$P=5$$ exhibits oscillations with growing amplitudes caused by small initial disturbances, i.e. instable behavior:

While choosing $$P=2.5$$ attenuates disturbances, i.e. renders the system stable:

What causes the mismatch between theory and actual behavior?

• When you normalized the equation, you have $y^\prime_{k+1}\cdot y_{ref} = y^\prime_{k+1}\cdot y_{ref} + 0.2u_k^\prime\cdot u_{ref}$
– Rem
Feb 9 '21 at 13:17
• Concerning the growing oscillations issue: $y_{k+1} = y_k(1-\frac 2 {30} P) + \frac 2 {30}P y_{ref}$. The last term is constant so it adds up to every iteration, i.e.: $y_{k+1} = y_k(1-\frac 2 {30} P) + k\cdot C$ with $C\in\mathbb R$, right?
– Rem
Feb 9 '21 at 13:24
• Yes, the last term adds to the first term, but it's constant. Assume, e.g., $y_k = 0$, then $y$ is $kC$ at every point in time. So it doesn't destabilize. Feb 9 '21 at 13:40
• Are you sure that the real value for the parameter $a$ is $2$? Note that the stability criterion needs $P\lt\frac{2}{aT}$ Feb 9 '21 at 13:46
• So $F$ is the same as $y'$? It is certainly an implementation mistake or instability caused by the implementation as the difference equation is stable and $y_k'\to y_{ref}'$ for $P=5$ for sure. You need to share the code or at least to explain how you simulated the output.
– A.Γ.
Feb 9 '21 at 17:31

Following the guide of A.Γ., I took a second look at the simulation results of the linear model compared with measurements:

Apparently, there is a difference albeit not a large one. Mainly due to the linearization which ignores the change of rate over time of the physical system. While this definitely affects stability margins in the closed loop, it does not justify the large difference between observed destabilizing control parameter $$P = 5$$, and theoretical value $$P = 30$$.

But then I opposed simulation results to measurements for two times the input value of the previous one:

This reveals yet another nonlinearity: The rate of change of output does not only increase over time, it also increases unproportionally with input value.

Scaling the slope of the integrator with factor $$5$$ makes the two systems match better:

For $$a=10$$, the stability margin reduces when choosing $$P=5$$:

$$|1 - \frac{10}{30}\cdot P| = |1 - \frac{1}{3} \cdot 5| = \frac{2}{3} < 1$$

Theory still says it is stable, but I can live with that in the light of this very simple model and its rough approximations.

What still puzzles me is the strong dependence of system behavior on absolute input value. But this might be something for the materials section.