control this LFO with pwm

From circuitbending to homebrew stompboxes & synths, keep the DIY spirit alive!

Moderators: Kent, Joe., luketeaford, lisa

Post Reply
User avatar
Dimitree
Veteran Wiggler
Posts: 667
Joined: Mon Aug 01, 2011 9:59 am

control this LFO with pwm

Post by Dimitree » Fri Nov 08, 2019 5:27 am

I have this weird LFO (that is part of a bigger circuit) that alread has CV control over Depth and Frequency.
It needs 0V to 5V.
I'd like to control that using pwm from a 3.3V microcontroller.
I'm wondering if I can simply use a mosfet or a logic buffer (to shift from 3.3V to 5V) followed by a simple RC low pass filter.
Would it be enough, or do I need an opamp buffer?

Image
You do not have the required permissions to view the files attached to this post.

jorg
Ultra Wiggler
Posts: 820
Joined: Fri Apr 03, 2015 9:38 am
Location: East Coast USA

Post by jorg » Fri Nov 08, 2019 9:30 am

Freq_CV is already being applied to an op amp buffer; you could easily just eliminate the 47k resistor there and send your PWM/RC filter directly to the (+) input of the op amp.

The Depth_CV input is seeing about a 16k load (parallel of the 27k to the Q14 emitter and 30k/10k to the IC24B op amp). On the op amp side, you could easily boost the impedance (e.g. use 300k/100k), but the transistor input is inherently low impedance. You probably still could adapt your RC filter to drive it; would need to use a relatively large capacitor.

Synthiq
Veteran Wiggler
Posts: 602
Joined: Mon Feb 06, 2017 3:10 pm
Location: California

Post by Synthiq » Fri Nov 08, 2019 4:41 pm

As I think jorg meant, if you level shift to 5V and use a small filter resistor (much smaller than the load resistance) and a large filter capacitor, you may not need a buffer amplifier. This also means that you will charge and discharge the filter capacitor with a large current due to the small filter resistor so this is a disadvantage.

Since the LFO is powered by +/-15V, nothing prevents you from level shifting the PWM signal to the existing +15V and then use filter resistors equal to twice the load resistance so the filter/load combo will divide the signal by 3 to get an output range from 0 to 5V. So for the FREQ_CV a 100kohm filter resistor could be used and the DEPTH_CV would use a 32kohm resistor. The filter capacitor values depends on PWM frequency, maximum tolerable ripple and bandwidth of the modulating signals.

User avatar
Dimitree
Veteran Wiggler
Posts: 667
Joined: Mon Aug 01, 2011 9:59 am

Post by Dimitree » Tue Nov 12, 2019 11:16 am

thank you!
are there solutions that do not imply modifing the existing circuit, and avoid using +/-15V, but only 3.3V and 5V supply? reason is this LFO is on another board that I'd like not to modify

Synthiq
Veteran Wiggler
Posts: 602
Joined: Mon Feb 06, 2017 3:10 pm
Location: California

Post by Synthiq » Tue Nov 12, 2019 1:18 pm

Dimitree wrote:thank you!
are there solutions that do not imply modifing the existing circuit, and avoid using +/-15V, but only 3.3V and 5V supply? reason is this LFO is on another board that I'd like not to modify
With those restrictions in mind, I would lowpass filter the 3.3V PWM signals with passive RC filters and then buffer them with non-inverting amplifiers with gains of 1.5 to scale the filtered PWM signals from 3.3 to 5V. The amplifiers would be powered by 5V and ground so they must be rail-to-rail input/output amplifiers like MCP6002 or similar.

If you want more signal bandwidth while maintaining low ripple you can use a second order Sallen-Key active filter with a gain of 1.5 instead.

User avatar
guest
Super Deluxe Wiggler
Posts: 4857
Joined: Mon Aug 19, 2013 11:49 am

Post by guest » Tue Nov 12, 2019 1:27 pm

your original suggestion would be fine. use some level shifting logic to go from 3.3V to 5V, like 74LV14 or CD40109 and follow that with a 1k resistor and 0.1uF capacitor (depending upon the frequency response you want).
openmusiclabs.com

User avatar
Dimitree
Veteran Wiggler
Posts: 667
Joined: Mon Aug 01, 2011 9:59 am

Post by Dimitree » Tue Nov 12, 2019 1:39 pm

great! many thanks!

Post Reply

Return to “Music Tech DIY”