0
\$\begingroup\$

enter image description here

Image source

enter image description here

Link to circuit simulation: https://tinyurl.com/28bmjgww

I would like to add a capacitor (decoupling) to my H-bridge because without it, the simulation shows that when the motor is switched off current flows back through the parasitic diodes of the MOSFETs and into the battery. I added a diode to the battery as well to protect it from that back flow.

So I have no idea how to choose an appropriate capacitor value. I know this formula:

I = C * dV/dt

The issue is that I don't know the term dV/dt. I know my current should be around 18 to 20 A and my supply voltage is 36 V. But I don't know how it changes with time. It is supposed to remain constant throughout the duration of operation of the motor. But is dV/dt referring to that or is it referring to the change in voltage during the start-up period? If so do I try to minimize the time (like assume a small value like 100 milliseconds or something?)

Also, do capacitors have voltage ratings or is it just how many Farads?

Please go easy on me, I am a chemical engineer involved in this electrical stuff, so I may be asking stupid things.

Thanks, any help is appreciated!

\$\endgroup\$
3
  • \$\begingroup\$ How much voltage overshoot can you allow during engine breaking? How will you dissipate away this energy? What's your source impedance? How much voltage sag can you allow during max acceleration? \$\endgroup\$
    – winny
    Commented Nov 25 at 8:04
  • \$\begingroup\$ Recursively determination through the simulated circuit? It couldn’t exactly simulate the motor so a compromise must be made. Switching frequency, motor inductance and its leakage inductance are parameters. You could start with a fraction of the energy absorbed by the motor between switching. Do not forget to put 10~100nF ceramic capacitors between poles and Vcc/Gnd: brushed motors are a sort of high frequency noise generator. \$\endgroup\$
    – user317139
    Commented Nov 25 at 10:27
  • \$\begingroup\$ Marisa Kirisame - Hi, Where did the top image come from? To comply with the site rule on referencing, details of the original source of copied / adapted material must be provided by you, next to each copied / adapted item. As a minimum, if the original source is online, please edit the question & add the webpage/PDF name & its link (URL) (e.g. website name + webpage title + URL). But some sources impose extra obligations e.g. copying from elsewhere on Stack Exchange must comply with the CC BY-SA license. See here for details. \$\endgroup\$
    – SamGibson
    Commented Nov 25 at 12:07

1 Answer 1

1
\$\begingroup\$

It depends on what you're doing with the motor.

If all the MOSFETs in the H-bridge are off, and the motor is turning, then it will act as a generator. The MOSFET body diodes will act as rectifiers, and rectified voltage from the motor will appear on the H-bridge supply rail.

Thus there is a possibility of over-voltage, but it depends on voltage and energy.

Voltage generated by the motor is proportional to rpm. At any rpm, the motor's voltage output will be a bit higher than the voltage that would be necessary to spin it without load at the same rpm. In fact it may be slightly higher, since the motor is unloaded when it acts as a generator.

So, if the motor will never be forced to turn faster than it would when unloaded and at full power, no overvoltage should occur. This would be the case for a drill, for example.

However, in other cases like an vehicle or a fan, the motor can be forced to turn faster, which means it will generate higher voltage than your power supply. Depending on how much, this may destroy your components.

The problem with your capacitor idea is that a capacitor of reasonable size can only store a small amount of energy, and the more energy it stores, the more voltage will rise. So it won't solve the problem. The role of the capacitor here is:

  • Provide decoupling, by lowering the impedance of the power supply at high frequency right on your board

  • Reduce noise, as high frequency harmonics from the PWM current will go through the cap rather than the battery wires

  • Absorb voltage spikes to prevent blowing the MOSFETs

  • And finally, slow down the voltage rise so the protection circuit has time to act when the motor acts as a generator.

As for the value, it is not critical. It should not be too large, otherwise you will have a huge current spike when connecting the battery, as the capacitor will immediately charge to full supply voltage. So if you use a Lithium battery with a BMS, and the cap is too large, the current spike may simply cause the BMS to think the output is shorted and disconnect. If that happens then you'll need a circuit to limit current while charging the supply caps, then connect directly to the battery.

It should not be too low, otherwise it is useless. The value depends on your battery, length of wires, PWM frequency, etc, so it's hard to say.

In any case:

  • If the motor can never be spun by an external force, then a capacitor will be enough to absorb voltage spikes.

  • If voltage can rise to dangerous levels because the motor can be spun by an external force, then you need something able to limit the voltage while absorbing all the energy generated by the motor, which can be a lot. The usual way is to detect overvoltage with a comparator, and when that occurs, turn on both low side MOSFETs. This shorts the motor, causing it to act as a brake, and the energy will be dissipated in the internal resistance of the motor windings.

\$\endgroup\$
5
  • \$\begingroup\$ This is answer is incredibly insightful I cannot express my thanks, thank you for the in-depth reply. I would like to clarify a few doubts I have. When you say the motor will be forced to turn faster, what do you mean? For example, in the case of a vehicle how would that occur? Like due to inertia or due to sudden braking? I'm assuming trying to accelerate would still make the motor only spin below it's absolute max rpm because of efficiency losses. I'm interested in that because you mentioned this high speed spinning can lead to dangerous voltage spikes. Sorry if question is basic, thanks! \$\endgroup\$ Commented Nov 26 at 18:41
  • \$\begingroup\$ I'm mostly interested in moving a primitive/basic vehicle at constant velocity. Although braking might occur. What I understood is that in case of vehicle or fan for example voltage spikes can occur, but I don't understand the part about faster spinning and the motor being moved by external force (it must be braking for example right or?) if possible I would like pointers on what sort of protective circuit I would need to mitigate this I would really really appreciate it \$\endgroup\$ Commented Nov 26 at 18:44
  • \$\begingroup\$ Consider an electric electric bicycle with a 36V battery. Let's suppose the maximum unloaded rpm of the motor with 36V supply voltage corresponds to 30 km/h. If you go downhill at 60 km/h, the motor would generate double that voltage. That's the issue I'm talking about. If you spin the motor then use it as a brake, it won't spin faster than its unloaded speed, so it won't generate more than the supply voltage. \$\endgroup\$
    – bobflux
    Commented Nov 26 at 20:13
  • \$\begingroup\$ There is an exception: if you apply PWM while using the motor as a brake, then the motor's inductance, combined with the MOSFETs, creates a boost converter using the motor as source. The output of this boost converter is the supply. If this occurs, it can output very high voltage on the supply. So in practice you always need a hardware protection, with a comparator that monitors supply voltage and will do something to limit it. That can be dumping current into a resistor, or shorting the motor. \$\endgroup\$
    – bobflux
    Commented Nov 26 at 20:16
  • \$\begingroup\$ You can also do it in software. But the advantage of fully-hardware protection circuits (ie, comparators and logic gates) is they still work when the software crashes, or when you connect the debugging probe and single step through your code, for example. \$\endgroup\$
    – bobflux
    Commented Nov 26 at 20:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.