Previous in Forum: Crate Pro Audio PA-4 Next in Forum: Electronics
Power-User

Join Date: Apr 2009
Location: Australia, sunny North Queensland
Posts: 380

# Voltage Controlled Oscillator

07/04/2012 11:51 AM

A big hello again, been awhile since my last confession

This is a copy of a Post I submitted in another forum and have yet to receive an answer. I know this forum is good for head banging and honest answers, so here goes...
Do excuse my simple non technical English and sometimes verbose reasoning in my attempt to avoid tech jargon.

I require some help if you guys and gals don't mind assisting?
I have done the hard yards this past week, searching the WWW and fiddling with circuit simulators to solve a problem.
I am at the end of my tether and am now here asking questions to get me back on my horse.
Here are the nuts and bolts:

I am wanting to control a motor through PWM.
I wish to control a DC motor speed for a 6 volt brush motor through a linear pot and also have that speed oscillate (throb) with the oscillation frequency controlled by a linear pot to have a complete cycle peak to peak of around 1 to 5 seconds.
I can create a PWM using either an OpAmp or a 555 timer.
I can also create a crude sine wave with either IC and output a positive voltage output and manipulate that wave to the low frequency of around 1 to 30Hz.

The challenge for me is combining the two together...
I am at the moment using the 555 timer to create a sine wave in a brutal and simple manner and using an OpAmp as a voltage controlled pulse oscillator.

So here is the simulation results I get from my present circuit:

you can see the sine wave controlling the pulse frequency. The pulse frequency can be controlled seperate to the sine wave by a pot while being driven by the sine wave ... hope that ain't confusing :P
That's good so far, but what is this process called?
I have an issue...the circuit I created to produce this frankenstein thingy, roughly works but shifts the width of each pulse MARK relative to the volatge in the sine wave.
I do need to know how I can keep the MARK of the pulse the same width. Any idea?

..and here is the completed circuit and do excuse my layout...I did my best to make it easy to read. I think there is some stuff that is not needed and also think there is stuff I need :P

NOTE: the C5 ceramic 1uF cap has been removed, it was doing nothing and forgot to remove it.
Basically, the 555 produces a sine wave as a result of cap C1 charging and discharging and the R3 pot controls the width of the sine wave.
I butchered that idea from a "police siren" with a 555 timer...saw a nice sine wave :P
I could not for the life of me use another 555 timer to get the effect I want, that of a shifting pulse frequency relative to a sinewave. So I used an OpAmp.
I have referenced U2C OpAmp to the output of the 555 timer (as opposed to using a typical voltage divider to the 6volt supply volatge).
The U2B has a pot (R8) that controls the pulse output frequency.
Ignore the discreets attached to the final output from U2A (2n3904). The final output here will be attached to a TIP31c that will drive the Dc motor.

I hope that was as clear as mud.
If you have an alternative super simple method to have a pulse frequency shift relative to a sine wave without having the mark of each pulse peak shift it's width relative to the voltage, I would love some thoughts.
Any add-ons or exclusions to help improve my circuit would be greatly appreciated.

To help you guys, if you think up another circuit...I have included my list of at-hand IC's:

555 TIMER
74HC14D HEX Inverting Schmitt Trigger
MC34025P Double Ended PWM
TL1431CD SMD Precision Programmable Voltage Reference
UCC27322 Gate Driver for MOSFET/IGBT 9A
MC33035 Brushless DC Motor Controller
CA3140E 4.5MHz BiMOS Op-Amp
OP07CP LOW-OFFSET VOLTAGE Op-Amp
LM311N VOLT COMPARATOR
BQ2004/2002 NiCd charger
UCC27322P Mosfet Driver
LM311N
74HCT688
74HCT73
74HCT04
74HC164

__________________
CraziestOzzy
Interested in this topic? By joining CR4 you can "subscribe" to

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, rate them!
Guru

Join Date: Mar 2011
Location: Sebastopol, California
Posts: 1123
#1

### Re: Voltage controlled oscillator

07/04/2012 12:37 PM

Use an Arduino and a motor controller shield. you can program the Arduino as the input analyzer for your frequency and then the motor controller to output to your motor using the shield. The motor shield has PWM channels that can easily handle your 6V motor if you power it separately with a 12v supply. You will have to check the current specs for the shield before you do, or OP-amp the output from the shield to match the current requirements of your motor.

