HELP with function generator using IC 555 timer!

Discussion in 'The Projects Forum' started by Narrin, Oct 3, 2011.

  1. Narrin

    Thread Starter Member

    Oct 2, 2011
    47
    0
    Good day,

    PLEASE HELP
    I have a project to simulate and build a low cost function generator. This can be either using Op amps, IC timers or Function Generator IC's.
    I must first simulate this or many examples/types of function generators using the Multisim sotware. It must include a switch for the type of wave (sine,triangular,square) and also a switch to vary frequency.

    I have simulated an IC 555 function generator circuit that i have found on this forum this is the link for the schematic i found in the thread:
    555 Function Generator.GIF

    I have tried to simulate it in Multisim but the output is just constant voltage. I know my schematic has errors somewhere but i do not know where. This is my attempt:
    IC555.jpg

    This is the file in Multisim:
    View attachment BILL design.zip
    I did not fully understand how to make the connections to VCC as shown in the original schematic.
    Someone please help. PLEASE!!
     
  2. Wendy

    Moderator

    Mar 24, 2008
    20,765
    2,536
    Give me a little while and I will redraw my 555 function generator using a CMOS type. It should help with some of the issues you have been having.

    The original design I showed you used a transistorized invertor that used LEDs to help prevent crossover shootthrough, a condition that is very dangerous for the transistors as they can both can be on at the same time. This can blow the transistors. The advantage to the design is it has a very robust drive.

    CMOS 555's do not have a robust drive, it can be very weak. This means the resistor to the op amp must be a pretty high value, or it will load down the CMOS 555 and cause other problems.

    [​IMG]
     
    Last edited: Oct 3, 2011
  3. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Bill,
    Just changing to a CMOS 555 won't fix the problem. You need to reference the noninverting (+) inputs of U2a, U2b and U2c to the virtual ground divider; the junction of R7 & R8.

    [eta]
    I take it back; Bill is showing separate grounds and virtual grounds; Narrin, you need to correct your grounds on the noninverting inputs of U2a, b and c, and remove the ground from the output of U2d. Use a signal ground symbol instead of earth ground for these virtual grounds.
     
    Last edited: Oct 3, 2011
  4. praondevou

    AAC Fanatic!

    Jul 9, 2011
    2,936
    488
    I had a short look at the schematic in multisim.

    C4 and C5 have no function, put them from +9V to GND.
    Q1 should be a pnp. You can use a 2905.
    Your noninverting inputs should be on a voltage level between + and GND, otherwise the circuit can't work. Supply the Opamp with a single supply, put the noninverting inputs at half of the supply voltage.

    Don't short the output of U3D to GND.

    The circuit attached will give you a triangle wave at the output of U2A. I didn't look any further.
     
  5. Wendy

    Moderator

    Mar 24, 2008
    20,765
    2,536
    The above schematic has a major problem. You need LEDs that drop 2.2V to 3.6V, or Zeners that drop more, simple diodes will not work for the design, period. Likely Q1 and Q2 are toast if it is used this way. This was explained in detail in post #2.

    Wookie has already pointed out there is a virtual ground that everyone seems to be ignoring.

    Here is the modified schematic I promised.

    [​IMG]

    I've mentioned the disadvantages of the 7555 (which is one make of a CMOS 555). One of the big advantages is the 1/3 and 2/3 trigger points. Wook as illustrated to me that it can be done with conventional op amps, but the CMOS 555 has a true rail to rail output, if you don't force it to overdrive a resistors it will go to either power supply voltage on the output.

    If I were to wire this design I would use a dual CMOS 555, something like a 7556. This would bring the design down to two chips.

    The wave shaper using U2b and CR1/CR2 is rather crude. There is the possibility of major improvement in this area using additional diodes and resistors.
     
    Last edited: Oct 3, 2011
  6. Narrin

    Thread Starter Member

    Oct 2, 2011
    47
    0
    Okay so I have tweaked the schematic a bit.
    BILL2.jpg

    From the oscilloscopes i am getting the sine,triangular and square waves but with a dc offset.

    That can be fixed at a later date but the problem is that the output from U2C gives me the sine wave, when i flip the switch to get the triangular wave Multisim gives me an error and says the timestep is too small. I have tried changing the timestep settings but is their a problem with the U2C and U3D opamp circuits?? i do not know..

    View attachment BILL design mod.zip

    Edit: i have now seen Bill's new post using the CMOS 555 i will attempt to simulate that circuit
     
  7. Wendy

    Moderator

    Mar 24, 2008
    20,765
    2,536
    Part of the problem is you don't understand what a virtual ground is. Do not use the ground on the scope, use the virtual ground. Look at the schematic I have provided, there is a reason I put the virtual ground next to the other output pins.

    Remember this circuit is powered from a floating power source, such as a 9V battery. The virtual ground is considered the ground from outside the circuit. As measured from the negative lead of the battery virtual ground is ½Vcc. But if you use the virtual ground as the reference the power supply with be ± 4.5VDC.

    If looked at the right way, the DC offset is an illusion.

    [​IMG]

    You also still have problems with this schematic.

    You need to really look at my schematic and understand what those triangles mean. They are there for a reason.

    [​IMG]

    The triangles are considered 0 volts, they are are also considered ground from the outside of the circuit. The waveform on the output will be true AC if looked at with a scope.

    You could eliminated U2d and use a ±5V power supply for simulation purposes, and if you build it put U2d back in and use qty 1 9V battery. U2d accurately simulates a ± 4.5VDC power supply.
     
    Last edited: Oct 4, 2011
  8. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    You should remove V2 and V3 from your schematic, as U1d's output is the virtual ground.

    You should save your screen print images in .png format rather than .jpg, as the .png format is not "lossy" like .jpg images are.
     
  9. praondevou

    AAC Fanatic!

    Jul 9, 2011
    2,936
    488
    I don't see a difference in using the output of U2D or half of the power supply as virtual ground in his simulation. (not both at the same time of course) provided that the output reference is virtual ground.
     
    Last edited: Oct 4, 2011
  10. Wendy

    Moderator

    Mar 24, 2008
    20,765
    2,536
    There is no difference. He could use a ± power supply, which his simulator would support. I made the design to use a single 9V battery. Real world vs. simulators.

    From his complaints, I am judging he is seeing the 4.5V offset and not understanding that is the ground from the outside. I could be wrong, but that is my interpretation.

    The CMOS 555 goes rail to rail. So does the inverting transistor driver. The inverting transistor driver has good drive characteristics, while the CMOS 555 is iffy, but uses less parts. Either way U2c will ruin the nice square wave, unless it is very fast.
     
  11. Narrin

    Thread Starter Member

    Oct 2, 2011
    47
    0
    Okay so the concept of virtual ground is new to me, as well as op amps but i am slowly learning and I did some reading on it.

    I am looking at building this circuit after i get it to work, with added circuitry for changing frequency.
    From what your saying if the output from U2d serves as a virtual ground, I can connect all my virtual ground to that point instead of using V2 and V3.

    I have done so and I am getting no DC offset when i connect the oscilloscopes to the virtual ground. I am getting the Square wave from the CMOS timer and the triangular wave from U2A using oscilloscopes connected at that point.
    From the output of U2C i can get the sine wave but when i use the switch to switch from sine to square or triangular output Multisim gives me a "timestep to small" error. Why is that?

    CMOS 555.png

    View attachment BILL design mod2.zip
     
  12. Narrin

    Thread Starter Member

    Oct 2, 2011
    47
    0
    I have tried simulating the three circuits separately (one for sine, one for square and one for triangle) but i am still getting the same error in multisim...
     
  13. Narrin

    Thread Starter Member

    Oct 2, 2011
    47
    0
    Okay so what i have done is removed the switch and just separated the sine wave apart from the square and triangular outputs. I understand that the purpose of the switch was to get all the waves to the same amplitude but it gives me the timestep error which i do not knw how to bypass. Is there another way i can bring all the waveforms to the same amplitude??

    from this circuit:
    CMOS555 bypass.png

    the square wave is at +/- 4.5V
    the triangular wave is at +/- 1.5C
    the sine wave is at +/- 2.3V
     
  14. Wendy

    Moderator

    Mar 24, 2008
    20,765
    2,536
    Are you talking peak to peak or RMS. In the implementation I used I tried to match the P-P values. Of course, the power supply voltage is pretty important for this to happen.
     
  15. Narrin

    Thread Starter Member

    Oct 2, 2011
    47
    0
    I am talking about the peak to peak values, i want to be able to get all to at least 4.5V or 5V pk to pk.
     
  16. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Try it like the attached schematic/simulation.

    LTSpice doesn't come with a multipole switch, and I haven't bothered to make one yet. I just connect R9, R10, or R11 to node C instead. Note that the output P-P amplitude adjustments are made using R9 through R11.

    R1/R2 were necessary as a voltage divider to reduce the output swing of the square wave, yet keep it centered around the virtual ground. Note that R2 connects to the virtual ground; in this circuit virtual ground is node COM, the "V" symbol.

    I'm not showing the mandatory bypass caps for the 555 timers nor the opamp. They are not necessary for a simulation, but make certain to include them in the real circuit. All ICs need a 0.1uF cap across their power/gnd pins. The 555's also need a 0.1uF or larger within an inch of the IC.
     
  17. Narrin

    Thread Starter Member

    Oct 2, 2011
    47
    0
    With this simulation in multisim i get a square wave of +/- 2.57 V and a sine wave of +/- 2.87 V whereas the triangular wave is +/- 1.5 V. What is the difference between the circuits? Changing the resistors R8,R9 and R10 does not do much for the amplitude..

    CMOS 555mod.png
     
  18. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    The difference is that I am switching between R9, R10 and R11 to the input of U2C, reading the output from OUT referenced to COM, and you are trying to read the signal from the common of S1 referenced to virtual ground.

    You need to connect R8 to an unused position of S1 instead of the inverting input of U2C, and the common of S1 to the inverting input of U2C.

    Then you can select between the square, triangle and sine waves by changing the position of S1. You can only select 1 waveform to output at a time.

    You can monitor the square wave present at the junction of R1/R2/R10 with XSC2 if you wish, but that signal will change when it's selected via S1 due to the feedback around U2C. The output from U2C will be correct.

    If you wish to have all three outputs available, you will need to add two more opamps and two more 15k resistors.
     
  19. Narrin

    Thread Starter Member

    Oct 2, 2011
    47
    0
    When I connect R8 to S1 and the common of S1 to the inverting input of U2C....and try to switch between the outputs i get the timestep error in Multisim.
    CMOS555no.2.png


    This is the same error i encountered before (a few posts up) and I am wondering if it really is a Multisim error.

    That is why earlier on I let the sine wave output through U2C but not the square and triangle.
    If all the waves are connected through U2C via the switch, I get the sine wave at the output of U2C but when i switch from the sine to square or triangular i get the timestep error.
     
  20. praondevou

    AAC Fanatic!

    Jul 9, 2011
    2,936
    488
    Can you post the multisim file with the timestep error configuration?
     
Loading...