2

This question is a continuity to my previous one: Weird DC motor behaviour at low PWM duty cycle

Here is my circuit schematic:enter image description here

Here is a video of how the gate voltage looks like (without and then with the motor connected): https://drive.google.com/file/d/1fhwfmat0HiVCM04DbWdiIYtffUbRr9q1/view?usp=share_link

Here is the shape of the rise waveform (6.380 µs rise time):

enter image description here

Here is the shape of the fall waveform (7.020 µs fall time):

enter image description here

For a total rise and fall time of 13.4 µs. Against a period of 500 µs, that's about 2.7% of the period. There is some small ringing on the fall waveform, I don't know if it's concerning or not.

Here are pictures of my physical layout:

enter image description here

enter image description here

So now it works as intended, but there are many things I want to improve, mainly because the motor will be loaded (certainly a lot) in the future, which means much more current going through the MOSFET and I'm mainly worried about heat management:

  • Reduce the rise and fall time to under 1%: add an intermediary gate driver stage using a part like these: TC4422 or IXDN604
  • Make the driver-gate and ground-source wires as short as possible and much thicker (as I've read many times now that they need to be "short and strong")
  • Replace the NE555 by a TLC555 for reduced power consumption
  • Use a large CPU heatsink with integrated fan for the MOSFET instead of my homemade one
  • Use a second MOSFET in parallel to improve heat dissipation; I don't really know if the gain from this one would be worth the trouble

Could you please give me your advice regarding these improvements?

Do you think they are relevant/good ideas?

Which one would have the most impact regarding heat management?

Thank you all for your time and replies, this has been a wonderful learning experience for me, and slowly working towards a functional and robust solution for this is a genuine joy.

Have a nice day!

EDIT

Here is a schematic equivalent of the PCB layout you posted, please tell me if I've understood everything correctly :

enter image description here

Oops, diode is the other way around

Solmyr999
  • 149
  • 8
  • Can you show how the motor and main supply/battery are connected? What's under the heatsinks, can we see the wired connections? What's the black blocky thing? Where is the 100uF, how is it wired, and what type is it? Why such an old, slow MOSFET? – Tim Williams Oct 20 '23 at 12:14
  • What MOSFET are you using? – Hearth Oct 20 '23 at 12:37
  • @Tim Williams - I've added a picture showing the entire layout : motor and main batteries are connected using car battery wire (cables will be shorter in final application). The MOSFET is under the heatsink, MOSFET drain is connected to the heatsink and upper aluminium bar. The black box is a switch. MOSFET source pin is pressed against the lower aluminium bar by a washer visible at the bottom. Both grounds are connected by the black source wire. Capacitor across the batteries is a non-polarised electrolytic motor starting cap. – Solmyr999 Oct 20 '23 at 12:40
  • MOSFET is an IRFP2907, I chose it because it is rated for high continuous current and has a low Rds on. What do you mean by old and slow MOSFET ? What would you replace it by ? – Solmyr999 Oct 20 '23 at 12:41
  • Just edited my question to add the parts list I used – Solmyr999 Oct 20 '23 at 12:43
  • Hm regarding the ringing issue, it might be because of the fast/violent switching. I faced that issue recently with a DC-DC switching IC, https://electronics.stackexchange.com/a/681271/252145 You can try increasing your 100R resistor to like 2kOhm and see if the ringing reduces – Christianidis Vasilis Oct 20 '23 at 12:53
  • @Solmyr999 The input capacitance of this FET is pretty high; you could user a lower capacitance one for faster switching. I do recommend a gate driver over a 555 though--actually, I recommend most anything over a 555. The length of the wires you're using for the gate driver is also longer than it should be, and your gate resistor is higher than it should be. Disclaimer: I work mostly at much higher switching frequencies than you're using here, so some of what I suggest might be irrelevant at such low switching frequencies. – Hearth Oct 20 '23 at 13:15

1 Answers1

3

Annotated photo:

enter image description here

You have a giant inductive loop around the switching circuit.

This is a lesson on seeing wires as what they really are:

All current-carrying paths have inductance proportional to length.

There is also a geometry factor due to how the wires are laid -- they're making a fairly wide loop here; and for the wire diameter relative to the loop width/length. (Capacitance too, but for other reasons, it isn't important here.)

Generally speaking, the inductance is proportional to length times the inductivity of free space, 1.257 µH/m. Typically the geometry factor is 0.2-0.6, so we expect more like 0.5 µH/m for general wiring. I'm guessing the perimeter here is a good 3m or so, totaling 1.5µH, or in that ballpark.

The fundamental equation of inductance is:

