Files
PX4-Autopilot/docs/en/peripherals/hiwonder_emm.md
Michael Fritsche 65be196b9b docs(rovers): add hiwonder rover airframes and setup guide (#27333)
* rover: add hiwonder rover airframes

* docs: hiwonder rovers setup guide

* docs(docs): compress images

* docs(docs): prettier

* docs(docs): subedit

* docs(rover): add back tip about custom firmware install

* docs(rover): detail the hiwonder build / enable instructions

* docs(rover): fix airframe typo for ackermann

* docs(docs): Improve firmware section

---------

Co-authored-by: chfriedrich98 <chfriedrich@student.ethz.ch>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
Co-authored-by: Ramon Roche <mrpollo@gmail.com>
2026-05-21 15:51:52 -04:00

4.4 KiB
Raw Permalink Blame History

Hiwonder 4-Channel Encoder Motor Module

The Hiwonder 4-Channel Encoder Motor Driver is a small I2C motor controller with integrated encoder feedback for up to four brushed DC motors. It is well suited to small wheeled rovers (differential, ackermann, or mecanum) where size, weight, and a low channel count make a full-size ESC overkill.

PX4 supports the board via the hiwonder_emm I2C driver.

Features

  • Four independent motor outputs with closed-loop speed control from on-board encoders.
  • I2C interface (default address 0x34, 400 kHz).
  • Battery voltage telemetry of the supply rail powering the motor outputs.
  • Selectable motor types (TT, N20, JGB37-520-12V-110RPM, or open-loop "no encoder").

Where to Buy

Hardware Setup

Wiring

Connect the four motors (with their encoder leads) to channels M1M4 on the EMM and supply the motor driver from a battery suitable for the motors used. Wire the EMM's I2C bus (SDA, SCL, GND) to an external I2C port on the flight controller. The driver is hard-coded to bus 1 (the first external I2C bus) at address 0x34, which is the board default.

::: info The driver auto-detects the four channels but the motor type is selected in firmware. The shipped default is JGB37-520-12V-110RPM; change HiwonderEMM.cpp (set_motor_type) if you use a different model. :::

Building the Firmware

To use the EMM, the hiwonder_emm driver must be compiled into the firmware and started on boot.

  1. Add the following line to the rover.px4board file of your board (for Skynode S this would be in boards/auterion/fmu-v6s/rover.px4board) so the driver is compiled in:

    CONFIG_DRIVERS_HIWONDER_EMM=y
    
  2. Make sure the driver is started on boot when the HIWONDER_EMM_EN parameter is 1.

    For rover airframes (ackermann, differential, mecanum) this is already done by the shared rover startup script rc.rover, which contains:

    if param compare HIWONDER_EMM_EN 1
    then
       hiwonder_emm start
    fi
    

    For other airframes that should use the EMM, add the same block to your board's rc.board_sensors file (for Skynode S this would be in boards/auterion/fmu-v6s/init/rc.board_sensors).

  3. Build and flash the firmware for your board.

::: info Many flight controllers already enable CONFIG_DRIVERS_HIWONDER_EMM=y in their rover.px4board configuration, so the default rover build is sufficient and step 1 is not required. :::

Flight Controller Setup

Enable the Driver

Set the HIWONDER_EMM_EN parameter to 1 and reboot. On the next boot the driver is started by the startup script (see Building the Firmware).

Actuator Allocation

The driver exposes a four-channel output group with the EMM parameter prefix. In Actuator Configuration, assign the rover wheel outputs (e.g. Motor 1, Motor 2, …) to channels EMM 1EMM 4 matching how the motors are wired to the EMM.

The output range is fixed in firmware to 0..255 (the EMM's protocol range, internally mapped to a signed [-128, 127] speed command — 128 is stop, values below are reverse, values above are forward). EMM_DIS{i} (disarmed) and EMM_FAIL{i} (failsafe) per-channel parameters are user-tunable in the standard range.

Supported Vehicles

The EMM is used on the reference Hiwonder rover frames:

  • 50002 — Hiwonder differential rover
  • 51003 — Hiwonder ackermann rover
  • 52001 — Hiwonder mecanum rover

See Rovers for vehicle-side configuration.

Further Information