Protect power supply against BEMF

Is there any proven, simple method to protect a power supply from overvoltage produced by BEMF if a motor is turned manually? What I am thinking of is a small battery or a capacitor, but I am not sure if that is sufficient. Also, Lithium based batteries will require some charging circuit, which is totally new to me while Lead acid batteries would be very bulky.
I am using two B-G431B-ESC1 as controllers/drivers, which have overvoltage protection on the input, but apparently, that triggers to late for the PSU it is attached to. No problems though with my (cheap) lab power supply. Due to the given driver boards, I cannot easily change the circuitry, I can only attach something between the boards and the PSU. In principle, the driver boards would also be capable of detecting BEMF and I could use that information to control a MOSFET or so, but sensing BEMF is currently not supported by SimpleFOC and I don’t want to dig deeper into the ADC related code since all that stuff seems to be a bit under cosntruction in SimpleFOC right now.

A good alternative could also be links to 24V PSUs >150W, which are known to be reasonanbly tolerant against regeneration.

Thanks for any advice!

I’m working on BEMF sensing for this board, I think the circuitry isn’t suitable for this specific use case.

I think that you want to measure the motor current, this should be proportional to the regen current(?). If the current is positive in the driven direction, the board is drawing power. If the current is negative, power is being delivered back to the power supply. The ODrive supports adding brake resistor, when the motor power gets below a certain threshold (i.e. -5A) it opens a few gates that let the excess power flow through a large resistor.

I think this feature requires additional circuitry that isn’t present on the B-G431B. You can search for ODrive brake resistor for details. Edit: you can view an old version of the ODrive schematic here, the schematic for the brake resistor circuitry is detailed on the last page of the schematic and requires a gate driver and 2 additional mosfets, which aren’t present on the B-G431B.

For the ODrive, you can configure the maximum braking current separate from the maximum drive current so you can limit the amount of power being delivered back to the PSU, see odrive docs here under “negative current”, I don’t think this is implemented in SimpleFOC. I think the B-G431B has all the required hardware to implement this, would be a nice feature to have.

Thanks a lot for the pointers to the documents and your long answer. I was aware that ODrive has that capability, but did not know how they implemented it. I will read the docs and learn… On the other side, measuring the current does not sound like a really simple solution since it requires a high power shunt resistor and some pretty sensitive analog circuitry, but let me first see how it is implemented in ODrive, perhaps it’s easier than I think it is. Most solutions will require a high power diode or similar in any case. Of course, I could take the pragmatic approach and just get me anotherone of the cheap lab PSU which is working fine right now (and looks good), but that feels like cheating a bit…

In ODrive it seems to be implemented as I expected it to be, a circuitry to measure the current and some MOSFETS which pull the DC Bus down and it is all software controlled. So, far a way from a really simple solution which I can have in parallel to my PSU. Implementing the software part on the B-G431-ESC1 boards is also not feasible for me since I have a few of them in parallel. Does anything speak against using two 12V AGM lead batteries in series with each other and in paralell to the PSU, without any additional circuit? Cost would be decent and the physical dimensions of small batteries are still acceptible.

What about a separate brake resistor circuit connected in parallel with all the ESC’s? Something which measures the bus voltage and switches on a MOSFET if it goes above a threshold. Then as energy burns up in the resistor and voltage drops below the threshold, it switches back off. Certainly could be done with an ATtiny, MOSFET, gate driver, and a couple resistors for a voltage divider to feed the ATtiny a range that it can measure. But there’s probably a simpler way to measure the voltage and switch the transistor with a pure analog circuit.

Or the simplest of all is to use the motor itself as a brake resistor. Switch on all MOSFETs of one channel, and the motor BEMF causes current to circulate in its coils and heat up.

SimpleFOC already has support for current sensing on the B-G431B (on the motor leads), it works very well. SimpleFOC also knows the motor voltage, I think that’s all the information you need to calculate the power draw or regen, which can then be limited in software. Of course, without a brake resistor to dump the energy the maximum brake power will be limited by the capabilities of your PSU.

B-G431B also has hardware for measuring the bus voltage (not implemented in SimpleFOC).

If you want to play around with current sense, use this pull request: B g431 b current sense fixes by sDessens · Pull Request #210 · simplefoc/Arduino-FOC · GitHub

Thanks again for the answers! I already use current sensing on the board and I do also measure the bus voltage, that part is fine. However, using all that information from one board to dump excess energy into a resistor will not help if you are using mutiple motors as I do, so I am more thinking along the lines of what @dekutree64 proposed, but it might well exceed my analog skills. Apart from this, it seems that I just burned one of my ESC boards during normal operation. No idea how, it was not hot at all and the motor used to be no problem at all for the board. I am still investigating, but it looks as if it just died silently.

What really annoys me is that now I have two broken boards, showing the same problem and I can’t find what is broken and not why it broke. The first one died during my initial experiments, that may have had many reasons. The one today however was in a pretty controlled environment, current was limited through simplefoc and I had heat sinks as well as a fan installed. Normally the board does not even get warm under these conditions. My concern is that it broke due to generated energy be it by the motor controlled by the now defective board or the other one attached to the same 24V PSU. On both defective boards I can still load and run programs, use the ADC, CAN and everything seems ok. However, I cannot measure any PWM signal on the input of the driver stage, the signals seem floating. All power rails seem ok to. This is really weird, since I can hardly believe that all 6 PWM outputs of the CPU shall be broken.

