330 likes | 490 Views
Critical Design Review. 2/26/2009 Jay Brasch Daniel Kopelove Kirk Nichols Katrina Bossert. Project Overview. Create a sensing vehicle with the following functionality Natural gas sensor Geiger counter Streaming v ideo
E N D
Critical Design Review 2/26/2009 Jay Brasch Daniel Kopelove Kirk Nichols Katrina Bossert
Project Overview • Create a sensing vehicle with the following functionality • Natural gas sensor • Geiger counter • Streaming video • Control various aspects of the vehicle • Orientation and position of vehicle • Orientation and position of camera (two-axis control) Kirk Nichols
Current Project Status • SCAB I rev c • New Parts • ENC28J60 • AtTiny24 • ATF16LV8C • SCAB II rev a • New additions • LPC 2377 • Motor Relays • Ethernet PHY Module • Peripherals • Geiger counter constructed, awaiting radioactive source for sufficient testing Kirk Nichols
System Diagram Base Station Laptop LabVIEW Sensing Ports AtTiny24 ATF16LV8C Pulse(2) Geiger (Velocity) USB Joystick Vuzix HUD ADC(2) Gas Sensor Ethernet (Peripherals) PHY/MAC Layer UART (5)+ATF750 CPLD NXP 2214/2377 (Range Sensors) System Information Servo(3) DC Motor I2C (3) (Compass) Battery Level Debug Port Vehicle Control Kirk Nichols
SCAB I - AtTiny24 • Peripheral Microcontroller • 10 MHz • SPI interface • Offload the following peripheral interfaces from the LPC 2214/2377 • 8 ADCs • 12 External interrupt pins Kirk Nichols
SCAB I - ATF16LV8C • Multiplex serial communication such that all serial communication can be controlled with one UART port on LPC 2214/2377. • Programmable with WinCUPL • 3.3V Source Kirk Nichols
Advantages over the LPC2214 Microcontroller • Ethernet MAC with associated DMA Controller • Access to PHY chip via MII • Put Ethernet work into hardware instead of software • Real-Time Clock • RTOS software available • Disadvantages • Only 3.3V source needed instead of 3.3/1.8V, therefore consumes more power • Need to Port Code SCAB II - New Microcontroller – LPC2377 Kirk Nichols
SCAB II - KS8721BL • I/F to 802.3 compliant MAC system on the LPC2377 • Media Independent Interface Management (MIIM) • Internal 2.5V regulator • 50MHz VCO • Connects to RJ-45 with Magnetics • LQFP-48 Daniel Kopelove
SCAB II - KS8721BL • 100Base-TX/FX • Increased regularity thanks to fiber • Link status interrupts Software: • Olimex Board – RTOS+UIP Daniel Kopelove
KS8721BL Daniel Kopelove
Communication Protocol • Command set (from LabVIEW to scab) • Data packets (from SCAB to LabVIEW) • LabVIEW is an intelligent controller (sends low level commands to SCAB) • Data packets are static size Daniel Kopelove
Command Packet Structure Timestamp – excessively late packet arrivals Sequence num – used for statistics Opcode – one of the predefined commands Optional Raw Data – A command may have some extra data, the format of this data depends upon which opcode accompanies it, Null padded, even word aligned Daniel Kopelove
Command Set • Current implemented commands Daniel Kopelove
Data Packet Structure Daniel Kopelove
Data Packet Structure (cont) Daniel Kopelove
LabVIEW User Interface Katrina Bossert
LabVIEW: Successes and Problems • Successful • Reasonable user interface • Web browser and successful IP address connection • Problems • LabVIEW USB Driver • Limitations in programming (e.g. you must request a specific size of data from a TCP/IP connection) Katrina Bossert
Current User Interface Goggles (incorporate C++ code) USB Joystick & LabVIEW Driver Serial Communication LabVIEW Keyboard Control Video Streaming TCP IP and Communication protocol Katrina Bossert
FreeRTOS • “Don’t do it” • Threading never as simple as it seems • Advantages • Manages system timers and interrupts • Convenient scheduling of recurring tasks • Our implementation • Latencies as high as 100 ms acceptable • Short, simple tasks Jay Brasch
FreeRTOS Pseudocode void ethernetController( void *pvParameters ) { DataType Data1, Data2 while( true) { vTaskDelayUntil( &xLastWakeTime, CYCLE_RATE_MS ) // Request data from the sensors. if(checkEthernetQueue(&Data1) if (Data.HighPriority) processCriticalTask(Data1) else processNormalTask(Data1) } } } Jay Brasch
Power Design Two battery sources for maximum isolation *35W motor battery readily available Jay Brasch
FAIL! Handling • Goal: Handle unexpected conditions gracefully • “Heartbeat” packet sent periodically • Battery state sensing • Relays • Reset motor controller • Reset router manually or 90 dB buzzer • Lost communication procedures • Wait and attempt reconnect • Move 5s opposite most recent heading • Execute Start of Day (SOD) task Jay Brasch
RTOS Scheduling (periodic) Jay Brasch
RTOS Scheduling (aperiodic) Jay Brasch
Milestones • Milestone 1 • SCAB installed on vehicle • Controlling motors • Controlling camera • Embed video stream in LabVIEW • LabVIEW controls vehicle via RS232 • Milestone 2 • SCAB acts as network host • Transmits telemetry data to LabVIEW interface • LabVIEW acts as network host • Transmits control commands to SCAB • System can run 30 minutes from battery Katrina Bossert
Responsibilities Kirk Jay SCAB Vehicle HUD Ethernet Communication LabVIEW Router Katrina Bossert Katrina Dan
KS8721BL Kirk Nichols
LPC 2377 Kirk Nichols
ATF16LV8C Kirk Nichols
KS8721BL Kirk Nichols
u08 pkt1[] = {0x00, • 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, • 0xb6, 0x98, 0x95, 0x3f, 0x08, 0x06, 0x00, 0x01, • 0x08, 0x00, 0x06, 0x04, 0x00, 0x01, 0x00, 0x16, • 0xb6, 0x98, 0x95, 0x1f, 0x0a, 0x00, 0x01, 0x02, • 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, • 0x01, 0x14 }; • IO3DIR |= 0x00000002; • IO3SET = 0x00000002; • initMAC(); • write_ptr = ReadETHReg(EWRPTL); • write_ptr |= (ReadETHReg(EWRPTH) << 8); • WriteMacBuffer(pkt1, 51); • write_ptr = ReadETHReg(EWRPTL); • write_ptr |= (ReadETHReg(EWRPTH) << 8); • WriteCtrReg(ETXNDL, write_ptr); • WriteCtrReg(ETXNDH, (write_ptr >> 8)); • SetBitField(ECON1,ECON1_TXRTS); Kirk Nichols