I am using my BrickPi to control a stairclimbing robot. It uses technic link treads to lift up legs by rotating the motor. However, whenever the back leg needs to be lifted, it lifts to the required height (using a touch sensor) and then I set its speed to 0. However, after that it tends to roll back a large amount, causing the leg to drop significantly in height, completely skewing the robot. Now I understand this is probably because the leg is heavy. However, it does not have this problem when the legs are not moving, i.e. the motor can then hold the legs perfectly fine. It’s when it has just finished moving that it is somehow more susceptible to unwanted movement.
I tried using the motorRotateDegree function but even the example of GitHub did not work at all, and from what I gathered in some topics there still seem to be some problems with this function.
Now what my question is: what can I do to stop the motor from rotating back after I tell it to stop?