DIY 8038 Function Generator

Discussion in 'The Projects Forum' started by WannabeGeek, May 24, 2012.

  1. WannabeGeek

    Thread Starter New Member

    May 24, 2012
    7
    0
    I've been trying to build a function generator with the ICL8038 chip I found on eBay. There are a few interesting schematics on the net and I've made a couple on my bread board. The datasheet says the chip is able to provide stable wave forms up to around 200 KHz. That is accurate for the triangle wave and up to a point for the sine wave as well. I've been having big problems with the square wave however. It looks fine up to around 1000 Hz, after that, the top left of the square starts drooping until it eventually ends up as a saw wave. So far, I'm just talking about the signal coming directly out of the 8038 on pin 9 before it goes into op amps and so on. I'm using a dual rail +12v 0 -12v power supply to run the chip. Does anybody know if there's a way to fix this using external components or is it just the limitations of the chip itself?

    I've attached a few photos I took of the square wave on my ancient oscilloscope :rolleyes:
     
  2. #12

    Expert

    Nov 30, 2010
    16,298
    6,809
    Look on the bottom of the chip and see if it says, "Made in China".
    Add a .1 uf capacitor from pin 6 to pin 11, directly across the power pins of the chip so it can get at the positive current it needs, fast, without trying to pull it all through the wiring from the power supply.
     
    Last edited: May 25, 2012
  3. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    Your scope probe and the square wave pullup resistor have a time constant that limits the risetime. You need fast operational amplifiers (unity gain or higher) to buffer each of the 3 waveforms.
     
  4. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
  5. #12

    Expert

    Nov 30, 2010
    16,298
    6,809
    The square wave pull up resistor can be as low as 1000 ohms (according to the graph on the datasheet). If you are using a lot more resistance, that will surely cause the problem that Ron mentioned.
     
  6. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    Yeah, he said he has an "ancient oscilloscope". I wonder if he is using a 1X probe. Even a 10X could have 20-30pF of capacitance. I wonder if it is built on a "protoboard" (plug-in style) BB. Those things typically add about 20pF per mini-bus, IIRC.
     
  7. #12

    Expert

    Nov 30, 2010
    16,298
    6,809
    I have a 1977 Phillips dual trace scope and the 10x probe says, "10M||8pf"
    The 1x probe is 1M||25pf

    That's ancient, but it wasn't cheap or off-brand.
     
  8. WannabeGeek

    Thread Starter New Member

    May 24, 2012
    7
    0
    Thanks for the quick responses. My oscilloscope is a Pantec Pan 8022. I bought it used without an owner’s manual and was unable to find any info about it on the net. If anybody knows where I could get a manual, I'd appreciate it. I have switchable probes and although the 10x looks a bit better, there's still way too little positive in the square wave at higher frequencies. The first version of the function generator I tried was acquired here: http://www.birthofasynth.com/Thomas_Henry/Pages/8038.html
    By switching capacitors at pin 10, I was able to get higher frequencies. I like the fine & course adjustments which make it really easy to get a stable exact frequency, but I would like to see a better method for changing the duty cycle. I was originally running the output of the waveforms through a TL074 but the square wave was distorted at higher voltages (See photo at around 10v peak to peak) which prompted me to have a look at the square wave before the op amp. The 8038 chip I got is certainly a knock off (see photo). The bottom of the chip says Malaysia on it ;-). I’ll experiment with capacitors from pin 6 to 11 as well as the square wave pull up resistor and let you know the results.
     
  9. WannabeGeek

    Thread Starter New Member

    May 24, 2012
    7
    0
    First, I tried adding a capacitor between pins 6 & 11 as #12 suggested. I couldn't observe any effect at any frequency. Then I tried replacing the 1k5 pull up resistor with a 1k and that had a small positive effect. I noticed when swapping the resistor that touching it with my finger increased the positive voltage droop, so I'm wondering if less than the recommended resistance would make an improvement. Anyway, I guess I was loading the circuit a bit with my 1x probe so now using a 10x and the smaller resistor; I'm getting a fairly decent square wave a 100 kHz with the test circuit from the Intersil website. Back to the first design I was working with, I'm still trying to decipher what could be causing the strange distortion of the square wave. Is there a better suited op amp than the TL074 I've been using? I had a look at the Zen design that Ron suggested. I wanted to try that one first but I don't have an LF351 yet. By the way, while testing the wave forms coming out of the TL074 on the Thomas Henry design, the signals seem to be oblivious to loading, but the problem with the square wave distortion is even more annoying. This time, the problem is not the frequency but the voltage. The triangle wave seems to be unaffected by whatever is causing the square wave to look strange. Am I possibly overloading the chip at 24v peek to peek? I’ve attached photos of the triangle wave vs. the square wave at 100 KHz measured coming out of the pots (Thomas Henry design) at maximum voltage. Does anybody know what might be causing the square wave distortion?
     
  10. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    Your square wave is suffering from slew rate limiting. Slew rate is how fast the output can change, typically specified in volts per microsecond. The TL074 typically slews at 13V/usec (8 minimum). For a 24V swing, the slew time will be ≈ 2usec. You need an op amp with faster slew rate.
     
  11. WannabeGeek

    Thread Starter New Member

    May 24, 2012
    7
    0
    Thanks for that valuable piece of information, Ron. Both the TL074 and the LF351 have a slew rate of 13v/us. Do you have any suggestions for a suitable replacement? Perhaps my last post was misleading. I have a power supply with a 24v swing but my wave forms (using the Thomas Henry design) are under 12v peak to peak. I'm assuming that would be theoretically within the range both op amps, or am I missing something? With the test circuit from Intersil, I'm getting a square wave with 22v peak to peak. The square wave with the test circuit has the problem of droopy positive voltage at higher frequencies but not distortion at higher voltages. Now I'm really confused ;-)
     
  12. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    I don't understand
    Do you need an op amp that can handle the 24V power supply? Can you live with a lower peak-to-peak swing than the ≈20V you can get with 24V? There are a lot more choices of lower voltage high speed op amps, but we might find a good one that will work with 24V.
    Can you use surface mount, or do you need thru-hole?
     
  13. WannabeGeek

    Thread Starter New Member

    May 24, 2012
    7
    0
    I'm definitely not ready for surface mount yet. It will have to work with DIP sockets. I can certainly live with waveforms under 12v peak to peak. I was originally planning on modifying the Thomas Henry design slightly for my purposes. Most of time, he's connecting ICs from ground to -12 or +12 which is probably why my signals are coming out under 12v. If I go with the Zen design, I'll have to either modify my power supply or modify the circuit to work with -12 and +12v. In that case, my signals might come out over 12v peak to peak which would be overkill. I would be really happy if I could just get the Thomas Henry design to produce decent waveforms at around 10v peak to peak. So far, that's been impossible. The circuit is also really busy at pin 9 where the square wave is produced. There might be a problem there that I could compensate for but my knowledge of electronics is too limited to know what that might be. Also my TL074 op amp may only be providing the minimum 8v/us slew rate for some reason which would explain the distorted form at 12v peak to peak. Is there any way I can test the slew rate? Do you have any experience with the MAX038 chip?
     
  14. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    You'll find that the LF351 will perform very similarly to the TL074.
    Both of those opamps have been around for quite awhile (mid-1970's). While they're still pretty good for a number of uses, they're simply not fast enough for your application.

    Square waves are pretty difficult to produce, as a theoretically ideal square wave is composed of the fundamental frequency, and ALL of the odd harmonics of the fundamental frequency; which implies unlimited bandwidth. All opamps have bandwidth limitations of some sort, so it is impossible to produce an ideal square wave using an opamp as an amplifier.

    However, you can certainly get faster opamps than the TL074 or LF351.
     
    WannabeGeek likes this.
  15. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    The MAX038 was a great IC, but the factory that produced them was destroyed by a tsunami around 20 years ago. The technology for that particular IC was lost. Stocks have long since been used up. If you see any around nowadays, it's virtually certain that they are counterfeit and won't perform like the originals did.
     
  16. WannabeGeek

    Thread Starter New Member

    May 24, 2012
    7
    0
  17. #12

    Expert

    Nov 30, 2010
    16,298
    6,809
  18. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    You can calculate your expected rise and fall times. It should be 4 times as fast as the TL07x. Just leave all the extraneous pins disconnected. Make sure you have close 100nF power supply decoupling caps on the power supply pin(s).
    If you are running inverting, or at higher than unity gain (noninverting), stray capacitance from the inverting input pin to GND will increase overshoot and ringing, or might even cause oscillation, so keep leads short. A socket will add a little capacitance, but might be OK. You can reduce or eliminate this effect by putting a small cap across the feedback resistor. It might have to be in the form of a gimmick. Here is the way to make one on a breadboard.
     
    WannabeGeek likes this.
  19. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    I think you would be better off using a comparator than an opamp; as opamps are internally compensated, where comparators are generally not compensated.

    Look at using an LM311, which is a very common and inexpensive comparator. You will need to connect the output transistors' emitter to either ground or -V. You will also need to use a pull-up resistor on the output, as this comparator can only sink current, it cannot source current.
     
  20. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    Just keep in mind that amplitude and offset control are difficult with a comparator, compared to an op amp.
     
Loading...