DC motors controller for mobile platforms with support for ROS framework
The motors controller was designed to control up to four brushed DC motors. It’s based on 32bit microcontroller Kinetis. The basic purpose of device is control drives of mobile robots both two wheeled and four wheeled. However, there are implemented a lot of features so device can be used for other purposes too. The project differs from other motors controllers mainly because it has ROS (Robot Operating System) support and it’s able to calculate odometry data (relative position and orientation of mobile robot) based on encoders measurements. The additional software is provided like a C++ API and user application (GUI) to configure and diagnose control unit.
Features of device:
- up to 4 brushed DC motors,
- up to 4 quadrature incremental encoders (inputs: A, B signals) with logic level equal to 3,3 V or 5 V,
- motors power supply should be in range 6-24 V DC,
- continuous current up to 8 A per motor,
- peak current up to 20 A per motor,
- communication by USB (HID),
- two control modes:
- closed, speed loop with PID controller,
- open loop,
- separate tunings for every motor,
- configurable watchdog to automatic motors shutdown in case of communication breaks,
- many of safety features: i.e. overvoltage, overcurrent, deadman’s switch
- two modes for different mobile platform types: two wheeled (channels can be connected parallel) and four wheeled,
- odometry calculations what mean relative position and orientation based on incremental encoders measurements,
- 4 digital outputs (DO) up to 1 A each, for example to brakes,
- 4 digital inputs (DI) which can be configured as an emergency stop, deadman’s switch, speed limiter or as general purposes input,
- low power consumption, especially in stand-by mode,
- graphical user interface (GUI) to configure and diagnose device,
- C++ API to handle, configure, tuning and diagnose device,
- available software module in ROS framework (Hydro/Indigo/Jade/Kinetic),
- dimensions: 70 x 70 x 20 mm,
- weight about 200 g.
The diagram of device is shown below and it contains encoders interfaces, a microcontroller module, a power stage, digital inputs and outputs.
Drive controller ROS node
The below diagram shows the structure of ROS node for device. This node subscribe data like a set velocity: linear and angular, states of digital outputs. The node publishes following informations: odometry data (relative position and orientation), states of digital inputs and supply voltage. The node code was published on GitHub: https://github.com/mdrwiega/md_drive_controller .
The electronics of device was designed in opensource software KiCad. Moreover, it was used to generation of visualization placed below.
The device visualization from KiCad
Tests of device
The device was tested in robot described in following topic: Four wheeled mobile robot with Raspberry Pi. The precision of odometry system was confirmed with motion capture system OptiTrack with six cameras.