TRS Input, Teensy 3.6, Yamaha FC7 expression pedal

Status
Not open for further replies.
Ok, new thing that I've searched around and can't find how to fix it.

I've got a TRS input connected to my Teensy 3.6 with a Yamaha FC7 pedal plugged into the input.
T -> A13
R -> 3.3V
S -> GND

I took a screenshot of the Serial Plotter for the analogRead(A13). As you can see, the data at the bottom range of the pedal is about 300 and the highest appears to be right about it's max level of 1023 with a little variance. What do I need to do to get the bottom range of the pedal to be at 0? Shouldn't the bottom end be at 0?



Code:
// the MIDI channel number to send messages
const int channel = 1;

// the MIDI continuous controller for each analog input
const int controllerA13 = 4; // 4 = hi hat foot control

/////////////////////
////// SET UP ///////
/////////////////////
void setup() {
  Serial.begin(9600);
}

/// HI HAT CONTROL ///
// store previously sent values, to detect changes
int previousA13 = -1;

elapsedMillis msec = 0;

/////////////////
////// LOOP /////
/////////////////
void loop() {
  
  //// HI HAT CONTROL ////
  // only check the analog inputs 10 times per second,
  // to prevent a flood of MIDI messages
    if (msec >= 100) {
    msec = 0;
    int HH = analogRead(A13);
    
    Serial.println("HH pedal");
    Serial.print("\t");
    Serial.println(HH);
    
    int n0 = map(HH, 0, 1023, 0, 127);
    
    // only transmit MIDI messages if analog input changed
    if (n0 != previousA13) {

      // only transmit MIDI if change is 1 or more
      int diff = abs (n0 - previousA13);
      if (diff > 0) {
        usbMIDI.sendControlChange(controllerA13, n0, channel);
        previousA13 = n0;
       }
    }
  }
}

Screen Shot 2019-02-13 at 5.19.23 PM.png
Screen Shot 2019-02-13 at 5.09.40 PM.png
 
When I tested everything with my Teensy 2.0, this is the routing I had to do for it to work. Although the difference between the 2.0 and the 3.6 is 5V vs. 3.3V. With the 2.0 I got a little more range if not all of its range. Can’t quite remember. Could the difference in power be what’s causing my problem???
 
Do you have a reason? The drawing isn’t what I’m actually using. It’s actually a TRS input and IT DID NOT WORK when I was in the testing stage with the Teensy 2.0 with having: T: power, R: signal, S:gnd. WHY should I switch my power and signal wires?
 
The drawing shows a potentiometer in use, I'm pretty sure that is just how they are designed to be used.

GND on one end and high signal on the other, and controlled output from the center
 
The schematic drawing keeps looking wrong, though...
Besides of that, the Yamaha FC7 does not behave like an ideal potentiometer. See manual : https://usa.yamaha.com/files/download/other_assets/3/865833/fc7_en_om_b0.pdf page 5.
Its specifications are already 50k +/-30% minimum resistance for Rv and Rt. It looks like Rt remains pretty constant, while only RV varies. So, at an ADC input like the one of the Teensy 3.x which is a precision Delta-Sigma SAR ADC expecting a source impedance of less than 10k (See Kinetis application note), you can’t get precise readings from a high impedance device like the FC7 without additional buffer circuitry.
If it were my job to design something around the FC7, I’d first trace the real resistance curves of it to have more detailed information about the behavior of Rt and Rv over the rotation angle. Then I’d set up a circuit with an op-amp in either bridge or differential configuration to get at its output a clean defined control voltage between 0 and 3.3V with low source impedance to feed finally the ADC.
 
Well, I don't get why it works with the 3.6 board this way but it worked the other way around with the 2.0 board. It's working now though. Thanks. Sorry that I was reluctant to try the change, but I just don't understand why those two wires would have gotten switched from one board to the next. Oh well. All working now. Thanks!
 
Status
Not open for further replies.
Back
Top