It's been a long while since I've dabbled in electronics and I need your help to critic this schematic I designed.
I am trying to design a digitally controlled analogue oscillator. The idea is that a control voltage is generated by the a microcontroller (Arduino) which is used via the 2 op amps, resistor and capacitor network which forms a integrator circuit.
The microcontroller will also send out a squarewave (top left) at the desired frequency which gets converted eventually via the transistor and shorts the ramp voltage to ground. This forms the sawtooth circuit.
That's technically not an oscillator, it's a sawtooth generator. An oscillator is autonomous (no external input), and free-runs by virtue of positive feedback.
You don't need the 1Meg resistor. It just makes your ramp slightly nonlinear. You will have to adjust your values slightly if you want to omit it and still get exactly 9.5V peak.
I assume you know you will need positive and negative supply voltages.
I ran a simulation on LTspice, and it does make a nice sawtooth. Why do you want a sawtooth wave at various musical note frequencies?
Yes, it's not a true oscillator. I'm trying to design a digital oscillator for a music synthesizer. The outputs will eventually be ramp (sawtooth) and squarewave. I did not want to go down the stand voltage controlled oscillator because of frequency drifting due to temperature changes etc...
You say that I would have to run this off + and - supply rails. What would I have to do convert the design to run off a single supply?
I'm going to get the microprocessor to send out a PWM and then filter it to create a control voltage. I've simulated that by the battery you see in the bottom left (0.6v). You can see the output control values i've calculated in the spreadsheet.
Are you going to AC-couple the output of your sawtooth generator? The reason I ask is that a single-supply op amp, even with rail-to-rail output, can only get within ≈100mV of zero volts. If you AC-couple, I suppose that won't matter.
I can show you how to do it with a single supply, but if I post the schematic, On1aag will come up with something with half as many parts, and compare me to Rube Goldberg again.
I can show you how to do it with a single supply, but if I post the schematic, On1aag will come up with something with half as many parts, and compare me to Rube Goldberg again.
What kind of single-supply, rail-to-rail I/O op amps do you have? I would like to look at the specs, and maybe run some simulations before I post a circuit that will disappoint you if your op amp is not up to the task.
Are you going to AC-couple the output of your sawtooth generator? The reason I ask is that a single-supply op amp, even with rail-to-rail output, can only get within ≈100mV of zero volts. If you AC-couple, I suppose that won't matter.
I can show you how to do it with a single supply, but if I post the schematic, On1aag will come up with something with half as many parts, and compare me to Rube Goldberg again.
What kind of single-supply, rail-to-rail I/O op amps do you have? I would like to look at the specs, and maybe run some simulations before I post a circuit that will disappoint you if your op amp is not up to the task.
what you can do is to use the pwm to charge a cap through a resistor and discharge once it gets to a particular voltage. the ramp would not be perfect and the frequency would be value dependent but the ramp peak (volume) would be fixed instead of varying with frequency.
Well, It's not a very good op amp, but the attached circuit works in simulation. Due to the finite slew time when the ramp resets, doubling the amplitude control voltage with each doubling of frequency will not quite keep the amplitude constant. You may have to use a lookup table for the PWM duty cycle. A faster slewing op amp would allow you to use a shorter reset pulse (lower value for C2), which would reduce but not eliminate the slewing problem.
The unused op amp section is tied to +10V because it's a convenient voltage within the input common mode range of the op amp.
If you are making multiple units, you might need to add a pot to calibrate the output amplitude. If so, let me know.
U1a can double as the op amp in a 2 or 3 pole lowpass filter for your PWM if you need it. Let us know if you want to do that. We will need to know the PWM frequency, and how much residual ripple you can tolerate on the control voltage.
what you can do is to use the pwm to charge a cap through a resistor and discharge once it gets to a particular voltage. the ramp would not be perfect and the frequency would be value dependent but the ramp peak (volume) would be fixed instead of varying with frequency.
Well, It's not a very good op amp, but the attached circuit works in simulation. Due to the finite slew time when the ramp resets, doubling the amplitude control voltage with each doubling of frequency will not quite keep the amplitude constant. You may have to use a lookup table for the PWM duty cycle. A faster slewing op amp would allow you to use a shorter reset pulse (lower value for C2), which would reduce but not eliminate the slewing problem.
The unused op amp section is tied to +10V because it's a convenient voltage within the input common mode range of the op amp.
If you are making multiple units, you might need to add a pot to calibrate the output amplitude. If so, let me know.
U1a can double as the op amp in a 2 or 3 pole lowpass filter for your PWM if you need it. Let us know if you want to do that. We will need to know the PWM frequency, and how much residual ripple you can tolerate on the control voltage.
Roff. Thank you very much for taking the time to look at this. I've took your feedback about the slew issues on the LM324N. So would a jfet opamp like the TL081 be a better choice.
Also. I've decided that I'm going to have to go down the positive and negative supply route. Probably will supply with +/- 15v. Is that a better choice. Does that simplify the circuit.
Roff. Thank you very much for taking the time to look at this. I've took your feedback about the slew issues on the LM324N. So would a jfet opamp like the TL081 be a better choice.
Also. I've decided that I'm going to have to go down the positive and negative supply route. Probably will supply with +/- 15v. Is that a better choice. Does that simplify the circuit.
TL074 or TL084 are much better quads, but their outputs only swing within 3V of the supply rails. You didn't answer the question about AC-coupling the output. If you are going to, then that isn't an issue, although if you want 9.5V p-p, you will need a single 15V supply, and a few circuit modifications
Here is a takeoff on your original circuit that uses a TL072, and should work if you can AC-couple the output (which you never addressed). It is straight off my simulation, so it needs to be cleaned up before you can build it.
Here is a takeoff on your original circuit that uses a TL072, and should work if you can AC-couple the output (which you never addressed). It is straight off my simulation, so it needs to be cleaned up before you can build it.
My 2n3904 model is broken and the simulated traces look bad. I tried many models from the internet and they are all with the same parameter values as what I've.