[sdiy] Calibration procedures for digital CV modules?

Roman Sowa modular at go2.pl
Thu Apr 22 16:45:42 CEST 2021


Hello,

you need any kind of known reference, be it calibrated accurate 
multimeter (yeah, I used the word "calibrated" again, let the flame war 
begin) or reference voltage compared with... calibrated accurate 
multimeter. I've seen IC-based reference sources sold over internet 
cheaply. Nothing certified, rather destined for DIYers, just good 
enough. But as you said new DMM is in the mail, so this is just 
pointless remark.

To have the ability of self calibration in the field, the module must 
contain good and reliable voltage reference chip with good long term 
stability (say $50). Then you can measure it with ADC, knowing what real 
voltage it is, say 2.4873V measured during assembly, it's easy to tell 
what actual ADC gain is, then route DAC to ADC and calibrate each note, 
or just gain and offset based on ADC readings. That calls for good 
linearity ADC of course, but there are so many good ones out there 
around $10 mark in singles. OTOH do you need it THAT accurate and 
completely self contained autocalibration? Maybe LM431 will be good 
enough, not to mention reference source included in the DAC itself.

In 20V there's only 240 notes, so calibrating each of them is no big 
deal if done automaticaly, neither calculating lookup table to 
compensate gain and offset errors - to avoid many calculations each time 
new note is needed at output.
As others said, use fixed arithmetic to calculate all values.
I've used 24-bits accumulator adding note jumps one by one to create 
16-bit look up table, works a treat.

And since it's going to be a quantizer, this will be used most of the 
times with oscillator. Then who cares about accurate voltages, all what 
matters is frequency, and frequency is super easy to measure. So 
calibration would measure oscillator frequency and adjust DAC out to 
reach requested note pitch. This way you can create 2 points for 
adjusting gain/offset of super linear DAC, or calibrate 240 notes with 
poor DAC. In this case ADC does not hae to be precise at all, even 
internal micro's ADC will do, because now the DAC is our good known 
source. Then calibrate ADC using DAC as refeerence.

And one final thought - it's very much worth to spend $5 more on a DAC 
with good 1LSB linearity, than spend time and effort trying to 
compensate each note in a crappy one.

There's so much more I could talk about it but this post is already too 
long.

Roman

W dniu 2021-04-22 o 11:22, Spiros Makris via Synth-diy pisze:
> Hello,
> I am designing the firmware of a quantizer/microtuner that uses a 16 bit 
> ADC and DAC (which I hope to share with you all in a few weeks!) and I'm 
> having trouble nailing down the process with which it will be 
> calibrated. I'll preface by saying that I don't have an accurate meter 
> yet (still in the mail), but the following has been validated by another 
> person with a high count DMM.
> 
> The input and output ranges of the module are +/- 10V and one bit 
> corresponds to roughly 0.3mV. Calibrating the input is fairly easy, and 
> due to the lack of an accurate meter, I just do it using a commercial CV 
> generator. I figured a mV or so of potential error doesn't matter much 
> when you identify the input note, and this seems correct in practice. 
> The module correctly identifies all the incoming notes in its whole range.
> 
> The scheme of producing the output value is:
> -Decide which note you will output
> -Multiply that by a constant "gain" value
> -Add the output offset compensation value
> -Add any tuning adjustments, if set up (the module gives the option of 
> detuning individual notes of the scale)
> 
> At first, I was using an integer gain value, which quickly became 
> apparent that won't work properly for the whole range. An error of 0.5mV 
> will become 6mV after an octave, which is already too much, more as you 
> go further away from the center note, so I abandoned that approach.
> 
> I then tried to use floating arithmetic, and calibrate using 2V:
> -Adjust the output until you get 2V
> -Divide that value by 24 to find the floating value that corresponds to 
> a single semitone.
> This has the advantage (in theory) that any error you introduce will be 
> divided by 24, so it keeps the tracking better for +/- 4 octaves, but 
> then starts to have more noticeable errors.
> 
> A solution that was suggested to me, but I have yet to implement and try 
> out, is to calibrate values for each octave and then produce a look up 
> table, which will be used to interpolate the output values as required. 
> This should be very accurate, but has the disadvantage of requiring a 
> lot of measurement points, ideally 20 (the total output range in octaves).
> A final thought, which is still very fuzzy, is to calibrate the output 
> dac for a semitone, then calibrate the ADC based on that and finally let 
> the module find the points for 1V, 2V etc on its own and produce the 
> aforementioned table. Still requires an accurate meter, but is more or 
> less automatic as a process.
> 
> What other options do I have that wouldn't require more than a couple of 
> samples from the calibrator? I use an atmega328 and still have ample 
> processing time and memory to spare. I know a mV or two of final error 
> is not the end of the world, but since the hardware offers the accuracy, 
> I'd like to use it to its full extend. Any additional advice and 
> suggestions are greatly appreciated.
> 
> PS. This is a collaboration project that has not been officially 
> revealed yet , which is why I am not giving away more info right now. 
> Please bear with me, this will be eventually released as a DIY, open 
> source project
> 
> _______________________________________________
> Synth-diy mailing list
> Synth-diy at synth-diy.org
> http://synth-diy.org/mailman/listinfo/synth-diy
> Selling or trading? Use marketplace at synth-diy.org
> 


More information about the Synth-diy mailing list