Open FFBoard Documentation

repository·master·Indexed 21 days ago

https://github.com/ultrawipf/openffboard

An open-source firmware platform for high-compatibility force feedback (FFB) simulation devices, such as steering wheels and joysticks, optimized for Direct Drive (DD) hardware. It supports various motor drivers (TMC4671, ODrive, VESC, PWM, MyActuator, Simplemotion) and encoders (ABZ, BISS-C, MagnTek, SSI). The project provides specific build targets for F411RE (FFBoard 1.0), F407VG (FFBoard 1.2+), and F407VG_DISCO (ST F407-Discovery board).

Tokens
1.6K
Snippets
2
Records
13
Agent score
75%

What's inside Open FFBoard

  1. Overview of Open FFBoard

    master

    Open FFBoard is an open-source force feedback (FFB) interface designed to create a highly compatible platform for FFB simulation devices like steering wheels and joysticks. It is primarily optimized for Direct Drive (DD) steering wheels.

    Note: This software is experimental and intended for advanced users. Features may contain errors and are subject to change.

    Key Resources:

    • Hardware Designs: Found in the OpenFFBoard-hardware repository.
    • Configuration GUI: Found in the OpenFFBoard-configurator repository.
    • Detailed Documentation: Available on the GitHub Wiki and the Doxygen site.
  2. Identify hardware targets for Open FFBoard

    master

    Open FFBoard provides specific subprojects for different hardware targets. Use the following subprojects based on your hardware:

    • F411RE: For FFBoard 1.0 hardware.
    • F407VG: For FFBoard 1.2 hardware.
    • F407VG_DISCO: For third-party development kits, specifically the ST F407 Discovery board.

    Each target subproject is designed to reference the main FFBoard firmware located in the parent directory.

  3. Extending Open FFBoard firmware

    master

    The firmware uses a modular, class-based architecture. This allows you to change the entire main class at runtime, effectively changing the USB device type and complete firmware behavior.

    To implement your own extensions:

    1. Review the FFBoardMain and ExampleMain class files in the UserExtensions folder.
    2. Use the provided helper functions for parsing CDC commands and accessing flash memory.
    3. Implement custom interfaces for motor drivers, button sources, or encoders if needed.
    4. Utilize the unified command system (defined in CommandHandler.h) to set parameters at runtime across different interfaces.
  4. Select an Open FFBoard Main Mode

    master

    The firmware's behavior is determined by its 'Main Mode' (Main Class). Common modes include:

    • FFB Wheel: A USB 1-axis force feedback device with HID FFB support. It supports multiple analog axis inputs and digital buttons.
    • FFB Joystick: A USB 2-axis force feedback device.
    • EXT FFB Gamepad: A USB 2-axis gamepad device without HID FFB. This is used for simple non-FFB devices or for sending custom FFB data via commands (see Ext FFB mode).
    • CAN Remote Analog/Digital: Sends all supported digital and analog inputs as CAN packets to a main FFBoard.
    • CAN Interface: A GVRET-compatible CAN interface used for CAN bus debugging.
  5. Use the F407_DISCO target for ST F407-Discovery boards

    master

    The F407_DISCO build target is designed for third-party development kits, specifically the official ST F407-Discovery board.

    Key Characteristics:

    • Pinout Compatibility: The pinout is closely based on the MMOS/OSW pinouts and should match them for the most part.
    • USB Vbus Sensing: USB Vbus sense is disabled in this target. This allows the build to work on boards lacking that specific connection, but it also means the system will not detect if the board is being powered externally via USB.
  6. Select the correct firmware for your FFBoard hardware

    master

    To avoid hardware damage or a non-working device, ensure you flash the firmware build that matches your specific board version and hardware configuration. Always use the .hex file for updates.

    Available Builds:

    • F407VG: For Official FFBoard 1.2+. Includes all features. Note: Requires a VBUS connection.
    • F407VG_DISCO: For third-party development kits (e.g., ST F407 Discovery board). Uses a different pin mapping. No VBUS required. Refer to the Pinouts and peripherals wiki for details.
    • F411RE: For FFBoard 1.0. Note: This version only supports TMC drivers.
  7. Generate EEPROM address files using generate_memory.py

    master

    To manage EEPROM memory addresses, do not manually alter eeprom_addresses.c or eeprom_addresses.h. Instead, define your memory layout in a memory_map.csv file and use the generate_memory.py script to automatically generate the source and header files. This script also performs a sanity check to ensure the memory map is valid.

    # Workflow:
    # 1. Edit memory_map.csv
    # 2. Run the script:
    python generate_memory.py
  8. Use the HID FFB command system in Python

    master

    The Python examples provide implementations for the HID command system. To use the HID Force Feedback (FFB) examples, you must ensure that the EXT FFB mainclass is enabled on your device.

    For a complete list of available commands to send via HID, refer to the project's official commands documentation.

    Note: A legacy pywinusb example is also provided in the repository, but it is restricted to Windows environments.

  9. Supported Motor Drivers and Interfaces

    master

    Open FFBoard supports various motor drivers through different communication interfaces. Use the following table to determine compatibility for your setup:

    NameInterface1ch Wheel2ch JoystickSupported MotorsSupported Encoders
    OpenFFBoard TMC4671SPI✅ yes⚠️ limited3 phase servo (BLDC), 2ph stepper (w. encoder), (DC)ABZ, SinCos, (Digital Hall), Analog hall
    ODriveCAN✅ yes✅ yes3 phase servoABZ, SPI, Internal
    VESCCAN✅ yes✅ yes3 phase servoABZ
    PWMPWM pins✅ yes❌ noAny external driver (PWM+Dir, Centered, RC PPM, 2x PWM)Any supported FFBoard encoder
    MyActuatorCAN✅ yes✅ yesIntegrated in servoInternal
    SimplemotionRS432 (w/ adapter) ⚠️✅ yes❌ no3 phase servo, StepperABZ, BISS-C