Skip to content

Commit

Permalink
Added description of power PCB. Removed typos
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrGri committed Dec 7, 2023
1 parent 195600b commit 04db7fe
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 28 deletions.
7 changes: 3 additions & 4 deletions Design/BOM.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
| M5x10 bolt | 4 | | | at the local hardware store | |
| M5x16 bolt | ? | | | at the local hardware store | |
| M5x20 bolt | ? | | | | |
| M12 nut | 8 | | Can be 3D printed, which is even better! | at the local hardware store | |
| M12 nut | 8 | | Can be 3D printed, which is even better! | at the local hardware store | |
| M12x1m rod | 1m | 2€ | Used to attach the loadcell to the M12 rodends + the rodends to the pedal. Must be cut to appropiate length. | at the local hardware store | |
| SK12 | 4 | 14€ | | https://www.amazon.de/dp/B07RHJG2HP?psc=1&ref=ppx_yo2ov_dt_b_product_details | |
| KP8 | 2 | 10€ | Pack of 4, only two necessary per pedal | https://www.amazon.de/gp/product/B0BFDXF223/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1 | |
Expand All @@ -22,10 +22,9 @@
| ESP32 | 1 | 21€ | Pack of 3, only one necessary per pedal. | https://www.amazon.de/diymore-Entwicklungsplatine-NodeMCU-Module-Bluetooth/dp/B09Z6RLS7R/ref=sr_1_3?keywords=esp32&qid=1691818759&sr=8-3 | |
| ADS1256 | 1 | 19.5€ | | https://www.amazon.de/gp/product/B0B7799V8W/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1 | |
| Loadcell | 1 | 30€ | 300kg | https://www.amazon.de/gp/product/B07ZX2KWPC/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&th=1 | |
| PCB | 1 | 8€ | Pack of 5, only one necessary per pedal. | | |
| PCB | 1 | 8€ | Pack of 5, only one necessary per pedal. | | |
| Bell wire | 1m | | | at the local hardware store | |
| Level shifter | 1 | 4.60€ | Pack of 15, only one necessary per pedal | https://www.amazon.de/gp/product/B082F6BSB5/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1 | |

| Level shifter | 1 | 4.60€ | Pack of 15, only one necessary per pedal | https://www.amazon.de/gp/product/B082F6BSB5/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1 | |
| PSU | 1 | 25€ | Can power multiple pedals | https://www.omc-stepperonline.com/de/lrs-350-36-mean-well-350w-36vdc-9-7a-115-230vac-geschlossenes-schaltnetzteil-lrs-350-36 | |
| SR5100 Schottky diode | 1 | 5€ | Pack of 20, only one necessary per pedal. | https://www.amazon.de/Packung-20-SR5100-Schottky-Barriere-Gleichrichterdioden-DO-201AD/dp/B079KK7QL5/ref=sr_1_3?keywords=sr+5100+diode&qid=1691820234&sr=8-3 | |
| | | | | | |
Expand Down
69 changes: 45 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,30 @@
# DIY-Sim-Racing-FFB-Pedal

