Real Time Process Control Introduction Tono Riesco Electronics

  • Slides: 28
Download presentation

Real Time Process Control (Introduction) Tono Riesco Electronics Engineer CERN

Real Time Process Control (Introduction) Tono Riesco Electronics Engineer CERN

Agenda • • • Introduction Control systems Basic concepts Real-Time Task Scheduling Real-Time in

Agenda • • • Introduction Control systems Basic concepts Real-Time Task Scheduling Real-Time in Linux

Control System In all the control systems, we found 3 basic components: • System

Control System In all the control systems, we found 3 basic components: • System to be controlled – With sensors, actuators, cables…etc. • Controller – Send orders to the system according a predetermined control objective. • Environment – Where the control system operates.

Typical Control System Controller Feedback System Environment

Typical Control System Controller Feedback System Environment

Control System Details Controller System Actuators Environment Data Process Data Filters Sensors

Control System Details Controller System Actuators Environment Data Process Data Filters Sensors

Types of Control Systems Depending of the interactions with the environment we distinguish 3

Types of Control Systems Depending of the interactions with the environment we distinguish 3 types of control systems: • Monitoring Systems – Do not modify the environment • Open-loop control systems – Loosely modify the environment • Closed-loop control systems – Tight interaction between perception and action

Monitoring Systems Do not modify the environment Sensor 1 Data Process Data Filters Sensor

Monitoring Systems Do not modify the environment Sensor 1 Data Process Data Filters Sensor 2 Environment Sensor n Display Examples: surveillance systems, air traffic control

Open-Loop Control Systems Sensing and control are loosely coupled Controller System Actuators Environment Planning

Open-Loop Control Systems Sensing and control are loosely coupled Controller System Actuators Environment Planning Data Process Sensors Examples: assembly robots, industrial chains, access systems

Closed-Loop Control Systems Sensing and control are tightly coupled Controller System Actuators Environment Planning

Closed-Loop Control Systems Sensing and control are tightly coupled Controller System Actuators Environment Planning Data Process Sensors Examples: humans, flight control systems, safety systems

Conclusions • If we have a tight interaction with the environment, the system has

Conclusions • If we have a tight interaction with the environment, the system has to react to events within precise timing constrains. • Timing constrains are imposed by the environment. • The control system must to be able to execute tasks within time constraints.

What’s a Real Time System? I • “A real-time system is one in which

What’s a Real Time System? I • “A real-time system is one in which the correctness of the computations not only depends upon the logical correctness of the computation but also upon the time at which the result is produced. • If the timing constraints of the system are not met, system failure is said to have occurred” Donald Gillies.

What’s a Real Time System? II • System capable of guaranteeing timing requirements of

What’s a Real Time System? II • System capable of guaranteeing timing requirements of the processes under its control. – It is essential that the timing constraints of the system are guaranteed to be met. Guaranteeing timing behavior requires that the system be predictable. – It is also desirable that the system attain a high degree of utilization while satisfying the timing constraints of the system. – Late or early answer → Wrong answer – Guarantee worst case vs. best effort

What’s not a Real-Time System? I • A real-time system is not a fast

What’s not a Real-Time System? I • A real-time system is not a fast system. – AFAP systems – Speed is always relative to a specific environment. – Running faster is good, but does not guarantee a correct behavior. • Real-time systems is not on-line systems or "an interactive system with better response time than we had".

Real-Time examples • Bottling plant • Servo loops in an airplane when on autopilot

Real-Time examples • Bottling plant • Servo loops in an airplane when on autopilot

How has to be a real time system? • Fast • Predictable • Deterministic

How has to be a real time system? • Fast • Predictable • Deterministic

Fast meaning in Real Time • Fast means that it has a low latency

Fast meaning in Real Time • Fast means that it has a low latency – It responds to external, asynchronous events in a short time. The lower the latency, the better the system will respond to events which require immediate attention

Predictable • Predictable means that it is able to determine task's completion time with

Predictable • Predictable means that it is able to determine task's completion time with certainty. • Predictable refers to a system whose timing behavior is always within an acceptable range. The behavior is specified on a system-wide basis, such as “all tasks will meet all deadlines”.

Deterministic • Special case of a predictable system. • Not only is the timing

Deterministic • Special case of a predictable system. • Not only is the timing behavior within a certain range, but that timing behavior can be pre-determined. • Pre-allocated time slots for each task. • Execution for each task occurs only during those time slots. Determinism is not essential to build predictable real-time systems.

Real Time Systems Event Real Time System Actio n • Real Time: System able

Real Time Systems Event Real Time System Actio n • Real Time: System able to respond to events within precise timing constraints.

Real Time Systems Real Time System t x (t) Environment y (t +Δ) •

Real Time Systems Real Time System t x (t) Environment y (t +Δ) • It is a system in which the correctness depends not only on the output values, but also on the time at which results are produced.

Real-Time classification Real-Time Hard (HRT) Guaranteed timing, cannot miss deadlines and must have bounded

Real-Time classification Real-Time Hard (HRT) Guaranteed timing, cannot miss deadlines and must have bounded latencies. Sensory-motor planning Soft (SRT) Ability to execute tasks according to a desired time schedule on the average Video display.

Definitions • Task – is a sequence of instructions that in the absence of

Definitions • Task – is a sequence of instructions that in the absence of other activities is continuously executed by the system until completion. t ai si fi

Definitions • Real-Time Task τi Di Ci Li Lai τ t i r i

Definitions • Real-Time Task τi Di Ci Li Lai τ t i r i si ri Request time (arrival time) si Start Time fi di Di Relative deadline Ci Worst Case execution time (wcet) fi Finish Time Li Latency di Absolute Deadline Lai Lateness (fi - di) Ti Tardiness (max (0, Lai))

Definitions • Lateness – • Tardiness – • Quality of not adhering to a

Definitions • Lateness – • Tardiness – • Quality of not adhering to a correct or usual or expected time Latency – • Quality of coming late or later in time The time that elapses between a stimulus and the response to it Jitter – Random variation in the timing of a signal, especially a clock

Task status Task Status Active Can be executed by the CPU Running it is

Task status Task Status Active Can be executed by the CPU Running it is being executed by the CPU Blocked waiting for an event Ready it is waiting for the CPU

Queue Ready Tasks • The ready tasks go to the “waiting queue” the ready

Queue Ready Tasks • The ready tasks go to the “waiting queue” the ready queue • The strategy of choosing which task go before is known schedule algorithm Activatio n Not a FIFO Queue!!! Dispatching τ1 τ2 τ3 CPU

Task Status Transitions Finished Wait Running Dispatching Blocked Preemption Signa l Ready Activation

Task Status Transitions Finished Wait Running Dispatching Blocked Preemption Signa l Ready Activation