I have Debian jesse installed on a mindstorms EV3 and I'm using the ev3.lego
library: https://github.com/topikachu/python-ev3
I want to be able to slow down the motor as it reaches its target destination because if it's going full speed when it gets there, it overshoots its target proportional to how fast it was going.
Example Python code: When I use this code to spin the motor:
from ev3.lego import Motor
b = Motor(port=Motor.PORT.B)
b.run_position_limited(position_sp = 100, speed_sp = 300)
The motor spins to position 100 on the tachometer with speed of 300.
When it gets to its destination, the momentum carries it to position 125 or so. So next time I tell it to go to position 100. It spins up, then overshoots to position 75.
What is the best way to try to minimize this error so I can tell the motor to move to position 100, and it either slows down before it reaches its target, or otherwise freezes the motor when it reaches the destination?