herolic / aeroquad

Automatically exported from code.google.com/p/aeroquad
0 stars 0 forks source link

Consider dT a parameter to updatePID() #108

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In the future we will have baro based AltitudeHold, Sonar/IR based low altitude 
hold, GPS position hold, and possibly other functions that need PID control.   

Currently updatePID() uses the global G_dt as the time factor applied to the I 
term and D term calculations.    Sensors like the Baro, Ultrasonic, IR, and GPS 
do not work on the same cycle time as the accel & gyro sensors, often they are 
much slower. This would be especially problematic if a sensors dT is not 
regular.  

Suggest making dT a passed parameter to the udpatePID function. This will allow 
a generic updatePID function to be used with these new sensors and functions 
(such as altitudeHold) and prevent hacking I & D gains in the configurator to 
compensate. The configurator trick wont work with sensors that dont have a 
regular periodic dT.

The BMP085 baro for example has differet dTs depending on if it is a pressure 
to pressure cycle (17ms) or a pressure - temperature - pressure cycle (19ms).

Original issue reported on code.google.com by wila...@gmail.com on 21 Feb 2011 at 1:54

GoogleCodeExporter commented 9 years ago

Original comment by CaranchoEngineering@gmail.com on 25 Jun 2011 at 4:41