Closed osresearch closed 6 years ago
I realized belatedly that this should probably use the wrapped y position; if the motor has been turned more than 360 degrees when closed loop is enabled it will unwind to the single-turn position.
I'm working on a patch that has the timer interrupt running constantly so that the yw
value is always valid. This will prevent this unexpected behaviour.
This also correctly computes the current angle using the lookup table, rather than having an approximation of the encoder value.