gps & sensor telemetry formula sae ryan langley 2104584 hpv sensor suite thomas cross 2107294

60
GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

Upload: rose-martin

Post on 18-Jan-2016

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

GPS & Sensor Telemetry

Formula SAE

Ryan Langley

2104584

HPV Sensor Suite

Thomas Cross

2107294

Page 2: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

HPV Super Series

• Human Powered Vehicle

• Multiple riders per vehicle

• Endurance races

• Manual lap timing

Page 3: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

Project Aims

• Sensor suite onboard vehicle

• Location, speed and lap times

• Data logging

• Display data to pit crew

Page 4: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

Pit Module•Graphical User Interface

•View real-time data

•Log/display lap times

•Data communications

Vehicle Module•GPS + Accelerometer

•Speed display

•Data logging

•Data communications

Page 5: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

GUI

Firmware

Hardware

Page 6: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

GUI

Firmware

Hardware

Page 7: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

RF Module

Reverse Polarity & Overvoltage Protection

Switched-Mode Power Supply (5V)

Linear Regulator(3.3V)

Liquid Crystal Display

Microcontroller

SD Card

Microcontroller

I2CUART

UART I2C SPI

Input Power

GPS Module Accelerometer

Page 8: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

RF Module

Reverse Polarity & Overvoltage Protection

Switched-Mode Power Supply (5V)

Linear Regulator(3.3V)

Liquid Crystal Display

Microcontroller

SD Card

Microcontroller

I2CUART

UART I2C SPI

Input Power

GPS Module Accelerometer

Page 9: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

Circuit Protection

• Reverse polarity protection

• Overvoltage protection

• Transient suppression

Page 10: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

RF Module

Reverse Polarity & Overvoltage Protection

Switched-Mode Power Supply (5V)

Linear Regulator(3.3V)

Liquid Crystal Display

Microcontroller

SD Card

Microcontroller

I2CUART

UART I2C SPI

Input Power

GPS Module Accelerometer

Page 11: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

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 SMPS1 x Linear

1.42 77.3% $9.41

2 x SMPS 1.21 80% $15.52

Page 12: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

RF Module

Reverse Polarity & Overvoltage Protection

Switched-Mode Power Supply (5V)

Linear Regulator(3.3V)

Liquid Crystal Display

Microcontroller

SD Card

Microcontroller

I2CUART

UART I2C SPI

Input Power

GPS Module Accelerometer

Page 13: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

Inputs

• GPS Module– Updates at 10Hz– UART - NMEA Data and checksum– 2.5m location accuracy

• Accelerometer– MMA8451Q– 3-Axis– I2C

Page 14: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

RF Module

Reverse Polarity & Overvoltage Protection

Switched-Mode Power Supply (5V)

Linear Regulator(3.3V)

Liquid Crystal Display

Microcontroller

SD Card

Microcontroller

I2CUART

UART I2C SPI

Input Power

GPS Module Accelerometer

Page 15: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

Outputs

• RF Module - RFD900– UART– 40km LOS

• LCD– I2C– Displays data to rider

• SD Card– SPI– microSD

Page 16: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

RF Module

Reverse Polarity & Overvoltage Protection

Switched-Mode Power Supply (5V)

Linear Regulator(3.3V)

Liquid Crystal Display

Microcontroller

SD Card

Microcontroller

I2CUART

UART I2C SPI

Input Power

GPS Module Accelerometer

Page 17: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

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

Page 18: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

AccelerometerSD Card

GPS

Protection Circuitry

5V SMPS

3.3V LinearRegulator

Programming Header

Page 19: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

GUI

Firmware

Hardware

Page 20: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

GUI

Firmware

Hardware

Page 21: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

Formula SAE

• Design & build race car

• Students of all disciplines

• Annual competition

• Flinders’ first year

Page 22: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

GPS Telemetry Project

• Basis for sensor addition

• Build car and driver feedback

• Improve performance of team

Page 23: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

Firmware Goals

• Configure sensors

• Read in, send and process data

• Log data

• Handle errors

• All in real time – or close to

Page 24: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

GPS

• Configure UART peripheral

• Configure GPS module

