|
Re: Programming Puzzle
You could also try using a PID to minimize error, rather than reach a setpoint.
IE: Rather than
My setpoint is currently 4.5 my process variable is at .1
Say
My setpoint is always 0, currently my process variable is -.6 (where -.6 is the circular difference between your 'goal' and your 'actual') then when your goal changes, the frame of reference you use to calculate your process variable changes, and your (probably only proportional gain?) controller will move your motor.
|