Continue to Site

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.

  • 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.

Digitally Controlled Oscillator: sawtooth wave too "wobbly"

Status
Not open for further replies.

artben

New Member
In 2008 this thread was active:

https://www.electro-tech-online.com...ed-oscillator-dco-design-help-required.86601/

It describes a way to construct a DCO. I built this circuit but cannot find out why the generated sawtooth is "wobbly". A video to illustrate:

https://www.youtube.com/watch?v=uWog4BIQmK8

This is my schematic (LTSpice):

**broken link removed**

Halfway during the video I touch R3 to demonstrate the wobble some more. R3 seems to be the problem. I added 0.22µF + 2.2µF bypass capacitors to the opamp (Schematic says TL071 but I used a dual opamp LM833 powered by +/- 15V) but the sawtooth is still too distorted. I tried buffering, capacitors in series etc all to no avail.

The PWM is generated by a LeafLabs Maple r5 board. This board GND is connected to the main GND. The control voltage for the sawtooth is generated by a MCP4921 12bit DAC.

I'm kinda out of ideas now, anyone?
 
Last edited:
I saw in the other thread, some talk about T1 not turning on well. They made C2 bigger and R smaller.
 
Thanks ronsimpson. I edited my first post and included the schematic. I already made some adjustments to the C2 and R and also changed the T1 (in my case Q1) to a BC550. I think the problem in the other thread was emptying the capacitor C1. I could be wrong but I don't have that problem - yet ;)
 
Hi artben,

Something doesnt seem right about the basic topology of this circuit. The emitter of the transistor is connected to the inverting terminal of the op amp, which means the input of the op amp gets driven by the emitter through R4 and R1 even with there is no pulse. That right there does not seem correct, or at least not as correct as it could be.
By using a PNP instead of NPN, the emitter can be tied to the output of the op amp where it can not drive it appreciably, unlike when it is tied to the input. This means it wont interfere with the generation of the ramp of the sawtooth. Using a PNP however requires inverting the pulse drive because to turn the transistor 'on' now requires a very low signal like -5v, and to turn it 'off' requires some high voltage like 5v. If you can not do that externally you can easily do that with another transistor.

If you try to keep the NPN you probably will have to use a pulse that goes all the way to some negative value at least equal to the output of U1. I think a PNP would work much better however. Using an NPN will always mean some drive always gets to the input which is not good.
You also do not need a capacitor C2 if you supply a short pulse externally.

How much time can you afford to have the sawtooth being reset?
 
Last edited:
Thanks ronsimpson. I edited my first post and included the schematic. I already made some adjustments to the C2 and R and also changed the T1 (in my case Q1) to a BC550. I think the problem in the other thread was emptying the capacitor C1. I could be wrong but I don't have that problem - yet ;)

hi,
Please post your LTS asc file.?
 
no problem, here's the asc file.

@MrAl: thx for your substantial feedback! Right now I'm working on a new design using your tips. Will report back!
 

Attachments

  • sawtooth_osc_v3.asc
    4 KB · Views: 171
  • TL071.mod.zip
    1.3 KB · Views: 130
Last edited:
Despite what is being said above, I would think that it looks like the transistor is doing its job - it's resetting the sawtooth reliably (quickly & after a consistent period), as can be seen on the video.

The 'wobbles' are possibly some noise (e.g. mains radiation) that has been coupled into the circuit (maybe through the DAC input - try connecting a stable voltage to the input of U1 and see if the 'wobbles' go away) through a bad earth, bad supply decoupling, etc. Is the CRO earth lead connected properly to the circuit?
 
My previous reply is awaiting moderation. Just to let you know: thanks all for the good ideas. Tonight I'll continue work on the PNP approach as put forward by MrAl.
 
Hi again artben,

I tried to run your asc file but i need your file tl071.mod to do that. If you could supply that file i could run your sim and see how it works as you have done.