With the Arduino watching the signals and doing the math it should only require a few lines of code to get what you want from it.

__________________
Most people are mostly good most of the time.
Power-User

Join Date: Apr 2009
Location: Australia, sunny North Queensland
Posts: 380
#2

### Re: Voltage controlled oscillator

07/04/2012 1:21 PM

I should have outlined i don't wish to use an AVR, PIC type chip.While I myself would likely delve into using a small processor and even write it up the old fashioned way with BASIC and a ATmega chip....showing my age here

I assumed (wrongly) in providing a list of available IC's at the bottom of my post I might help others in assisting me by limiting their ideas to what was available. My bad.

I intend to use the smallest footprint possible on the smallest PCB with the lowest possible parts count and cost. As mentioned earlier, available power is sourced from a 6volt Pb acid battery. Not asking for much....lol

I looked into using the quad opamp only without the 555 timer and using the unused opamp of the LM324 in present circuit to produce a sine wave via wein bridge oscillator.
The problem with that idea and why I went the way of the 555 timer, was that in using a wein bridge oscillator with one opamp, the current consumption was required from the batteries to maintain stability of the oscillator. I like to avoid that option of waisting power.
I have seen two diodes replace the typical light bulb current sink HERE but this circuit just does not work and other variants fail miserably as well. You can back-track to the main page HERE

If you have an idea that may point me towards a working, practical, small parts count positive end sinewave circuit that works with only one opamp, I will be friendly stalker for life

I think I am so far into this, that I can no longer think "outside the square" and need some gentle nudges here.

I can live with the present output of pulse state I get out of the three opamps if I can only use the fourth opamp to produce a positive end sinewave without worrying about gain, distortion ...I am after all driving a DC motor !!!.

__________________
CraziestOzzy
Guru

Join Date: Dec 2008
Location: Long Island NY
Posts: 15433
#3

### Re: Voltage Controlled Oscillator

07/04/2012 2:31 PM

How about a simple 555 PWM directly. The total resistance of the potentiometer (R1) and the capacitor (C1) sets the frequency of the oscillation while the wiper position sets the PWM duty cycle. Oh, I'm not fond of using the output impedance of your op-amp to current limit the BJT base current. This reduces component lifetime considerably.

__________________
"Don't disturb my circles." translation of Archimedes last words
Power-User

Join Date: Apr 2009
Location: Australia, sunny North Queensland
Posts: 380
#6

### Re: Voltage Controlled Oscillator

07/05/2012 2:16 AM

point taken...if I understand you correctly, that area of the circuit (output from the OpAmp) will have once on PCB a resistor before it hits the BJT. Have yet to work the value out for the resistor connecting to the TIP32 I plan to use....

as an aside, I actually may use a UCC27322P - Single 9-A High Speed Low-Side MOSFET Driver With Enable instead of the TIP32 to drive the 6volt DC motor. It's overkill but works on the strip board. And oddly enough, i can get bulk mosfet drivers cheaper than TIP32's

I will revisit the 555 option you mentioned. I am sure I tired it out before but wouldn't work as intended. The issue I think I had was that the MARK of the pulse changes with duty cycle. I am trying to keep the MARK of each square wave pulse the same width and have the SPACE between pulses change with the Sine Wave frequency.May have to use your idea in the real world, as part count is going beyond my restrictions for a small footprint.

I do remember using that circuit you linked to with the dual signal diodes over this last week. Quirky thing was that the lowest speed of the motor was at 50% resistamce of the pot and would increase speed when turned to either 0 or 100% resistance.

Compromise for the sake of cost....ewww

__________________
CraziestOzzy
Guru

Join Date: Sep 2006
Location: Near Frankfurt am Main, Germany. 50.390866N, 8.884827E
Posts: 17996
#11

### Re: Voltage Controlled Oscillator

07/05/2012 4:10 AM

Well said Redfred, I could notr agree more.....

But he needs a circuit I feel.....here is one:-

http://www.dprg.org/tutorials/2005-11a/index.html

There are many around but mostly basically the same.....

