Quote:
Originally Posted by DustinB_3
Thanks for the whitepaper
I think I understand fairly well, would this work:
*snip*
Arm_Out = Get_ADC_Result(2); //GetAnalogInput(Port) Checks the Port and Return 0-1024
Error = (Arm_Out - Target); // Computes Error Based on How Far you are from the goal
Drive = ((Gain * Error)+127); // Based on the gain it outputs a number and then add 127 so the Victor Understands
pwm01 = Drive;
|
Correct me if I am wrong, but that is NOT a PID loop. All that is going on there is a proportional control based on distance of the arm from the target. That code does not account for the integral of error or the rate of change of error, making it a P loop, not a PID loop.
So that will control the arm, but it is
not PID control.