Brushed Motors - umrover/mrover-ros GitHub Wiki
Project Overview
On the rover exists a MCU board which essentially is a PCB powered by 12V which has various voltage lines and MCUs embedded on it. Two of the MCUs embedded on it is what we call the Motor MCUs, which are two STM32s chip whose tasks are to control the brushed motors of the rover.
The brushed motors which the STM32s control are the arm joints (Joints A, B, F, Finger, Gripper), Mast Gimbal (Pitch and Yaw), ISH carousel system, the SA system (Joints 1, 2, 3, Scoop, and Microscope).
System Overview
The two STM32 MCUs are connected via the same I2C line. They are both follower devices and the leader device in the I2C bus is the Raspberry Pi.
Top Level Code
The code is written in C++.
The I2C.cpp file is a wrapper for I2C. The Controller.cpp defines the Controller class which basically represents a motor. The ControllerMap.cpp file basically creates Controller devices based on the config (esw.yaml) file. The ROSHandler.cpp file defines all the functions that are called in response to services and topics.
MCU Code
Code can be found in embedded-testbench in dev/motors.
https://github.com/umrover/embedded-testbench/tree/dev/motors
Appendix
Motor MCU Pinouts (Blurry - sorry)
There are some pins that happened to be swapped on the actual motors MCU board.
Motor MCU 0 Pinout
Source is Motor MCU Pinout Google Sheets
Motor MCU 1 Pinout
Source is Motor MCU Pinout Google Sheets
Arm Topics
Source is Teleop ESW ICD Sheet Google Sheets
Arm Services
Source is Teleop ESW ICD Sheet Google Sheets