End-to-end Analysis and Design
- f a Drone Flight Controller
Zhuoqun Cheng, Richard West, Craig Einstein Boston University
End-to-end Analysis and Design of a Drone Flight Controller Zhuoqun - - PowerPoint PPT Presentation
End-to-end Analysis and Design of a Drone Flight Controller Zhuoqun Cheng, Richard West, Craig Einstein Boston University Emerging Drone Applications Current State of the Art Most drone apps controlled by humans Use SBCs based
Zhuoqun Cheng, Richard West, Craig Einstein Boston University
Most drone apps controlled by humans
Emerging trend towards autonomous drones
○ e.g., PX4 + Aero board, DJI example ○ Our AIM to combine flight control + mission objectives onto SBC with sufficient processing power, while meeting SWaP constraints
○ STM32 ARM Cortex M3/M4 single-core SBCs ○ Popular firmwares include Cleanflight, Ardupilot, PX4 ○ Lack support for autonomous control w/ adaptable mission
○ Object-tracking drone, e.g., Skydio ○ Shortcomings: ■ Not flexible enough to support reconfigurable missions ■ Dual board architecture: Microcontroller w/ FC firmware + powerful SBC w/ GPOS
○ Dual board ■ Microcontroller w/ FC firmware + powerful SBC w/ GPOS
○ Aim to meet SWaP (Size Weight and Power) constraints ○ Use Quest-V virtualized separation kernel ■ Virtualization-based CPU, memory and I/O partitioning ■ Quest RTOS and Linux in two sandboxes
Main Memory Core 0 Core 1 Core 2 Core 3 Quest Linux
Quest-V Quest-V
Flight Controller Image Processing Data Logging 3rd-party Apps
○ Popular racing drone flight controller ○ Firmware on ARM Cortex M3/M4 STM32 SoC ○ Multithreaded application on Quest RTOS
Main Memory Core 0 Core 1 Core 2 Core 3 Quest Linux
Quest-V Quest-V
Flight Controller Image Processing Data Logging 3rd-party Apps Cleanflight
○ Aero, UP2, Edison, MinnowMAX, etc.
○ periodic task ~ user thread; driver INT handler ~ kernel thread
Task VCPU Task VCPU VCPU Interrupt handler VCPU Scheduler
budget C and period T
○ guarantees C within T if task is runnable
Task VCPU C/T Task VCPU C/T VCPU C/T Interrupt handler RMS Scheduler
Device Driver Device Driver Device Driver ….. Data Alignment Data Alignment Data Fusion Data Fusion Device Driver Device Driver …..
○ Used to quantify system reaction time, etc. ○ E.g., Delay b/w motor speed reaction to attitude change
VCPU RMS Scheduler VCPU
Task1 Task2
VCPU
Task3
task1
T=10 ms
task2
T=1ms RMS Scheduler Four-slot Buffer
○ End-to-end reaction time: the interval between a sampled input and its first corresponding output ○ End-to-end freshness time: the interval between a sampled input and its last corresponding output WC Reaction: 1 ms WC Freshness: 10 ms
input
○ End-to-end reaction time: affected by the consumer ○ End-to-end freshness time: affected by the producer ○ Use: a combination of reaction and freshness times can bound the periods of tasks
task1
T=10 ms
task2
T=1ms RMS Scheduler Four-slot Buffer
WC Reaction: 1 ms WC Freshness: 10 ms
input
within the pipeline, determine the pipeline’s worst case end-to-end reaction and freshness times
RMS Scheduler Four-slot Buffer PWM Task AHRS Task Four-slot Buffer SPI Interrupt handler C: 200us T: 1ms C: 100us T: 5ms C: 1ms T: 5ms Din Dout
○ three stages: Read, Process, Write ○ Freshness-oriented: Simpson’s four-slot buffer ○ Asynchronous
VCPU VCPU RMS Scheduler Buffer R P W R P W
T=1ms T=10 ms RMS Scheduler single-slot FIFO R P W R P W
○ End-to-end reaction time: the interval between a sampled input and its first corresponding output ○ End-to-end freshness time: the interval between a sampled input and its last corresponding output WC Reaction: 10 ms WC Freshness: 1 ms
input
○ End-to-end reaction time: affected by the consumer ○ End-to-end freshness time: affected by the producer ○ Intuition: a combination of reaction and freshness times bounds the periods of tasks
10 1 R P W R P W
Reaction: 1 Freshness: 10
1 10 R P W R P W
Reaction: 10 Freshness: 1
Din
R P W Dout R P W R P W R P W R P W producer consumer Dout
: first corresponding output
Din R P W Dout R P W R P W R P W producer consumer
Dout Worst case end-to-end reaction time?
R P W
R P W Dout R P W R P W R P W Dold Din producer consumer
R P W
R P W Dout R P W R P W R P W Dold Din producer consumer
R P W
R P W Dout R P W R P W R P W Dold Din producer consumer
Worst case end-to-end reaction time!
○ reaction time, producer has higher priority ○ freshness time, producer has lower priority ○ freshness time, producer has higher priority
○ Composability: appending tasks to a pipeline might preempt previous tasks, but will not affect the worst case reaction and freshness times of the prior tasks as long as all the tasks are schedulable ○ End-to-end time of the pipeline is extended by the period
periods of tasks
its tasks’ VCPU periods
RMS Scheduler single-slot FIFO PWM Task AHRS Task single-slot FIFO SPI Interrupt handler C: 200us T: ? C: 100us T: ? C: 1ms T: ? Din Dout Reaction: 4ms Freshness: 8ms
requirements
the inequations ○ To prune the search space, start w/ Tprod > Tcons ○ Also use sensor & actuator hardware frequency
○
○ ○ start w/ Tprod > Tcons
○ Atom x7-Z8750 4 cores @1.6 GHz (only use core 0 for now) ○ On-board IMU, PWM
○ Port Cleanflight to Linux to measure end-to-end times ○ Profile task execution time
○ Atom x7-Z8750 4 cores @1.6 GHz (only use core 0 for now) ○ On-board IMU, PWM
○ Port Cleanflight to Linux to measure end-to-end times ○ Profile task execution time
R:10 ms; F: 23 ms R:10 ms; F: 23 ms R:20 ms; F: 44 ms
○ Atom x7-Z8750 4 cores @1.6 GHz (only use core 0 for now) ○ On-board IMU, PWM
○ Use end-to-end design to derive task periods
R:10 ms; F: 23 ms R:10 ms; F: 23 ms R:20 ms; F: 44 ms
○ Observed worst reaction and freshness end-to-end times are always less than timing constraints
worst-case end-to-end times of task pipelines
flight controllers’ end-to-end timing requirements
Main Memory Core 0 Core 1 Core 2 Core 3 Quest Linux
Quest-V Quest-V
Flight Controller Image Processing Data Logging 3rd-party Apps