Writing the software is the remaining part. All of the hardware is ready for sensorless field-oriented control (FOC).This is to get a smooth start when the motor is already spinning. The duty-cycle to get the same speed is also calculated. When the motor is rotating while the controller is off, the commutations and the direction are tracked.This is due to the fact that the magnetic flux is integrated after the zero crossing instead of adding a delay based on the previous speed. Commutation works perfectly even when the speed of the motor changes rapidly.The RPM limit also has a soft back-off strategy.If the current becomes way too high, the motor is switched off completely. When the current limits are hit, a soft back-off strategy is used while the motor keeps running.High RPM (separate limits for each direction).
High regenerative braking current (separate limits for the motor and the input).
Because of the servo output, the odometry and the extra ADC inputs (that can be used for sensors), this is perfect for modifying an RC car to be controlled from Android (or raspberry pi).
This is an overview of the schematic (download a complete PDF here): I really enjoy sharing knowledge, so I want to keep all the hardware and software open. This might sound a bit ambitions, but my goal is to make the best ESC available. I have made many updates to my custom motor controller recently and the old post is getting confusing with notes and updates, I decided to write a new post about it that hopefully is more clear, more complete and easier to follow.