$$V = L \frac{dI}{dt}$$

For a transistor capable of switching over a hundred amperes, even if over some microseconds, that's a dI/dt of 20A/µs easily, or a peak voltage of 30V. Maybe not destructive, but dI/dt may peak higher than this as well, and this adds to switching losses. Not to mention, the fraction of this loop inductance near your driver circuit, drops a fraction of its voltage, which likely explains the ringing waveform.

The ringing frequency will be the transistor's Coss with the loop inductance. This is about 2.1nF, giving a resonant frequency of 2.9MHz. Since it looks to be about 1.5MHz instead, either there's more capacitance than that for some reason; or we can assume it instead, go in reverse, and find 5.4µH loop inductance: perhaps the wiring is longer than I think, or the geometry factor is closer to 1 (or even above).

The diode at the motor is doing much less than it could be. It is, at least, clamping the inductance of the motor itself, but it leaves the wiring unclamped, so the transistor has to deal with all of it.

The capacitor at the battery does nothing; in fact the battery itself has quite a lot more capacitance already. Batteries are essentially capacitors with extra stuff (chemical reactions); they're actually pretty good, generally speaking, at short time scales (100s Hz+). The limiting factor (dominant loop impedance) is the wiring inductance.

Remarkably, we can cure all these problems with a simple rearrangement: move the diode and capacitor adjacent to the transistor.

The explanation for this change should be pretty obvious and understandable now: you have an inductive loop in the wiring, and by adding that inductance in series with the motor's winding inductance, you can handle both in one location (at the drive), while keeping switching noise away from the battery leads (not that it matters here, but it would in a professional automotive application, for example).

Wiring inductance should also be kept lower by pairing conductors. You almost always want the positive and negative/return currents paired together, such as by twisting or tying the wires together, or using cable. For three elements spaced apart as shown here (the drive, motor and battery), you should increase the total wiring length just a bit, so that the motor connects only to the drive, and the drive connects only to the battery -- that is, extend the +24V connection from [battery and motor] down to the drive, so the motor inductance can be clamped there, and a capacitor can locally bypass it. This keeps the current loops local and independent, rather than coupling into everything nearby.

You'll probably need a bigger capacitor too (1000s uF), partly to keep ripple voltage down, partly just because ESR has to be small enough as well (~mΩ).

Finally, with a more compact arrangement, you can look into faster gate drive and transistors.

NE555 is only good for ~200mA, and CMOS even less. A separate driver is required.

Discrete circuitry can be used, boosting that to a fraction of an ampere with fairly simple means (e.g. 2N4401/3 emitter follower), or several amperes if you shop around for suitable parts (e.g. PBSS303NX/PX). Among ICs, yeah, a TC4420 would do fine, but take care, specifically because it is so much more powerful, so much faster, than anything you have worked with so far -- instead of meters of wire being a concern, mere centimeters of wire are a problem!

These drivers are fast and powerful devices; not powerful in the sense of making things move like the motor does, no, but powerful on short timescales, timescales that semiconductors are sensitive to. You can easily cause malfunction from stray switching signals, or outright destruction from excess voltage or current peaks.

When you see PCB layout recommendations, heed them well: do not use perfboard or solderless here; use a "deadbug" or "manhattan" style breadboarding technique instead. Use copper-clad PCB as a ground plane, and route connections on top of that. Make nodes by soldering squares of copper clad on top, or cutting out islands in it. The nearby ground plane minimizes loop area, keeping the inductive geometry factor low, and keeping currents in local loops, flowing where you expect them to flow. You also get a nice common ground connection for free, and it's an excellent RF shield and reference plane.

As for faster transistors: first off, there is some folly in choosing extremely low RDS(on) parts. I've seen newbies do this plenty of times, so it bears some discussion.

Now, the reason for that naivete is pretty obvious; newbies likely don't know how to work with the charge and time parameters, so ignore them, and concentrate on what they do know instead (resistors dissipate power, aha!). That's very understandable.

What's interesting is, it's a folly I've seen professionals make from time to time as well; and even myself occasionally!

So let this serve as a reminder: applications are balanced in multiple aspects, rarely if ever just one variable. Here, don't neglect time or charge or speed; model things in SPICE, or measure them on the breadboard, making sure to model strays/parasitics appropriately, like wiring inductance. And to strategize around their effect, like where and how to probe a circuit to get accurate measurements.

As for the underlying cause, then: if you find yourself skipping over datasheet parameters, I mean to be fair -- it might be because you really don't need them (who cares about the body diode here?..). You don't always need every parameter in every application. But also, if you're not understanding some parameters, or not applying/using them correctly, maybe stop for a moment and think about it; look them up, drill down into them a bit more, see how they're measured, how they're used; or ask!

