® 实时嵌入式软件设计 李曦 llxx@ustc.edu.cn 计算机系计算机应用研究室
实时嵌入式软件设计 李曦 llxx@ustc.edu.cn 计算机系计算机应用研究室
用户需求 选择嵌入式处理器 及硬件平台 嵌入式系统 选择合适的 系统分析 嵌入式操作系统 阶段 设计过程 计算机工程view 在操作系统上 开发应用程序 系统设计 阶段 否 应用程序 测试通过 是 整个系统测试 开发结束 2/100
嵌入式系统 设计过程 系统分析 阶段 计算机工程view 2/100 系统设计 阶段
Helicopter Flight Control(多速率、并发) Do the following in each 1/180-second cycle: Validate sensor data and select data source;on failure reconfigure the system. Do the following 30Hz avionics tasks,each once every 6 cycles: RAm用 55T图 Keyboard input and mode selection Data normalization and coordinate transformation Tracking reference update 。 Do the following 30Hz computations,each once every 6 cycles 装3W Control laws of the outer pitch-control loop Control laws of the outer roll-control loop Control laws of the outer yaw-and collective-control loop Do the following 90Hz computations,each once every 2 cycles,using outputs produced by the 30Hz computations Control laws of the inner pitch-control loop Control laws of the inner roll-and collective-control loop Compute the control laws of the inner yaw-control loop,using outputs from the 90Hz computations Output commands to control surfaces 。 Carry out built-in-test 任务图? !2
Helicopter Flight Control(多速率、并发) Do the following in each 1/180-second cycle: • Validate sensor data and select data source; on failure reconfigure the system. • Do the following 30Hz avionics tasks, each once every 6 cycles: – Keyboard input and mode selection – Data normalization and coordinate transformation – Tracking reference update • Do the following 30Hz computations, each once every 6 cycles – Control laws of the outer pitch-control loop – Control laws of the outer roll-control loop – Control laws of the outer yaw- and collective-control loop • Do the following 90Hz computations, each once every 2 cycles, using outputs produced by the 30Hz computations – Control laws of the inner pitch-control loop – Control laws of the inner roll- and collective-control loop • Compute the control laws of the inner yaw-control loop, using outputs from the 90Hz computations • Output commands to control surfaces • Carry out built-in-test 任务图?
Multi-rate Control Systems USTC More complicated control systems have multiple sensors and actuators must support control loops of different rates. Having only harmonic rates simplifies the system. EX.Helicopter flight controller The sampling rates of A,B,and C are 180Hz,90Hz,30Hz resp. Do the following in each 1 180 second cycle: ·D0A Do B once every 2 cycles c3 C2 ·Do C once every6 cycles ● Output commands Wait until the beginning of the next cycle
Multi-rate Control Systems • More complicated control systems have multiple sensors and actuators – must support control loops of different rates. • Having only harmonic rates simplifies the system. – EX. Helicopter flight controller • The sampling rates of A, B, and C are 180Hz, 90Hz, 30Hz resp. Do the following in each 1 / 180 second cycle: • Do A • Do B once every 2 cycles • …… • Do C once every 6 cycles • …… • Output commands • Wait until the beginning of the next cycle
From CE to CE:Atwo-steps desigh Application Functional Model Task gen. Software Tasks Model Control Problem 3 Modeling Tools Mathematical Model Cultural Wall/Gap (Simulink) 控制工程师:Sync approach Task mapping 计算机工程师:Async approaeh Program Generation RTW Embedded Coder Architecture Model Implementation Tools CPU1 CPU2 000 CPUk Combined Timing Functionality Program (C) 40 i1 0 1 1 Compilation/Linking C Compiler 2 0 0 Embedded System 0 Real-Time Code 十十十十十十 十十十 60 81 (logical time) (physical time)
From CE to CE:A two-steps design Cultural Wall/Gap 控制工程师:Sync approach 计算机工程师:Async approach