PID code questions
In the pid code from First's "Navigation" sample, there is something I don't understand.
The integral error is combined with "pid_time", which is unfamiliar to me, I thought the integrated error (sum) should just used as is.
motor_info[motor].pwm = (KP_P * motor_info[motor].pos_error) +
((KI_P * motor_info[motor].pos_error_i)/pid_time) +
(KD_P * motor_info[motor].pos_error_d);
This pid_time variable is reset when the target position (or velocity) is changed,
but the integral value is not also cleared. Won't that cause problems?
__________________
Don Reid
|