Removed debugging code from APM_PI

This commit is contained in:
Jason Short 2011-11-08 14:41:21 -08:00
parent d375de8424
commit 0ca427bdd9
1 changed files with 6 additions and 6 deletions

View File

@ -10,15 +10,15 @@
long
APM_PI::get_pi(int32_t error, float dt, bool calc_i)
{
if(true)
if(calc_i){
_integrator += ((float)error * _ki) * dt;
if (_integrator < -_imax) {
_integrator = -_imax;
} else if (_integrator > _imax) {
_integrator = _imax;
if (_integrator < -_imax) {
_integrator = -_imax;
} else if (_integrator > _imax) {
_integrator = _imax;
}
}
return (float)error * _kp + _integrator;
}