Skip to content

Arduino Firmware to convert Thrustmaster T3PA Pedals to USB.

Notifications You must be signed in to change notification settings

adrianmarino/t3pa-pedals

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Thrustmaster T3PA Pedals USB Firmware

Arduino firmware that allows convert T3PA Pedals to USB. It allows to use T3PA Pedals with other wheel bases as a regular 3 axis joystick. Is important note that this firmware allows to convert any pedals to USB or build your own pedals and use it through USB port as a regular 3 axis joystick. Both the circuit and firmware are agnostic, could be used for any pedals project.

Requisites

Firmware dependencies

Hardware

  • 3 x 0.2 µF capasitors. Used to remove electric noise from arduino analog inputs (A0, A1 and A2).

Circuit

Settings

You could change T3PA Pedals settings via serial terminal.

  1. Open a serial terminal with Putty and make a conection with COM(windows) or /dev/ttyACM0(linux) ports [1] at 9600 baud [2].

  1. Press all pedals at same time to enter to config mode. You should see the following message on the serial terminal:

    Config mode: ON
  2. See help with help command:

    -----------------------------------------------------------
    T3PA - Pedals
    -----------------------------------------------------------
    You can modify settings by sending a JSON to device. You
    can also read current settings. All settings are saved
    into device internal memory.
    -----------------------------------------------------------
    Options:
     
    1. Use 'show' command to see current settings.
    2. Send a json to update settings.
    3. Use 'off' command to finish config mode.
    -----------------------------------------------------------
  3. See current settings with show command:

    Settings:
    {
      "clutch_smoothing_factor": 0.99,
      "break_smoothing_factor": 0.99,
      "throttle_smoothing_factor": 0.99
    }
  4. Change settings with a json command:

    Command:

    {"clutch_smoothing_factor": 0.95, "break_smoothing_factor": 0.95, "throttle_smoothing_factor": 0.95}

    Output:

    Loading json settings...
    Appling settings...
    Saving settings...
    Settings:
    {
      "clutch_smoothing_factor": 0.95,
      "break_smoothing_factor": 0.95,
      "throttle_smoothing_factor": 0.95
    }

Important: The firmware applies an Exponentially Weighted Moving Average (EWMA) to each pedal. EWMA uses a Smoothing Factor to control the average level over each pedal signal. The higher the value, the less smoothing (higher impact of the latest reading). For more details, see EWMA. In this project, EWMA is primarily used as a method to eliminate electrical noise on analog inputs, finding a curve that fits better to the input data points detected in analog inputs.

  1. Finish config mode with off command:

    Config mode: OFF

Important: The Config mode minimizes pedal input lag by eliminating the need to wait for serial commands. This mode increase the execution time in the main program loop.

Change settings via SerialPort python class

Setup python env and run notebook

  1. Create python env and install required libraries.

    conda create -n t3pa
    conda install pyserial
    conda install jupyterlab
  2. Enable python env.

    conda activate t3pa
  3. Open jupyterlab

    jupyter lab
  4. Open and run notebook.ipynb