View Single Post
  #3   Spotlight this post!  
Unread 01-03-2010, 14:10
Tom Bottiglieri Tom Bottiglieri is offline
Registered User
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 2003
Location: San Francisco, CA
Posts: 3,186
Tom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond repute
Re: WPI PIDController doesn't account for varying dT?

Quote:
Originally Posted by FRC4ME View Post
I was looking through WPI's PIDController code and noticed that they do not incorporate dT into the calculations anywhere. For example, the calculate() method contains the line:

Code:
m_totalError += m_error;
Shouldn't it be like this?

Code:
m_totalError += m_error * m_period;
The way it is now, changing the period of the PID loop would require resetting of the I and D constants. Multiplying the integral by the period and dividing the derivative by the period would remove this inconvenience.
How often do you change the period?