Log in

View Full Version : Proportional Control


ShadowFlame
14-02-2004, 11:53
The rest of the controls team on our team are having trouble figuring out how to use a 10 turn potentiometer to regulate the position of a Van Door motor, to make it line up with a 3/4 turn potentiometer on our driver controls. We can't figure out the math, and how we would write it into our code. Thanks for any help!! :)

*Edit* We are also having problems figuring out to write code for accelerating and decelerating (in incremenets of 5). The current loop in the code would have "lw" for the left wheels and "rw" for the right wheels, and the variables we use for the value of those motors for the previous loop with would be "lw2" and "rw2". The equation we thought of was "lw = lw2 - p1_y", but we don't know how to find the value of "lw2" or "rw2". If this equation is wrong, please let me know if you can think of a better one. Again, thanks for any help!!