Pretty normal behavior, nothing weird. There is absolutely no protection on that board, or any other hobby boards for that matter. Your only way out of this would be a custom optoisolated MCU board with the latest ELICE reinforced isolation drivers for the power stage. Very big and very expensive. Probably about $100 only for the BOM.

Cheers,
Valentine

It is quite easy to break this board, I have 3 dead ones (RIP), on all boards there is one shorted-out mosfet and I can’t program them anymore.

I suspect that current from the BEMF killed the boards. In all cases I was running a motor with ~0.02 ohm phase resistance with a voltage limit around 6. If simpleFOC or the sensor slips up for a fraction of a second, that’s 6v / 0.02ohm = 300A through the mosfets, they won’t survive that. I switched to a motor with 0.05ohm phase resistance and I haven’t killed a board since.

Still a lot cheaper than buying a $2000 commercial board. And a lot more educational and fun when they go “CRACK” and release that smoke, hahaha. Some even get sparks going on. Always use eye protection!

Cheers,
Valentine

I have 2 of these boards that gave up their blue smoke so that I could learn. I actually managed to desolder the MOSFETs from the first board to replace blown FETs on the second after killing the MCU on the first board so I’ve managed to kill them 3 times in total :see_no_evil:

1 Like

This is really interesting, thank you for sharing :rofl: :rofl: :rofl: I’ll never forget my first blown component. It made a huge pop and a spark and there were shrapnels flying and I nearly lost an eye. It hit my lower eyelid, and burned a hole, just a few mm from my cornea. Pure stupid luck. Better be lucky than smart, they say. I always thought people wear lab goggles only in movies to look cool.

@Valentine, now I understand why you always emphasize the importance of protective glasses! In my life I had burned a lot of components while I was still developing hardware (some decades ago…) and I love fireworks. This time however, the boards died silently without smoke and especially the last one in a no-load state (probably). With overload conditions I would also not understand why the CPU’s PWM outputs should be killed (in contrast to the MOSFETS of course!). My assumption is more that it was also related to BEMF. It is rated at 3.8V/krpm BEMF which results to roughly 4V if I pulled the break line in my application (paragliding simulator). The board has overvoltage protection, which should kick in at 26V but either that is too slow or not working. Still it is a bit strange since there are so many components between the CPU and all the components directly effected by such a condition. Also, tha MCU is still working as it seems. Miraculus. Anyway, not so important, I just want to make sure this doesn’t happen in my final setup. The broken one was still using the 0.6 Ohm motor from the initial trials. The other brake line uses a significantly higher rated motor with 1.1 Ohm resistance, but I have no data on it’s BEMF.

I remember debating the TVS diode in the past. When designing controllers, I believe it is a good practice to incorporate those fat TVS diodes even though they are annoying. With annoying I mean, they use up a lot of voltage overhead, so if designing for a 80v system one has to bite the bullet and use 150v FETs in order for the TVS to work properly.

Another aspect, in that regard, is, even though it sounds counterintuitive, the higher ohm windings will resist a change in “energy” while the low ohm stator may not have a high BEMF it will dump that energy fast, so from a TVS viewpoint, with higher resistance and high BEMF the relative slow release of energy makes it easier on that diode ?

Edit: I know it may not be relevant for a 24v PSU, since the protection trigger margin is so sensitive. The TVS purpose of course is to protect the FETs. So really this discussion is straying away from the OP dilemma. I agree with the folks mentioning brake-resistors. I believe the Odrive crew has demonstrated that it works.

You are raising a point that most either avoid or do not understand or find by trial and error. Start from the use case, select the motor, then the controller then the power supply, then you write the code. And always consider than your board usually must be rated 100 to 200% headroom, so if you plan on 30A you need a 60 to 90A board which must be a real 60A, not a Chinese 60A peak. And the board components must be sized from the mosfets to boost capacitors to driver current and protection, then isolation to MCU. With a separate circuit for braking and stalling. And correct cooling (anything over 30A will require forced air or liquid cooling). Then you are looking at a $2000 board and 3 months of full time setup and testing…

What @Valentine says is certainly true and sounds likely really many years of experience. In my particular case, my final motor will normally pull something like 3A and in exceptional cases up to 9.5 for a very short time. To protect against the latter I use heat sinks, a fan and temp sensors (one on the board and one on the motor). That’s probably as good as it gets with a hobby budget and after all, the specs of the B-G431B- ESC1 are pretty good.
Returning to my initial topic: It might not be a real issue at the end if my math is correct. The finally chosen T-Motors G60 Kv55 should exhibit pretty low BEMF in my application, hopefully still in the range acceptible to all attached devices - trial and error will tell. And for completeness: The one which broke things was an ACT 42BLF03 (hall sensors replaced by a magnetic sensor).

Superinteresting thread!

But I have one question regarding the original question: shouldn’t you just size the system to prevent the BEMF from going above your bus voltage?
Because if it does, you will lose ability to control the motor, it will just be coasting along until the voltage drops again?

I’ve thought about this, what will happen if someone outside forces the motor to spin? How do you prevent anyone/anything from turning the motor and injecting BEMF into the board? It’s easy to exceed the voltage. Example, you climb a hill and then go downslope, very fast, this will certainly have cases where the motor spins so fast it exceeds the voltage?

This is exactly what happens in my case. I can’t prevent a pilot from pulling the break line hard and in some cases, you even have to do it. The motor on the other side should exert a force of 20N at a specific point, slightly increasing if you go down from there and getting less if you release the line above that point (a bit like a spring). To simulate turbulences, that point varies dynamically. If it moves down fast, I at least will often overreact ant pull too strong. The result is a broken board :-(.