310 likes | 545 Views
High Speed Digital Systems Lab. Bus Tracking System Final Part B presentation. Presented by: Gal gavish and Yuval Peled Supervisor: Hen Broodney. Spring 2004. Project’s Goals. Create a system that tracks a bus and gathers the arrival times to each station along its route.
E N D
High Speed Digital Systems Lab Bus Tracking SystemFinal Part B presentation Presented by: Gal gavish and Yuval Peled Supervisor: Hen Broodney Spring 2004
Project’s Goals • Create a system that tracks a bus and gathers the arrival times to each station along its route. • The system includes only one module: the bus. • The bus identifies a station’s position using GPS and prints it to LCD
General System Requirements • Independent of human intervention. • Gathers the time of arrival only to stations that belong to the bus’s route. • Print station’s ID and allowed speed in the area. • Low power consumption.
GPS – Global Positioning System • Position is determined by the distance from 3 or 4 satellites. • The position calculation is done insideThe receiver and is transmitted to themicro-processor. • A new position calculation is done every second. • The GPS accuracy is up to a few meters. (10 – 15)
GPS – Time to first fix • Cold start: less than 2 minutes. Search satellites, collect ephemeris and almanac data, compute position fix. • Warm start: less than 45 secondsNo satellite connection for more than 1 hour, but • back up voltage keeps almanac and ephemerisHot start: less than 20 secondsNo satellite connection for less than 1 hour, but back up voltage keeps almanac and ephemeris
GPS – Interface & HW Development board: +5 Volt To RS232 Port RS232 connector GPS Receiver Maxim 232A Antenna RS232 TTL/CMOS Level
Development board: LCD Entries exits PIC18F452 microprocessor GPS - Trimble + peripherals Clock Generator 10MHz Serial EEPROM Battery 9V Block diagram for the bus module
GPS – Message packets Packets structure: • <DLE> is the byte 0x10 • <ETX> is the byte 0x03<DLE> <ID> <data string bytes> <DLE> <ETX> • Every <DLE> byte in the data string is preceded by another <DLE> byte.
GPS – Message parsing DLE Status DLE 1 DLE Status Empty ETX Status Full DLE DATA ETX DLE Status DATA Status DLE 2 DATA DLE <DLE> <ID> <data string bytes> <DLE> <ETX>
GPS – Packets implemented • Time report:Get the time of week from the GPS • GPS status:Print to LCD the current satellite communication status. How many satellites are visible, when it does position fixes, are the DOP too high, etc • Single precision LLA: Get the current position fix. It contains 3 float numbers representing the latitude, longitude and altitude calculated in the GPS module. • Single precision Velocity: Get the current velocity and movement direction of the bus. It contains 3 float numbers representing the velocity north, east and up. • Double precision LLA: 3 double numbers representing the latitude, longitude and altitude.
Software design We have 1 main module: • The bus module. And 4 utility modules: • UART module • GPS module • I2C module • LCD module
Software Architecture Bus UART module Initialization Receive position Print result I2C module LCD module EEPROM Search and write GPS module
Utility modules I2C module: • Write to and read from a shift register inside the PIC18F. • No interrupts needed. GPS module: • Implemented TSIP (Trimble Standard Interface Protocol). UART module: • Used to connect between the GPS and the microprocessor software.
Initialize bus GPS High priority interrupt Parse message New GPS message Wait for a new GPS message General message Print message to LCD Position message NO Check if it’s My station Print speed To LCD Write time In memory YES Bus moduleprogram flow
Bus module - interrupts GPS Initialize… Wait… Connected UART High priority interrupt EEPROM Phase
Timing • EEPROM timing: • Write/read 8 bytes from serial 8 bit bus using the shift register. • 5 msec each read/write action. • Search a station in table: takes 50-100 msec. (before displaying the speed) • GPS timing: • Sends position message every one second. • Sends health message every 5 seconds
Power consumption • PIC18F452:~1.6 mA • GPS receiver:~50 mA • GPS Antenna:~150 mA • EEPROM:~3.2 mA • Max 232A:~10 mA • TOTAL = 215 mA
EEPROM - Memory List of all stations: • Up to 3000 stations, Average of 8 lines in each and 1 speed mark = 3000 x (4 + 4 + 6 + 8 x 3 + 1) = ~ 115KB List of stations in route: • Up to 400 stations and arrival times = 400 x (8 + 2) = ~ 4KB
Goals accomplished • Learning TSIP and implementing it on the PIC18F452 • Find and purchase a GPS receiver and antenna. • Install new GPS hardware on the development board. • Integration of GPS, UART, LCD and I2C modules on the PIC.
Conclusions • The GPS module of part B can be combined with the Bluetooth module of part A:- it will enable a much faster connection establishment between the bluetooth devices.- it will enable passing information between buses and stations such as time of next arrival, current position or even commercials. • The GPS module of part B can be combined with a cellular device:- it can enable all position calculations and memory accesses to be done in a remote server thus minimizing the embedded system’s complexity.- anyone with a cellular device can receive real time information about buses positions and expected time of arrival.
High Speed Digital Systems Lab Bus Tracking SystemFinal part Bpresentation Presented by: Gal Gavish and Yuval Peled Supervisor: Hen Broodney Spring 2004
Hardware • Microchip PIC18F452 – a 40-pin chip. • Trimble GPS Lassen SKII and antenna • Serial EEPROM (24LC256) by Microchip - 256K x 8bit. • Clock generator – 10MHz. • LCD • Battery – 9V.
Specifications – Cont. Microchip PIC18F452
Specifications – Cont. Trimble Lassen II K GPS
Specifications – Cont. Microchip 24LC256 EEPROM
EEPROM life expectancy • Serial EEPROMs are typically rated to endure 1 million write operations per byte. • Every time the bus enters the central-station it clears the entire EEPROM memory. • Assume the bus returns to the central-station 20 times a day, 5 days a week. Life_expectancy = 10^6 / (20x5x52) ~ 192 years Before BER increases dramatically.
Software tools • We’ll be using the C18 C compiler from the MPLab IDE (Integrated Development Environment) to write our C code for the programs running on the PIC. • We’ll be using the MPLab ICD 2 (In Circuit Debugger) to program the PIC.
Debugging tools • To debug the application programmed on the PIC we’ll use the in-circuit debugger (ICD) supplied with the PICDEM 2 Plus development board. • Since debugging with the ICD is slow, we’ll also be using the LCD and the LEDs on the development board for faster and easier debugging.
High Speed Digital Systems Lab Bus Tracking SystemFinal Part Bpresentation Presented by: Gal Gavish and Yuval Peled Supervisor: Hen Broodney Spring 2004