Which, is actually a pretty good exercise by itself: even just finding definitions of datasheet parameters can be surprisingly difficult, let alone how they're measured or used. (The root cause is, more or less, the industry standards they're cribbing from (JEDEC, JESD, etc.), aren't available publicly, so outside of industry, we never really know what they mean, or why they're chosen for a particular part.) Offhand, Toshiba has a good explainer of parameters they use, and older databooks are often a good resource; old Motorola (now Nexperia, NXP and others) datasheets and databooks, and IR (International Rectifier, now Infineon) databooks and appnotes, can be illuminating here. I'll actually intentionally not add citations here, as an exercise to find them. (If such references end up in the comments, or subsequent edits, consider that spoilers, then. ;) )

Anyway, faster transistors -- despite the above discussion, there is still some value in keeping Rds(on) low. Particularly if capacitances are reduced accordingly. Notice Qg(tot) on that IRFP2907 was around 400, 600nC max? Compare to a modern type like CSD19506KCS NexFET | TI with max 156nC. The gate can switch about three times faster for the same drive, but even more than that, the Miller effect has been reduced extremely well in the NexFET family (see how small the notch/step/plateau is in the gate charge plot!), meaning the drain voltage can transition in a fraction of the time the gate does. Which means less gate drive is required; you still get reasonable load-side switching performance with modest drive input. Now, this is still a fairly large transistor (by "large", I mean die area; gate charge is roughly proportional to die area, while RDS(on) is inverse to it -- which is why lower RDS(on) * QG is a figure-of-merit for device performance; power dissipation tracks with die area as well), and I would probably choose a 1-2A gate driver, or a larger one with series gate resistance limiting it to a similar level (i.e. 4.7 to 15Ω). This affords gate transition time in the 200-300ns range, and drain transition time in a modest fraction of that. (Which, again, if we're switching say 50A in 100ns, that's a huge dI/dt that needs very short, and wide, wiring between MOSFET, clamp diode and bypass capacitor!)

Indeed, both conduction and switching losses can be reduced so well with modern devices, they're largely available in SMTs more than THTs. It's hard to sink power out of an SMT assembly; typically these will be good for just a few watts each. But they're indeed capable of tremendous efficiency, so even a 1kW motor drive can dissipate just a handful of watts, with thermal pads coupling PCBs to heatsinks or the enclosure, and that'll do.

But, as I'm sure you can guess -- it takes quite some engineering to pull off something so precise, to be handling thousands of watts while dissipating dozens. One slight misstep and the whole thing explodes (hundreds of amperes of fault current are available from the battery, nothing a tiny silicon chip can survive for more than hundreds of microseconds!). You will be more comfortable with larger devices, capable of dissipating some power, and switching them a bit more slowly (fractional µs should be okay with modest layout). And it's not like you need to switch the motor at 100s of kHz,a few will do, so the switching speed doesn't need to be anything crazy. Just make sure the switching happens all in one place, keep the MOSFET-diode-bypass loop short, and you'll be sitting well.

Once you have the basic PWM drive down, perhaps study current mode control next? :) Complexity: modest, some comparators and op-amps; advantage: continuous torque control/limiting, complete prevention of locked rotor or inrush surge currents; greatly reduces risk of catastrophic transistor failure!

Cheers and good luck.


Here is an example layout, on PCB, top-down view:

enter image description here

Notice the components are about as close together as possible. A few mm here and there won't be a problem, but the important part is a distance of ~cm between them rather than ~m.

The +V and GND connections are a sandwiched pair over almost the entire board area: the conductors are very wide, and narrowly separated (i.e. by board thickness, ~1.5mm). A small exception to the +V area is the switching/output connection, which is similarly wide. Note that the gate drive connections should be the only ground connection between the control and power circuits; avoid making other ground connections between them, which would create loops.

