I would like to know how the brake functions of the librarie provided by Pololu work ? (Not how to use them).
My questions are :
- What is the difference between these 2 lines of codes :
- Is the 2nd line of code reverse the power of the engine to ensure a better braking or it just sets the speed to 0.
I need to brake my motors and if I could do it without using a short-circuit to reverse the power it would be really nice.
Many thanks for your answers and advice.
Calling setM1Speed(0) sets the motors to full coast. Calling setM1Brake(400) shorts the motor leads to GND and inductively brakes the motor. You can find more information on this in the dual VNH5019 motor shield Arduino library page.
Many thanks for this explanation.
Therefore, if I understood, the function setM1Brake(400) just stops magnetically the motor, isn’t it ?
I do not understand verry well English so could you please explain me with other words what “full coast” means ?
When braking the motor, the motor driver shorts the motor leads together through ground, which causes the motor to electrically brake. When configured for coasting, the motor driver outputs are turned off and the motor leads are effectively floating/disconnected.
You can test the two scenarios for yourself by disconnecting the motor from the driver and spinning the output shaft by hand, first with the leads separated (full coast) and then again with the leads held shorted together (brake).
I understand now the difference between the 2 functions.
But I have met a new problem recently with driver, I will post a new post with a video to explain it.