Closed Finn6360 closed 1 year ago
Since the encoders get zeroed on startup, the safest thing to do would be to have the encoder get reset when the arm is fully extended or retracted.
When the current in the motor is way too high and the speed is negative, then it's probably trying to retract but it's all the way retracted. In that case, set the encoder value to 0.
When the current in the motor is way too high and the speed is positive, then it's probably trying to extend but it's all the way extended. In that case, set the encoder to MAX_EXTENDED
value.
I believe I did what you wanted Matt. We had the retract stopper and Ben said we probably don't need the extend stopper. I did, however, add hard limits.
Makes it not crash into floor.