Author Topic: Help debugging a PWM control  (Read 742 times)

0 Members and 5 Guests are viewing this topic.

Offline awakephdTopic starter

  • Regular Contributor
  • *
  • Posts: 91
  • Country: us
Help debugging a PWM control
« on: July 10, 2024, 07:45:28 pm »
I hope that this is the right place to post this ... I have put together a PWM motor control circuit, as shown in the attached schematic. Let me hasten to say, I don't know if this is utter garbage, or somewhat on the right track ... but currently (pun intended) the N-FET is getting quite hot, just driving a motor at a max of 12V and 350mA.

Supposedly the N-FET is capable of 250V and 50 amps, so it shouldn't exactly be overloaded. It has a max of 38W of thermal dissipation, with .06Ω across D-S at Vg = 10V. Gate threshold is a minimum of 3V; max gate voltage is +/- 30V.

As shown, I am using an optically isolated gate driver ... probably not a very good one ... so my first thought is that it was too slow in rise and/or fall times, leading to extended periods in the higher-resistance range. But I've attached scope shots of the PWM pulse coming in on the gate of the N-FET. As shown, the rise and fall times are in the vicinity of 40ns. Since the PWM frequency is only around 500Hz, I would have thought this was plenty fast to avoid overheating ... ?

However, two other details that show up in the scope screen shots. One is that the drive voltage on the gate is nominally 14V. The second is that there is quite a bit of ringing on any given pulse - sometimes more, sometimes less, but looks like typically it is ringing as much as half-a-volt negative and as much as half-a-volt over the nominal 14V drive - maybe more, as I am not completely sure how to interpret what I am seeing on the scope.

One other bit of information: even if I hold the PWM signal high (on), continuously enabling the N-FET, I am getting a good bit more heat than I would expect from 350mA.

So, questions: 1) Would driving the gate at a voltage greater than the voltage across D-S cause problems? 2) Could the ringing (especially the negative) cause the overheating? (Even though, as best I can tell, the ringing does not rise to the minimum gate threshold voltage? 3) Am I wrong in thinking the rise/fall time on the gate drive is fine? 4) Could the N-FET be defective? I will admit to sourcing it from Ali-Express, so I am wondering if I got "bitten" by a forged part, or something like that.

Perhaps I should add 5) Is my entire circuit junk, and needs to be redesigned?

Any help that anyone can offer will be most appreciated!!
« Last Edit: July 10, 2024, 09:14:03 pm by awakephd »
 

Offline moffy

  • Super Contributor
  • ***
  • Posts: 1910
  • Country: au
Re: Help debugging a PWM control
« Reply #1 on: July 10, 2024, 07:53:01 pm »
I hope that this is the right place to post this ... I have put together a PWM motor control circuit, as shown in the attached schematic.
No attached schematic.
 

Offline awakephdTopic starter

  • Regular Contributor
  • *
  • Posts: 91
  • Country: us
Re: Help debugging a PWM control
« Reply #2 on: July 10, 2024, 09:15:37 pm »
Argh! I hate when I forget to attach the attachment! I have edited the OP and added the attachments. The schematic is in the motor drive.pdf file; the screen shots are PWM_1.png and PWM_2.png (one showing a rising edge and one showing a falling edge.)
 

Offline moffy

  • Super Contributor
  • ***
  • Posts: 1910
  • Country: au
Re: Help debugging a PWM control
« Reply #3 on: July 10, 2024, 09:37:30 pm »
The FDPF51N25 carrying only 0.35A in a TO-220 package and fully on is only dissipating 0.02W so it shouldn't be getting warm. So possibilities:
1. It is carrying more current than expected or is not fully on. How are you measuring current? What does the D-S waveform look like?
2. You have a fake device.
3. You have a defective device.
14V on the gate is no problem it is rated for +/- 30V.
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 6030
  • Country: de
Re: Help debugging a PWM control
« Reply #4 on: July 10, 2024, 09:41:06 pm »
Am I reading your schematic correctly? You're PWM driving a 12 V motor at 180 V?
 

Offline Mahagam

  • Contributor
  • Posts: 39
  • Country: pl
Re: Help debugging a PWM control
« Reply #5 on: July 10, 2024, 09:44:21 pm »
Actually you have no ringing. Try to catch picture with the higher samplerate. Just increase the memory depth.
 
The following users thanked this post: Someone

