🛠 First wiring and initialization of the 4-Encoder Motor Driver

Unit 4-Encoder Motor Driver (DRV8837DSGR) · avance · Guide avancé pour le câblage physique, la gestion de l'alimentation et la vérification de la communication I2C du module DRV8837DSGR.

Objectifs

This tutorial aims to perform a safe first boot of the 4-Encoder Motor Driver Unit. Unlike simple modules, this device integrates an STM32F030C8T6 microcontroller and four DRV8837DSGR H-bridges. The goal is to validate the power chain, I2C communication, and encoder integrity before any movement command. We will cover external voltage management and I2C address configuration.

Matériel nécessaire

Étapes

  1. Power Source Preparation: The module accepts a DC input of 6 to 12V. Never connect a voltage higher than 12V. For a first test, use a 7.4V (2S LiPo) adjustable supply to limit inrush current. Check polarity on the external power connector.
  1. Motor Connection: Connect a 6-wire geared motor to PH2.0-6P connector #1. Follow standard pinout: two wires for the motor (OUT1/OUT2), two for encoder power (VCC/GND), and two for encoder signals (A/B). Motor wire inversion is harmless, but encoder wire inversion will reverse reading direction.
  1. Host Connection: Connect the module to the controller via a Grove HY2.0-4P cable. This port carries I2C (SDA/SCL) and 5V. The module has an internal DC-DC converter providing up to 5V @ 8A, but ensure your host is independently powered if needed.
  1. Hardware Verification: Before sending commands, use a multimeter to verify 5V presence on Grove connector VCC pins. Check if the WS2812C RGB LED lights up (it may blink or stay off depending on initial firmware).
  1. I2C Scan: Run an I2C scan on your host. The default address is 0x24. If the module does not respond, check SDA/SCL connections and common ground. The address is configurable between 0x08 and 0x77 but requires a specific command once communication is established.

Vérification

Pour aller plus loin

Once communication is established, explore advanced control modes like closed-loop speed regulation. You will need to configure PID registers via I2C to compensate for deviations between the setpoint and the actual position measured by the encoders.

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials