Quote:
|
Originally Posted by Don Reid
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?
|
From reading the responses in the thread, it looks like pid_time is implemented to reduce wind up. It was also mentioned that set_pos() and set_vel() reset pid_time.
If I'm calling set_vel() every 26ms from my Default_Routine(), am I destroying the I term of the PID control loop? Because I'm resetting pid_time so often?
Would it be better to not reset pid_time?
-SlimBoJones...