Skip to content

ChrGri/DIY-Sim-Racing-FFB-Pedal

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Arduino Build Doxygen Action

DIY-Sim-Racing-FFB-Pedal

Disclaimer

This repository documents my research progress. I wanted to understand the necessary signal processing and control theory algorithms behind such a device.

The FFB pedal is a robot and can be dangerous. Please watch The Terminator before continuing. If not interacted with care, it may cause harm. I'm not responsible for any harm caused by this design suggestion. Use responsibly and at your own risk.

License

Shield: CC BY-NC-SA 4.0

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

CC BY-NC-SA 4.0

The reason for that license selection is that at some point in time, individuals start

  • to steal the sources and binaries and sell them on the internet
  • mass production of FFB pedals in their living rooms to make money by taking parts from this project and Simucubes design files.

All that, without contributing anything to this project.

Related repos

For the sake of clarity, this project is divided into multiple repositorys:

Description Link
Mechanical and electrical design https://github.com/ChrGri/DIY-Sim-Racing-FFB-Pedal-Mechanical-Design
Software (firmware, SimHub plugin, ...) https://github.com/ChrGri/DIY-Sim-Racing-FFB-Pedal

Features

Control of pedal parameters

To tune the pedal parameters, a SimHub plugin was developed, which communicates with the pedal over USB.

Effects

Currently ABS, TC and RPM vibration are supported effects. The SimHub plugin communicates with the pedal and triggers game effects as parameterized.The effects and its description can be found in wiki.

Servo tuning

The used microcontroller has software to communicate with the used iSV57 servo. Therefore, it can tune the servos PID loop and read certain servo states like position, torque, power.

Joystick data stream

The joystick/gamepad data is provided via three redundant channels

  1. Bluetooth
  2. 0V-3.3V output analog signal. Can be read by e.g. https://gp2040-ce.info/. The pin 25 was used for analog output.
  3. vJoy gamecontroller (only available when SimHub runs, also need enable control map plugin).

To provide native USB HID output, development with ESP32 S3 started, it's working, but not stable yet, see.

Pedals in action

IMAGE ALT TEXT HERE

More pedal action examples can be found in the Discord.

Contributions

A lot of awesome devs have helped this project grow. Just to name a few:

  • tjfenwick started the project with an initial implementation.
  • tcfshcrw helped to elevate the Simhub plugin to its current form, added a ton of pedal effects, hardware and discord support, good guy and much more.
  • MichaelJFr helped with refactoring the code at the beginning of this project. Fruitful discussions let to the implementation of the control-loop strategies.
  • Ibakha Discord channel CEO.

Wiki

Detailed descriptions of certain aspects can be found on the dedicated Wiki page:

Discord

A Discord server has been created to allow joint research.

Hardware

During the development of this project, PCBs to hold the electric components were developed, see below
.

Also a (mostly) 3d printable mechanical design was designed and optimized to withstand the high forces of this application, see below
.

Please refer to the https://github.com/ChrGri/DIY-Sim-Racing-FFB-Pedal/tree/main?tab=readme-ov-file#related-repos section to access the design files.




Examples other awesome DIYers have done are listed below:

Design Link
Tjfenwick's design
Bjoes design
GWiz's design
shf90's design

Software

ESP32 code

Architecture

A Doxygen report of the sources can be found here.

Install ESP32 driver

The drivers can be found here here.

Firmware generation and flashing

Firmware can be built and flashed via VS Code. Prebuilt binaries can be flashed e.g. via ESP32 webflasher of the flashing tool.

Built from source (via VS Code)

See this guide.

Flash prebuilt binaries via web flasher

The binaries are available here. They can be flashed via the ESP webflasher. Another Webflasher.

ESP32
Memory address File
0x1000 bootloader.bin
0x8000 partitions.bin
0xe000 boot_app0.bin
0x10000 firmware.bin
ESP32S3
Memory address File
0x0000 bootloader.bin
0x8000 partitions.bin
0xe000 boot_app0.bin
0x10000 firmware.bin

iSV57T-130 servo config tuning

The iSV57T allows parameter tuning via its RS232 interface. To tune the servo towards this application, I executed the following steps.

With the current PCB design, the ESP can directly communicate with the iSV57T servo. Manual tuning as described before isn't necessary anymore. A description of the steps I undertook to decode the communication protocol can be found on the Disord server. Additional features such as sensorless homing and lost-step recovery were developed and integrated with the help of this communication.

SimHub plugin:

The SimHub plugin was designed to communicate with the ESP to (a) modify the pedal configuration, e.g. the force vs. travel parameterization and (b) to trigger effects such as ABS oscillations.

image

To install the plugin, the plugin DiyActivePedal.dll has to be copied to the SimHub directory, e.g. C:/Program Files (x86)/SimHub

Steps after flashing the firmware

The pedal will not move initially after flashing. One has to open the SimHub plugin, connect to the pedal, and send a config with non-zero PID values. Recommended PID values are:

P=0.2-0.4
I=50-150
D=0

After sending the initial config, power cycling of the pedal is necessary. The pedal should move afterward.

Error handling

Pedal doesn't move after initial setup

  1. Make sure, that you follow the above instructions. The default PID values are set to 0 thus the pedal will not move. You have to send non-zero PID values and restart the pedal to observe pedal travel.
  2. Open the serial monitor in Arduino IDE, set the baud rate to 921600, and restart the pedal. You should see some debug info. Make a screenshot and kindly ask the Discord server for help.

Bluetooth doesn't show gamepad data

Install DirectX 9

The serial monitor shows a message "Couldn't load config from EPROM due to version mismatch"

Install a SimHub plugin matching the ESP firmware you installed and send a config to the pedal.

The com port showed access denied or can not connect

Check the arduino plugin scan setting, please use scan only specfiec port as below.

Todo

ESP code:

  • Add automatic system identification of pedal response
  • Add model-predictive-control to the ESP code for the improved pedal response
  • Add field to invert motor and losdcell direction
  • send joystick data to simhub plugin and provide data as vJoy gamecontroller
  • allow effects to move stepper beyond configured max/min position, but not the measured homing positions
  • Optimize iSV57 communication
    • Let the communication task run from the beginning of the setup routine
    • Read pedal state every cycle (currently, the pedal performance is degraded)

SimHub plugin:

  • Send SimHub data via wifi to ESP
  • GUI design improvements for the SimHub plugin
  • JSON deserialization make compatible with older revisions
  • include the types header file and use it
  • Make use of effects from the ShakeIt plugin
  • add OTA update for esp firmware
  • automatic serial monitor update
  • serial plotter
  • add different abs effect patterns, e.g. sawtooth
  • make effects proportional to force or travel selectable by dropdown menu

Misc:

  • Create a video describing the build progress and the features
  • Add Doxygen + Graphviz to the project to automatically generate documentation, architectural design overview, etc.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 51.3%
  • C++ 18.3%
  • HTML 16.4%
  • C# 11.9%
  • JavaScript 0.9%
  • CSS 0.6%
  • Other 0.6%