Tim Williams
  • 33,670
  • 2
  • 22
  • 95
  • Thank you very much for your great answer and the time you took to write it ! I'm indeed an electronics newbie just starting to understand practical circuit design and all the specific advice and good practices you gave me are what I'm looking for. It will take me a few days to process everything you wrote so I might come up with more questions later on. – Solmyr999 Oct 20 '23 at 16:12
  • After a few reads of your answer, here are some questions I have regarding what you told me : I've read everywhere that putting a flyback diode + a snubber across a motor is always a good idea; yet you say that we can move the diode across the mosfet. Will this be equivalent ? Shouldn't we instead add a diode across the mosfet ? Isn't the body diode supposed to play that role for the mosfet ? (maybe its performances are poor compared to a proper diode) – Solmyr999 Oct 20 '23 at 16:18
  • Regarding pairing conductors, how can all the inductances be in series when there is a battery in the middle ? You suggest shortening the wire between the motor and battery as much as possible so that the two wires going to the drive can be twisted together to reduce coupling ? – Solmyr999 Oct 20 '23 at 16:26
  • Not "across the MOSFET", just moved over to it. Your circuit is correct so I saw no reason to redraw it. If you like, simply imagine the MOSFET, diode and capacitor close together, and the motor and battery moved out to arbitrary distance (on paired wires each). – Tim Williams Oct 20 '23 at 16:28
  • If I've understood correctly, by putting a diode + capacitor as close as possible across the mosfet drain and source, we deal with all the switching noise and transients in one area to prevent it from interacting with the rest of the circuit ? – Solmyr999 Oct 20 '23 at 16:28
  • Looking at the CSD19506KCS datasheet, there is absolutely no benefit in using a IRFP2907 over it ? (I bought a bunch of them as well) Where can I get information regarding the latest parts and how can I know if a part is outdated ? – Solmyr999 Oct 21 '23 at 11:08
  • "Just make sure the switching happens all in one place, keep the MOSFET-diode-bypass loop short, and you'll be sitting well." Could you please detail this for me ? Especially the mosfet-diode-capacitor setup, I haven't understood it properly and I feel this is a key element in designing power mosfet circuits. – Solmyr999 Oct 21 '23 at 11:17
  • Deadbug construction is soldering component leads to make nodes that are suspended mid-air, whereas Manhattan is soldering these nodes on islands or pads that are right next to a copper ground plane, is that right ? Manhattan seems much easier to make and clearer visually that perfboard. How do you accomodate DIP through hole IC packages on a Manhattan construction though ? Do you extend the pins with wires and suspend the IC or you make smaller pads ? – Solmyr999 Oct 21 '23 at 11:32
  • What do you mean no benefit? I specifically mentioned gate charge as an important parameter, did you see how the values differ? Did you look up the definition for gate charge? Have you understood how that will affect your waveforms? (If not, and you haven't found an existing answer to them, these would make excellent new questions.) – Tim Williams Oct 21 '23 at 11:49
  • 1
    Well, there are many ways to do it, but what I like is to cut pads out of a piece of copper-clad and surface-mount parts to that. DIPs can have the leads bent out, which looks like this: https://www.seventransistorlabs.com/Images/Inv1kW_DCDC.jpg a strip can also be grooved with a hacksaw blade, and then glued or soldered down to the main base, to make regularly spaced pads. – Tim Williams Oct 21 '23 at 12:02
  • Sorry, I think I wasn't clear enough in my comment. I meant to say that the CSD19506KCS is superior in every way to the IRFP2907. Therefore there is no benefit in using an IRFP2907. Performance of the CSD19506KCS is similar but its gate charge is much smaller, which means less drive power required, faster switching time and therefore much better efficiency with less thermal losses. – Solmyr999 Oct 21 '23 at 12:14
  • Oh I see, yes :) – Tim Williams Oct 21 '23 at 12:15
  • Thanks a lot for your edit, I think it allowed me to finally understand what you meant. Please take a look at the edit in my question : I've made a schematic drawing equivalent of your PCB; please tell me if I'm wrong. – Solmyr999 Oct 21 '23 at 12:44
  • Yes, you've got it! – Tim Williams Oct 21 '23 at 12:55
  • Ok, I think I know what to do next to improve my circuit : layout the control circuit using manhattan construction, use a ~1-2 amps gate driver, very thick and short driver-gate connection, use deadbug construction for the power switching circuit with ground plane and very short and thick leads , use 1000 µF cap, replace IRFP2907 with CSD19506KCS, screw mosfet to a cpu heatsink, use twisted pairs to connect the motor and the batteries to the power switching circuit – Solmyr999 Oct 21 '23 at 14:39
  • One last question : would you parallel two CSD19506KCS to spread the heat or one is enough in this case ? Thank you again for your time and knowledge – Solmyr999 Oct 21 '23 at 14:41
  • I don't know your motor rating or expected operating range so I've only picked something comparable to what you started with. – Tim Williams Oct 21 '23 at 15:04
  • An extreme approximation I would make is at maximum 100 amps going through the mosfet for a few seconds when the motor is heavily loaded. I think I will go with two paralleled mosfets just to be on the safe side. – Solmyr999 Oct 21 '23 at 15:13