Skip to main content

Test Fixture and Calibration - Eurorack MIDI to 16x16 CV Gate Module

This design, along with its firmware and scripts were made so that the CVs of the Eurorack MIDI to 16x16 CV Gate Module (MIDI_16Gx16CV) could be calibrated and the other functions tested. That module is difficult to validate after assembly and had some teething issues that I wasn't able to figure out without a way to measure all of the CVs across a wide range of outputs. I tried to make measurements of the module manually on the first few I made but the results weren't amazing.

The initial intent was for the main board of the MIDI_16Gx16CV to plug directly into the test fixture. The test fixture has connector sockets aligned with the main board. Unfortunately I made a classic mistake mirroring the design so I had to create some cables to connect the test fixture to the DUTs. In the end that worked out okay, I'm not sure it would have worked if the headers had been correct (for other reasons). 

The test fixture uses an Arduino Pro Mini. To get enough I/O to read the gates and CVs of the DUT, the fixture uses a MCP23018 a 16 pin I/O expander and two MCP3208 ADCs. The I/O expander is connected to SPI and the ADCs are connected to I2C. 

The fixture has 3 LEDs which I've assembled with different colors these could be used for a various statuses.

After assembling the test fixture I found that the ADCs were in need of calibration. The LM4040 voltage reference for the ADCs was disappointing. I think the LM7805 provides a more accurate and stable 5V. With either voltage reference, the ADCs need to be calibrated to get the measurement accuracy needed in the DUTs so the first step in using them was to get voltage readings from 0-10V in 0.5V steps, read the ADCs several times and average the readings. At that point I decided that trying to create a self-contained auto-calibration test fixture wasn't going to happen. I settled on recording the test fixture's calibration values and applying them in the scripts used to measure and calibrate the DUTs. This choice has (for now) kept the test fixture firmware fairly simple. 

The test fixture firmware accepts command strings via the serial port normally used for uploading firmware updates. The commands can trigger the test fixture to read the digital or analog inputs and they can send MIDI commands to the DUT.

The rest of the calibration is managed by some python scripts.

To test/calibrate a DUT the general steps are:

  1. Connect the DUT (all 3 cables, one for each header), plug in a USB serial adapter to the test fixture's Arduino.
  2. Run the script to activate every midi note on the the DUT and measure the CVs with the test fixture.
  3. Use to convert the output of and get the DAC_CAL_VALS table (see DUT firmware).
  4. Reprogram the DUT with the DAC_CAL_VALS table.
  5. Run the again and then to validate the result.

An uncalibrated DUT's CVs look something like this before calibration:

Before Calibration
That's not a particularly useful way to see the need for calibration. Here's the same data but the CVs are subtracted from an ideal CV for each note.

Before Calibration

Clearly the CV drifts away from the ideal value, in this case the default CAL_FACTOR is a little off but there's a fair bit of variation in the output that isn't caused by that as well. The spike at the end of the range is because the DUT's CVs can't go above the voltage rail on the DUT so the error is a lot bigger there. Another way to see the need for calibration is to look at the difference between the CV and the average. 

Before Calibration

So that DUT's CVs varied -20mV and +30mV over the whole range of  MIDI notes sent. 
Here's what the same plots look like after calibration.
After Calibration

After Calibration

After Calibration

That's a huge improvement. The uncalibrated variance of 50mV total is very noticeably out of tune on high pitch notes. The calibrated variance remains less than 5mV over almost the whole range. I think that could be improved further by re-calibrating the test fixture. The calibration I'm using up to this point was with a multimeter that only had 10mV precision above 6V, I have a better bench multimeter I can use now to recalibrate when I find the time.

Because I only needed one it's unlikely I'll make more of these as test fixtures. It would be possible to convert this into a useful Eurorack module that can read gates and CVs so here's what I'd change if I made a new version.
Issues on v1:
  • The 20pin headers are on the wrong side to use directly with the DUT. Fixing that would make it a lot simpler to use but it would need a completely new PCB layout.
  • Figure out a replacement or simplify the 5V reference for the ADCs. The LM4040 wasn't very good. The LM7805 is probably fine.
  • To get the test fixtures serial port to work at the same time as the MIDI output to the DUT a rework needs to be done. Here's a redline of the schematic for that.
  • R100-R115 need to be 11kΩ to keep a 10V input in the range of the ADC. Noted in BOM not on schematic.
  • Could probably switch to SMD i/o expander and ADCs if available. I designed for DIP versions because other packages were difficult to find.

BOM: Google Doc (there are two sheets!)