Offline awakephdTopic starter

  • Regular Contributor
  • *
  • Posts: 91
  • Country: us
Re: Help debugging a PWM control
« Reply #6 on: July 10, 2024, 11:28:54 pm »
The FDPF51N25 carrying only 0.35A in a TO-220 package and fully on is only dissipating 0.02W so it shouldn't be getting warm. So possibilities:
1. It is carrying more current than expected or is not fully on. How are you measuring current? What does the D-S waveform look like?
2. You have a fake device.
3. You have a defective device.
14V on the gate is no problem it is rated for +/- 30V.
Thanks, Moffy. I am measuring current by way of the bench power supply, which is feeding only the "high voltage" part of the circuit (i.e., what is going through the N-FET and motor). I have it set to a maximum of 350mA, but at lower duty cycles it is showing more like 275-300mA.

I am more and more inclined to think the N-FET I was using is a fake part. One thing that I wondered about when I got the part is that the tab is enclosed in plastic (is that a TO-220F? or ??) - that made me nervous about its ability to dissipate heat, though as you say it shouldn't have been getting hot in the first place. And perhaps more conclusively ... it has now failed completely!

I swapped it out for an FDP33N25, which is rated 250V / 33A. So far, it seems to be performing better; unlike the previous part, it runs completely cool when the PWM is 100% (i.e., no actual pulse, just continuous on). It still seems to get a bit hot when the PWM is at a low duty cycle (10-15%), but not when the PWM is at a higher duty cycle (>20%). Odd ...
Am I reading your schematic correctly? You're PWM driving a 12 V motor at 180 V?
No, not at this point, though that sounds like it could be exciting! :) Ultimately I would like to control higher voltage (90 - 180V) DC PM motors with this circuit - thus the rating of the N-FET for 250V / 50 amps (or now, 33 amps) and the indication of a high-voltage DC power supply. But since I am not entirely sure that I know what I'm doing ... I figured it would be a heck of a lot safer to hook up the bench power supply set to 12V, 350mA, rather than the rectified-and-filtered mains - which, yes, is also not 180V, but closer to 160. Did I mention that I am not entirely sure that I know what I'm doing?? :)
Actually you have no ringing. Try to catch picture with the higher samplerate. Just increase the memory depth.
Mahagam, can you say more about not having ringing? Are you saying that this is an artifact of the DSO? FWIW, when I swapped out the N-FET a little while ago, I also experimented with a slightly different configuration and some different values for the resistors at the gate of the N_FET. The original circuit had the 10Ω resistor before the 100KΩ resistor to ground; I changed it so that it now comes after (see R6 and R7 in the attached, updated schematic). In terms of changing values for the resistors, I first tried going with a 100Ω resistor to the gate, and a 1KΩ resistor to ground. This seemed to eliminate the ringing (or what I thought I was seeing as ringing), at the cost of drastically increasing the rise and fall times, to nearly 1υS. I then changed back to a 10Ω resistor to the gate, keeping the 1KΩ resistor to ground; now the rise/fall time is in the vicinity of 100ns; no apparent ringing on the rising edge, but what looks like ringing at the bottom of the falling edge.

Please, anyone, do not hesitate to tell me what I am doing wrong. As you can no doubt tell from the above, though I have dabbled in electronics for many years, my only training is trial and error ... and I'm really, really good at the second part. :)
 

Offline awakephdTopic starter

  • Regular Contributor
  • *
  • Posts: 91
  • Country: us
Re: Help debugging a PWM control
« Reply #7 on: July 10, 2024, 11:35:02 pm »
Well, a little more thought and I realized that, of course the FDPF51N25 was completely enclosed in plastic (TO-220F case) ... that's because it was (or was supposed to be) an FDPF, rather than an FDP.  :palm:
 

Offline moffy

  • Super Contributor
  • ***
  • Posts: 1910
  • Country: au
Re: Help debugging a PWM control
« Reply #8 on: July 11, 2024, 12:33:06 am »
I swapped it out for an FDP33N25, which is rated 250V / 33A. So far, it seems to be performing better; unlike the previous part, it runs completely cool when the PWM is 100% (i.e., no actual pulse, just continuous on). It still seems to get a bit hot when the PWM is at a low duty cycle (10-15%), but not when the PWM is at a higher duty cycle (>20%). Odd ...