I would add a reversed biased diode across the motor if the MOSFET does not have it integrated - many do!

__________________
"What others say about you reveals more about them, than it does you." Anon.
Guru

Join Date: Aug 2005
Posts: 5723
#4

### Re: Voltage Controlled Oscillator

07/04/2012 2:36 PM

I think I may have got the wrong end of the stick here.

PWM stands for pulse width modulation, but, you seem to be trying to keep the active pulses the same width whilst changing their frequency.

What about just using two sine wave oscillators both at fixed frequencies.

The fast one feeds the negative input of a single op-amp used as a comparator.

The slow one has a DC offset controlled by a pot and feeds the positive input of the comparator.

__________________
We are alone in the universe, or, we are not. Either way it's incredible... Adapted from R. Buckminster Fuller/Arthur C. Clarke
Active Contributor

Join Date: May 2005
Posts: 17
#5

### Re: Voltage Controlled Oscillator

07/05/2012 1:09 AM

What are the requirrments for speed control accuracy? What is the load and does it vary? 'open loop' (without feedback) speed control is not very good at all. Make a self-oscillating current controller for the motor with a comparator, hysteresis feedback, fet, recirculating diode and sense resistor. Then use the back emf of the motor to sense the speed (motor term voltage-(motor current*winding resistance*constant)) is proportional to speed. then use the speed command sinewave minus the feedback speed times some constant to drive the current amplifier. -hughv

Power-User

Join Date: Apr 2009
Location: Australia, sunny North Queensland
Posts: 380
#8

### Re: Voltage Controlled Oscillator

07/05/2012 2:25 AM

There are no requirements. Feedback is human controlled via the Pot while the motor is on. I can see where you coming from though with the chance of oscillation running off uncontrolled afte a duration in time as I presently have an open-loop.
Your answer is a good one and similar to Randall's solution. Something I looked at earlier but failed to examine it further.
Thanks.

__________________
CraziestOzzy
Power-User

Join Date: Apr 2009
Location: Australia, sunny North Queensland
Posts: 380
#10

### Re: Voltage Controlled Oscillator

07/05/2012 2:32 AM

you are correct Randall !!!
I will watch my use of terminology
thanks and your idea makes sense and is confirmed by the other remarks after yours.

__________________
CraziestOzzy
Participant

Join Date: Nov 2011
Posts: 3
#7

### Re: Voltage Controlled Oscillator

07/05/2012 2:20 AM

hello

i am an innovator from INDIA

i feel a simple pnp&npn compliamentary pair trasnsistor op.amp with feedback oscillator will solve ur problem with 1.5v to 3v dc battery supply and i have designed 100 application circuits with this basic oscillator&amp.

u can use any general purpose pnp..npn silicon transistors OR for better amplification and feedback u can use germanium transistor pairs of pnp//npn

alternatively u can use ic741

if u need any further help write/mail me

all the best

sreenivasa narayanan

From the CR4 Rules: Do not post phone numbers or email addresses. The CR4 Admin will delete all phone numbers and email addresses posted in threads or comments. You can share this information via the CR4 internal messaging system.

Power-User

Join Date: Apr 2009
Location: Australia, sunny North Queensland
Posts: 380
#9

### Re: Voltage Controlled Oscillator

07/05/2012 2:30 AM

**************************

THIS POST HAS BEEN RESOLVED

**************************

and thanks for all the input, corrections and ideas.I am tossing the 555 timer and using a single quad OpAmp to perform all the functions.

...I also will watch my use of terminology

__________________
CraziestOzzy
Guru

Join Date: Mar 2011
Location: Sebastopol, California
Posts: 1123
#12

### Re: Voltage Controlled Oscillator

07/05/2012 11:55 AM

Yea!

__________________
Most people are mostly good most of the time.
Power-User

Join Date: Apr 2009
Location: Australia, sunny North Queensland
Posts: 380
#13

### Re: Voltage Controlled Oscillator

07/08/2012 5:13 PM

