Implementing full digital control on an analog pedal

Started by Esppse, June 12, 2024, 08:13:14 PM

Previous topic - Next topic

Esppse

Hello,

I have been very curious about this topic for a long time but haven't fully committed to such a task because of how few digitally controlled analog drive pedals exist compared to plain jane ones.

I own a Nova Drive and an Analog Drive but would love to do my own.

Now as far as I understand, digipots and an Arduino are one way to do it, but I have heard advice against that due to noise?

Now when I look on the inside of this Bliss Factory, there are no digipots. Can someone explain how optocouplers can achieve the same result?

https://www.reddit.com/media?url=https%3A%2F%2Fpreview.redd.it%2Fkrqexpmucpz51.jpg%3Fwidth%3D1080%26crop%3Dsmart%26auto%3Dwebp%26s%3D809303e43a6992ed0b9b39cf9d284eba207b7520

mark2

They act as variable resistors.

The microcontroller digitally blinks the LED at high rates with PWM, which varies the photoresistors and changes their resistance.

So you can use one (rheostat) or two (voltage divider) of these LED/resistor pairs to replace a pot.

Esppse

Hmm, thats very interesting, so the microcontroller has to constantly send out a signal, otherwise the resistance value will be incorrect.

Is there a specific universal optocoupler part# that covers 1k-1meg that can be easily acquired for this application? Where can I find more information on how to implement the PWM for this task?

Would this approach definitely be better than digipots for something like fuzzes and distortions?

ElectricDruid

Quote from: Esppse on June 13, 2024, 03:15:10 AMHmm, thats very interesting, so the microcontroller has to constantly send out a signal, otherwise the resistance value will be incorrect.
That's true, but it makes it sound like the microcontroller will be permanently busy doing that. That's not how it works. Generally you set up a PWM module and it'll sit there and output whatever value you gave it until you give it a new value. So the microcontroller only has to keep track of whether you moved any knobs and whether any values need updating.

QuoteIs there a specific universal optocoupler part# that covers 1k-1meg that can be easily acquired for this application?
A lot of typical optocouplers would cover that range. VTL5C3 is one example. You can adjust the minimum possible resistance by putting fixed resistors in series with the LDR, and you can adjust the maximum resistance by putting resistors in parallel with the LDR.
Note that adding resistors in parallel changes the taper, but on a programmable pedal that need not be a problem. You could add a look-up table to compensate, or to provide a specific pot feel.

QuoteWhere can I find more information on how to implement the PWM for this task?
The standard "analog outputs" on an Arduino are actually PWM outputs, so it's very simple.
The PWM frequency is important, and I think the Arduino uses something pretty low by default, but it might be enough for vactrol control since the LDRs don't react very fast.

QuoteWould this approach definitely be better than digipots for something like fuzzes and distortions?
It certainly avoids several problems with digipots, like the limited voltage range and the likelyhood of clicks as you change value. The biggest downsides of vactrols for something like this are size and cost.

R.G.

First: digipots come in several varieties. The pure analog pots are implemented as a string of resistors from one pin to another. Setting the pot tells the pot circuit to connect one of the junctions of the resistors to the wiper pin. The digipot will either forget the setting when power goes off, or the fancier ones will remember the setting and stay there the next time power comes on. For these, the digital control does not need to be active except when the setting changes.
PWM for analog pot setting will be very sensitive to layout and decoupling to keep digital noise out of the analog path.
PIC microcontrollers can be set up to use >very< little power, so there is less digital power/energy to get into the audio path; Arduinos are higher power, but the programming eco-system is more developed.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

mzy12

How do companies like Strymon implement digi controls? I find my volante has no control range from the 7 o'clock to 9 o'clock, which is very annoying. I'd like to implement digital controls in my own pedal, but avoid that problem.

R.G.

I've never dug through a Strymon to see exactly what they do, but I suspect they do the actual controlling in software inside the chips and only use external pots or encoders as user suggestions to the software/chips for where to set the controlling in the algorithms inside.

