A simple motor shunt regulator
Two of the legged robots I have worked on use low Kv BLDC motors coupled to a planetary gearbox as their actuators like the Mini Cheetah actuators. These actuators are great, but have a small problem when running from the lab power supply rather than a battery pack. When doing negative work the motors will back-feed the power supply, raising the voltage on the output filtering capacitors and triggering the over voltage protection. This has resulted in many of the robots shutting down and collapsing in a rather dramatic fashion.
To solve this I built an automatic shunt regulator based off of the one I saw on the open-source ODrive motor controller. I tried to buy a hobby one online but the biggest I could find was rate for an anemic 15W and only went up to 33V, not the 48V we needed. Plus I thought it would be interesting to try and make one.
The shunt regulator works by monitoring the bus voltage and dumping the energy from the motors into a 50W 0.47Ω power resistor, essentially acting as a variable load to regulate the voltage. A microcontroller monitors the bus voltage with a voltage divider and modulates the amount of power going into the brake resistor by varying the duty cycle of a 20kHz PWM signal switching a MOSFET. The gate driver quickly charges the gate capacitance and ensures the MOSFET is turned on hard, minimizing power dissipation during conduction.
The reason for the PWM signal is to be able to modulate the amount of power dissipation rather than dumping the maximum possible power of over 1.2kW for only a small rise in voltage. The PWM signal is controlled with this simple proportional controller where current to the brake resistor is increased proportionally based on the bus voltage providing a smooth fade in or out of power dissipation. Here’s the C code snippet running on the micro.
brake_duty = min(max((v_bus - v_ramp_start)/(v_ramp_end - v_ramp_start), 0.0f), 1.0f);
By configuring v_ramp_start
and v_ramp_end
in the firmware the supply voltage and responsiveness to voltage spikes can be adjusted.
You can’t see it in this image of the board, but I also soldered a thick single core copper wire to the main power rails underneath just because pushing 40A through proto board tracks didn’t seem like a great idea. I never got around to designing a PCB for this and making the circuit more robust, but that could be a fun future project.
Enjoy Reading This Article?
Here are some more articles you might like to read next: