Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 8 of 8

Thread: TRS Input, Teensy 3.6, Yamaha FC7 expression pedal

  1. #1
    Junior Member
    Join Date
    Jan 2019
    Posts
    9

    TRS Input, Teensy 3.6, Yamaha FC7 expression pedal

    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;
           }
        }
      }
    }
    Click image for larger version. 

Name:	Screen Shot 2019-02-13 at 5.19.23 PM.png 
Views:	1 
Size:	59.7 KB 
ID:	15903
    Click image for larger version. 

Name:	Screen Shot 2019-02-13 at 5.09.40 PM.png 
Views:	1 
Size:	24.9 KB 
ID:	15904

  2. #2
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    7,602
    Is that drawing right with 3.3V on the center contact? Swap the 3v3 and signal pin A13 to the center.

  3. #3
    Junior Member
    Join Date
    Jan 2019
    Posts
    9
    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???

  4. #4
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,187
    Independent of the supply voltage, swap the green and the white wire!

  5. #5
    Junior Member
    Join Date
    Jan 2019
    Posts
    9
    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?

  6. #6
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    7,602
    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

  7. #7
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,187
    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/downloa...7_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.

  8. #8
    Junior Member
    Join Date
    Jan 2019
    Posts
    9
    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!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •