From Control Model to Program: Investigating Robotic Aerial Vehicle Accidents with M AYDAY Taegyu Kim 1 , Chung Hwan Kim 2 , Altay Ozen 1 , Fan Fei 1 , Zhan Tu 1 , Xiangyu Zhang 1 , Xinyan Deng 1 , Dave (Jing) Tian 1 , Dongyan Xu 1 1 Purdue University 2 UT Dallas
Drone (Robotic Aerial Vehicle) Accidents
RAV Control and Control-Semantic Bugs π¨ π§ππ₯ πππ’πβ Control Program Observed vehicle states in β6DoFsβ π§ π¦ π πππ Control Control-Semantic Bug Mission Sensor Station Module Module β’ Accident root cause inside control program β’ Incorrect or incomplete Control Model Physical implementation of Environment control model Motor Aerodynamics
A Motivating Accident
Challenges in Investigating the Accident Control-level Attack Log impact β’ βTwo Gapsβ Control Control Model β’ Domain gap ? Domain Gap β’ Control domain β Program domain Program Control Program β’ Time gap Root Cause β’ Attack time β Impact time 80 Velocity (cm/s) β’ Our solution: M AYDAY 60 Attack CMD 40 β’ Bridge the gaps Reference Velocity 20 Impact Actual Velocity 0 β’ Enable cross-domain investigation 4800 4900 5000 5100 5200 Control Loop Iteration Time Gap
MAYDAY Workflow Control-level Control Program Program Log Program Crash Investigation (Source Code) Instrumentation Analysis Result Program-level Control Variable Investigation Dependency Graph (CVDG) Runtime Offline Analysis & Instrumentation Post-Accident Investigation Logging
α· α· α· αΆ α· αΆ α· αΆ αΆ αΆ α· αΆ αΆ α· α· αΆ αΆ αΆ αΆ α· α· αΆ α· αΆ α· αΆ α· αΆ α· αΆ αΆ αΆ α· α· α· α· RAV Control Model Control Variable Dependency Graph (CVDG) S M P S M P S M P π π π¦ π π π ANGLE π¦ π¦ π π π¦ POS π¦ π§ π π π§ POS π¦ π§ Controller Controller Controller π π VEL VEL VEL π¦ π π¦ π¦ π π¦ π§ π π π π π¦ π π§ 6DoF π¦ π§ Controller Controller Controller ACCEL ACCEL ACCEL π¦ π π π π¦ π¦ π π¦ π§ π π π π π¦ π π§ Controller π¦ Controller π§ Controller X-axis Cascading Yaw Cascading Y-axis Cascading Controller Controller Controller Cascading π = ππ’ππ β α· π¦π‘πππ + α· π§πππ‘π π = βππ’ππ α· π¦πππ‘π + α· π§π‘πππ π π controller S M P S M P S M P π π π π π¦ π¨ π π¨ POS π¦ π π π ANGLE π¦ π π π ANGLE π¨ π Controller Controller Controller VEL π¦ π¨ π π VEL VEL π π¨ π¦ π π π π¦ π π π π π π¨ π Controller Controller Controller Inter- ACCEL ACCEL ACCEL π¦ π¨ π π π¨ π¦ π π π π π¦ π π π π π π¨ Controller π Controller Controller S dependency Z-axis Cascading Roll Cascading Pitch Cascading Controller Controller Controller between Motor Controller controllers : Sensor Input S P : Parameter Input x 4 M : Mission Input
αΆ αΆ α· α· αΆ α· αΆ αΆ αΆ Mapping Control Model to Control Program Control Model S M P Control Program void AC_PosControl::rate_to_accel_z( POS π π¦ π¨ π π¨ π¨ Controller β¦ Mapping vel_err.z = vel_target.z - cur_vel.z VEL p = _p_velz._kP() * vel_err.z; π¦ π¨ π π π¨ π¨ Controller accel_target.z = accel_ff.z + p ; β¦ ACCEL π π¦ π¨ π π¨ Controller π¨ : Parameter : Reference : Vehicle state π π¦ π¨ π π¨ π¨ : Sensor input : Parameter input : Mission input S M P β’ Control model variable β Control program variable β’ Control model data flow β Control program execution paths
Logging Enhancement β’ Control/vehicle operation log β’ Recorded by default β’ Supported by major drone control programs β’ Recorded by control-level logging functions β’ Program execution log If err.z -= cur.z; else err.z = 0.0; p = kP* err.z; β’ Enabled by M AYDAY β’ Logging functions inserted via LLVM-level instrumentation β’ Guided by mapping between control model and program
Control-Level Investigation Initial Investigation Digression 1000 Initial 800 X-axis Velocity Digression 600 400 200 0 -200 8000 15000 22000 29000 36000 Control Loop Iteration : Reference β’ Identify initial digressing controller : Actual state β’ [Controller, corrupted variable, initial digression time] β’ Infer control-level corruption path based on CVDG
Moving from Control Domain to Program Domain Initial Investigation Digression 1000 Initial 800 X-axis Velocity Digression 600 400 200 0 -200 8000 15000 22000 29000 36000 Control Loop Iteration : Reference β’ Corrupted control variable β Corrupted program variable : Actual state
Program-Level Investigation Initial Investigation Digression 1000 Initial 800 X-axis Velocity Digression 600 400 Attack Input 200 0 -200 Attack Input Program-level 8000 15000 22000 29000 36000 Corruption Path Control Loop Iteration : Reference β’ Control-level corruption path β Program-level corruption path : Actual state β’ From initial digression to attack input β’ Bug localized in basic blocks that implement the corruption path
Evaluation: Effectiveness of M AYDAY
Evaluation: Solving the Earlier Case Control-Level Log 1000 Initial 800 X-axis Velocity Digression β’ Initial digressing controller: X, Y-axis velocity controller 600 400 Attack β’ Corrupted control variable: X, Y-axis acceleration reference Input 200 β’ Control-level corruption path: 0 -200 8000 15000 22000 29000 36000 Control Loop Iteration Program-Level Log β’ Attack input: Control gain k P β’ Number of BBs on corruption path: 34 β’ Source LoC: 89
Evaluation: Runtime Overhead of M AYDAY
Conclusion β’ Drone accident may be caused by control semantic bugs β’ Control-level logs alone are not sufficient for bug-tracing β’ M AYDAY : a cross-domain accident investigation tool β’ Bridging the domain gap and the time gap β’ Mapping control model to control program β’ Integrating control-level and program-level logging β’ Connecting control-level and program-level investigation
Thank you! This work was supported in part by ONR Grant #N00014-17-1-2045. tgkim@purdue.edu
Recommend
More recommend