electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software » Developers' Corner
Inverting an LFO - single supply
Post new topic   Reply to topic Moderators: DrJustice
Page 1 of 1 [10 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
CHRISKELLY



Joined: Apr 08, 2018
Posts: 103
Location: England
Audio files: 3

PostPosted: Wed Sep 04, 2019 3:31 pm    Post subject: Inverting an LFO - single supply Reply with quote  Mark this post and the followings unread

I was reading this thread about summing CV's

http://electro-music.com/forum/topic-71213.html

And although it was a bit over my head, it got me thinking about something on a circuit of mine:

I'm using a vactrol to control the decay of a sound. The decay increases as the resistance to ground increases. So as the CV lowers, the decay increases.

I want to use a 5V simple R2R LFO as a CV, but I'll need to invert the LFO voltage before I use it to control the vactrol. (So that a rising CV gives a rising decay etc)

If I use the inverting input on an op amp (single supply) then the non-inv input should be biased to half the supply voltage.
So is this the correct strategy:
- offset and scale the CV to change from between 0V - 5V to between 2.5V - 5V
- input this new range at the inverting input of the op amp to get between 0V - 2.5V but with the signal inverted
-adjust the gain of the op amp to a gain of 2, to get back to between 0V and 5V but with the signal inverted.

Thanks
Chris

P.s - i know I could just make a new R2R for this but I'm trying to use the same one Wink
Back to top
View user's profile Send private message
PHOBoS



Joined: Jan 14, 2010
Posts: 5856
Location: Moon Base
Audio files: 709

PostPosted: Wed Sep 04, 2019 7:59 pm    Post subject: Re: Inverting an LFO - single supply Reply with quote  Mark this post and the followings unread

That would work but there is no need for the scaling or at least it depends on your supply voltage and the used opamp but that's for later.

I am probably going to repeat myself a bit from the other thread but let's see if I can make it a bit more clear to you.
The output signal of an inverting opamp (with a gain of 1) is the difference between the input and a reference voltage inverted/mirrored across said
reference voltage. (you might have to read it a couple of times)

With a bipolar supply this reference voltage is usually 0V (GND) so if you input +7V the difference between 0V and +7V is of course just 7V. If you
mirror this across 0V you get -7V (a positive* input voltage gets subtracted from the reference voltage). If you input +2V the difference is 2V which
mirrored across 0V gives -2V. If you input -3V the difference is 3V which will result in +3V (a negative* input voltage gets added to the reference
voltage). you'll get the idea. So if the reference voltage is 0V is pretty straight forward.
[+7V][0V][-7V]
[+2V][0V][-2V]
[-3V][0V][+3V]

* positive and negative in relation to the reference voltage!

now let's say we put this reference voltage at +4V. If you input +7V the difference is 3V. +7V is higher (so positive) compared +4V so you have to
subtract the difference. +4V - 3V = +1V. If you input +2V the difference is 2V. However!... although an input of +2V might be a positive voltage
compared to GND it is a negative voltage (lower) compared to +4V so you have to add the difference. +4V + 2V = +6V. If you input -3V the
difference is 7V. -3V is of course also negative compared to +4V so you add the difference. +4V + 7V = +11V.
[+7V][+4V][+1V]
[+2V][+4V][+6V]
[-3V][+4V][+11V]
as you can see +4V is centered between in/output voltages.

if you would use a reference voltage of -1V the results would be:
[+7V][-1V][-9V]
[+2V][-1V][-4V]
[-3V][-1V][+1V]


I'll let you try the next one with a reference voltage of +2.5V
[0V][+2.5V][?]
[+1V][+2.5V][?]
[+2V][+2.5V][?]
[+2.5V][+2.5V][?]
[+4V][+2.5V][?]
[+5V][+2.5V][?]

if you get that part correct we can continue,. Wink

_________________
"My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider Twitch YouTube
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
CHRISKELLY



Joined: Apr 08, 2018
Posts: 103
Location: England
Audio files: 3

PostPosted: Thu Sep 05, 2019 1:03 am    Post subject: Reply with quote  Mark this post and the followings unread

[0V] --> 5V
[1V] --> 4V
[2V] --> 3V
[3V] --> 2V
[4V] --> 1V
[5V] --> 0V

!!!!!
Thank you Phobos!!
I wish there was an emoji that was both facepalm and having a light bulb moment because I totally get it now and when you explained it, it was so obvious! (I guess it would be an LED moment in our case)

Thanks for your help as usual Very Happy

Chris
Back to top
View user's profile Send private message
PHOBoS



Joined: Jan 14, 2010
Posts: 5856
Location: Moon Base
Audio files: 709

PostPosted: Thu Sep 05, 2019 5:56 am    Post subject: Reply with quote  Mark this post and the followings unread

excellent! Very Happy

That's just the theory though. You can try it out and it might work but I'd like to know what the supply voltage is.
Also is the R2R LFO just one complete circuit ? Otherwise you could just invert the signals before the R2R and if you'd
use XOR gates to do that you can change the direction with a switch or another signal.

_________________
"My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider Twitch YouTube
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
CHRISKELLY



Joined: Apr 08, 2018
Posts: 103
Location: England
Audio files: 3

PostPosted: Thu Sep 05, 2019 10:16 am    Post subject: Reply with quote  Mark this post and the followings unread

This LFO is from a 4017 running at 5V power.
Set for an 8 step cycle and goes:
0V
1V
2V
3V
4V
5V
4V
3V
2V
1V
[Repeat]
(Well near enough - they all lose volts through the diodes tying them together at the voltage divider)
I'm building a bank of them all running at different clock speeds.
Back to top
View user's profile Send private message
CHRISKELLY



Joined: Apr 08, 2018
Posts: 103
Location: England
Audio files: 3

PostPosted: Thu Sep 05, 2019 10:18 am    Post subject: Reply with quote  Mark this post and the followings unread

Hang on - I meant
0.5V
1.5V
2.5V
3.5V
4.5V
3.5V
2.5V
1.5V
Rolling Eyes
Back to top
View user's profile Send private message
CHRISKELLY



Joined: Apr 08, 2018
Posts: 103
Location: England
Audio files: 3

PostPosted: Thu Sep 05, 2019 11:19 am    Post subject: Reply with quote  Mark this post and the followings unread

Tested and it works! Just needed a non-inverting buffer first, for some reason.

Cheers Phobos Very Happy
Back to top
View user's profile Send private message
PHOBoS



Joined: Jan 14, 2010
Posts: 5856
Location: Moon Base
Audio files: 709

PostPosted: Thu Sep 05, 2019 1:43 pm    Post subject: Reply with quote  Mark this post and the followings unread

awesome. Razz

Does everything run on 5V ? I wouldn't expect an opamp to get close enough to the supply rails,. well a rail to rail opamp could.
A buffer makes sense if you feed it straight from a resistor network.

_________________
"My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider Twitch YouTube
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
CHRISKELLY



Joined: Apr 08, 2018
Posts: 103
Location: England
Audio files: 3

PostPosted: Thu Sep 05, 2019 3:41 pm    Post subject: Reply with quote  Mark this post and the followings unread

It's a weird setup with some parts running at 9V but the drums in the circuit are based on the korg monotribe which i built at 5V, so the logic controllers got built at 5V. The vactrols have a sweet spot / useful range between 1.5 - 2.5V so LFO's at 0V - 5V made sense.

Today i used a TL072 at 9V and just sent the 0 - 5V into it to get buffered/inverted. Will probably swap for rail to rail opamps eventually but tbh the vactrols don't notice if I lose some voltage at the top/bottom!
Back to top
View user's profile Send private message
PHOBoS



Joined: Jan 14, 2010
Posts: 5856
Location: Moon Base
Audio files: 709

PostPosted: Thu Sep 05, 2019 4:15 pm    Post subject: Reply with quote  Mark this post and the followings unread

ah 9V for the opamp, that gives you some headroom. Could use an LM358 which will go much closer to 0V than a TL072,
but for a vactrol it doesn't matter that much as long as it works.

_________________
"My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider Twitch YouTube
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic Moderators: DrJustice
Page 1 of 1 [10 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » Developers' Corner
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use