1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

problem with PWM signal

Discussion in 'Electronic Projects Design/Ideas/Reviews' started by maicael, Nov 1, 2013.

  1. audioguru

    audioguru Well-Known Member Most Helpful Member

    Joined:
    Mar 16, 2004
    Messages:
    32,447
    Likes:
    937
    Location:
    Canada, of course!
    Aren't you making a low frequency inverter with a higher frequency PWM signal that is actually not very high?
    Then you do not need those huge power transistors to drive the Mosfets, ordinary little transistors will be fine. But the big transistors will work if that is all you have.
     
  2. MrAl

    MrAl Well-Known Member Most Helpful Member

    Joined:
    Sep 7, 2008
    Messages:
    11,032
    Likes:
    952
    Location:
    NJ
    ONLINE
    Hi,

    Well they look like they should work for this but a test is in order. Maybe you can test the circuit and see if the MOSFET switches ok.
    Normally smaller transistors are used so these would be a bit of an overkill, as long as the gain is high enough.
     
  3. maicael

    maicael Member

    Joined:
    Jul 11, 2013
    Messages:
    173
    Likes:
    0
    Location:
    nigeria
    hello again,
    1) can a comparator like say LM339 or LM393 or any at all be used to construct an "error amplifier" or a differential amplifier as they call it?
    2)it seems that a signal passed into the inverting input of a comparator inverts the signal for example when comparing a triangle with a DC and i put the triangle at the inverting input i noticed that Duty Cycle increases as the DC control voltage also increases.
    i am just wondering why we need to invert signals in the first place.
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. maicael

    maicael Member

    Joined:
    Jul 11, 2013
    Messages:
    173
    Likes:
    0
    Location:
    nigeria

    on a side note does anyone know any high speed switching schottkey signal diodes similar to the kind of work the popular 1N4148 diodes do.
     
  6. audioguru

    audioguru Well-Known Member Most Helpful Member

    Joined:
    Mar 16, 2004
    Messages:
    32,447
    Likes:
    937
    Location:
    Canada, of course!
    No. A comparator cannot he an amplifier because an amplifier has negative feedback that cannot be used with a comparator (there is one exception when the frequency is extremely low and a pretty big capacitor is on its output to ground). The output of a comparator must switch high and low and not ne linear.

    A comparator has a differential inputs and very high gain to "compare" signal voltages on its inputs. It is normal for the output duty-cycle to change when comparing a triangle-wave with a changing DC voltage. That is how PWM works except the changing DC voltage is a sinewave with a faster changing DC voltage.

    That is how a comparator works. One input is inverted as part of the comparing process. If you invert the output then the it will have the same phase as the previously inverted input but the other input will be inverted art the output.
     
  7. maicael

    maicael Member

    Joined:
    Jul 11, 2013
    Messages:
    173
    Likes:
    0
    Location:
    nigeria
    hello,
    pls i just want to ask if after using the LM393 comparator to generate PWM if i could use the unused comparator to act as a buffer for the PWM even though i know that the PWM would still work.
    i just feel weird when i have to ground the unused inputs as i feel like i am wasting precious silicon or whatever material used in creating it.
    hope buffering wont affect the PWM wave form at all if it is possible to do so.
     
  8. audioguru

    audioguru Well-Known Member Most Helpful Member

    Joined:
    Mar 16, 2004
    Messages:
    32,447
    Likes:
    937
    Location:
    Canada, of course!
    There is no need to buffer the output of one comparator with another comparator. If you do it then you are doubling your chances of comparator failure.
     
  9. MrAl

    MrAl Well-Known Member Most Helpful Member

    Joined:
    Sep 7, 2008
    Messages:
    11,032
    Likes:
    952
    Location:
    NJ
    ONLINE

    Hello there,

    Buffering is only needed if the output of previous stage can not drive the next stage. This can occur when the comparator itself cannot pull the output to ground with enough current or the pullup resistor has to be relatively high because of that stage's design. If it is only about the pullup resistor being too high then a following stage will help in providing the next stage with a lower drive impedance and if it is enough then all is well, but if you need more drive then you have to go to a transistor or more.

    Comparators can act as op amps, and op amps can act as comparators, but each of these means there are a couple of tradeoffs. To use an op amp as a comparator we have to put up with the relatively slow response of the op amp. To use a comparator as an op amp we have to first use a pullup resistor and second make sure it is compensated properly with a compensation network (sometimes this is just a small value cap from output to the inverting terminal, which makes the comparator act like an op amp), and then it can act like an error amplifier with asymmetrical output drive.
    It's usually better to use the right part for the job, but sometimes we try to get away with using an unused portion of a multi sectional chip and so we try to come up with ways to use the unused sections rather than add a whole chip. An example of this is when i designed a triac controller a long time ago. I needed one op amp and one comparator, but didnt want to have to use an LM358 and a LM339 (or similar parts) as i only needed ONE comparator. So i used one section of the LM358 as op amp and one section as comparator and it worked just fine without any real tricks. Note also though that the op amp can be faster if the output does not have to change much.

    If you have more questions it would also help if you draw a quick schematic, if you can that is.
     
  10. maicael

    maicael Member

    Joined:
    Jul 11, 2013
    Messages:
    173
    Likes:
    0
    Location:
    nigeria
    hello,
    i want to ask your opinion about this configuration which i intend to use as part of the feedback system to maintain steady output voltage.
    the diagram uses a 4N35 optocoupler and from the diagram Vout will be connected to the input of an error amplifier which already has a reference voltage already and from there duty cycle will be duly adjusted as per needed.
    i am trying to eliminate the need to use a small feedback trafo as i want to reduce amount of components.
    what do you guys think?
     

    Attached Files:

  11. MrAl

    MrAl Well-Known Member Most Helpful Member

    Joined:
    Sep 7, 2008
    Messages:
    11,032
    Likes:
    952
    Location:
    NJ
    ONLINE
    Hi,

    I think if you connect the bridge rectifier direction to the 220vac output then the diodes forward drops have less influence on the voltage measurement.
    That would put the 220k resistor on the DC side of the bridge rect.

    Also consider that with 1ma input you only get about 0.7ma output, so the resistor values on the output probably have to be increased.

    Also, LED efficiency drops with age, meaning less light output over time, and it is somewhat exponentially related to the drive current. So the lower the current the better the aging is so the more stable the output voltage will be over long time periods like years. I would think 1ma should be ok though, but it depends on the max current of the LED. One tenth the max current should be ok.
     
    Last edited: Feb 8, 2014
  12. maicael

    maicael Member

    Joined:
    Jul 11, 2013
    Messages:
    173
    Likes:
    0
    Location:
    nigeria
    Hello Sir,
    1)Basically the 220k resistor should be between pin 1 of the 4N35 and the postive DC voltage output after rectification so that voltage measurement would be as accurate as possible?
    2)it is also possible that i can choose to increase the 220k resistor to a higher value so as to reduce the input current based on your explanation about the drive current.i will try to study the datasheet again anyway.
    could you elaborate here better please?
    also what actual resistors at the output would have to be increased?
     
  13. maicael

    maicael Member

    Joined:
    Jul 11, 2013
    Messages:
    173
    Likes:
    0
    Location:
    nigeria
    here is an error amplifier constructed to work with the proposed 4N35 optocoupler circuit.
    The TL082 is set up as an error amplifier with a steady 5v reference.
    the inverting input is biased but this was done so that even without voltage correction i can still manually control output voltage.
    Vin receives sample of output voltage from 4N35 output added to the biased voltage and the error amp does the rest.
    what are your opinions?
     

    Attached Files:

  14. audioguru

    audioguru Well-Known Member Most Helpful Member

    Joined:
    Mar 16, 2004
    Messages:
    32,447
    Likes:
    937
    Location:
    Canada, of course!
    You do not want to rectify the feedback signal which will squash the peaks reducing the amplitude of the sinewave and its filter will act very slowly.
    Instead you want the feedback signal to be a sinewave that adds to or subtracts from the original 50Hz sinewave that feeds the comparator.
    Then it will regulate the output voltage immediately without distortion.
     
  15. MrAl

    MrAl Well-Known Member Most Helpful Member

    Joined:
    Sep 7, 2008
    Messages:
    11,032
    Likes:
    952
    Location:
    NJ
    ONLINE
    Hi,

    Well i was actually wondering why you have a 100 ohm 5 watt resistor at the output of the opto coupler.
    I see now you also have a 10k pot with the 470 ohm resistor so that might be ok.

    Also, why a 5 watt for the 220k?

    With 1ma input to the opto coupler LED, the output current will be around 0.7ma roughly, which is 70 percent of the 1ma input. That 0.7ma has to drive the next stage.
    I guess you intend to drive the error amplifier with that signal?

    Where is that triangle wave coming from, what is that for? Is that for regular PWM?

    It is nice that you are providing drawings now, but i think it would be better if you could get better scans as the pictures lack contrast so are harder to read. Maybe more lighting would help there if you use a camera.
     
  16. maicael

    maicael Member

    Joined:
    Jul 11, 2013
    Messages:
    173
    Likes:
    0
    Location:
    nigeria
    hello audioguru,
    pls i am a bit lost here as to what you are trying to say.could you elaborate a bit better please.Thanks
     
  17. audioguru

    audioguru Well-Known Member Most Helpful Member

    Joined:
    Mar 16, 2004
    Messages:
    32,447
    Likes:
    937
    Location:
    Canada, of course!
    You are making a PWM sinewave inverter with a 50Hz Bubba sinewave compared to a high frequency triangle wave.

    Add a new opamp with the Bubba sinewave on its (+) input and you attenuate the output of the inverter and use it as negative feedback to the (-) input of this new opamp. The output of this new opamp becomes the sinewave input on the comparator.
    If the inverter output sinewave has a low amplitude then the negative feedback will increase the level of this new sinewave. If the inverter output sinewave has an amplitude too high then the negative feedback will decrease the level of this new sinewave.
    Because the inverter output is filtered then the output of the Bubba oscillator needs the same filter so that their phases match.
     
  18. maicael

    maicael Member

    Joined:
    Jul 11, 2013
    Messages:
    173
    Likes:
    0
    Location:
    nigeria
    hello,
    on a side note does anyone know any schottkey fast signal switching diodes that performs as good as the regular 1N4148 diodes.its funny as i have tried to ask around here but people dont know the name schottkey so i guess i have to look for their parts number.
     
  19. MrAl

    MrAl Well-Known Member Most Helpful Member

    Joined:
    Sep 7, 2008
    Messages:
    11,032
    Likes:
    952
    Location:
    NJ
    ONLINE
    Hi,

    There are the 1N5817 and similar diodes. What do you need this for?
     
  20. maicael

    maicael Member

    Joined:
    Jul 11, 2013
    Messages:
    173
    Likes:
    0
    Location:
    nigeria
    just comparing performance with the regular 1N4148 signal diodes.
    The schottkey diodes have a lesser voltage drop so i am wondering if this will mean anything significant as i was testing some simple oscillator cicuits where the 4148 was used.
    just being curious and playing around.
     
  21. MrAl

    MrAl Well-Known Member Most Helpful Member

    Joined:
    Sep 7, 2008
    Messages:
    11,032
    Likes:
    952
    Location:
    NJ
    ONLINE
    Hi,

    Well the lower voltage drop is usually a welcome specification, but the final decision always depends on what application it will be used in, the exact circuit location.
    The Schottky diodes have more leakage, but that's not usually too much of a problem except in an application that needs very low leakage.
     

Share This Page