Introduction to Realtime Embedded Systems Spring 1398 99
Introduction to Real-time Embedded Systems Spring 1398 -99 Real-time Embedded Systems 1
Course References 1. Hermann Kopetz, Real-Time Systems, Design Principles for Distributed Embedded Applications, 2 nd Edition, © 2011 Springer. 2. E. A. Lee and S. A. Seshia, Introduction to Embedded Systems - A Cyber-Physical Systems Approach, Second Edition, Lee. Seshia. org, 2017. 3. Phillip A. Laplante, Seppo J. Ovaska, Real-Time Systems Design and Analysis, Tools for the Practitioner, 4 th Edition, © 2012 IEEE Press. 4. . Simon Cirani, et. al. , Internet of Things: Architectures, protocols and standards, 2019, John Wiley and Sons. Real-time Embedded Systems 2
Introduction and Definitions Material from Chapter 1 of all three references Real-time Embedded Systems 4
What is a Real-time System? Real-time: “instantaneous” or “without delay” Definition 1: Correctness of the system behavior depends on The logic and sequence of the output The timing of the output sequence Definition 2: To respond as quickly as required by the user or the control system (being responsive) A “guarantee” of response is needed within a specified “deadline” A System Real-time Embedded Systems Cyber-physical Real-time System 5
Basic definitions Event Synchronous vs. Asynchronous Periodic vs. Aperiodic vs. Sporadic Interval / duration Digital clock, granules, ticks start event Response time terminating event digital clock ticks Timeline digital clock granule interval duration Real-time Embedded Systems 6
Examples of Event Types Periodic Aperiodic Sporadic Events Cyclic Code Synchronous Timer Interrupt Power-loss alarm Asynchronous Regular user input interrupt Conditional branch Division-by-zero Real-time Embedded Systems 7
General Architecture of a Real-time System An embedded system, including processing elements, real-time embedded OS, and firmware Real-time Embedded Systems 8
Embedded System Encapsulated Specific purpose Interfacing No direct user interface Interface with upper layer software Firmware Program on an embedded system ROM-based Real-time Embedded Systems 9
Motivating Examples Heart Surgery while beating Robotic equipment Stereoscopic (3 D) video Intelligent traffic lights Only need to stop for cross traffic Car detection equipment OR inter-vehicle communication systems Fly-by-wire aircrafts – a more reliable flight No need for mechanical/hydraulic links – lighter and more fuel efficient Pilot commands are sent through flight computer Can be analyzed to avoid human errors Real-time Embedded Systems 10
Cyber-physical Systems Intersection of physical and computer systems Real-time Embedded Systems 11
Hard and Soft Real-time Failure Catastrophic failure Deadline Hard deadline A hard real-time system: A system with all hard deadlines A firm real-time system: A system with a few hard deadlines If a few deadlines are missed, it may not be a catastrophic failure A soft real-time system: A system with no hard deadline. If a deadline is missed, the performance is “degraded", but it is not a failure See the examples Real-time Embedded Systems 12
Some examples 1. Anti-lock Brake System (ABS) or Vehicle Airbag System 2. Aircraft accelerometer and positioning system (roll, yaw, pitch) 3. Industrial manufacturing control systems 4. 5. 6. 7. 8. 9. 1. Robotic arms 2. Packaging systems A video playback system A pacemaker A bank ATM A navigation controlled robot Heart Surgery Vehicular communication systems (VCS) Real-time Embedded Systems 13
New Definition A real-time system is a computer system that must satisfy bounded response-time constraints or risk severe consequences, including failure. Punctuality: Deviation from average response-time approaches zero Near real-time systems: A delay between an event and its processing Example: Elevator door response time Real-time Embedded Systems 14
Example Response time Min Max Mean Sensor (Ts) 5 ms 15 ms 9 ms Hardware (Thw) 1µs 2µs 1. 2µs System software (Tss) 16 µs 48 µs 37 µs Application (Tas) 0. 5 µs Door drive (Tdd) 300 ms 500 ms 400 ms What is the overall response time? Real-time Embedded Systems 15
Processing Load and Utilization CPU Utilization Execution period pi Execution time ei Deadline di Overloading tradeoff Changes or corrections Cost-effectiveness Example - CPU Utilization CPU utilization zones Real-time Embedded Systems 16
Example – elevator controller An individual elevator controller in a bank of high-rise elevators has the following software tasks, for every period i ∈ {1, 2, 3, 4}: execution periods of pi and worst - case execution times of ei , Task 1 : Communicate with the group dispatcher (19. 2 K bit/s data rate and a proprietary communications protocol); p 1 = 500 ms, e 1 = 17 ms. Task 2 : Update the car position information and manage floor - to - floor runs, as well as door control; p 2 = 25 ms, e 2 = 4 ms. Task 3 : Register and cancel car calls; p 3 = 75 ms, e 3 = 1 ms. Task 4 : Miscellaneous system supervisions; p 4 = 200 ms, e 4 = 20 ms. Question: What is the overall CPU utilization factor? Real-time Embedded Systems 17
Design Process Modeling High fidelity Abstract Modeling example: Differential equations for physical phenomena State machines for traffic lights Modeling languages / tools NI Lab. View, Math. Works Simulink Design Physical interface Processing units Network & communication Analysis System properties / specifications Real-time Embedded Systems Analysis categories 18
Real-time design is multidisciplinary! Real-time Embedded Systems 19
Real-time System Requirements Functional Requirements Data acquisition / collection Control Human interaction Temporal Requirements Deadline, latency, jitter, … Dependability Requirements Fault-tolerance Security Real-time Embedded Systems 20
Data Collection - Some Definitions State variables E. g. , car position, speed, color, license plate State Real-time entity Speed & license plate (for speed camera) Position & license plate (for red light camera) Observation Deterministic System Event deterministic: deterministic for events Temporal determinism: deterministic system with known response time for each output Non-deterministic: some randomness inside the system (logic and/or time) Real-time Embedded Systems 21
Functional Requirements – Data Collection Variables and State variables Controlled object and its state Real-time (RT) entity Sphere of control (SOC) The authority to change the value of this RT entity Real-time image Temporal Accuracy E. g. Green traffic light Real-time database Update with RT entities Real-time Embedded Systems 22
Data Collection – continued Signal Conditioning: Dequantization, averaging / error mitigation, scaling and linearization Alarm Monitoring: Primary and secondary alarms Alarm / event logging Example: pipe rupture and RT entities Real-time Embedded Systems 23
Digital Control Actuation: Actuating variables Observe Calculate Control Observe • Observe real-time entities Real-time Embedded Systems Calculate • Execute control algorithm Control • Output actuating variables 24
Human-Machine Interfacing Mistakes can be catastrophic Mode confusion in cockpit Inform and assist operator Logging & reporting Visualization and visual control Proper reaction and fault monitoring Respond properly to human input Even the wrong ones Detect unusual, unexpected control sequences Real-time Embedded Systems 25
Temporal Requirements Example – Thermal Ctrl. Real-time Embedded Systems 26
Real-time Embedded Systems 27
Temporal Requirements Dead-time: Controlled object delay + computer response-time Jitter: Min & Max response-times (delay) Why jitter? Response-time no longer constant -> new parameter to compensate Jitter << delay Error Detection Latency to detect errors in the system Same order of magnitude as fastest sampling period (dsample) Real-time Embedded Systems Jitter may increase measurement error 28
Temporal Requirement Terms Real-time Embedded Systems 29
Dependability Requirements - Reliability Real-time Embedded Systems 30
Dependability Requirements - Safety: reliability regarding critical failures What is a critical failure? Fault containment Ultrahigh reliability (1 FIT) - Example: Computer controlled car brake with 1 FIT Certification Fault-containment Handling fault scenarios without probabilistic arguments FT validation of subsystems and system emergent properties Real-time Embedded Systems 31
Dependability Requirements – Maintainability & Security Maintainability M(d) MTTR Repair rate (μ): repairs/h Maintainability vs. Reliability FRUs & serviceability Pluggable interfaces Security Traditional: confidentiality, integrity & availability Information authenticity & integrity Authorization & availability Io. T security Real-time Embedded Systems 32
Dependability Requirements - Availability Real-time Embedded Systems 33
Dependability Requirements for Hard/Soft Real-time Systems Real-time Embedded Systems 34
Fail-safe vs. Fail-operational Fail-safe Identify a number of safe states Bring the system to one of those sates in case of failure A characteristic of the controlled object Computer system needs to have error detection rate ~ 1 A watchdog (external) computer system can monitor lifesignal Force into safe state when life sign does not arrive in time Fail-operational No safe state to go into Operate with minimal service level Real-time Embedded Systems 35
Guaranteed Response vs. Best Effort Guaranteed Response Design analysis of load and fault can be done without probabilistic measures Deterministic design and environment effects Needs extensive analysis during design Requires adequate (computing) resources to handle peak load Required for hard real-time systems Best Effort If no deterministic design can be given May lack adequate computing resources Rare-event scenarios may result in failure Real-time Embedded Systems 36
- Slides: 36