MUFF WIGGLER Forum Index
 FAQ & Terms of UseFAQ & Terms Of Use   Wiggler RadioMW Radio   Muff Wiggler TwitterTwitter   Support the site @ PatreonPatreon 
 SearchSearch   RegisterSign up   Log inLog in 
WIGGLING 'LITE' IN GUEST MODE

scaling and shifting lfo to 0...5V
MUFF WIGGLER Forum Index -> Music Tech DIY  
Author scaling and shifting lfo to 0...5V
ello
hello, i need to create a 0....5V output from possibly any input that i get in my modular, so i thought of building this circuit.



would this work? is there another preferable way of doing this? i have build an arduino based module and would like to add some cv modulation inputs.

basically i want to maintain the lfo shape to a certain degree at least for voltages from -5 to 5V, i don't really care if voltages like -8/+8 get clipped as i can use an attenuator before entering the above circuit.

any advice?
Troubleshooter
Hi,
I would use a Gain&Offset opamp cirquit with just one TL072 and 2 pots. In the first stage sum (using one opamp) your input with a pot sweeping between your voltage rails. In the second stage use a non inverting gain stage (use the 2nd opamp) with variable gain.
Really just opamp basics.
http://www.ti.com/lit/an/sloa097/sloa097.pdf
ello
wow. that is awesome. thank you very much. figure 4 seems to be exactly what i need. i am just unsure about the potentiometers you mentioned, since i need do make sure not to leave the -0.5 ... 5.5V range at any time. since that would possibly destroy the arduino.

but is that even sure using the clamping diodes? would they need ground and +5V or even other reference?
latigid on
Resistors a bit low perhaps? I did something similar with 50k input impedance.

If you make the second op amp stage an MCP600X powered at the MCU voltage you don't need any further protection and probably no output resistor.
ello
i must admit that i don't really understand how to pick certain resistor values. guess i need to continue learning some basic electronics understanding.

as to the MCP600, the characteristics mention VSS – 1.0V to VDD + 1.0V for the analog inputs and VSS – 0.3V to VDD + 0.3V for the others. so wouldn't that chip burn when a voltage between -8...+8V enters while it is powered at +5V?
latigid on
Generally an op amp (with suitable current limiting) will clip/distort signals outside the rail voltages to those rails. You can condition the input with the TL07X so that clipping is avoided, but it shouldn't hurt if the voltages are outside the limits.



The Mutable Instruments way is to use one inverting amplifier (MCP600X) and treat the inverted CV in software.
ello
cool. thank you. i will maybe even sacrifice an opamp to check how it behaves on this just for the sake of experimenting. i guess it is worth it smile
SphericalSound
The arduino (328 at least)pins are quite hard to kill . If you put a 1k resistor before they can resist -5, -10v constinously and not die.

