introduction - ebolzMagy/EMCFFBV2 GitHub Wiki

Introduction

Welcome to the EMCFFBV2 project! This is an advanced firmware designed to transform your ESP32-S2 or ESP32-S3 microcontroller into a powerful USB HID device with Force Feedback (FFB) capabilities. Whether you're building a gaming controller, a steering wheel, joystick, or a custom input device, EMCFFBV2 provides the flexibility and features you need.

Supported Boards

EMCFFBV2 is compatible with a variety of ESP32-S2 and ESP32-S3 development boards, including:

  • LOLIN S2 Mini

    LOLIN S2 Mini

  • ESP32-S3 DevKit C1

    ESP32-S3 DevKit C1


Firmware Features

EMCFFBV2 comes packed with powerful features to support your custom input device projects:

Axis Support

  • 8 Axis Inputs: Supports axes from X to SY.
  • Force Feedback (FFB):
    • 1 FFB axis on Axis X (for non-FFB Axis Y).
    • Note: 2-axis FFB support is currently under development.

Buttons and POV

  • Up to 128 Buttons: Fully customizable button mappings.
  • 4 POV (Point of View) Hats: Note: POV support is currently under development.
  • 128 RGB LEDs: Customizable RGB lighting for buttons.

Analog Shifter

  • Supports analog shifter input for realistic gear shifting.

Supported Sensors

EMCFFBV2 supports a wide range of sensors for axis input:

  • ADC Sensors: For non-FFB axes (e.g., potentiometers).
  • ABI Encoders: For precise position tracking.
  • I2C Magnetic Encoders: For contactless position sensing.
  • SPI Magnetic Encoders: Note: SPI encoder support is currently under development.

Motor Driver Support

EMCFFBV2 is compatible with various motor driver configurations, including:

RC PWM

  • Used for controlling ESCs (Electronic Speed Controllers).
  • Ideal for simple motor control applications.
  • Note: RC PWM support has not been fully tested.

Centered PWM

  • Supports bidirectional motor control.
  • Commonly used for controlling brushed DC motors.
  • Note: Centered PWM support has not been fully tested.

PWM/DIR

  • Combines PWM (Pulse Width Modulation) and DIR (Direction) signals.
  • Suitable for controlling motor speed and direction.

2PWM

  • Uses two PWM signals for motor control.
  • Typically used for controlling brushed DC motors or simple stepper motors.

EMC BLDC

  • Supports FOC (Field-Oriented Control) for precise control of brushless DC (BLDC) motors.
  • Ideal for DIRECT DRIVE applications requiring smooth and efficient motor operation.
  • Note: Need special motor driver, currently under development - COMING SOON.

Hall Current Sensor Support

Overview

Hall Current Sensors are now supported in EMCFFBV2 to enable True Torque Control for Force Feedback applications. These sensors measure the actual motor current in real time, allowing the firmware to apply precise force feedback effects with high accuracy and stability.

Benefits of Hall Current Sensors

  • Accurate Torque Measurement: Direct measurement of current ensures that torque output matches expected force feedback values.
  • Improved Force Feedback Response: Eliminates drift and enhances the realism of haptic feedback.
  • Protection Against Overcurrent: Helps prevent excessive motor current that can cause overheating or component failure.
  • Enhanced PID Control: Enables more stable and precise torque control when used in conjunction with FOC.

Customization

One of the key strengths of EMCFFBV2 is its flexibility:

  • Customizable Axes: Configure each axis to suit your hardware setup.
  • Customizable Buttons: Map buttons to any function you need.
  • Support for Various Motor Drivers: Choose the motor driver that best fits your project.
  • Support for Multiple Sensors: Mix and match sensors to achieve the desired functionality.

DirectInput Game Support

EMCFFBV2 supports a wide range of games that utilize DirectInput for force feedback and control:

  • American Truck Simulator
  • Assetto Corsa
  • Assetto Corsa Competizione
  • AutoMobilista2
  • City Car Driving
  • Dirt4 (requires custom device_defines.xml)
  • Dirt Rally(requires custom device_defines.xml)
  • Dirt Rally 2.0 (requires custom device_defines.xml)
  • Euro Truck Simulator 2
  • F1 2019
  • F1 2024
  • Grid (2019)
  • Grid AutoSport
  • Project Cars 1/2
  • RaceRoom Racing Experience (RR)
  • Rfactor2
  • Spintires
  • Spintires Mud Runner
  • Any other DirectInput FFB-supported games

These games support DirectInput-based force feedback effects and are compatible with EMCFFBV2 when configured correctly.

To enable forcefeedback feature in codemaster games like Dirt Rally2, F1, EA SPORT WRC..etc, find device_defines.xml file, example location

F:\SteamLibrary\steamapps\common\DiRT Rally 2.0\input\devices or D:\SteamLibrary\steamapps\common\EA SPORTS WRC\WRC\Content\input\Windows\devices

edit with text editor like notepad, add

<device id="{8203303A-0000-0000-0000-504944564944}" name="emcffbv2" priority="100" type="wheel" /> then save.


Getting Started

To get started with EMCFFBV2:

  1. Download the latest firmware from the Releases page.
  2. Follow the Firmware Installation Guide to flash the firmware to your ESP32 board.
  3. Connect your hardware and start customizing your device!

Need Help?

If you have any questions or need assistance, feel free to visit the Discussions section. We're here to help!


Happy building! 🚀