Why does differentiating PID feedback break the system?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have designed the following motor speed controller, which takes feedback of the motor's position from a rotary encoder, and differentes it to get the speed.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/984615/image.png)
However, I realized that this not only makes the controller really inaccurate, it also makes the quality of the output dependant on the fundamental sample time of the model. Here are different speed outputs I get at various sample times when giving the controller a reference of 15000rpm (250rps) :
- 1/50000s (50KHz) :
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/984620/image.png)
- 1/500000s (500KHz) :
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/984625/image.png)
- 1/1000000s (1MHz) :
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/984630/image.png)
So the higher the sampling frequency, the closer to the reference the controller output settles. I have found that increasing the frequency to about 5MHz results in a pretty much a perfect output, but now the simulation takes forever to run.
Also for comparison, when I take the speed feedback directly as shown follows, it also results in a good output:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/984635/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/984640/image.png)
As far as I can tell, differentiating the position signal gives an accurate replica of the speed signal, so I am very confused as to why this is happening. Is there a solution to this that doesn't involve running this system at 5MHz? Any help on understanding or solving this problem would be appreciated!
0 Kommentare
Antworten (4)
Pemendra Kumar Pardhi
am 1 Mai 2022
Hello Janith Wijekoon With increasing sampling time signal gose to nearly continues time mode which requires large memory. Moreover in discret time domain with less sampling frequency less no of samples point which has required less memory size. With large sampling frequency (i.e large memory size signals) shape will near fine signal with slow speed However less sampling frequency gives less sample data that's why reconstruction of signals will not be good. But run time of simulation model willl be fast due to less memory required.
Only one doubt why it gives different output speed. It is dibatable.
0 Kommentare
Dr Narayanaswamy P R Iyer
am 1 Mai 2022
Hi: Instead of integrator at the output of convert to RPS module, use a multiplier block along with time block or time module and see how it goes.
Peter O
am 2 Mai 2022
Numerical differentiation is a very tricky thing to get right for a lot of controls cases. The reason is because unless you have a constant derivative, there is no guarantee that
. When they differ enough, the control action may not be acting on the correct change in the error signal. In practical systems, noise will further exacerbate the problem, so it is common to also incorporate an averaging step to the derivative to improve the error derivative at the cost of lag time. When implemented correctly, a good differential controller can reduce the time it takes to bring a signal back to the desired setpoint after a large excursion of the signal. But the relative timing of the loop and the signal dynamics are important.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/984860/image.png)
As your example here shows, when the timestep is small, the change in signal is more likely to reflect the true system derivative (5 MHz -> 200 ns timestep on a signal with much slower dynamics is practically the instantaneous value), but as the timestep grows this is no longer the case. The derivative gain then acts on an "echo" or altered representation of the system state, which can push the control signal in the wrong direction, leading to oscillation, increased settling time, and/or instability.
0 Kommentare
Communitys
Weitere Antworten in Power Electronics Control
Siehe auch
Kategorien
Mehr zu Classical Control Design finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!