Critical Design Review 2/26/2009 Jay Brasch Daniel Kopelove Kirk Nichols Katrina Bossert.
-
date post
21-Dec-2015 -
Category
Documents
-
view
212 -
download
0
Transcript of Critical Design Review 2/26/2009 Jay Brasch Daniel Kopelove Kirk Nichols Katrina Bossert.
Critical Design Review
2/26/2009Jay Brasch Daniel KopeloveKirk 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
NXP 2214/2377
ADC(2)
Gas Sensor
(Range Sensors)
Pulse(2)
Geiger(Velocity)
(Compass)I2C(3)
Sensing Ports
PHY/MAC Layer
DC Motor
DC Motor
Servo(3)
UART(5)+
ATF750 CPLD
System Information
Vehicle Control
Battery Level
Battery Level
Debug Port
Debug Port
Ethernet
Base Station
LaptopLaptop LabVIEWLabVIEW
Vuzix HUDVuzix HUD
USB Joystick
(Peripherals)
AtTiny24AtTiny24 ATF16LV8CATF16LV8C
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
SCAB II - New Microcontroller – LPC2377
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
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 interruptsSoftware:• Olimex Board – RTOS+UIP
Daniel Kopelove
KS8721BLMDIO1
MDC2
RXD3/PHYAD13
RXD2/PHYAD24
RXD1/PHYAD35
RXD0/PHYAD46
VDDIO7
GND8
RXDV/PCS_LPBK9
RXC10
RXER/ISO11
GND12
VDDC13
TXER14
TXC/REF_CLK15
TXEN16
TXD017
TXD118
TXD219
TXD320
CO/RMII21
CRS/RMII_BTB22
GND23
VDDIO24 INT/PHYAD0 25LED0/TEST 26LED1/SPD100 27LED2/DUPLEX 28LED3/NWAYEN 29PD 30VDDRX 31RX- 32RX+ 33FXSD/FXEN 34GND 35GND 36REXT 37VDDRCV 38GND 39TX- 40TX+ 41VDDTX 42GND 43GND 44X0 45X1 46VDDPLL 47RST 48
KS8721BLE1
KS8721bl
LED100LEDACT
TX+
RX+
TX-
RX-
E_MDIOE_MDC
E_RXD1E_RXD0
E_RX_ER
E_REF_CLKE_TX_ENE_TXD0E_TXD1
E_CRS
3v3
GNDGND
GND
100nF
C111
GND
100nF
C112
GND
3v3
10kR107
3v3
100nF
C113
NetLabel317
GND
3v3
NC100nF
C114
GND
3v3 3v3
GND
100nF
C115
3v3
10kR108
3v3
10kR109
3v3
PD
PD
PHY_INT
3v3
10kR110
E_X1
E_X1
4.99kR111
1.5kR112
GND
REXT
REXT
RST
TRI1
GND2
Output 3
VDD 4
CD1
VCO
E_REF_CLK
GND
3v3
100nF
C116
VDDTX local bypass
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 StructureField (offset) Timestamp
(0x0)Sequence Num (0x3)
Opcode (0x7) Optional Raw Data (0x9)
Format U32 U32 U16 U64
Timestamp – excessively late packet arrivalsSequence num – used for statisticsOpcode – one of the predefined commandsOptional 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 commandsCommand Code
Set speed pulse width 0x0010
Set vehicle heading servo pulse width 0x0011
Set pan servo pulse width 0x0012
Set tilt servo pulse width 0x0013
Send data 0x0020
Set periodic data transmission interval 0x0021
Restart system 0x0030
Reset DC motor controller 0x0031
Self Destruct 0x0BAD
Daniel Kopelove
Data Packet StructureField (offset) Timestamp
(0x00)Sequence Num (0x03)
Valid (0x07) Geiger counts last sec (0x0E)
Format U32 U32 U64 U16
Field (offset)
Geiger counts last 5 sec (0x11)
Geiger counts Last X sec (0x13)
Geiger counts last Y sec (0x15)
Speed pulse last W sec (0x17)
Format U16 U16 U16 U16
Field (offset)
Speed pulseLast X sec (0x19)
Speed pulse last Y sec (0x1B)
Speed pulse last Z sec (0x1D)
Gas LEL (0x1F)
Format U16 U16 U16 U16
Daniel Kopelove
Data Packet Structure (cont)Field (offset) A/D 2 (0x21) Compass
(0x23)I2C 1 (0x27) I2C 2 (0x2B)
Format U16 U32 U32 U32
Field (offset) Battery stack V 1 (0x2F)
Battery stack V 2 (0x31)
Servo 1 pulse width (0x33)
Servo 2 pulse width (0x35)
Format U16 U16 U16 U16
Field (offset) Servo 3 pulse width (0x37)
H&S Data (0x39)
Speed pulse width (0x3D)
Format U16 U32 U16
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
LabVIEW
USB Joystick& LabVIEW Driver
Video Streaming
TCP IP and Communication
protocol
Keyboard Control
Goggles(incorporate
C++ code)
Serial Communication
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 Pseudocodevoid 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
Jay Brasch
12 V (26 W) Consumption (W) 7.6V (21 W) Consumption(W)
SCAB 4 Motor 20
Ethernet Controller 3 Ethernet Camera 6
Router 6 Servos 2
Geiger Counter 2
Total 15 Total 26
*35W motor battery readily available
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
Task Time 1 2 3 4 5 6 7 8 9 10 11
Poll Tiny 1 x
Poll Batt 1 x
Poll Link 1 x
Poll Periph 1 x
Poll Command Queue 1 x
Poll Speed 1 x
Poll Gas 1 x
Heartbeat 1 x
Comm. INT 3 x x x
RTOS Scheduling (aperiodic)
Jay Brasch
Task Time
Request from Tiny 1
Open/Close relays 1
Actuate Servos 1
Change motor speed 1
Send Data 3
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
Questions
HUD
ResponsibilitiesKirk
Katrina
Jay
Dan
Ethernet Communication
Router
SCABVehicle
LabVIEW
Katrina Bossert
KS8721BL
180R101
180R102
LEDACTLED100
TX+ TX-
RX+ RX-
49.9R103
49.9R104
49.9R105
49.9R106
100nF
C109
L1
3v3
100nF
C110
GND
TPOUT- 2
rcon6
TPOUT+1
TPIN+7
LED1+9
LED2+11
TPIN-8
LED1-10
LED2-12
tcon3
RJ45 w/Mag
U22
magjack
3v3
Kirk Nichols
LPC 2377
Kirk Nichols
ATF16LV8C
Kirk Nichols
Kirk Nichols
KS8721BL
• 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
Kirk Nichols