Allen-Synthesis / EuroPi

EuroPi: A reprogrammable Eurorack module based on the Raspberry Pi Pico

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug Report] PWM frequency is causing noisy cv output

awonak opened this issue · comments

Additional observation from @t-schreibs

Ran into an odd issue the other day. Probably not a support thing, but idk where else to drop this, and I'd be interested to hear what y'all think. I was feeding CV values from one EuroPi into another, where the second one was running Poly Square, and the output I was getting was bizarre, like almost FM-y. It was like the input analog value was super noisy. However, feeding those CV values into another oscillator (was testing w Beads w no audio input) sounded crystal clear, and any other CV value into Poly Square was also crystal clear. I'm trying to figure out where to start debugging this. Any chance it's a weird hardware thing?

Further observations from @t-schreibs

I have one EuroPi which, I believe, is still running 0.3.0 of the firmware, and the rest are up to 0.5.0. I'm testing w RadioScanner into Poly Square just to get an easily controllable steady CV value. While the output from 0.3.0 is not perfect by any means (I'm getting audible pops & crackles), the pitch center is much more stable. The output from 0.5.0 wanders quite a bit

Yep, I've confirmed there's something up with the latest version - I brought the other EuroPi up to 0.5.0 and now it's demonstrating the same problems as the other ones

Root cause suspected to be the change in PWM freq:
f0ae072

Oscilloscope testing between versions:
https://imgur.com/a/C5h0YYn

Documentation on valid PWM freq ranges:
https://docs.micropython.org/en/latest/rp2/quickref.html#pwm-pulse-width-modulation

In my testing, I found that the PWM freq can be set to match the machine freq, with the higher the machine & pwm freq, the less noisy the cv output will be. Both machine and pwm freq overclocked to 250mhz had the best results. However, I don't know if this has any performance implications on the rest of the script. That will require a bit of further testing.

Another consideration is for the firmware to provide a mechanism for switching between PWM modes, for example:

  • High resolution (default): lower pwm freq to produce smoother resolution at the cost of stable voltage (eg. envelopes)
  • High CV Accuracy: higher pwm freq to produce more stable cv at the cost of step resolution (eg. pitch cv)