Formula SAE Ryan Langley 2104584 GPS & Sensor Telemetry HPV Sensor Suite Thomas Cross 2107294 Formula SAE Ryan Langley 2104584
HPV Super Series Human Powered Vehicle Multiple riders per vehicle Endurance races Manual lap timing
Project Aims Sensor suite onboard vehicle Location, speed and lap times Data logging Display data to pit crew
Vehicle Module GPS + Accelerometer Speed display Data logging Data communications Pit Module Graphical User Interface View real-time data Log/display lap times Data communications
Hardware Firmware GUI
Hardware Firmware GUI
Reverse Polarity & Overvoltage Protection Input Power Reverse Polarity & Overvoltage Protection Switched-Mode Power Supply (5V) Linear Regulator (3.3V) GPS Module Accelerometer UART I2C Microcontroller Microcontroller UART I2C SPI RF Module Liquid Crystal Display SD Card
Reverse Polarity & Overvoltage Protection Input Power Reverse Polarity & Overvoltage Protection Switched-Mode Power Supply (5V) Linear Regulator (3.3V) GPS Module Accelerometer UART I2C Microcontroller Microcontroller UART I2C SPI RF Module Liquid Crystal Display SD Card
Circuit Protection Reverse polarity protection Overvoltage protection Transient suppression
Reverse Polarity & Overvoltage Protection Input Power Reverse Polarity & Overvoltage Protection Switched-Mode Power Supply (5V) Linear Regulator (3.3V) GPS Module Accelerometer UART I2C Microcontroller Microcontroller UART I2C SPI RF Module Liquid Crystal Display SD Card
Power Supply 3.3V and 5V rails Linear regulator for each rail 5V SMPS powering 3.3V linear regulator SMPS for each rail 3.3V @ 0.1A 5V @ 0.9A Ploss (W) Efficiency Cost($AU) 2 x Linear 7.17 40.3% $3.30 1 x SMPS 1 x Linear 1.42 77.3% $9.41 2 x SMPS 1.21 80% $15.52
Reverse Polarity & Overvoltage Protection Input Power Reverse Polarity & Overvoltage Protection Switched-Mode Power Supply (5V) Linear Regulator (3.3V) GPS Module Accelerometer UART I2C Microcontroller Microcontroller UART I2C SPI RF Module Liquid Crystal Display SD Card
Inputs GPS Module Accelerometer Updates at 10Hz UART - NMEA Data and checksum 2.5m location accuracy Accelerometer MMA8451Q 3-Axis I2C
Reverse Polarity & Overvoltage Protection Input Power Reverse Polarity & Overvoltage Protection Switched-Mode Power Supply (5V) Linear Regulator (3.3V) GPS Module Accelerometer UART I2C Microcontroller Microcontroller UART I2C SPI RF Module Liquid Crystal Display SD Card
Outputs LCD SD Card RF Module - RFD900 UART 40km LOS I2C Displays data to rider SD Card SPI microSD
Reverse Polarity & Overvoltage Protection Input Power Reverse Polarity & Overvoltage Protection Switched-Mode Power Supply (5V) Linear Regulator (3.3V) GPS Module Accelerometer UART I2C Microcontroller Microcontroller UART I2C SPI RF Module Liquid Crystal Display SD Card
Microcontroller 2 x UART - GPS & RF Module 1 x SPI - SD Card (SPI Mode) 1 x I2C - Accelerometer, LCD PIC18F46K22 2 x UART, 2 x SPI/I2C 64KB Program Memory 64MHz oscillator
Protection Circuitry 5V SMPS GPS Programming Header 3.3V Linear Regulator Accelerometer SD Card
Hardware Firmware GUI
Hardware Firmware GUI
Formula SAE Design & build race car Students of all disciplines Annual competition Flinders’ first year
GPS Telemetry Project Basis for sensor addition Build car and driver feedback Improve performance of team
Firmware Goals Configure sensors Read in, send and process data Log data Handle errors All in real time – or close to
GPS Configure UART peripheral Configure GPS module Receive NMEA data Process & Send data
Configure UART 1 start – 8 data – 1 stop – no parity 115,200 baud Interrupt based Ring buffer TAIL HEAD $ G P R M C
Configure UART
GPS Configure UART peripheral Configure GPS module Receive NMEA data Process & Send data
Configure GPS Module Send only GPRMC and GPGSA Lat & long Date & time Speed, heading Precision Configure baud to 115,200 Send data at 10 Hz
GPS Configure UART peripheral Configure GPS module Receive NMEA data Process & Send data
Receive NMEA Data $ \n GPS_msg_flag Receive ISR N N Y Y RXIF Framing error? Buffer overflow? ‘$’ or ‘\n’ Put in buffer Exit Flush buffer Receive ISR N N Y Y $ GPS_msg_flag \n
GPS Configure UART peripheral Configure GPS module Receive NMEA data Process & Send data
Process & Send Data Pull msg from RX buffer N Y Y N $ G P R M C … \n Pull char from buffer Is it ‘$’ Place in array Is it ‘\n’ Place 0 in array Check Checksum N Y Y N $ G P R M C … \n
Accelerometer Configure I2C peripheral Configure Accelerometer module Obtain data
Configure I2C 400 kHz speed Set as Master device Generic code
Accelerometer Configure I2C peripheral Configure Accelerometer module Obtain data
Configure Accelerometer Read latest data (not FIFO) 8G, 4G, or 2G mode 8-bit resolution
Accelerometer Configure I2C peripheral Configure Accelerometer module Obtain data
Obtain data Read the values at 10 Hz Use ‘get’ functions to access X, Y, and Z values.
The Main Loop
The Results
The Results ACC IN RFD OUT GPS IN
Data Logging Easy to use Windows compatible file system Different files for GPS and ACC data
Data Logging Main Loop SD_Card.h SD_Card.c FatFs Files diskio.h diskio.c SPI.h SPI.c
Main Loop SD_Card.h SD_Card.c FatFs Files diskio.h diskio.c SPI.h SPI.c
SD Card Provides high-level logging functions Create/open files Log ACC data Log GPS data Save files
Main Loop SD_Card.h SD_Card.c FatFs Files diskio.h diskio.c SPI.h SPI.c
FatFs Generic FAT File System Module Designed for embedded systems 3rd party open source Platform independent
Main Loop SD_Card.h SD_Card.c FatFs Files diskio.h diskio.c SPI.h SPI.c
Disk IO Provides low-level disk IO functions Initialize Read Write Disk Status
Main Loop SD_Card.h SD_Card.c FatFs Files diskio.h diskio.c SPI.h SPI.c
SPI Portable SPI peripheral code Various initialization options Byte transmit, receive and exchange
Logging Result
Hardware Firmware GUI
Hardware Firmware GUI
10 Hz New Message Received? No Update Lap/Race Timer Yes No Valid Message Header? Get Message Type Plot GPS Location Display Acceleration Yes Reset No Valid Message? Lap Detected? Yes Yes Extract Message Data Log Lap Time
Receiving Data Scan until new message is received Check for valid header e.g. “$GPRMC…” Check for correct length and checksum Extract message data Lat & long Date & time Speed, heading
Update GUI Update lap/race counter every 0.1s Plot most recent GPS location Display accelerometer data Display heading/speed
Lap Detection Check if travel line crosses finish line Log lap time and display on graph/table Reset lap timer
GUI
Summary Designed generic hardware Data processing and transmission Display real-time data on user interface Autonomously log lap times