Have a look at the drive waveform and the D-S waveform, it sounds like it is not turning fully on and/or some interaction with the PSU current limit, you should set the PSU so that the overcurrent doesn't engage except in a fault condition.
For higher voltages the FET drain will need some high speed clamping to prevent overvoltage and failure. A good starting point is by placing a high speed capacitor across the supply near the FET, polypropylene is a good choice, and a fast reverse diode from drain to supply/fast capacitor to catch any spikes. A snubber across the FET can also be helpful.
 

Offline Circlotron

  • Super Contributor
  • ***
  • Posts: 3240
  • Country: au
Re: Help debugging a PWM control
« Reply #9 on: July 11, 2024, 02:40:36 am »
That ACS712 current sensor in the MOSFET source lead is ringing alarm bells. Any extra inductance in the source lead can play havoc with the gate-source voltage. MUCH better to put the sensor in the drain lead and have the source take as short and direct path to ground as possible.

Also, the fact that there is ringing in the gate drive before each transition is a bit weird. After the transition, sure, but before when everything is quiet...
« Last Edit: July 11, 2024, 02:43:49 am by Circlotron »
 

Offline Mahagam

  • Contributor
  • Posts: 39
  • Country: pl
Re: Help debugging a PWM control
« Reply #10 on: July 11, 2024, 07:18:55 am »
Mahagam, can you say more about not having ringing? Are you saying that this is an artifact of the DSO?
You saw artifacts of the sinc interpolation.
Please, take the image with sample rate 1Gsps or 2Gsps. Or try to switch from sinc(x)/x interpolation to the x.
 

Offline inse

  • Frequent Contributor
  • **
  • Posts: 672
  • Country: de
Re: Help debugging a PWM control
« Reply #11 on: July 11, 2024, 09:29:28 am »
As in your first screenshot at 20MS/s you have a sample every 50ns, so only 4 samples per division at your zoom level.
The interpolation the scope does, gives you funny results like the voltage already trembling in expectation of the pulse.
Turn off the interpolation and be surprised
 
The following users thanked this post: Mahagam

Offline Mahagam

  • Contributor
  • Posts: 39
  • Country: pl
Re: Help debugging a PWM control
« Reply #12 on: July 11, 2024, 09:39:10 am »
Or, instead of turning off interpolation, just increase sample rate to the max value.
 

Offline inse

  • Frequent Contributor
  • **
  • Posts: 672
  • Country: de
Re: Help debugging a PWM control
« Reply #13 on: July 11, 2024, 09:44:24 am »
Sure - I was just proposing to turn off interpolation to see the reality 😳
 

Offline awakephdTopic starter

  • Regular Contributor
  • *
  • Posts: 91
  • Country: us
