Homepage Knowledgebase GitHub

Voltage inverter, freewheeling and regenerative breaking

I’m trying to get a better global understand of how the whole systems works. One thing that get me confused is what is the the voltage inverter? I’ve looked at the schematic at the end of the user manual for the sapog firmware and the FET are connected to V_bat but at the beginning of the document it written as inverter volatgae supply.
The document mentions as well the inverter being turn off in freewheeling, what does that means exactly?

Lastly in the regenerative breaking section they talk about
‘Typically, the controller’s hardware is equipped with some protection circuits that activate and dissipate the excessive energy when Vinv increases a certain threshold;’ what does that look like normally?

Really appreciate the help!

A three-phase voltage inverter is a circuit composed of six transistors pairwise (or an integer multiple of six if they are connected in parallel or, rarely, mostly in older designs, in series) where each pair uses pulse-width modulation to generate a particular average phase voltage. You will find more info at https://en.wikipedia.org/wiki/Power_inverter.

It’s the same thing. Conventionally, the inverter supply voltage is denoted Vbat.

It means that all six transistors are permanently closed. When turned off, the inverter may still conduct through the anti-parallel diodes.

Usually, it’s a set of TVS (transient voltage suppression) diodes, possibly with a braking resistor. You can find an example on the schematic here (the three diodes next to the power input): How I Learned to Stop Worrying and Love ESC Development

Hi Pavel,

Thanks very much for the information.
Regarding the freewheeling, with the current firmware is it active of passive freewheeling?

The firmware implements active freewheeling. If the inverter is turned off, however, it’s passive, but this mode is not used normally, as you can see in the description.

Alright I understand better! And in the sapog software when does freewheeling is applied vs regenerative braking?

Freewheeling is only used when the drive is turned off with a non-stationary rotor and during desaturation cycles. Regenerative braking is used normally otherwise.

I’m not sure I understand the nuance. Practically what is turning the drive off? When there is a 0 duty cycle or RPM command?
Also can you choose the strength of the regenerative braking or the maximum current?
Thanks for your input

Yes. You will find an exhaustive description of the logic in the reference manual for Sapog.

No, the regenerative braking current is not limited.

If I wanted to the regenerative breaking to be apply of the 0 duty cycle or RPM, would it be complicated to change the software at this effect?

Am I correct is saying that the freewheeling @ 0 command happens here:

for RCPWM:

for UAVCAN openloop:

for UAVCAN RMP control

Also what would be the impact of calling the motor_set_duty_cycle with a 0 dc request?

That would require revamping the control logic a bit. We do not have that on the roadmap but you are welcome to send a pull request.


I’m interested in looking into this. I guess I will start by looking into how the regen braking is handle right now.
Am correct in seeing that regen only happen in RMP control? I see that the duty cycle need to be negative but I dont see how it can happen in openloop.

Regenerative braking is possible in open-loop control as well. For it to take place, the output voltage modulated by the inverter has to be below the back electromotive force induced in the motor. This is explained in the second chapter of the Sapog Reference Manual.

During regenerative braking, the source voltage Es modulated by the controller is lower than the induced BEMF Eb, which creates reverse current flow from the motor into the VSI and further into the power supply network. According to the formulas presented in section 2.1.1, reversing the current will also reverse the torque, causing the motor to rapidly decelerate.