[sdiy] Calibration procedures for digital CV modules?
rburnett at richieburnett.co.uk
Thu Apr 22 12:29:08 CEST 2021
> You can maybe get away with integer math by using fixed point?
Fixed-point fractional was going to be my recommendation, instead of using
For example if you want to scale a value down by 1.23% you would multiply
the 16-bit ADC or DAC value by 64730 then shift the result right 16 bit
positions and round up if necessary. Really it is just integer maths as far
as the CPU is concerned, but *you* imagine where the binary point is, and
keep track of which bits are the whole part and which bits are fractional
From: Patrick Dowling
Sent: Thursday, April 22, 2021 11:06 AM
To: Spiros Makris
Cc: synth-diy mailing list
Subject: Re: [sdiy] Calibration procedures for digital CV modules?
Yeah, having a calibration point per octave is easy to implement (see o_C or
Yarns) but actually calibrating it gets tedious pretty quickly, unless you
can set up some automation loop (serial port to module, multimeter with USB,
You can reduce the effort somewhat by first calibrating -10V, 0V and 10V and
generating a (hopefully) better set of initial per-octave values than the
theoretical values. That table might even be “good enough”, it’ll probably
depend on the output scaling tolerances, etc.
I like the idea of it being mostly self-calibrating with a loopback from
DAC->ADC but it is a bit chicken-eggy.
You can maybe get away with integer math by using fixed point?
> On 22. Apr 2021, at 11:22, Spiros Makris via Synth-diy
> <synth-diy at synth-diy.org> wrote:
> 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
> Selling or trading? Use marketplace at synth-diy.org
Synth-diy mailing list
Synth-diy at synth-diy.org
Selling or trading? Use marketplace at synth-diy.org
This email has been checked for viruses by AVG.
More information about the Synth-diy