Actions

Difference between revisions of "Digital FD-8 pedal"

From Just in Time

Line 25: Line 25:
 
{{StopImagesFlow}}
 
{{StopImagesFlow}}
  
==Mode of operation==
+
==Software==
The circuit essentialy does the following: Measure the output voltage of the hall sensor using the ADC. Determine a corresponding resistance and program that resistance value in the digital pots. Easy.
+
The software for this device is available on [https://github.com/DannyHavenith/FD-8 GitHub].
  
The challenge is in the phrase ''"Determine a corresponding resistance"'', or in other words: mapping the ADC values to the right 255 potmeter positions. A ratiometric hall effect sensor typically outputs ½Vcc when no magnetic field is experienced; Depending on the polarity of the magnet, when a magnet approaches, the voltage will either drop to Gnd or rise towards Vcc. It would be nice if the firmware could auto-detect the polarity and also determine the minimum and maximum values.
+
The basic mode of operation is as follows:
 +
# Measure the output voltage of the hall sensor using the ADC.
 +
# Determine a corresponding resistance and program that resistance value in the digital pots.
 +
# Repeat
 +
 
 +
There are two complexities that the firmware resolves as it performs the above two steps:
 +
* '''Range'''. Depending on the strength of the magnet and its distance from the sensor, the Hall effect sensor will report only a limited range of values that don't span the complete possible range. The firmware will detect the minimum and maximum values and use those to map that range to the full range of ''0&mdash255'' that should be given to the potentiometer;
 +
* '''Polarity'''. Ratiometric Hall effect sensors typically output a voltage range of either ''½Vcc—Vcc'' or ''Vss—½Vcc'', depending on the orientation of the magnet, where ½Vcc is the value that is output when no magnetic field is measured. The firmware will determine the median value of the range of input values. If that median is above ½Vcc, it will conclude that higher voltages mean that the pedal is moved down (magnet is moved towards the sensor). Otherwise it will conclude that decreasing voltages mean downwards motion.
 +
 
 +
All of that is contained in one single [https://github.com/DannyHavenith/FD-8/blob/master/fd8.cpp source file].

Revision as of 22:25, 16 February 2014

Work in Progress
This page describes a work in progress. All specifications may change and the final product may significantly deviate from what we describe here. It is very well possible that there will be no final product at all.
Warning.png

[[Revision timestamp::20140216222532|]]

In Roland FD-8 Issues: Hall Sensor Modification we described how a ratiometric hall sensor could replace the resistor film to repair the Roland FD-8 high hat pedals. Even though that Hall Sensor implementation works, an MCU based approach might have some additional advantages:

  • complete variable resistance to be compatible with other drum modules
  • adjustable sensitivity curve
  • more than 3 resistor levels, allowing true detection of foot-down velocity.
  • auto-calibration, i.e. no need for pots to set the trigger points.

Hardware design

Work-in-progress schematic
Single-sided PCB routing is fun!
This was before I realized that not all 78L05 have the same pinout...

We're currently working on a "more digital" version, based on a MCU and a digital potentiometer. We're using the following hardware:

  • attiny13 MCU (ebay, datasheet), an 8-pin AVR with effectively 5 io pins and 10-bit ADC.
  • Two MCP41010 digital potentiometers (ebay, datasheet) in series (10K each, because when we sourced it, a single 50K version was a lot more expensive on ebay). These are the most expensive parts in this design.
  • Honeywell SS490 ratiometric hall effect sensor as in the non-MCU version, or alternatively an Allegro A1302 (Just ordered a pair on ebay. Should be comparable to the Honeywell if used in a 5V setup)

Additionally (and optionally) we're adding:

  • a momentary switch (button) to explicitly start calibration (we're still researching complete autocalibration). An alternative to having a momentary switch would be to allow the pedal to recognize a certain pattern in the input, though it could be hard to find a pattern that is easily recognizable and that will never occur while playing (we can't fully exclude the possibility that someone will play a 17/4-beat one day...).
  • an LED. Every MCU project should have an LED.

If we forego the LED and switch we could use the pin to separately control the second potmeter, providing an extra bit of precision.

Software

The software for this device is available on GitHub.

The basic mode of operation is as follows:

  1. Measure the output voltage of the hall sensor using the ADC.
  2. Determine a corresponding resistance and program that resistance value in the digital pots.
  3. Repeat

There are two complexities that the firmware resolves as it performs the above two steps:

  • Range. Depending on the strength of the magnet and its distance from the sensor, the Hall effect sensor will report only a limited range of values that don't span the complete possible range. The firmware will detect the minimum and maximum values and use those to map that range to the full range of 0&mdash255 that should be given to the potentiometer;
  • Polarity. Ratiometric Hall effect sensors typically output a voltage range of either ½Vcc—Vcc or Vss—½Vcc, depending on the orientation of the magnet, where ½Vcc is the value that is output when no magnetic field is measured. The firmware will determine the median value of the range of input values. If that median is above ½Vcc, it will conclude that higher voltages mean that the pedal is moved down (magnet is moved towards the sensor). Otherwise it will conclude that decreasing voltages mean downwards motion.

All of that is contained in one single source file.