User controls can philosophically be split into two parts. One is the [something] that the user flips, moves, twists, or whatever to cause a change, and the second is the thing that actually varies and works directly on the signal. In an analog pot, the user part is a shaft that gets twisted. The actual variation is a movement of a contact on a strip of resistive material. When you go to electronic controls, analog or digital, the connection between the user part and the actual signal-varying part can be split. For instance, some wah pedals used an LDR for the varying resistor and a light bulb shaded by a moving shutter for the user-moved part.

In digital controls, you have more options. The signal-varying part might be just software changing an internal multiplying gain on the numbers representing the signal (which is a more pure DSP kind of thing) or it might be a pulse width modulated chopping, then filtering process. It could even be a PWM modulation of a light source onto an LDR, etc. Sensing what the user wants to do can then be several ways, with a pot, a switch, a slider, a partially-covered LDR and so on. The digital software then does the linking between what the user wants and what the control actually does.

For conversion of pre-existing analog effects to digital controls, probably the handiest thing to do is to use a digital pot. These are ICs that have inside them a string of resistors with many taps along the resistor. They are fed digital signals telling them which tap to connect to the "wiper"pin.
Another is to use a digital signal to PWM an LED which lights an LDR.  Or PWM generating an analog voltage into a VCA.

That's not the only way. I once used double-shaft stepper motors coupled to a user knob on one end and pot shafts on the other. The motor could be driven to a specific rotation by digital circuits driving the motor phases. If the motor was "released" by having its windings just not driven, the user could still turn the knob on the other end of the motor. This was, of course, a mechanical mess to do, but it worked.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

soggybag

I read an interview with Chase Bliss, it sounded like their pedals leaned heavily on LED/LDR. Look up "Chase Bliss gut shots" you'll find plenty of LDRs. I counted 15 in one pedal!

mzy12

I'm in the process of taking my volante apart, I can't see any vactrol type things yet. I'll let ye know what I find.

Matthew Sanford

It may have other options chips that use bjt or cmos rather than ldrs. Maybe little 4 pin things?
"The only knowledge is knowing you know nothing" - that Sew Crates guy

Controlled Chaos Fx

ElectricDruid

Quote from: mzy12 on June 17, 2024, 12:24:35 PMI'm in the process of taking my volante apart, I can't see any vactrol type things yet. I'll let ye know what I find.

Ooh, exciting! Post a photo, please! We want to see too!!

FiveseveN

Guys, the Volante is a standard DSP effect, why would it have vactrols or digipots etc.? Do Strymon even make analog stuff?



Quote from: mzy12 on June 17, 2024, 09:58:10 AMI find my volante has no control range from the 7 o'clock to 9 o'clock
For all 9(?) parameters or just one knob? Could be an issue with the pot ADC or associated reference voltages. But that's unrelated to this thread so let's not hijack it.
Quote from: R.G. on July 31, 2018, 10:34:30 PMDoes the circuit sound better when oriented to magnetic north under a pyramid?

artofharmony

I'm so glad someone posted about this! I've been wanting to do digital-controlled analog for a while and even bought some microcontrollers and digital pots to mess with. Sounds like the LED/LDR combo is the route to go.

However, I feel like digital pots are still a viable option when messing purely with control voltages that never touch the audio path. Old Blood Noise Endeavors uses them in their Expression Ramper for exactly that purpose. They even have the pots on a socket so you can swap it out if you want. I was wanting to build an auto-expression thing at one point, which is why I bought the digipots to begin with.

Also worth noting: I seem to remember reading that digipots have a wildly large tolerance range.

ElectricDruid

Quote from: FiveseveN on June 17, 2024, 02:45:28 PMGuys, the Volante is a standard DSP effect, why would it have vactrols or digipots etc.?

Aww, how disappointing! No, of course it wouldn't. If it's DSP, all the control can be done in the firmware and there's no need for any of that hardware mucking-about we're discussing.

ElectricDruid

Quote from: artofharmony on June 17, 2024, 05:33:43 PMI'm so glad someone posted about this! I've been wanting to do digital-controlled analog for a while and even bought some microcontrollers and digital pots to mess with. Sounds like the LED/LDR combo is the route to go.
They're *a* route to go. Don't cut off all your other options. So far, no-one has even mentioned multiplying DACs or VCAs, and both of those are viable solutions in certain situations too.