Re: Help debugging a PWM control
« Reply #14 on: July 11, 2024, 01:31:43 pm »
Have a look at the drive waveform and the D-S waveform, it sounds like it is not turning fully on and/or some interaction with the PSU current limit, you should set the PSU so that the overcurrent doesn't engage except in a fault condition.
If by drive waveform, you mean the signal at the gate of the MOSFET, that is shown in the attached scope shots in the first post. To show the D-S waveform, would I put the probe on D, or S, or put a probe on each and take the difference? Or ... should I be probing the gate and the drain, and see how the timing compares? I am sorry to be asking what are likely to be dumb questions - in addition to the limits of my understanding of electronics, I am just now learning to use my first DSO (I've only used ancient analog scopes in the past).
Quote
For higher voltages the FET drain will need some high speed clamping to prevent overvoltage and failure. A good starting point is by placing a high speed capacitor across the supply near the FET, polypropylene is a good choice, and a fast reverse diode from drain to supply/fast capacitor to catch any spikes. A snubber across the FET can also be helpful.
Could anyone point me to a sample schematic of something like this? I *think* I understand where to put the capacitors, but I don't have any idea what value they should be. For the fast reverse diode, are you talking about something different than D2?
That ACS712 current sensor in the MOSFET source lead is ringing alarm bells. Any extra inductance in the source lead can play havoc with the gate-source voltage. MUCH better to put the sensor in the drain lead and have the source take as short and direct path to ground as possible.
Yes, I gave myself a proper dope-slap a couple of days ago when I realized what I had done. I am not sure what I was thinking! FWIW, the ACS712 uses hall-effect sensing on a straight-through conductor between pins 1 & 2, so maybe, sorta, it kinda is like the FET is connected directly to PGND ... ? Okay, probably not. I have already been pondering how to bodge the circuit board to move the AC712 to where it should be, between the drain and the motor. My poor one-off home-brew PCB already has quite a few bodges on it, but thus far I have gotten lucky; the traces have been placed such that I've been able to make revisions by cutting a trace here and/or soldering an 0603 component across two traces there or so on - no actual bodge wires required. One option I have considered is to remove the AC712 from the circuit and short across, then test the FET circuit; that might be the first step.
 

Offline awakephdTopic starter

  • Regular Contributor
  • *
  • Posts: 91
  • Country: us
Re: Help debugging a PWM control
« Reply #15 on: July 11, 2024, 01:37:00 pm »
You saw artifacts of the sinc interpolation.
Please, take the image with sample rate 1Gsps or 2Gsps. Or try to switch from sinc(x)/x interpolation to the x.

As in your first screenshot at 20MS/s you have a sample every 50ns, so only 4 samples per division at your zoom level.
The interpolation the scope does, gives you funny results like the voltage already trembling in expectation of the pulse.
Turn off the interpolation and be surprised

Or, instead of turning off interpolation, just increase sample rate to the max value.

Clearly this is a place where I have a lot more to learn about using a DSO! I will try both, though I'll have to look for the interpolation setting - still figuring out the many and incredible capabilities of this SDS804X. Question: what are you seeing in the scope trace that helps you know that this is an interpolation artifact? Or to ask it another way, what should I be looking for so that I don't get fooled into thinking I'm seeing signal where I'm actually seeing interpolation?
 

Offline awakephdTopic starter

  • Regular Contributor
  • *
  • Posts: 91
  • Country: us
Re: Help debugging a PWM control
« Reply #16 on: July 11, 2024, 01:38:45 pm »
Thanks to all of you for helping me learn! Again, please do not hesitate to tell me when / if I am doing it all wrong - that will not come as any surprise to me. :) Of course, I'm even more grateful when / if you tell me how to do it right instead!
 

Offline Mahagam

  • Contributor
  • Posts: 39
  • Country: pl
Re: Help debugging a PWM control
« Reply #17 on: July 11, 2024, 01:54:11 pm »
Question: what are you seeing in the scope trace that helps you know that this is an interpolation artifact?
1. Ringing before signal rise/fall.
2. 20MSa/s
 
The following users thanked this post: awakephd

Offline Wolfram

  • Frequent Contributor
  • **
  • Posts: 392
  • Country: no
Re: Help debugging a PWM control
« Reply #18 on: July 11, 2024, 02:11:44 pm »
Your "flyback" diode is in the wrong place. The FET will avalanche the energy stored in the motor inductance on every switching cycle. This diode needs to be across the motor, ideally forming a tight loop together with the MOSFET and the local decoupling caps. I notice those are missing in your schematic as well, you need some caps between the motor supply voltage and ground.
 
The following users thanked this post: Ian.M, awakephd

Offline moffy

  • Super Contributor
  • ***
  • Posts: 1910
  • Country: au
