hardware setup - ebolzMagy/EMCFFBV2 GitHub Wiki
Hardware Setup
The EMCFFBV2 firmware allows for manual configuration of GPIO pins, enabling support for a wide range of sensors, motor drivers, and other peripherals. This flexibility allows you to create a custom hardware setup tailored to your specific needs.
Supported Boards and Pin Mapping
EMCFFBV2 supports the following development boards:
LOLIN ESP32-S2 Mini
Pin | ADC | PWM | IO |
---|---|---|---|
1 - 18 | β | β | β |
21+ | β | β | β |
ESP32-S3 DevKit C1
Pin | ADC | PWM | IO |
---|---|---|---|
1 - 18 | β | β | β |
21+ | β | β | β |
Go to Settings by clicking the gear icon in the top-right corner.
Selecting a Simulation Mode
Before configuring GPIO pins, select the appropriate Simulation Mode based on your use case:
- Gamepad Mode: For a gamepad without force feedback (FFB) axes.
- Driving Mode: For a driving simulator setup with one FFB axis on Axis X.
- Flight Mode: For a flight simulator joystick setup with two FFB axes on Axis X and Y.
GPIO Pin Configuration
EMCFFBV2 allows you to assign functions to GPIO pins using the firmwareβs pin mode settings:
Pin Modes
Pin Mode | Description |
---|---|
Not Set |
No function assigned |
Button Gnd |
Button input with ground pull-down |
Button Vcc |
Button input with VCC pull-up |
Button Row |
Matrix button row |
Button Column |
Matrix button column |
Analaog Axis |
Analog input for joystick axes |
Analog To Button |
Converts analog input to button presses |
Analaog X Shifter |
X-axis shifter input |
Analog Y Shifter |
Y-axis shifter input |
Vsense |
Voltage sensing input |
Brake Resistor |
Brake resistor control |
Xy Shifter Rev |
Xy shifter Reverse switch |
Encoder1 A |
Encoder 1 channel A |
Encoder1 B |
Encoder 1 channel B |
Encoder1 I |
Encoder 1 index |
Encoder2 A |
Encoder 2 channel A |
Encoder2 B |
Encoder 2 channel B |
Encoder2 I |
Encoder 2 index |
Drv1 Pwm A |
Motor driver 1, PWM A (Axis X) |
Drv1 Pwm B |
Motor driver 1, PWM B |
Drv1 Pwm C |
Motor driver 1, PWM C |
Drv1 Pwm D |
Motor driver 1, PWM D |
Drv1 Csense A |
Current sense input A |
Drv1 Csense B |
Current sense input B |
Drv1 Csense C |
Current sense input C |
Drv1 En |
Motor driver 1 enable |
Drv2 Pwm A |
Motor driver 2, PWM A (Axis Y) |
Drv2 Pwm B |
Motor driver 2, PWM B |
Drv2 Pwm C |
Motor driver 2, PWM C |
Drv2 Pwm D |
Motor driver 2, PWM D |
Drv2 Csense A |
Current sense input A |
Drv2 Csense B |
Current sense input B |
Drv2 Csense C |
Current sense input C |
Drv2 En |
Motor driver 2 enable |
Spi Sck |
SPI clock |
Spi Mosi |
SPI data out |
Spi Miso |
SPI data in |
Spi Cs 1 |
SPI chip select 1 |
Spi Cs 2 |
SPI chip select 2 |
I2C1 Scl |
I2C bus 1 clock |
I2C1 Sda |
I2C bus 1 data |
I2C2 Scl |
I2C bus 2 clock |
I2C2 Sda |
I2C bus 2 data |
Led Neopixel |
RGB LED control |
Description of Pin Modes
- LED_NEOPIXEL: Controls RGB LEDs on buttons.
- I2C1_SCL / I2C1_SDA: First I2C bus.
- DRV1_PWM_A-D: Primary PWM signal for motor control on Axis X.
- DRV1_CSENSE_A-C: Current sensing for motor control on Axis X.
- DRV2_PWM_A-D: Primary PWM signal for motor control on Axis Y.
- DRV2_CSENSE_A-C: Current sensing for motor control on Axis Y.
- ENCODER1_A / ENCODER1_B: Quadrature encoder input for motor positioning.
Axis Sensor Configuration
- If ENCODER1_A and ENCODER1_B are assigned to any pins, the ENCODER1 option will be available for all axes.
- ADC-based sensors like potentiometers can only be used if the axis is not an FFB axis.
Motor Driver Configuration
The Driver Mode options depend on which PWM pins are assigned:
- RC PWM: Requires at least DRV1_PWM_A.
- CENTER PWM: Requires DRV1_PWM_A and DRV1_PWM_B.
- PWM DIR: Requires DRV1_PWM_A and DRV1_PWM_B.
- DUAL PWM: Requires DRV1_PWM_A and DRV1_PWM_B.
- EMC BLDC: Requires DRV1_PWM_A, DRV1_PWM_B, and DRV1_PWM_C.
Additional Motor Parameters
- Poles: Defines the number of poles in the motor (not critical unless using EMC BLDC mode).
- Current Sense: The mV/A ratio of the Hall current sensor.
By configuring these settings, you can fully customize the behavior of your hardware setup to suit your specific requirements.
Troubleshooting
If you encounter any issues during the hardware setup, here are some common solutions:
GPIO Pins Not Working
- Ensure the pins are correctly assigned in the EMCFFBV2 Utility.
- Check if the pins are not being used by other peripherals.
Motor Not Responding
- Verify the motor driver configuration and wiring.
- Ensure the motor driver is properly powered.
Sensor Not Detected
- Check the sensor wiring and connections.
- Ensure the correct pin mode is selected in the EMCFFBV2 Utility.
Next Steps
β‘οΈ Continue to Axis for Axis configuration.
Need Help?
If you have any questions or encounter issues, visit the Discussions section or check the FAQ for more information.
Happy building! π