I apologise for the long note but I think this may be useful (if not / you already know this then sorry) for some searching for info on this topic.
I have been doing some more digging into this topic mainly to improve my understanding but also to make sure we arenât missing a trick.
Firstly, there are multiple ways of achieving regenerative braking with a brushless motor. As has already been mentioned above, if you simply turn a brushless motor using an external source, provided the rotational speed is high enough you will produce enough BEMF to move charge back into the power source. We know this is nearly never the case and so, really, what we are trying to do is achieve this same effect at lower rotational speeds and use the common driver circuit as a boost converter.
The most discussed strategies online seem to be around the more simple brushless motor control, â6 step commutationâ and even within this control algorithm, there are multiple examples of how to achieve it. First there is the âThree Switch Strategyâ (which I think has possibly been mentioned above already) where you quite simply switch the low side transistors at a pwm duty cycle between 0 and 100% to control the level of regeneration and braking torque. (Note: this happens no matter the commutation step and all other switches (high side) are left floating)
A second alternative method is âFull Bridgeâ (FYI the names are just as they were called in the document I was reading, not necessarily to true / given name). In this method all switches are used at least once, but for each commutation step only 1 phase (and one switch within that phase) is active, the rest are floating. (This one warrants an example: Step1 = PhaseA Low, phase B and C floating, step 2 = Phase C high, phase A and B floatingâŚ)
In addition to the above there is another strategy âTwo switchâ whereby you are essentially commutating in the reverse direction. I.e. Lets use an exampleâŚyou are on a bike and you are commutating clockwise to get up a hill and now you are going back down the hill. If you start to commutate the motor in the anti-clockwise direction, this too will provide a positive charge to the battery. The only warning with this method is that it very quickly moves from regenerative braking to plugging as you increase the duty cycle.
This paper covers the above and also shows some graphs showing how each perform which are interesting A new electric braking system with energy regeneration for a BLDC motor driven electric vehicle - ScienceDirect
It is this method that got me thinking about the SimpleFOC algorithm, I was watching one of the videos showcasing the SimpleFOC working and when in âvoltageâ mode you are able to drive the motor forward or backward using positive or negative inputs (voltages) as if it were a DC motor. Surely this means that to an extent the library is already capable! Now I am aware that there is no formal âcontrolâ of the regeneration or power source protection etc. however this could mean we could use a âuser control loopâ to switch to the âvoltageâ mode and start playing around with this.
Now as you will see when reviewing the paper I have linked above, the most simple to implement also seems to come up on top for capability as well, the âThree Switch Strategyâ. I think @runger has already stated that the SimpleFOC library currently only seems to control 3 PWM outputs?? and thus it cannot leave a phase floating which is the main issue stopping the first 2 options being used.
Just to finish this off as I saw a note about coasting come in as I was writing this.
@dekutree64 I completely agree, surely there is a torque setting which would activate coasting already in the library. Again, referring back to the 6 step commutation scheme, to coast it seems you essentially commutate based on the step but the two active phases are both Low rather than one being high and one being low.
I am now the frustrated kid sitting at home waiting for my DRV8301 driver module and motor to turn up but perhaps someone here already has a test set up?