QuoteHowever, I feel like digital pots are still a viable option when messing purely with control voltages that never touch the audio path.
Yes, that's a good point. There are parts of a circuit where we could be considerably less fussy.

QuoteAlso worth noting: I seem to remember reading that digipots have a wildly large tolerance range.
Microchip MCP42xxx series are +/-20% for 1K, +/-30% for 50K and 100K. Somewhat worse than the +/-20% you see on typical pots, but only a bit. Other digipots may do better or worse, but I'm guessing that's a fairly typical number.


mzy12

Quote from: FiveseveN on June 17, 2024, 02:45:28 PMGuys, the Volante is a standard DSP effect, why would it have vactrols or digipots etc.?
I legit forgot that lmao  ;D  :'(

mzy12

I'm looking at options for vactrols and they all seem expensive to implement in any decently complex pedal. If you had a pedal with 6 pots, that's more than €30 spent on vactrols  :icon_eek:

artofharmony

Quote from: ElectricDruid on June 17, 2024, 05:52:36 PMThey're *a* route to go. Don't cut off all your other options. So far, no-one has even mentioned multiplying DACs or VCAs, and both of those are viable solutions in certain situations too.

Please enlighten me!

Also, my auto-expression project was going to use ElectricDruid's TAPLFO chip, so this is a full-circle moment for me  :icon_lol:

PRR

Quote from: R.G. on June 17, 2024, 11:31:59 AMI once used double-shaft stepper motors coupled to a user knob on one end and pot shafts on the other.

(I suppose you know) That's similar to what is reported as how Neil Young's "Whizzer" works, except hobby-grade model aircraft servo motors. (And the unit sits above a precious Fender DeLuxe coupled by belts so as not to risk any harm to his toan.)

http://www.robotplatform.com/knowledge/servo/servo_tutorial.html
  • SUPPORTER

ElectricDruid

Quote from: mzy12 on June 17, 2024, 07:52:35 PMI'm looking at options for vactrols and they all seem expensive to implement in any decently complex pedal. If you had a pedal with 6 pots, that's more than €30 spent on vactrols  :icon_eek:
Yeah, that's the downside with the vactrols. That and the space they take up. If you've got a variable resistor and can replace it with just one vactrol, it's not too bad, but if it needs two, it's as bulky as an actual pot. And you still need the actual pot connected to the uP that's going to control all this.

Quote from: artofharmony on June 17, 2024, 08:08:55 PM
Quote from: ElectricDruid on June 17, 2024, 05:52:36 PMThey're *a* route to go. Don't cut off all your other options. So far, no-one has even mentioned multiplying DACs or VCAs, and both of those are viable solutions in certain situations too.
Please enlighten me!
Well, a multiplying DAC can use an audio signal as the reference voltage, and the output level is then set by the digital code you set on the DAC. So it provides digital volume control. I think I first saw this in the old Sequential Pro-FX schematics, a very erly programmable effects rack.

A VCA can do the same thing, except in that case you're using analog control of the volume, and you'd need an ordinary DAC to provide a control voltage to the VCA. This can be pretty simple to implement. For example, a couple of MCP4802 8-bit dual DAC chips and a AS2164/V2164/SSI2164 quad VCA and you've got four channels of digitally-controlled audio. There's a MCP4822 12-bit chip too, but since the VCAs are controlled with a V/dB scale, even 8-bit is better than 0.5dB resolution for over 100dB of range, and there's no way you can hear that. You can put a simple RC filter between the DAC and VCA to smooth the control voltage and prevent any stepping and you're off.

QuoteAlso, my auto-expression project was going to use ElectricDruid's TAPLFO chip, so this is a full-circle moment for me  :icon_lol:
That brings up one final point, which is that one way to simplify getting digital control is to minimise the *need* for it. If I were to add (say) an SPI interface to my LFO chips, they could be digitally controlled directly. As it is, they use 0-5V CVs, so they're pretty easy to digitally control anyway - just send a DAC output to the CV inputs. Even a heavily filtered PWM channel straight from a processor is enough - it doesn't have to be a fancy DAC.
For example, if I was trying to convert a chorus to be programmable, I might well replace the fully-analog LFO with something like the StompLFO to simplify getting digital control over the LFO rate and depth.