Rather than start a new post, figured I might continue this one as an addendum to a problem solved, to compliment search engines and those interested to know the solution to using a single quad Op-Amp as a dual voltage controlled "oscillator" in a simple circuit with minimal parts count.
Thanks Randall for provoking some alternative thought at the beginning of this post that inspired me to produce the next circuit that replaces the previous one above and ... and correcting my use of jargon.
While the title of this post suggests a question concerning "voltage controlled oscillator", I have since evolved to describing my desired circuit as a Frankenstein amalgamation of circuit ideas with no name.
Like Frankenstein, i's ugly but works and I just need to add something else to finish it off.
That last need is at the very end of this message if you wish to skip the grimey details of my pidgeon english.
I have basically re-invented the wheel, nothing new to share except a circuit that basically works. I say "basically", because there may be need for filtering and some minor tweeking in the real world (in particular resistor values) when I transfer the present working simulation and apply it and the accompanying circuit onto a bread board.

I have dismissed the use of a sinewave produced from a 555 timer IC mentioned at the beginning of this post and settled for the produced triangle wave that is converted to a square wave pulse from one of the Op-Amps in the LM324N quad I am using.

Triangle wave produced by U1D and converted to a square pulse

I still need a something similar to a sine wave of some description as explained at the very end of this message. The guts of the Op-Amp controls the frequency and is labelled U1D in the new circuit below. A 100K linear potentiometer controls the frequency which has a range of 50hZ to 600hZ determined by the present values of C3, R1 and the pot attached to U1D. All pots are a 100k value.

Better quality circuit image can be found HERE
Now for the best bit and a problem solved...
What can be done with this circuit and using only one IC,
the Op-amp LM324N to do what I want it to?

1. I can control a DC motor by PWM with the duty cycle roughly between 5% to 95% for this circuit. The motor runs within the limits I set with a potentiometer or by removing the voltage source for R11 and R4 and replacing it with a variable voltage source. The variable voltage is within a narrow range of roughly 5 to 6 volts for this circuit as-is to oscillate.
Most importantly for me, the frequency will not change due to the duty cycle being changed.
In theory, 0.1 to 99.9% duty cycle can be reached if the resistors and pots (R11, R4 and pots R3, R10) are removed and the variable voltage input connected to the inverting (-) input of the Op-Amps U1C and U1B. The resistors R5, R12 still perform the same function and remain connected to the Inverting (-) input of the Op-Amp) and Ground. The variable voltage input range in this case will be 1.25DC to 3.15 DC.
U1B/U1C can have seperate variable voltage inputs effectually setting a minimum and maximum duty cycle. But that is not the direction this circuit is being used for and I have not expanded this function for other uses.

Fig 1a
Resistors removed (as described above) with input voltage around 3v
.
Horizontal line is voltage, compared against the triangle wave (frequency) and the square pulse output of U1C IC. The DIV scale for all Figures is 2v DC

Fig 1b
Same details as Fig 1a, except input voltage is just over 1v.
Duty Cycle has changed with frequency fixed.

2. I can control the speed [U1B] of a motor to a set speed and independantly have that speed [U1C] accelerate and decelerate back down to a set level.
For example, I set the static speed of a motor to 20rpm with one pot and have the speed accelerate to 60rpm and back down to 20rpm with another pot.

Fig 2a
U1B (red) at a preset duty cycle determined by a pot..
U1C (green) has a different duty cycle to UC1B and can shift its duty cycle and if duty cycle of U1C is less than UC1B, then the duty cycle of U1B is output. See Fig 2b

Fig 2b
Comparison of duty cycle with that of Fig 2a

3. I can adjust rpm [IC U1D] at the same time for both static speed and acceleration with another pot (U1D) that controls the frequency.

Fig 3
Showing the final square wave pulse output after merging of the two outputs from U1C and U1B. I used D2 (MBR2545CT) with R13 doing a touch of filtering to spikes. I didn't bother showing a plot for frequency change and RPM as wasn't much exciting to show really.

4. I can control the speed [IC U1A] of another motor by adjusting its frequency with a pot.

NOW in order for me to complete this project, I need to ask a very simple question...
how can I create a voltage that shifts from 1v to 3v in a repetative loop with the space bewteen peak to peak voltage manually adjustable from 1 to 10 seconds?
Supply line voltage is at 6vdc and prefer to use discrete parts .
I basically need either U1C or U1B inverting input to receive this variable voltage input.