Re: Help debugging a PWM control
« Reply #19 on: July 11, 2024, 02:37:12 pm »
Have a look at the drive waveform and the D-S waveform, it sounds like it is not turning fully on and/or some interaction with the PSU current limit, you should set the PSU so that the overcurrent doesn't engage except in a fault condition.
If by drive waveform, you mean the signal at the gate of the MOSFET, that is shown in the attached scope shots in the first post. To show the D-S waveform, would I put the probe on D, or S, or put a probe on each and take the difference? Or ... should I be probing the gate and the drain, and see how the timing compares? I am sorry to be asking what are likely to be dumb questions - in addition to the limits of my understanding of electronics, I am just now learning to use my first DSO (I've only used ancient analog scopes in the past).
Quote
For higher voltages the FET drain will need some high speed clamping to prevent overvoltage and failure. A good starting point is by placing a high speed capacitor across the supply near the FET, polypropylene is a good choice, and a fast reverse diode from drain to supply/fast capacitor to catch any spikes. A snubber across the FET can also be helpful.
Could anyone point me to a sample schematic of something like this? I *think* I understand where to put the capacitors, but I don't have any idea what value they should be. For the fast reverse diode, are you talking about something different than D2?

1. Look at the Gate to Source waveform for the low duty cycle where you have the strange heating.
2. Look at the Drain to Source waveform under the same conditions to see if it is turning fully on.
3. How you do that is up to you and your setup.
I have attached part of a PWM circuit I designed and use for my CNC3020 milling motor. The capacitors C1(electrolytic) and C12(polypropylene) are very close physically to the MOSFET. The diode D1 is a fast diode to clamp inductive spikes into C1/C12 and R6/C2 provide a snubber to help dampen any ringing.
2308375-0
« Last Edit: July 11, 2024, 02:46:54 pm by moffy »
 
The following users thanked this post: awakephd

Offline awakephdTopic starter

  • Regular Contributor
  • *
  • Posts: 91
  • Country: us
Re: Help debugging a PWM control
« Reply #20 on: July 11, 2024, 03:47:42 pm »
I have attached part of a PWM circuit I designed and use for my CNC3020 milling motor. The capacitors C1(electrolytic) and C12(polypropylene) are very close physically to the MOSFET. The diode D1 is a fast diode to clamp inductive spikes into C1/C12 and R6/C2 provide a snubber to help dampen any ringing.
(Attachment Link)

Thank you so much! Are R12/16/17/18/19 for current sensing (through R10/R11, attached to something outside the right side of the schematic )? If so, does it pose any problem placing this between source and ground? Kind of have to put it there, I'm assuming, to get a ground-referenced voltage? I'm now realizing that this must be why I put the ACS712 in the same location (between source and ground) in my circuit.

If you all get tired of answering my questions, please let me know - I don't want to be an annoyance, but I surely do appreciate what I am learning!
 

Offline moffy

  • Super Contributor
  • ***
  • Posts: 1910
  • Country: au
Re: Help debugging a PWM control
« Reply #21 on: July 11, 2024, 03:57:44 pm »
I have attached part of a PWM circuit I designed and use for my CNC3020 milling motor. The capacitors C1(electrolytic) and C12(polypropylene) are very close physically to the MOSFET. The diode D1 is a fast diode to clamp inductive spikes into C1/C12 and R6/C2 provide a snubber to help dampen any ringing.
(Attachment Link)

Thank you so much! Are R12/16/17/18/19 for current sensing (through R10/R11, attached to something outside the right side of the schematic )? If so, does it pose any problem placing this between source and ground? Kind of have to put it there, I'm assuming, to get a ground-referenced voltage? I'm now realizing that this must be why I put the ACS712 in the same location (between source and ground) in my circuit.

If you all get tired of answering my questions, please let me know - I don't want to be an annoyance, but I surely do appreciate what I am learning!

"Are R12/16/17/18/19 for current sensing?" Yes, a cheap and easy way to get a lowish value current sense resistor, they feedback to a UC3843, current mode PWM which is used in a slightly different way.
 
The following users thanked this post: awakephd

Offline awakephdTopic starter

  • Regular Contributor
  • *
  • Posts: 91
  • Country: us
Re: Help debugging a PWM control
« Reply #22 on: July 19, 2024, 09:35:54 pm »
Sorry for the long delay in following up - today has been the first chance I've had to modify the circuit. As you will see in the attached schematic, I have, for the moment, taken the ACS712 out of the circuit, moved the flyback diode, added the snubber circuit, added bypass capacitors for the motor - essentially copying the circuit that Moffy provided, except with somewhat different capacitor values due to what I had on hand.

On the one hand, the outcome is a vast improvement. The MOSFET is no longer heating up in the same slow-speed range as before (10% or so). I've attached scope shots of the gate (yellow), drain (purple), and source (blue). As you will see, the start of the PWM pulse is fairly clean, but there is a bit of "ringing" after it goes high (ringing in all three signals). The end of the PWM pulse is ... quite exciting, with a LOT of ringing (or at least, that's what I assume it is) going on on all three signals. Given that the MOSFET is happy - at least driving the motor at 12v - I don't know if this is a problem, or related to not having quite the right capacitor values, or yet another artifact of the DSO that I don't yet know how to recognize.

Speaking of artifacts, before I changed the circuit (bodge wires everywhere!) I tested again to show myself what others were observing as far as the interpolation artifacts that seemed to show ringing *before* the signal changed. Yep, sure enough ... switching from sinc to x flattened out those artifacts, as did making sure I had more samples. The learning continues ...
« Last Edit: July 19, 2024, 09:38:18 pm by awakephd »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf