# Stability of PID values update function for quadrotor

A reviewer of the last paper I sent replied me that the it is very dangerous to update a PID with next kind of formula (paper is about quadrotor control):

$$K_p (t + 1) = K_p (t)+e(t) (μ_1 (Pe(t)) + μ_4 (Pe(t)))$$

$Pe(t)$ is the % relationship between the desired angles and the real angles, and $e(t)$ is the difference between those angles. $μ_1$ and $μ_4$ are the membership functions of a fuzzy function. I think that the reviewer is talking about the time increment update rather than the fuzzy usage and specific formula.

How can stability of this formula be tested, please?

EDIT:

membership functions are represented in following graph:

$e(t)$ is not the absolute difference between angles, just the difference. It can be negative

• A time step of 1 second is rather large and less general. The stability is mainly dangerous because you basically use forward Euler integration. What would be the update formula for a time step of $dt$? May 13, 2016 at 15:54
• My $dt=0.1segs.$ I do use Euler integration for calculating displacement and velocity out of acceleration. How to proof the stability in that case? Is transfer function and Bode diagram or something similar necessary? May 13, 2016 at 19:56
• Can you give us more information? To analyze stability, we need to know more about $\mu_1$ and $\mu_4$. Also, if the system is discretized, then $dt$ might need to be in the expression for $K_p(t+1)$. May 13, 2016 at 19:56
• Done it: triangular shape functions. I've seen Gaussian too, but this aspect think doesn't matter May 16, 2016 at 17:38

I think I may have reason for your reviewer's caution. You are updating the proportional gain of a PID controller, and you are concerned with the stability of your update law. Restating your update: $$K_p(t+1)=K_p+e(t)(\mu_1(Pe(t))+\mu_4(Pe(t))).$$ You have re-stated that $e(t)$ is the difference, which means that the error is not positive semi-definite ($e(t)\geq 0$). However, the membership functions $\mu_1$ and $\mu_4$ are positive semi-definite; this implies that $E(t)=e(t)(\mu_1(Pe(t))+\mu_4(Pe(t)))$ is either positive or negative semi-definite, which means that $K_p$ grows unbounded in some region $D$.
At this point, it is clear that the update law is not stable in some region (in the sense of Lyapunov) for $e(t)\neq 0$. We can substantiate this with discrete-time Lyapunov analysis.
$Proof:$ Dropping the time dependence for clarity, let $$V(K_p)=\frac{1}{2}K_p^2$$ be a candidate Lyapunov function. The rate of change along solutions is given by \begin{align}\nabla V(K_p)&=V(K_p+E)-V(K_p)\\&=\frac{1}{2}(K_p+E)^2-\frac{1}{2}K_p^2\\&=K_pE+\frac{1}{2}E^2\end{align}. For stability of the system, we must have $\nabla V(K_p)<0$. This implies $$K_pE+\frac{1}{2}E^2<0$$$$\to K_p<-\frac{1}{2}E.$$ We can conclude from converse Lyapunov results that the system is unstable for at least $K_p>-\frac{1}{2}E$, which is an obvious reason for concern. There may be a better Lyapunov candidate function to demonstrate this result, but we can be sure that the system is locally unstable.
• ok, I wrongly used "absolute difference" expression. It was just to differentiate from $Pe$, which is % based difference. $e(t)$ is just the difference, but it can take negative values. Does this change your arguments? May 16, 2016 at 20:30
• I gave it a shot. The result was clear cut for the original post, but I think my response highlights at least one concern. The more I think about it, the more I am wondering what the general effect of controlling $K_p$ based on an error function will have on the stability of a system--I suspect that this is not a good practice, but if somebody can find a paper proposing this, I'm sure that OP would appreciate it. Jun 16, 2016 at 15:53