Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   PID Timing (http://www.chiefdelphi.com/forums/showthread.php?t=99987)

Tom Line 12-01-2012 22:06

PID Timing
 
If seems to me that PID Loops are time dependent. After all, you have the derivative term which is essentially monitoring the change in your error term.

My question then, is why the derivative term isn't normalized for time (divided by the loop timing) to account for loops changing speed. In the past, we've not used "D" terms, but it seems that when the cpu starts to get loaded down, the D term could cause issues due to varying loop timing.

Am I off base?

jhersh 13-01-2012 02:13

Re: PID Timing
 
No... it doesn't sound like you are off base. Are you sure the the PID is not time compensated?

Tom Line 13-01-2012 02:54

Re: PID Timing
 
Well, we've always written our PID's by ourselves. The math is trivial and it's good for the kids to understand where they come from. Not a single paper I've read on PID calculation states as an assumption that the loop needs to be consistently timed. That's why I'm curious if we can improve our PID loops by incorporating a time normalization into the derivative term.

Ether 13-01-2012 07:07

Re: PID Timing
 
1 Attachment(s)
Quote:

Originally Posted by Tom Line (Post 1104008)
My question then, is why the derivative term isn't normalized for time (divided by the loop timing)

See attached screenshot.

Joe Ross 13-01-2012 09:21

Re: PID Timing
 
How are you calculating the derivative if you aren't taking into account the actual loop time? Same for the integral.

jwakeman 13-01-2012 09:43

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.

apalrd 13-01-2012 21:31

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.

Ether 13-01-2012 21:36

Re: PID Timing
 

Quote:

Originally Posted by apalrd (Post 1104896)
Use a timed RT loop to guarantee time.

http://www.chiefdelphi.com/forums/sh...64&postcount=3




All times are GMT -5. The time now is 09:35.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi