I recently added a Brains module to my Pepper, which needs on some CV -5...5V instead of 0...5V. So far so good. What kind of op-amp would do this? I tried an inverting summing design with gain of 2: input 2.5V to the inverting input via 2k, input the Bela analog out to the positive in and having the FB R at 4k. I thought this would do it with the formula: Vout=(Vin-2.5V)2=2Vin-5V. Vin:0...5V=>Vout:-5V...5V. The available op-simulators disagree. Any thoughts on that?
Pepper Analog out to -5V...5V
Maybe try something like this:
It's inverting, so you might want to put a unity gain inverting amplifier after it if you care about that, or just "fix it in software"(TM)
- Edited
importantly, you'll need to power the opamp from ±12V (or ±5V if it's a rail-to-rail opamp). You'll need -5V voltage reference for this design (or any other convenient value, just fine-tune the resistor through which it connects to the summing node. Check out the LM4040 series.
Also, I'd go for larger resistors. No point in drawing 10mA from the DAC through the 500R resistor, when you could draw 1mA through a 5k resistor with the same effect when changing the feedback resistor to 10k. Similarly for the voltage reference.
giuliomoro Also, I'd go for larger resistors.
Yes, laziness on my behalf, the default resistor value in falstad was 1k and I just ran with it.
yes, the op-amp will be working from +/- 12V rails.My goal is to use 100k Resistors.
Why do I have to use -5V, when I can use the inverting input?
If you ignore the -5V source and the 1k resistor connecting it to the op-amp's inverting input you've got an amplifier with a gain of -2 (Rfb/R1 = 1000/500 = 2, and it's inverting, so -2) . Putting in an AC signal with a range of 0-5V would give you 0 to -10V on the output. Then, ignoring the AC source and the 500R resistor, and just taking the -5V and the 1K resistor, we have an amplifier with a gain of -1. So -5V in gives 5V out. Now it's a summing amplifier, so we sum 0 to -10 with 5, to give us 5 to -5V. To make it work as a summer you need to ground the non-inverting input so that the feedback forces the inverting input to 0, giving a virtual ground there.
There's probably other ways to do it, but that's how I would go about it.
Cheers
- Edited
I did some tests today and it looks like, it can't be done with just one op-amp alone. As you said, first apply a gain of -2 and then invert and offset by -5V. I missed the part with the grounding of the non-inverting input.
You should be able to do it with one opamp and a positive voltage reference, but you'll need to connect the existing +10V reference to the non-inverting node via an appropriate resistor divider. Something like this:
Note that Bela's output may not fully reach 5V (it depends on whether the 5V regulator actually reaches it cleanly), so you may want to allow for a bit more gain to compensate for that. Use maybe 4.85V as a safety margin.
- Edited
I tried, but it didn't work. This is a working solution:
https://www.falstad.com/circuit/circuitjs.html?ctz=CQAgjCAMB0l3BWckHTADgOzoJwDYBmddSLAJgBYQFJrraEBTAWjDACgBDcHMnvggTz8Q6cElZIw8eOGh4FeMIvTKFZMFPmKduhVJmR2AJxEkQBSFXO1p8Exb5gyYsBSrOxDewHdw78Bd-D0xhIz8wXlFbKLBQqHYIgLjhSKd48IshaKzUqMzLa1pBYRt2AHkLPFcoimURWgLqkRKG9gAlEHxwPFtU3qhBiltGwZgEDsdAr2mx5DnG6AnTbuVabrJSQZo4Bw2tjYQw5F2IqM2xfa92AHMu4TIj+5AyTD5G9gB7URA8KlphjgxEgYBBiuAwRCLOwgA
you just posted the same URL I posted?
- Edited
I did some changes, but couldn't save it. Anyway, your circuit doesn't work as hoped. THis is the circuit as text:
$ 1 0.000005 105.18789638808724 50 5 50 5e-11
a 192 192 336 192 8 15 -15 1000000 -0.000024999435429416552 0 100000
r 192 128 336 128 0 5000
r 32 128 144 128 0 5000
w 144 128 144 176 0
w 192 128 192 176 0
w 144 176 192 176 0
R 32 128 0 128 0 0 10 0 0 0 0.5
g 96 256 96 272 0 0
w 96 256 192 256 0
w 192 256 192 208 0
a 496 208 640 208 8 15 -15 1000000 0.00004999737093770498 0 100000
w 192 256 496 256 0
r 336 192 496 192 0 100000
O 640 208 688 208 1 0
w 496 256 496 224 0
w 640 128 640 208 0
w 336 192 336 128 0
r 496 128 640 128 0 200000
w 496 128 496 192 0
r -80 176 -80 256 0 24000
r -80 256 -80 336 0 100000
w -80 336 0 336 0
w 0 336 0 256 0
w 0 256 96 256 0
w -80 256 -32 256 2
w -32 256 -32 176 0
w -32 176 32 176 0
R -80 176 -112 176 0 0 40 -12 0 0 0.5
w 32 176 144 176 0
o 6 64 0 4098 0.0000762939453125 0.1 0 2 6 3
o 17 64 0 4099 10 0.00009765625 1 2 17 3
38 6 F1 0 0 5 -1 Voltage
(input 0V):
(input 5V):
(input 2.5V):
The circuit I suggested was a summing amplifier which used one opamp per channel and reuses the existing +10V voltage reference and produces an inverted output: 0V input -> +5V output;
5V input -> -5V output. This inversion can be easily compensated for in software.
Why do you prefer your last circuit? I understand it is non-inverting, but also it is using twice as many opamps and it requires a negative voltage source (btw: you should not use the negative power rail as a voltage reference, as it's normally too noisy for that and it will drastically worsen the power supply rejection rate of your circuit. Use an LM4040 at 10V or similar).
I see. I don't prefer my circuit, I prefer the simplest working solution. I hadn't noticed, that the result is just an inversion of my required voltage range. Compensating for that in SW is a no-brainer. Thanks for having patience and clarifying.
- Edited
I have some modules, where I can't control the SW. So I decided, to create such a Signal processor and including also 2 VU Meters (digital 0...10V) and analog -10V...+10V. I also added the +10V/-10V/+5V as convenient output.
To make things more interesting, you can replace the 10V ref. Voltage with any voltage you like (unless it's greater then the supply voltage). If anyone is interested, send me a message. I still have 2 PCBs and FPs from prototyping.
You only need to add the jacks, the 2 LM4040-10, the meters and some male headers (Eurorack power, VU Meter connectors). SMD parts are all mounted.