Also, i watched your video and it would have been nice to get some info on what the scales where on the scope picture, but that wobble you are seeing is caused by what looks like line frequency interference. It might be coupled from either external source or just because that 150k resistor (or pot) is too high of a value. You might have to go lower on the pot value and higher on the cap value to reduce that interference, or even possibly shield the circuit in a metal enclosure. Also, keep the leads to that pot and every lead connected to the inverting input of the op amp short.
If the couple is mainly because of the sources (like the one on the right) then the PNP mod should help that too. I'm still very surprised to see the emitter tied to the inverting input though, so changing that transistor to a PNP should make the circuit better overall anyway.
 
Last edited:
Thanks for your efforts. I updated the post with the asc file, it now also includes the tl071.mod.

In one of my many experiments I tried a stable voltage instead of the DAC but that didn't solve the wobbling. CRO settings, plug and earth leads should be ok; I had other oscillators perform correctly on this scope.
 
Hello again,

Oh yes very good idea. It appears that the 150k ohm resistor may just be too high of a value for this circuit in that it allows too much line frequency noise pickup.
I'll run your circuit next...

LATER:
Ok, circuit doesnt run too bad i guess, but if you inject an AC source signal into the inverting terminal through a 1Megohm resistor you'll see the same effect as your video shows. It's harder to see in the analysis screen though, you have to look at 50ms or more, and you see the variation as an amplitude variation. Lowering the 150k to say 100k would help, going even lower would help even more.
Also, the NPN transistor allows a glitch to get through the circuit from the pulse source, a PNP shouldnt allow that either, but this may or may not bother you too much.
 
Last edited:
I have done this not using a NPN transistor but with a MOSFET like a VN2222.
Usually I use a CMOS switch like a CD4016 or MC14016
 
Yesterday I made a redesign based on the feedback in this thread:

**broken link removed**

Redesigned the current limiting opamp U1 so R5 is now a lot smaller then in the previous version. Also redesigned the reset impulse train because Q1 is now a PNP. The impulse train has a constant voltage of 5V with only spikes down to 0V. When you're redesigning better look at everything ;).

The bad news: the sawtooth is still as wobbly as it was with the previous design. I'm gonna retest with a stable voltage instead of the current limiting opamp U1. Most designs I've seen use a current sink based on transistors instead of the current limiting opamp U1.
 
Hi again,

Are you sure you have both non inverting terminals connected together and to ground properly? That could also cause a problem if they are not connected properly.

Also, when i said lower R5 i meant something like 15k should do it, i dont think you have to go as low as 1.8k but as long as you have it that way now you can leave it. But as you lower R5 you have to increase C1 proportionally so that you keep the same timing. In other words, if R5 is 15k then C1 is 0.02uf instead of 0.002uf for example.

Can you post the asc file for this new circuit too?
 
Last edited:
Did you ever try the longer discharge pulse from #7. When I modeled it with a lower beta transistor it couldn't discharge the cap with the short pulse width. It does look like your picture always starts from the same place though. What does it look like on a time scale of 100 ms.?
 
Thanks all. Here's the new version in asc format. Will experiment tonight and tomorrow with the GND tip. Will also experiment with the C2 value. A longer pulse and thus a complete discharge might indeed add stability to the sawtooth.

@ronv: do you mean the timescale in the video?
 

Attachments

  • sawtooth_osc_v4.asc
    4.5 KB · Views: 143
Last edited:
Yes the video. If it is 50 or 60 HZ we should see it on the longer time scale. Same if it is a few pulses that don't get completly reset.
 
Fixed it! Changed R5 to 10K (I can always redesign the U1 opamp part to achieve a different voltage range from the DAC). Changed C2 to 100n (Tried a couple of values, 100n gave the most stable waveform). Made a direct connection between the non-inverting inputs of the opamp and rebuild the entire circuit using shorter wires etc. Also made some adjustments to my scope. The resulting waveform is very stable. I think the distortion will be even less when I transfer this circuit from the breadboard to its own specially designed PCB.

Thanks all!
 
Hey, you're welcome. Id be interested to hear how you intend to use this too, what it is for mostly.
Would be nice to see some pictures of the completed circuit too.
 
Last edited:
Status
Not open for further replies.

Latest threads

Back
Top