team 9 - mrav software design narrative nick gentry, vinayak gokhale, vineet ahuja & oliver...
TRANSCRIPT
TEAM 9 - MRAVSOFTWARE DESIGN NARRATIVE
Nick Gentry, Vinayak Gokhale, Vineet Ahuja & Oliver Staton
March 23, 2011
Design Considerations
Peripherals: ADC, UArt, Timer, I2C
Constants stored in Information memory portion of Flash
All peripherals will be Flag driven. Why?
JTAG ports will be used for debugging
Main Design Consideration
ADC used to Sample Ultrasonic Sensors at 20 Hz
Gyroscope sampled at 250 – 300 Hz
Accelerometer sampled at 250 – 300 Hz
Magnetometer sampled at 10Hz
User inputs at 250 – 300 Hz
START
INITIALIZE GLOBAL
VARIABLES
WRITE CONSTANTS TO NON-VOLATILE
FLASH
INITIALIZE:ADC
TIMER_A, BUART / I2C
VERIFY CONNECTION
W/BASE STATION
ENABLE PERIPHERALS
W/O INTERRUPTS except UArt
VERIFY SENSOR IDS
CHECK ESC ARM
CONDITION FLAG
INITIALIZE ESCs , BEGIN
IDLE CONDITION
WHILE (1)
SENSOR SAMPLE == 1
SAMPLE SENSORS by
enabling interrupts
PIDCOUNT == 50
CALCULATE MTR DUTY
CYCLES
IF HEARTBEAT
== 100
SET NEW PWM VALUES
TOGGLE HEARTBEAT LED
YES
NO
YES
NO
YES
NO
YES
YES
NO
YES
NO
NO
Timer_A Interrupt
Enable interrupt, set flag & set counter to 0
Sensor counter == val
Increment counter
Exit
YES
NO
PID
FBdt
dr.pNy.pNy.vN
r.pEy.pEy.vE
r.h y.h
y.w
r.yaw y.yawy.yawRate
PID
FBdt
d
PID
FBdt
d
PID
FBdt
d
PID
FBdt
d
ROTATE TO BODY
PID
FBdt
d
PIDw/ LPF
MOTOR MIXER
ROTATE TO BODY
North tilt
y.yaw
East tilt
y.yaw
SUM (L+R+F+B)
y.pitch
y.pitchRate
F-B
L-R
pitch
y.rollRatey.roll
roll
yawRate
L+R-F-B
-1
FBdt
d
PID STABILITY LOOPS
Library Written Tested
UArt Yes No
Timer Yes Partially
I2C Yes In process
ADC Yes Yes
PID controller No Worked with James Goppert and developed full simulation in Scicos
Status
The END