Thanks in advance for those following this and providing thought.

__________________
CraziestOzzy
Guru

Join Date: Jun 2011
Location: Phnom Penh
Posts: 4019
#14

### Re: Voltage Controlled Oscillator

07/08/2012 11:56 PM

You have to be one of the most diligent OPs that's graced this forum.

Thanks for the intelligent effort.

__________________
Difficulty is not an obstacle it is merely an attribute.
Guru

Join Date: Sep 2006
Location: Near Frankfurt am Main, Germany. 50.390866N, 8.884827E
Posts: 17996
#15

### Re: Voltage Controlled Oscillator

07/09/2012 6:15 AM

If thats the way you want to go, so be it.

But its far far more complicated than needed.....it also uses far more components than needed as well.......but its your choice.....

__________________
"What others say about you reveals more about them, than it does you." Anon.
Power-User

Join Date: Apr 2009
Location: Australia, sunny North Queensland
Posts: 380
#16

### Re: Voltage Controlled Oscillator

07/09/2012 8:14 AM

Thanks for that.
More than happy to use something that works with the 555 or even two 555 timers.
The circuit you link to doesn't do the job described in it's own description and in my simulation tests. The frequency changes with adjustments to the duty cycle and maximum duty cycle is achieved at 50% resistance with either end of the pot (0/100% resistance) producing the minimum duty cycle.
I have tried numerous varients of the 555 with one and two IC's and all seem to change the frequency when the duty cycle is changed through a pot..

thanks ;)

__________________
CraziestOzzy
Guru

Join Date: Sep 2006
Location: Near Frankfurt am Main, Germany. 50.390866N, 8.884827E
Posts: 17996
#17

### Re: Voltage Controlled Oscillator

07/09/2012 11:41 AM

This is where a simulation is a bad idea, real life would have shown you that if you had built the circuit and used it, as I have in 2008, it would control the motor speed perfectly......

The frequency is unimportant as long as the mark/space ratio is correctly adjusted.

DC motors do not care what the frequency is really within quite large bounds....nor do they care if it is not fully stable either....the relationship to the ON time to the OFF time is more important...

The only effect of a wrong frequency (usually a very low frequency), is if it finds something in the motor that starts to vibrate in sympathy, that sounds terrible!.....and unstable frequency has no bearing on the speed control....as I mentioned before, the mark/space ratio is the really important part.....not the frequency or its stability, or not.....

Try it out, its simple and easy to make on a perf board or similar......you are in for a pleasant surprise!!!!

Best of luck.

__________________
"What others say about you reveals more about them, than it does you." Anon.
Power-User

Join Date: Apr 2009
Location: Australia, sunny North Queensland
Posts: 380
#18

### Re: Voltage Controlled Oscillator

07/09/2012 12:13 PM

no worries...I am up for a challenge....will rig up the circuit tomorrow and let you know.

__________________
CraziestOzzy
Guru

Join Date: Dec 2010
Posts: 1668
#20

### Re: Voltage Controlled Oscillator

08/04/2012 3:34 PM

The following circuit I used to get a nice triangle wave [it simultaneously makes a square wave]. Values given were for about 50 Hz, but you can increase R2 and the capacitor to get a slower triangle. LP324 is just a low power version of LM324. Supply voltage can be any value that suites IC. A CMOS op amp with very low input current is useful to use very high R2 ohms e.g. 2.5 megohm for R2 would give 5 second period with 1 microfarad.

You were lucky, I needed to test my new scanner. The capacitor gets alternating polarity, so if you use an electrolytic then two in series, back to back, are advisable. Good luck.

67model

Guru

Join Date: Mar 2012
Posts: 2189
#19

### Re: Voltage Controlled Oscillator

07/10/2012 3:02 AM

CO, if you want to use a strictly analog approach, one which works quite well as a VCO is a state-variable filter in combination with operational transconductance amplifiers and a comparator. Produces a very clean sine wave over a fairly wide frequency range. If you wish to control the frequency accurately, you can use it as the oscillator component of a phase-locked loop (PLL).

Digital techniques far surpass analog these days, and at low cost. Forgive my curiosity, but what is your application, exactly?

-e

Interested in this topic? By joining CR4 you can "subscribe" to