Low pass filter for PWM

Discussion in 'General Electronics Chat' started by HellTriX, Aug 16, 2008.

  1. HellTriX

    Thread Starter Active Member

    Apr 11, 2008
    83
    1
    Hiya, was wondering if someone could help me with a simple low pass filter for my PWM driver. The frequency is 20khz so I would like to add a filter to keep it from oscillations above that. I think its oscillating in the mhz range but I can't be certain my scope is not good enough to pick it up, but the driver gets real hot real fast once the main 20khz disappears. So my only guess at this point is oscillation. I added a resistor at one point and it was more stable.

    Not sure how to design a filter for a square wave.

    tnx
     
  2. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    A square wave is the sum the fundamental frequency and of all odd harmonics of the fundamental frequency. You would not want to filter out the high frequencies, as the shape of your square wave would go right in the toilet.
    Check out this Wikipedia page: http://en.wikipedia.org/wiki/Square_wave
    Here's an animation from that page to illustrate what I'm talking about:
    [​IMG]

    Post a schematic of what you have; maybe we'll be able to figure out what's going on.

    At 20kHz, the drive requirements of a lot of MOSFET gates becomes pretty significant. Seems to me you were planning on having around 10 MOSFETs all being driven at the same time. That's a lot of gate charge.
     
  3. HellTriX

    Thread Starter Active Member

    Apr 11, 2008
    83
    1
    It was working good with a resistive load. I added a motor as a load now and having problems with gate drive.

    I was pushing 24v at 50amps into the resistive load nicely, and now with just 24v and 3-5amp motor load its causing problems.

    I admit my gate drive wire is like 8-9 inches long :p

    I will fix that later as well as the schematic. Its 97F in my lab right now and I don't feel like turning the AC back on in there hehe.
     
  4. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Hmm - do you have power diodes across the bridge to take care of reverse EMF, and small caps (330pF-1nF) across those diodes to buy them time to turn on?

    MOSFETs driving an inductive load without reverse-EMF "flywheel" diodes can get zapped mighty quick.
     
  5. HellTriX

    Thread Starter Active Member

    Apr 11, 2008
    83
    1
    After I burned out one driver chip, I did add a diode and well as a 15v zener. I havne't added a capacitor since I wasn't sure what size to use. So now I will try a capacitor size as you metioned.

    I was worried about just putting in a capacitor not knowing if it would slow the turn on/off time to the point of overheat/destruction.
     
  6. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Well, the cap goes across the power diodes in the bridge.

    It just buys the power diodes some time to conduct. Reverse-EMF spikes happen very quickly, and big diodes are very slow to turn on. There's a trade-off between buying time for your big rectifiers to conduct, and having a lot of capacitance to charge/discharge when the bridge switches polarity. 1nF would probably be on the excessive side, but it's hard to say without looking at how fast your MOSFETs are actually getting turned off, and what the turn-on time is for your flywheel rectifiers.
     
  7. HellTriX

    Thread Starter Active Member

    Apr 11, 2008
    83
    1
    Oh I c what you mean.

    I have measured the on off time of the parallel mosfets at 90-120ns.
    The diodes I'm using are STTH60P03S. Looking at the datasheet it seems like the reverse recovery time is 60-30ns as a derivative current over time. Then the forward recovery is much higher at >400 to ~75ns.
    Are we looking at the forward recovery here? So we would need a capacitor to drop the 400-75ns time down a bit?

    Side note, I have measured the output switching signal with the scope and their is almost no over/undershoot. Less than 50mV.
     
  8. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Ahhh, how are you using those diodes? They're common cathode.

    An AKAK configuration would've been more appropriate. A to ground, KA to one side of the load, K to Vdd. Use one on each side of the bridge.
     
  9. HellTriX

    Thread Starter Active Member

    Apr 11, 2008
    83
    1
    Seem to have muted one of the problems. I put a 470M ceramic capacitor across the ground and positive input of the driver. I had a .1mf electrolic there before, guess it was insufficient. I did build another driver to a pcb and attached it right beside the mosfets, but I should have checked it before I did. It appears the driver defective right out of the package.
     
  10. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    I don't know what you're doing. I don't see a schematic posted.

    (hint, hint)
     
  11. HellTriX

    Thread Starter Active Member

    Apr 11, 2008
    83
    1
    Got the schematic nearly done in eagle. Too tired to finish it, will have it up after sleep.
     
  12. HellTriX

    Thread Starter Active Member

    Apr 11, 2008
    83
    1
    Ok Schematic time:
    It may not be 100% accurate, I gotta go over it while looking at my circuit. (I have my logic circuit and current sense stuff disconnected at the moment).
    I seem to be having a problem right when the duty cycle hits 0, or something less than 1%. I'm not entirely sure. It basically reacts the same way is leaving the mosfets gates disconnected and they go off into oscillation land except that it won't recover when duty cycle comes back up. The output from the 555 is still good but the gate driver just seems to shut down. Oh speaking of which, my gate driver is a 5 pin that I represented with the 8 pin. The driver is driven by the 555 with both pins on the 3710 connected (the reason I got this particular driver since it gives the correct output logic with both pins going high/low at same time).

    [​IMG]
     
  13. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    OK, your LM317 requires a minimum load of 10mA to ensure regulation. If it's an LM317L, then 5mA. To ensure a 10mA minimum load, a 120 Ohm resistor should be used between the OUT and ADJ terminals; in your diagram it's R2.

    Now, your Vref may vary between 1.23v and 1.27v (that's the voltage between OUT and ADJ). At any rate, the current from the ADJ terminal to ground/resistor R3 is what will determine your output voltage. So, if your Vref is 1.25v (which they nominally are, but measure yours to be certain) then a 120 Ohm resistor between OUT and ADJ will give you I=E/R, or 1.25/120 = 10.4166...mA current. From there, it's Vout = Vref + (I x R3), or R3 = (DesiredVout - Vref)/10.4166...mA

    So if you want a Vout of 11 (which it appears from your 1k and 7.8k resistors), and your Vref is in fact 1.25, then:
    R3 = (11-1.25)/10.4166...mA = 9.75/10.4166.. = 936 Ohms.

    Rather than replacing both R2 and R3, you could add a resistor from Vcc to ground that would guarantee a minimum 10mA load. R=Vout/10mA - but since your R2 is already pulling 1.25mA, you could go with R=Vout/8.75mA = 11/0.00875 = 1257 Ohms.

    You have a 0.1uF cap on the output of the LM317. This is good for supression of high frequency transients, however it is not sufficient for the kinds of transients that a 555 timer will generate, particularly when you are at very low PWM%. You'll get a 200mA surge in one direction and an immediate 200mA surge in the other direction. This is like shorting out the output of the LM317 for a moment, and it's throwing your UC3710 into a tizzy.

    I suggest that you add a 220uF low-ESR cap across Vcc/ground right at the 555 timer. Keep the 0.1uF cap, too

    You should have a 0.1uF and a 10uF cap at the output of the LM317. If the supply lead to the LM317 is more than 6" or so, put a .1uF and a low-ESR 220uF cap at the input.

    Your UC3710 needs a bypass cap across it's Vcc and ground leads too. It has a much higher load than the 555 at +4A/-4A. The gates of all of those MOSFETS will be trying to charge and discharge in the blink of an eye.

    You will avoid a LOT of problems if you simply limit the minimum and maximum PWM range. If you don't want to do that, then consider increasing C1 to decrease the frequency of your timer. Something's gotta give somewhere.

    Oh, the output of your 555 timer isn't connected to the UC3710. That'll make it tend to not work very well ;)
     
    Last edited: Aug 17, 2008
  14. HellTriX

    Thread Starter Active Member

    Apr 11, 2008
    83
    1
    Actually the discharge pin of the 555 drives the 3710.

    What size cap you think I should use across the driver chip?
    I have just a .1uf there now. Don't think I have any low ESR caps except the 1pf - 47nf ceramics, will have to get some.

    I have also thought about limiting the duty cycle from 2-5% to about 98% and then bypass the driver with either 0v drive or 11v drive to the mosfet gates to put them full on or full off. Unfortunately I haven't came up with a clean way to do it and have not put much thought into it yet.

    I will now improve the 317 stability 10ma load, and add the recommended caps at different places.

    If and when it becomes stable I will add the rest of my circuity and update the schematic. Quite a large project I jumped into.
     
  15. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Really - why the discharge pin? It's pin 3 of the 555 that has the rated current output. I haven't looked at what one might get out of the discharge pin, but I'm sure it's not going to be nearly as robust as pin 3.

    That'll depend on how long your supply lines are, I suppose. Those gates are going to need a LOT of current, and you need a "storage tank" in the form of capacitors nearby to draw from. You'll probably need several different sizes; 0.1uF to take care of the higher frequency transients, 10uf, 220uF, perhaps as much as 1000uF. The large value caps have a considerable amount of parasitic inductance, which hampers their ability to accept/release a charge. The smaller caps are sort of like a "bucket brigade". Put the smallest caps closest to the IC itself, with leads as short as possible from the Vcc to the ground pin. That minimizes parasitic inductance.

    How about a pot with a switch on the bottom?

    OK. I didn't do an exhaustive analysis of your circuit. It wasn't really possible since you left off some critical values, like the size of the pot on the 555 timer. You might actually be drawing at least 10mA all the time, but I simply can't tell by the information you've given.

    Complete documentation of your project is really rather important. Otherwise, you will hate yourself six months or a year down the road when something breaks, and you've forgotten why you did something. It took a lot of work to get this far; best to document it while it's still pretty fresh in your mind. Less chance for errors, and much less work if you do it now.

    You might want to submit it for a proposed design review, showing what is, and what you're thinking of adding. Might save you time and $$$, and you might wind up with some interesting added features too.
     
  16. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    OK, after some searching of various datasheets I've downloaded (actually, five of them...)

    ST Microelectronics says that the discharge pin of their version of the NE/SE/LM555 timer can sink 15mA with a supply of 15v, or 4.5mA with a supply of 5v. With 11v Vcc, you're probably able to sink 10mA with the discharge pin (that's quite a bit less than the output, but I'm rolling with it.)

    You're using R1, a 10k resistor to source current to the input of your UC3710 from your 11v supply. This is a maximum supply current of 1.1mA. The input current to your digital in isn't much - but it doesn't say what kind of capacitance it might have. You also have the 100 Ohm resistor R4 in the current path to slow things down. I don't know if the input to the UC3710 is a Schmitt trigger, but if it isn't, the less time the input spends between 0.8v and 2v, the better.

    So, the target is to split the difference, and have the discharge transistor sink 1/2 of it's capacity, or 5mA. This should cut the rise time of the input signal for the UC3710. Yes, the fall time will increase, but not as much as the rise time will decrease.

    R1 = 11v/5mA = 2.2k Ohms.
    You'd likely be better off with a voltage follower arrangement, but let's not overcomplicate things at the moment.
     
  17. HellTriX

    Thread Starter Active Member

    Apr 11, 2008
    83
    1
    great help! ty :)

    I realize the design for the 555 is a lil different, but it was one of the few I found that had such a great PWM resolution. I believe it goes from 0 to 100%. I've observed it but had a bit of noise so I can't say for certain if its truly 0-100%. I always wasn't aware of the low source/sink of the discharge but at the time I wasn't too worried about it since the UC3710 appears to be a schmitt trigger input. I'll also balance the source/sink like you recommend. It may help if I have something weird going on.

    Underload when its working, even at high current the switching signal at the mosfet gates is near perfect. The output is like a mirror image. Such sharp slopes my scope can hardly measure the rise/fall and dead time.

    Also I realized as you made some suggestions for my supply lines to the UC3710. Didn't even realize my error. I'm using about 12-13 inches of 22awg wire to my lead acid bank. And giving I'm switching up to 8amps in under 100ns It sounds like 22awg is weak. Caps may help but I should probably switch them to 10awg including some caps.

    Good idea, I will get around to adding the rest of the schematic over the next few days (maybe) this is my finals week then I get a month off from the university so I may not be able to pick this back up for 4 days. Also the rest of the schematic is the logic, current sense, power supply, and other protection circuits. They are still in their first prototype phase but are tested as working individually :p So tying them all into the schematic will be interesting.
     
  18. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Well, it won't be quite 0% or quite 100%. It could get pretty close, but even if your PWM pot is up against one stop or the other, there will still be a small RC time across one of the diodes (D1/D2) and C1.
    Wouldn't hurt to have a 0.1uF cap from the high side of R1 to ground either, but we're getting into overkill territory. I didn't see anything in the datasheet for the UC3710 datasheet stating that it had a Schmitt-trigger input; only the input voltage levels of what it considered to be a logic high or logic low. The in-between is the "no-man's land", or indeterminate voltage level that you want to spend as little time as possible in.

    That's a good sign.

    Well, AWG 22 can carry up to 7A when used for chassis wiring - which you are. But I'd bring it up to at least AWG 18, and most certainly use bypass caps right at the IC. Otherwise, you're going to have a pretty unstable supply, particularly when you're at very low or very high PWM settings.
    You don't have to have them all in the same schematic. Just use connectors or terminals with signal names to show where the signals are coming from or going to. Have one sheet that's a functional block diagram, naming each functional component and what the basic interconnections are.
     
  19. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Just noticed something else - on your schematic, you say that Hin and Lin are tied together. Actually, they are called the inverting input and the non-inverting input. They shouldn't be tied together.

    If you want a non-inverted output, then tie the inverting input to ground and feed your PWM signal to the non-inverting input. This was how they obtained their total supply current @ 200kHz (see note 5, bottom of page 3)
     
  20. HellTriX

    Thread Starter Active Member

    Apr 11, 2008
    83
    1
    Oh, I just looked at my circuit, I did tie the other pin to ground. And fed my input to the other pin.
    Also noticed I forgot to add my diodes beside the output mosfets. Even forgot to rename the output mosfets to the correct model number.

    I'll have to see if eagle does functional block diagrams.

    Anyways, off to school, tnx again.
     
Loading...