Resilient

03-25-2009, 09:13 PM

I am working on keeping my newfangled wheel encoders from making wild speed oscillations and was looking at some example code.

err_R = (req_speed_R - enc_speed_R); // calculate proportional term

i_err_R = calc_vel_integ(i_err_R, err_R); // calculate integral term, with saturation to prevent windup

req_err_R = (req_speed_R * 8) / 10; // calculate velocity feed forward term

out_R = calc_vel_out(req_err_R + err_R + i_err_R); // calcuate motor outputs based on total error term I was reading about PI loops and have a good idea what the proportional and integral terms are. But I was reading about feed forward and was confused as to what role it is playing here.

The full code is here:

http://www.nubotics.com/support/ww01/code/atmel/ww01_avrgcc_square.c.php

But I am really just not understanding what the feed forward part of this code is doing. Any help clarifying it for me would be appreciated.

err_R = (req_speed_R - enc_speed_R); // calculate proportional term

i_err_R = calc_vel_integ(i_err_R, err_R); // calculate integral term, with saturation to prevent windup

req_err_R = (req_speed_R * 8) / 10; // calculate velocity feed forward term

out_R = calc_vel_out(req_err_R + err_R + i_err_R); // calcuate motor outputs based on total error term I was reading about PI loops and have a good idea what the proportional and integral terms are. But I was reading about feed forward and was confused as to what role it is playing here.

The full code is here:

http://www.nubotics.com/support/ww01/code/atmel/ww01_avrgcc_square.c.php

But I am really just not understanding what the feed forward part of this code is doing. Any help clarifying it for me would be appreciated.