# Disclaimer
This repository documents my own research progress. I wanted to understad the necessary signal processing and control theory algorithms behind such a device.
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](https://en.wikipedia.org/wiki/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 responsible and at your own risk.
The FFB pedal is a robot and can be dangerous. Please watch [The Terminator](https://en.wikipedia.org/wiki/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.


# Discord
A [Discord](https://discord.gg/j8QhD5hCv7) server has been created to allow joint reasearch.
A [Discord](https://discord.gg/j8QhD5hCv7) server has been created to allow joint research.


# Hardware
## Electronics

### PCB design
The embedded code of this DIY FFB pedal runs on an ESP32 microcontroller. The PCB design was developed to proof the concept. It holds the ESP32, the ADC, a levelshifter and connectors. Currently the version 3 of this PCB design is used which introduced sensorless homing of the servo. The PCB design and pinout diagram can be found [here](Wiring/Esp32_V3).
## Control PCB
The embedded code of this DIY FFB pedal runs on an ESP32 microcontroller. The PCB design was developed to prove the concept. It holds the ESP32, the ADC, a level shifter, and connectors. Currently, version 3 of this PCB design is used which introduced sensorless homing of the servo. The PCB design and pinout diagram can be found [here](Wiring/Esp32_V3).

Here is an image of the plain PCB:
![](Wiring/Esp32_V3/PCB_empty.jpg)
![](Wiring/Esp32_V3/PCB_empty.jpeg)

Here is an image of the assembled PCB:
![](Wiring/Esp32_V3/PCB_assembled.jpg)


### Wiring
The PCB has some three connectors with the following wiring:
The PCB has three connectors with the following wiring:

#### Servo motion port
| Connector at PCB | Servo |
Expand All @@ -54,14 +54,37 @@ The PCB has some three connectors with the following wiring:
| S-| S-|

#### Servo power port
It is recommended to use a Schottky diode in the positive line from the PSU to the servo. The plated side facing the servo.
It is recommended to use a Schottky diode in the positive line from the PSU to the servo. The plated side faces the servo.
| PSU | Servo |
:------------------------- | :-------------------------
| 36V/48V| Vdd+|
| Gnd| Gnd|



## Power PCB
Depending on the load direction, the servo will act as a generator. It will produce an additional current flow from the servo to the PSU which could trigger the over-voltage protection from the PSU and the servo. To prevent the reverse current flow to the PSU and thus prevent over-voltage protection from the PSU, a Schottky diode was added to the power line. To prevent the trigger of the over-voltage protection from the servo a large capacitor was added in the power-line.

| Component | Link |
:------------------------- | :-------------------------
| SR5100 Schottky diode | [Amazon.de](https://www.amazon.de/Packung-20-SR5100-Schottky-Barriere-Gleichrichterdioden-DO-201AD/dp/B079KK7QL5/ref=sr_1_3?keywords=sr+5100+diode&qid=1691820234&sr=8-3) |
| 100V 10kF capacitor| [Amazon.de](https://www.amazon.de/dp/B07QWTMKWZ?ref_=cm_sw_r_apan_dp_ANE55Z4BEQEJHQBQSDVM&language=de-DE) |

To hold the components, a [power PCB](https://github.com/ChrGri/DIY-Sim-Racing-FFB-Pedal/tree/main/Wiring/PowerPcb) was developed, which also featured a port to hold XT30 connectors. The

Here is an image of the plain PCB:
![](Wiring/PowerPcb/front.svg | width=100)

Here is an image of the assembled PCB:
![](Wiring/PowerPcb/PCB_assembled.jpg | width=100)








## Mechanical design
Here are some examples of mechanical designs awesome DIYers have done:

Expand All @@ -75,7 +98,7 @@ Here are some examples of mechanical designs awesome DIYers have done:


## BOM
The [BOM](Design/BOM.md) refers to the pedal design which I have choosen, see [here](Design/MechanicalDesign.md).
The [BOM](Design/BOM.md) refers to the pedal design which I have chosen, see [here](Design/MechanicalDesign.md).

# Software

Expand All @@ -91,19 +114,19 @@ The drivers can be found here [here](https://www.silabs.com/developers/usb-to-ua
Firmware can be built and flashed via Arduino-IDE or Arduino-CLI.

#### Built from source (via Arduino-IDE)
1. Install the ESP32 dependencies in Ardiuno-IDE, see e.g. [here](https://randomnerdtutorials.com/installing-the-esp32-board-in-arduino-ide-windows-instructions/)
1. Install the ESP32 dependencies in Arduino-IDE, see e.g. [here](https://randomnerdtutorials.com/installing-the-esp32-board-in-arduino-ide-windows-instructions/)
2. Install the [libraries](https://github.com/ChrGri/DIY-Sim-Racing-FFB-Pedal/tree/main/Arduino/libs)
3. Flash the [code](Arduino/Esp32/Main), e.g. via Ardiuno-IDE to esp32.

#### Built from source (via Arduino-CLI)
1. Install the [Arduino CLI](https://github.com/arduino/arduino-cli/releases)
2. Execute the [build script](Arduino/Esp32/arduinoCliBuildScript.bat) from a local repo.
3. Flash the binaries via e.g. webinstaller, see [below](#flash-prebuilt-binaries-via-webflasher).
3. Flash the binaries via e.g. web installer, see [below](#flash-prebuilt-binaries-via-webflasher).

#### Flash prebuilt binaries via webflasher
#### Flash prebuilt binaries via web flasher
The binaries are available [here](https://github.com/ChrGri/DIY-Sim-Racing-FFB-Pedal/releases). They can be flashed via the ESP [webflasher](https://esp.huhn.me/).

Memory adress | File
Memory address | File
:-------------------------:|:-------------------------:
| 0x1000 | Main.ino.bootloader.bin |
| 0x8000 | Main.ino.partitions.bin |
Expand All @@ -112,9 +135,9 @@ Memory adress | File


## iSV57T-130 servo config tuning
The iSV57T allows parameter tuning via its RS232 interface. In order to tune the servo towards this application, I executed the following [steps](StepperParameterization/StepperTuning.md).
The iSV57T allows parameter tuning via its RS232 interface. To tune the servo towards this application, I executed the following [steps](StepperParameterization/StepperTuning.md).

With the current [PCB](Wiring/Esp32_V3) 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 protocoll 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.
With the current [PCB](Wiring/Esp32_V3) 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.
Expand All @@ -124,7 +147,7 @@ The SimHub plugin was designed to communicate with the ESP to (a) modify the ped
To install the plugin, the plugin [binaries](https://github.com/ChrGri/DIY-Sim-Racing-FFB-Pedal/releases), hidden inside the SimHub_plugin.zip, have 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.
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:

```
Expand All @@ -133,14 +156,14 @@ I=50-150
D=0
```

After sending the inital config, power cycling of the pedal is necessary. The pedal should move afterwards.
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 followed 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 the pedal in order to observe pedal travel.
2. Open the serial monitor in Arduino IDE, set baudrate to 921600 and restart the pedal. You should see some debug info. Make a screenshot and kindly ask in the Discord server for help.
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.


# Misc
Expand All @@ -152,11 +175,9 @@ To get a better understanding of the motion and forces, a [python](Validation/Pe


# Todo
- [ ] Add Doxygen + Graphviz to the project to automatically generate documentation, architecureal design overview, etc.
- [ ] Add Doxygen + Graphviz to the project to automatically generate documentation, architectural design overview, etc.
- [ ] Add automatic system identification of pedal response
- [ ] Add model-predictive-controll to the ESP code for improved pedal response
- [ ] Create video describing the build progress and the features
- [ ] https://github.com/gin66/FastAccelStepper/issues/194
- [ ] Add model-predictive-control to the ESP code for the improved pedal response
- [ ] Create a video describing the build progress and the features
- [ ] GUI design improvements for the SimHub plugin
- [ ] Send SimHub data via wifi to ESP
- [ ] Read the actual pedal config from SimHub
Binary file added Wiring/PowerPcb/PCB_assembled.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 04db7fe

Please sign in to comment.