Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The LLC / ATmega2560 acts as a SPI slave to the MLC / Raspberry Pi. The data exchange repeats at 50 Hz. The communication is synchronous, i.e. the LLC waits for the MLC to initiate the exchange.

SPI is full duplex, the input and output data are exchanged simultaneously.

https://git.rwth-aachen.de/CPM/Project/Lab/software/blob/master/vehicle_atmega2560_firmware/vehicle_atmega2560_firmware/spi_packets.h

https://git.rwth-aachen.de/CPM/Project/Lab/software/blob/master/vehicle_atmega2560_firmware/vehicle_atmega2560_firmware/spi.cSee Mid Level Controller, SPI for details.

Inputs / Sensors

ADC

The ADC measures the battery voltage and the motor current. These are only used for monitoring, not control.

...

The yaw rate and acceleration vector are read from the IMU via I2C. The yaw rate is summed, to give an estimate of the yaw angle.

Odometer

The odometer has 3 digital outputs. Each signal change (rising or falling) is handled by an interrupt. The signal change indicates a motor rotation of approx. 60 degrees. The rotation count and motor speed are derived from those signals.

...

Should the communication with the MLC fail repeatedly, the LLC will enter a safe mode. The motor is commanded to brake. The safe mode is indicated by flashing all LEDs.

Tests

By setting a jumper, a test mode is activated. This allows testing the inputs and outputs without the MLC.

TODO details

Device Programming, Fuses

Image Removed