-
-
Notifications
You must be signed in to change notification settings - Fork 17
Science
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. One of the MCUs embedded on it is what we call the Science MCU, which is an STM32 chip whose task is to read and parse NMEA-like messages via USART to and from the Jetson.
This chip controls various devices such as MOSFETs, servos, spectral sensors, and temperature sensors. This is useful for stuff like getting data during the science task at competition, controlling the arm laser during the equipment servicing task at competition, and controlling the LED array during the autonomous traversal task at competition.
Our science board has an STM32 chip which we write code for that controls all the logic flow for controlling the MOSFET, reading in spectral data, reading in thermistor data, and controlling the servo sensors.
Here, the MOSFET is controlled via output pins from the science board. The spectral is read in via I2C. The thermistor data is read in through the STM32 chip's ADC input pins. The servo sensors are commanded via PWM (where a certain PWM corresponds to a certain angle).
The Jetson is the one that runs the program to connect the science board system to the ROS network. A script runs on the Jetson to run all the logic to handle this connection. The Jetson is connected to the STM32 chip via USART. NMEA-like messages are used to transmit information via USART.
This program runs main. This reads NMEA like messages via UART from the STM32 chip and depending on the data received, it will publish the data to ROS topics.
In order for the user to control devices such as heaters and various LEDs, this program acts as the server for various services. Upon receiving a service request, the program will send an NMEA like message via UART to the STM32 chip to issue out the command.
Locks exist to prevent two functions from trying to access the UART line at the same time
The default servo position, the mapping of the heater to mosfets, and the mapping of auton led to mosfet devices must be changed directly in the code that must be flashed on the STM32. Other than that, you can change most things using the config file.
MCU code can be found in the embedded-testbench repository in dev/science.
https://github.com/umrover/embedded-testbench/tree/dev/science
Source is in the Science PDB Fuse MCU Pinout Google Sheets
Source is in the Teleop ESW ICD Sheet
Source is in the Science PDB Fuse MCU Pinout Google Sheets
Source is in the Science PDB Fuse MCU Pinout Google Sheets
Source is in the Connector Interface 22-23 Google Sheets