Just protect with 1k and you are good
ello
since i have only some tl07x opamps at home i tried the following circuit. it acts totally weird. i know this simulation (http://tinyurl.com/ru2nrzn) should not be taken too serious, but i didn't expect it to be that off.

my circuit in reality outputs between -0.09V on -12V input and 2.6V at 12 V input. and 2.2 at 5V input. i tried different chips because i thought it was broken, but seems to be the circuit itself. is it soo much misbuilt?



@SphericalSound this sounds like a last solution if i cannot get some useful scaling to work. i want at least reach some 0...1023 result at the analog input for a range between -5 to 5volts. clipping for higher inputs like from my doepfer lfo which outputs -8...8volts but to completely loose the negativ inputs is not that preferred, too.

next i will try the circuit with inverting in the first stage and inverting it back in a second stage. just to see if that works.
PrimateSynthesis
ello wrote:

my circuit in reality outputs between -0.09V on -12V input and 2.6V at 12 V input. and 2.2 at 5V input. i tried different chips because i thought it was broken, but seems to be the circuit itself. is it soo much misbuilt?


Firstly, you should never draw power pins like that.

Secondly, a TL072 can't go below the negative rail.

Thirdly, the best way to make sure that the output cannot go negative, is to power it single-sided.

Fourthly, you don't need voltage dividers to ground. Let the op-amp do the dividing.

I built a little -5/+5 to 0/+5 converter box many years ago. It used one dual op-amp (LM358, LT1013, I don't remember, but those are both good choices). I ran it off +15 and ground (because my modular is 5U). Sorry, I looked for a schematic, but I couldn't find it. Anyway, you would use different values, and it should be easy to figure out. Add +5V with the first op-amp, so it's 0 to +10, then divide it in half with the second op-amp to get 0 to 5V.
ello
thanks for your insight.

what exactly is wrong with the pins?

i tried building it the way you described. maybe i got a whole packet of faulty opamps, since none of them do anything like they should. and a while back, i built some buffered multiples as well as inverters and those all worked without any issues. so i am really starting to think they are all broken... guess i need to go to my local electronics dealer and get some from there
Synthiq
ello wrote:
since i have only some tl07x opamps at home i tried the following circuit. it acts totally weird. i know this simulation (http://tinyurl.com/ru2nrzn) should not be taken too serious, but i didn't expect it to be that off.

my circuit in reality outputs between -0.09V on -12V input and 2.6V at 12 V input. and 2.2 at 5V input. i tried different chips because i thought it was broken, but seems to be the circuit itself. is it soo much misbuilt?



@SphericalSound this sounds like a last solution if i cannot get some useful scaling to work. i want at least reach some 0...1023 result at the analog input for a range between -5 to 5volts. clipping for higher inputs like from my doepfer lfo which outputs -8...8volts but to completely loose the negativ inputs is not that preferred, too.

next i will try the circuit with inverting in the first stage and inverting it back in a second stage. just to see if that works.

The TL07X is only specified to operate with at least 10V supply (or +/-5V) so I can imagine you have a problem if you supply only 5V. On top of that, the input common mode range (according to the spec) doesn't include 1.67V from the negative supply even in the typical case. Likewise, the output has a problem reaching less than 1-2V from the supplies so this application isn't really a good fit for the TL072. You would be better off to still drive the opamp from a higher +/-12V supply and just limit the input current to the Arduino with a resistor. The ADC in the 328 controller allow as much as 10kohm in source resistance in case you want to limit the input current even more.

Note also that if the input is not driven, the amplifier will act as a voltage follower and the ADC will see the same voltage as on the non-invering input of the opamp and not 0V. This may or may not be an issue. The circuit in your first post doesn't have this problem.
Mungo
ello wrote:
what exactly is wrong with the pins?
Some people don't like the power pins on the functions, style choice. Another issue is not having the pins labelled so if you flip or rotate the part its hard to tell which is + and which is -
ello wrote:
my circuit in reality outputs between -0.09V on -12V input and 2.6V at 12 V input. and 2.2 at 5V input. i tried different chips because i thought it was broken, but seems to be the circuit itself. is it soo much misbuilt?

ello wrote:
i tried building it the way you described. maybe i got a whole packet of faulty opamps, since none of them do anything like they should. and a while back, i built some buffered multiples as well as inverters and those all worked without any issues. so i am really starting to think they are all broken... guess i need to go to my local electronics dealer and get some from there
The TL072 parts are probably working just as they would be expected to. Simulations rarely match all the real world parameters of the parts (good simulations are very slow, so they are usually simplified). The "gotchas" are all listed in the data sheet:

Supply voltage, min: +/-5V, max: +/-15V
Common-mode voltage, min: VCC– + 4V, max: VCC+

Extended data sheets show the maximum output voltages too, which with a 0-5V supply for a TL07x are worst case no drive at all (minimum output and maximum output limits are overlapped).

Now consider how the specifications for the MCP6002 are different.
ello
thank you both for the explanations it makes totally sense that i have the issues, if the input voltage slips out of the input range.

however, i seem to not really understand the background. the mcp6002 has a supply voltage from 1.8 - 6.0V, and to my understanding a very small input range of +-300mV. i must completely misunderstand the mechanisms there or does this mean i may be able to find an opamp maching my special case?

.. btw, i still don't understand about the pins. in the schematics?


for the sake of it, i just added the 1k resistor and use the voltage block to sequence the cv, as that codewise already works.


edit: wouldn't a LM741 be a good choice?
Mungo
ello wrote:
however, i seem to not really understand the background. the mcp6002 has a supply voltage from 1.8 - 6.0V, and to my understanding a very small input range of +-300mV. i must completely misunderstand the mechanisms there
Probably a misunderstanding, consider their input common mode range when using the same terms and format:
MCP6002: Common-mode Input Range, Min: VSS - 0.3, Max: VDD + 0.3
TL072: Common-mode Input Range, Min: VSS + 4V, Max: VDD + 0V

There is a "class" from Ti on the subject, TIPL 1130:
https://training.ti.com/system/files/docs/1130%20-%20Input%20and%20Out put%20Limitations%20-%20slides_0.pdf
ello
awesome. thanks for the link. this is really helpfull and right about time to wrap my head around it
MUFF WIGGLER Forum Index -> Music Tech DIY  
Page 1 of 1
Powered by phpBB © phpBB Group