|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||||
|
||||||
|
Re: PID Timing
How are you calculating the derivative if you aren't taking into account the actual loop time? Same for the integral.
|
|
#2
|
|||
|
|||
|
Re: PID Timing
Things are easier if you use a "fixed dt". This means you should execute your PID algorithm at a fixed rate. Example, run the loop every 10ms or every 100ms. Otherwise you do need to adjust your gains for the time since you last ran the loop every time you run the loop.
|
|
#3
|
|||||
|
|||||
|
Re: PID Timing
Two solutions:
-Calculate DT with a tick count, shift register/feedback node, and subtract. -Use a timed RT loop to guarantee time. You can not care about the dt because it is constant. Time in PID will then be counted in iterations instead of milliseconds, which is fine. I am currently doing the second. It seems to be working well so far. |
|
#4
|
||||
|
||||
|
Re: PID Timing
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|