#PWM DAC Board

1 messages · Page 1 of 1 (latest)

glad solstice
#

I'm designing a board ostensibly for my USB MIDI thing but I figure it might be useful to other folks to have a generic board that can convert PWM from a microcontroller into either a DC or other analogue voltage by low-passing the PWM.

My current plan is to have "low ripple" outputs that use a sallen-key or similar. I might also add some lower quality outputs that are just passive low-passes.
I also want the option for level shifting either via an adjustable gain trim or some preset switch or solder bridge to convert the 3.3v or 5v PWM into eurorack appropriate voltages
Lastly I'll probably put some buffers or level shifters on there for gate signals

Attached is the basic idea for one of the sallen-key low passes which is designed to output DC with a ~32kHz PWM frequency, including level shifting to 0-10v

#

Would love feedback from other folks if you think it'd be useful for you and what features you may want

chilly ocean
#

yes.

#

32kHz seems low. why so slow?

#

how long does it take to get a DC out voltage from 0% to 100%?

glad solstice
#

Slow because if I pushed it faster the PWM started to bleed through the low pass circuit. Takes <0.001s for the filter to respond

#

It's also only a cutoff of 1kHz

covert scaffold
#

move the passive RC in front and check the filter response. i like it better that way because the filter gets a prefiltered signal. also why the adjustable gain, don't you want dc accuracy?

glad solstice
#

I'll move that passive RC.
Adjustable gain because it seemed like an easy way to get DC accuracy, this way I can calibrate it for 1V/Oct

#

Basically play C0 then C1 and make sure there's 1V between them

covert scaffold
#

what if you need subunity gain

#

also maybe you want both gain and offset for that. an inverting amp makes it easy

glad solstice
#

I don't think for this I need sub unity since eurorack is always higher voltage than an uC. But it could be a good thing to add in case others require it

#

Also do I need an op amp or can I use a BJT instead?

covert scaffold
#

for what? a single bjt isn't very accurate for anything

glad solstice
#

For the gain bit

covert scaffold
#

nah why

#

you don't want additional nonlinearity

glad solstice
#

For cost reasons but I guess op amp is the best option

glad solstice
#

So this is why you don't let your projects sit for a year. I already built one of these boards as a prototype

covert scaffold
#

You had already? Yes I think i remember

glad solstice
#

Yeah, it even works

glad solstice
#

I've zoomed in real close here to make sure to check the Y-axis, this is without the second passive filter vs with

#

And then at full scale so you can see the response time

#

The question I don't know how to answer is: what's good enough?

glad solstice
#

I think I'm overthinking it for my application, with a V/oct output I can just make sure the wobble doesn't throw it out more than, say, 10 cents then it's good

covert scaffold
#

What are those blips?

#

10 cents is noticeable

glad solstice
#

The spikes? PWM transitions I think

#

Yeah they are

covert scaffold
#

Different scales? How are they larger than the step

glad solstice
#

I scaled the pwm by 1000 so it fit on the screen at the same time

glad solstice
#

quick back of the napkin maths says I need <4mV of ripple to keep a v/oct output under 5 cents of pitch modulation

covert scaffold
#

Better to do 1, you want vibrato only when you want it

glad solstice
#

With the current filter I get 0.5mV of ripple which is under 1 cent