The motor command
How a H-Bridge works
Put a link to wikipedia here.
Commands generated by motor power
The base of the command is to switch (PWM) the high MOS of on side and leaving close the low MOS of the other side. Others MOS are open.
When the switching MOS is closed the current go through the motor; when it is open the motor becomes a generator, because the low MOS still closed the motor is in short-circuit.
See pictures (TODO add pictures)
To reduce power lost (and so heating) when the high MOS is opened, both of the low MOS are closed. The low MOS, on the same side of the switching high MOS, conducts the current through the diode resulting in a little power lost. Closing this MOS permits to limit power losts and so to reduce the heating of this MOS. The risk is to short-cut Vbat with the ground for a short time when opening the high side MOS and closing low side MOS.
Stopping the motor
To stop the motor we have to solution :
BRAKE: the first one is to apply a 0% PWM, that correspond to close both los MOS and open both high MOS. This put in short-circuit the motor that is in generator. This short-circuit create an electrical brake that stops the motor quickly. (protocol command '!l00' or !r00')
HIGH-Z: The second solution is to open all MOS. The motor is neither powered nor short-circuited, so it stops by slowing down progressivley. (protocol command '!L' or '!R')
Deadtimes
Explain here why and how deadtime are applied.
Current limitations
Explain here the different existing protections.