We are trying to use PID to keep our double wheel thrower spinning at the same speed. However, when we implemented it, both wheels start spinning, then after about 2 seconds, one wheel stops and starts spinning the opposite direction. I’m assuming it’s because one of the ime’s is reading a negative value, and reverses to match the other motor. Am I correct in this, and if so, how do I correct this.
Without seeing your code it’s hard to say specifically what is happening. If you are writing your own PID control loop then one thing to do is limit the control values that you send to the motor to always be positive (or negative, depending which way the wheel runs). Make sure to use nMotorEncoder to read the IME values, do not use SensorValue as it will quickly overflow (SensorValue can only count to 32767). If you would like you can send me the code in a private thread.