Complementary PWM generator with deadtime

Discussion in 'General Electronics Chat' started by cmartinez, Aug 13, 2018.

  1. cmartinez

    Thread Starter AAC Fanatic!

    Jan 17, 2007
    5,362
    6,289
    I need to PWM a motor with an n-FET using an already existing function in an MCU. That's the easy part, because I already know how to do that. What I'd like to do now, is to generate a complementary signal that will be used for EMI suppression purposes. But this signal must have an independent delay-start and a delay-end with respect to the original signal, as shown in the following graph.

    upload_2018-8-13_11-10-11.png

    A requirement is that the complementary wave must be generated outside the MCU, mainly to avoid programming overhead. Another requirement is that D-st and D-end must be independent of each other, and easily adjustable in order to account for the different gate rise and fall times of the mosfet being driven. Frequency range will be between 10 and 28 KHz

    After some thought, I realized that generating D-st is not that complicated, but that I cannot predict the future to generate D-end, since the reference signal must always be the original PWM function. And D-end has a negative value with respect to PWM.

    The solution that came to mind was to generate a delayed replica of the original PWM wave to drive the motor's mosfet, and then generate the complementary function referenced to the original PWM one to drive the EMI suppresor circuit. This way all delay values would stay positive, the downside being that I'd need to generate three different delays instead of two. Those would be: Da, Db and Dc; as shown in the following image:

    upload_2018-8-13_11-11-5.png

    An advantage is that Da can stay constant, and only Db and Dc must be adjustable. Using a couple of pots for this purpose would be an acceptable solution.

    My first thought was to use a set of 555/556 chips to accomplish this, but I'm beginning to think that maybe there's a simpler (and, especially, more reliable) solution out there. Maybe using gates, flip-flops or whatever? It also occurred to me that a slave MCU could also be used to accomplish this, but that seems like an awful waste of resources.

    What do you guys think?
     
  2. cmartinez

    Thread Starter AAC Fanatic!

    Jan 17, 2007
    5,362
    6,289
    After browsing through the multitude of enthusiastic answers and well-meaning and valuable opinions posted in this thread so far [/END SARCASM], I've come to the conclusion that the best thing to do would be to use the already-familiar PIC10F322 that has a CWG built-in function with the exact features that I need. The device is cheap, easy to program, and has the low pin-count desirable for my design. Only downside maybe is that the "easy to adjust" requirement is met only halfway, this because the delay values can only be changed by reprogramming the device.

    Another thing is that the PIC10F322 doesn't have UART nor SPI interfaces that would allow to serially communicate with it, and command it to dynamically change the PWM duty cycle ... but I'm going to start looking into other members of the PIC family and see if any of them come with a UART port, and PWM and CWG functions; and possibly use one of them as a complete solution to this problem
     
    ebeowulf17 likes this.
  3. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    8,634
    1,969
    That PIC has a 3-channel ADC. If you put a couple of pots on two of the channels you could read their values and adjust timings in software.
     
    cmartinez likes this.
  4. OBW0549

    Well-Known Member

    Mar 2, 2015
    2,490
    2,103
    I haven't looked, but I would be absolutely shocked if there aren't a multitude of such PICs to choose from.
     
    cmartinez likes this.
  5. cmartinez

    Thread Starter AAC Fanatic!

    Jan 17, 2007
    5,362
    6,289
    Yeah, I already found quite a few, thanks. I used digikey's parametric search, because Microchip's parts select page sucks.
     
  6. jpanhalt

    Expert

    Jan 18, 2008
    6,292
    1,173
    cmartinez likes this.
  7. ebeowulf17

    Well-Known Member

    Aug 12, 2014
    2,277
    399
    If you did choose to try the original scheme, couldn't you reduce Da to a point where Da and Dc were the same, thereby only needing two delay values?

    I guess, depending on how it was physically implemented, maybe having the values match doesn't matter, since you still need two physically separate timers to delay the two different signals.
     
  8. cmartinez

    Thread Starter AAC Fanatic!

    Jan 17, 2007
    5,362
    6,289
    Da has to be greater than Dc, otherwise Dc would end up being negative ... and negative time is something that I'm unable to achieve without Dr Strange's green infinity stone ... :D
     
  9. ebeowulf17

    Well-Known Member

    Aug 12, 2014
    2,277
    399
    I understand negative delays are... difficult, to say the least!

    Sorry, I totally mis-wrote my last post. What I should've said is reduce Da until Dc is zero (not until Da = Dc; that would be silly!) DelCOMP could transition at the same time as PWM, so long as DelPWM has the appropriate Da delay.
     
    cmartinez likes this.
  10. freeman3020

    Member

    Jun 18, 2017
    34
    4
    You can use this circuit

    use ic 7414, and resistor like 100ohm and capacitor 10n

    it's make good complementary for signal

    [​IMG]
     
    cmartinez and Bordodynov like this.
  11. Bordodynov

    Well-Known Member

    May 20, 2015
    1,821
    549
    See
    draft22.png
     
    cmartinez likes this.
  12. freeman3020

    Member

    Jun 18, 2017
    34
    4
    i prefer to use 74LS14 , HC is CMOS and very noisy , not stable in complementary
     
  13. Bordodynov

    Well-Known Member

    May 20, 2015
    1,821
    549
    Perhaps this was due to the fact that you used a large capacity (10nF).For CMOS it is not recommended to use such a large capacitance.With this capacity, the microcircuit is heated.
    In the second stages, you can use the MIC1557 timer, which has a fixed hysteresis (1/3 and 2/3 thresholds from the power supply).
    But of course it will be more expensive.
     
  14. cmartinez

    Thread Starter AAC Fanatic!

    Jan 17, 2007
    5,362
    6,289
    Beautiful circuit! ... I'll be changing R2 and R5 with 10k pots configured as rheostats, and add a 5K resistor in series to R5, to match the last circuit. Then I'll test it and see the resulting adjustment range. Many thanks to both!
     
  15. danadak

    Well-Known Member

    Mar 10, 2018
    1,466
    305
    Dead band in PSOC, but dead clocks setting is for both edges, eg. symmetrical.

    Quad out, True and Complementary.

    And of course Verilog or schematic capture capability should you so choose.


    Need four or more of them, no problem, just drag/drop/config.

    Regards, Dana.
     
Loading...