Current-controlled triangle+square-wave generator

Thread Starter

Alec_t

Joined Sep 17, 2013
11,504
Thought this concept might be useful for anyone wanting a variable-frequency oscillator :-
ICO-1.PNG
The anti-paralleled transistors in the optoisolators behave as a variable bi-polar current source to determine the oscillation frequency. Frequency is approximately linearly dependent on the photodiode input current, with a range of at least one decade for any given timing capacitor. U3a is configured as a Schmitt trigger with upper and lower thresholds as close to the rails as is reasonable (to maximise the triangle-wave amplitude), given that the opamp is not a rail-to-rail one. U3b is a unity gain buffer. The use of optoisolators naturally has the advantage that the frequency control can be floating with respect to the oscillator output if desired.
The el cheapo variant below uses one optoisolator in a diode bridge, but is otherwise similar. Its triangle wave-shape is kinked slightly due to the diodes.
ICO-2.PNG
I haven't investigated the upper frequency limit, effects of temperature or using alternative op-amps/optos.
Have fun.
 

dannyf

Joined Sep 13, 2015
2,197
I haven't investigated the upper frequency limit
The upper end will be limited by the current source (or a voltage source + a resistor): to maintain linearity, you have to charge up / discharge the capacitor a little bit at a time, and you don't want to charge it up or discharge it too much. And it should on average sit at around the upper end and lower end of the opamp's swing.

If you replace the opamp with a st inverter (HC132 for example), ....

I am not quite sure where it can be used.
 

Thread Starter

Alec_t

Joined Sep 17, 2013
11,504
See attached. If you don't have an LM324 model, just use any opamp model you do have.
I did play around with an HC132 (actually 74HC14) instead of the LM324, but that produced a less symmetrical triangle of lower amplitude and wouldn't tolerate much loading without severe distortion of the triangle.
 

Attachments

Last edited:

dannyf

Joined Sep 13, 2015
2,197
The symmetry / duty cycle of the triangle wave is determined by the charges put to and withdrawn from the capacitor. That charge is a function of the optos' imbalance, and where the capacitor sits.

In a sim, the optos are perfectly balanced. With a HC132, its transition points (to high and low) are 1.5 - 2.5v, give or take a few. In a 5v system, that means the capacitor gets charged up more per pulse than discharged down per pulse. So you have a shorter up-swing and longer down-swing.

The cure is to put a resistor / pot on one of the optos.

the same problem may exist with the opamp solution - you can adjust the "mid-point" to counter that, however.
 

Bordodynov

Joined May 20, 2015
2,642
I used a similar scheme of my generator (using 555) to create a medical home machine type "Vitaphone".
This is a simple, low-power, sound generator with variable (swinging) frequency. The frequency ranges 50 - 15,000 Hz. Industrially manufactured apparatus (prototype) showed high effectiveness in the home and clinical settings. Effect is determined by the fact that the small blood vessels in their resonate frequencies, which improves blood flow and lymph flow through small vessels. It is effective in the treatment of human kidney.
 
Top