• Receive NMEA data

• Process & Send data

Page 25: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

Configure UART

• 1 start – 8 data – 1 stop – no parity

• 115,200 baud

• Interrupt based

• Ring buffer

TAIL

HEAD

$ G P R M C

Page 26: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

Configure UART

Page 27: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

GPS

• Configure UART peripheral

• Configure GPS module

• Receive NMEA data

• Process & Send data

Page 28: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

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

Page 29: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

GPS

• Configure UART peripheral

• Configure GPS module

• Receive NMEA data

• Process & Send data

Page 30: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

Receive NMEA Data

$

\n

GPS_msg_flag

N

YY

N

Receive ISR

Page 31: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

GPS

• Configure UART peripheral

• Configure GPS module

• Receive NMEA data

• Process & Send data

Page 32: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

Process & Send Data

• Pull msg from RX buffer

M C … \n$ G P R 0

N

NY

Y

Page 33: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

Accelerometer

• Configure I2C peripheral

• Configure Accelerometer module

• Obtain data

Page 34: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

Configure I2C

• 400 kHz speed

• Set as Master device

• Generic code

Page 35: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

Accelerometer

• Configure I2C peripheral

• Configure Accelerometer module

• Obtain data

Page 36: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

Configure Accelerometer

• Read latest data (not FIFO)

• 8G, 4G, or 2G mode

• 8-bit resolution

Page 37: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

Accelerometer

• Configure I2C peripheral

• Configure Accelerometer module

• Obtain data

Page 38: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

Obtain data

• Read the values at 10 Hz

• Use ‘get’ functions to access

X, Y, and Z values.

Page 39: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

The Main Loop

Page 40: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

The Results

Page 41: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

The Results

ACC IN

RFD OUT

GPS IN

Page 42: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

Data Logging

• Easy to use

• Windows compatible file system

• Different files for GPS and ACC data

Page 43: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

SD_Card.hSD_Card.c

Data Logging

SPI.hSPI.c

FatFsFiles

Main Loop

diskio.hdiskio.c

Page 44: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

SD_Card.hSD_Card.c

diskio.hdiskio.c

SPI.hSPI.c

FatFsFiles

Main Loop

Page 45: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

SD Card

• Provides high-level logging functions– Create/open files– Log ACC data– Log GPS data– Save files

Page 46: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

SD_Card.hSD_Card.c

SPI.hSPI.c

FatFsFiles

diskio.hdiskio.c

Main Loop

Page 47: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

FatFs

• Generic FAT File System Module

• Designed for embedded systems

• 3rd party open source

• Platform independent

Page 48: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

SD_Card.hSD_Card.c

SPI.hSPI.c

FatFsFiles

diskio.hdiskio.c

Main Loop

Page 49: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

Disk IO

• Provides low-level disk IO functions– Initialize– Read– Write– Disk Status

Page 50: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

SD_Card.hSD_Card.c

SPI.hSPI.c

FatFsFiles

diskio.hdiskio.c

Main Loop

Page 51: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

SPI

• Portable SPI peripheral code

• Various initialization options

• Byte transmit, receive and exchange

Page 52: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

Logging Result

Page 53: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

GUI

Firmware

Hardware

Page 54: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

GUI

Firmware

Hardware

Page 55: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

Yes

No

Get Message TypeValid Message Header?No

Yes

New Message Received?

Yes

Valid Message?

Extract Message Data

No

Update Lap/Race Timer

10 Hz

Plot GPS Location Display Acceleration

Lap Detected?

Log Lap Time

Yes

Re

se

t

Page 56: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

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

Page 57: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

Update GUI

• Update lap/race counter every 0.1s

• Plot most recent GPS location

• Display accelerometer data

• Display heading/speed

Page 58: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

Lap Detection

• Check if travel line crosses finish line

• Log lap time and display on graph/table

• Reset lap timer

Page 59: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

GUI

Page 60: GPS & Sensor Telemetry Formula SAE Ryan Langley 2104584 HPV Sensor Suite Thomas Cross 2107294

Summary

• Designed generic hardware

• Data processing and transmission

• Display real-time data on user interface

• Autonomously log lap times