True Time Mittuniversitetet True Time 2 0 http

  • Slides: 22
Download presentation
True. Time Mittuniversitetet

True. Time Mittuniversitetet

True. Time 2. 0 http: //www. control. lth. se/truetime/ Reference Manual link Mittuniversitetet

True. Time 2. 0 http: //www. control. lth. se/truetime/ Reference Manual link Mittuniversitetet

True. Time is a Matlab/Simulink Event-based simulator for real-time control system. It is used

True. Time is a Matlab/Simulink Event-based simulator for real-time control system. It is used for the simulation of Networked Control System (NCS). In NCS, actuators, sensors and controllers are interconnected by a communication network. Actuator Process Sensor Communication Network Controller Mittuniversitetet

True. Time capabilities: • Investigate the true, timely behavior of time or event-triggered control

True. Time capabilities: • Investigate the true, timely behavior of time or event-triggered control loops affected by real-time scheduling and networking • Experiment with novel real-time scheduling techniques, including feedback scheduling • Investigate the performance of various wired or wireless MAC protocols • Simulate complex scenarios involving battery-powered mobile robots communicating over a wireless network Mittuniversitetet

Components Mittuniversitetet

Components Mittuniversitetet

Computation component • Simulates and event-based realtime kernel. • Executes user-defined tasks and interrupt

Computation component • Simulates and event-based realtime kernel. • Executes user-defined tasks and interrupt handler (C or M-files) • Arbitrary user-defined scheduling policies • Supports external interrupts and timers • Code structured into code segments Mittuniversitetet

Init Each kernel block must have an initialization script The purposes of the initialization

Init Each kernel block must have an initialization script The purposes of the initialization script are: • • Specify the number of I/O Define a scheduling policy Creating tasks Creating interrupts handlers Pre-defined priority functions exist for scheduling policies: • • fixed-priority rate-monotonic deadline-monotonic earliest-deadline-first scheduling Mittuniversitetet

Example Initialize the kernel, specifying the scheduling policy Create a periodic task Create an

Example Initialize the kernel, specifying the scheduling policy Create a periodic task Create an aperiodic task Attach an aperiodic task or interrupt handler to a network interface Mittuniversitetet

Tasks • Tasks are used to model the execution of user code • The

Tasks • Tasks are used to model the execution of user code • The release of task instances (jobs) may be periodic or aperiodic • For periodic tasks, the jobs are created by an internal periodic timer • For aperiodic tasks, the jobs must be created by the user (e. g. , in response to interrupts) Mittuniversitetet

Task code is represented by a code function in the format: [exectime, data] =

Task code is represented by a code function in the format: [exectime, data] = function mycode(segment, data) The data input/output argument represents the local memory of the task The segment input argument represents the program counter The exectime output argument represents the execution time of the current code segment Mittuniversitetet

All statements in a segment are executed sequentially, nonpreemptively, and in zero simulation time

All statements in a segment are executed sequentially, nonpreemptively, and in zero simulation time Only the delay can be preempted by other tasks No local variables are saved between segments Mittuniversitetet

The name of the initialization script An optional argument to the initialization script Number

The name of the initialization script An optional argument to the initialization script Number of local Inputs and Outputs Number of external triggers for the kernel task Number of the node (must be unique) A constant time offset and time drift from the nominal time. Mittuniversitetet

Communication component Network Block • • Wireless Network Block • 802. 11 b WLAN

Communication component Network Block • • Wireless Network Block • 802. 11 b WLAN • 802. 15. 4 Zig. Bee Mittuniversitetet Ethernet CAN TDMA FDMA Round Robin Switched Ethernet Flex. Ray PROFINET

Modelling wired networks • Models the medium access delay and the transmission delay. •

Modelling wired networks • Models the medium access delay and the transmission delay. • No built-in support for network and transport layer protocols Mittuniversitetet

Modelling wireless network Used in a similar way as the wired network block Supports

Modelling wireless network Used in a similar way as the wired network block Supports two common MAC layer policies: • 802. 11 b/g (WLAN) • 802. 15. 4 (Zig. Bee) Variable network parameters x and y inputs for node locations Generates a transmission schedule Mittuniversitetet

The number assigned to the network block. The number of nodes connected to the

The number assigned to the network block. The number of nodes connected to the network. The speed of the network. The minimum frame size The probability that a network message is lost during transmission Mittuniversitetet

Example Networked Mittuniversitetet

Example Networked Mittuniversitetet

Networked control of a DC-Servo Controller Task Dummy Task Controller CSMA/CD 80 kbps Mittuniversitetet

Networked control of a DC-Servo Controller Task Dummy Task Controller CSMA/CD 80 kbps Mittuniversitetet Sensor Task Actuator Task Sensor / Actuator Interfering Task Interfering Node

Networked Control Loop Mittuniversitetet

Networked Control Loop Mittuniversitetet

Step Response Control Signal Mittuniversitetet

Step Response Control Signal Mittuniversitetet

Network Schedule Control Node Sensor/Actuator Node Interfering Node High → Sending Medium → Waiting

Network Schedule Control Node Sensor/Actuator Node Interfering Node High → Sending Medium → Waiting Low → Idle Mittuniversitetet

CPU Schedule Actuator Task Sensor Task High → Running Medium → Ready Low →

CPU Schedule Actuator Task Sensor Task High → Running Medium → Ready Low → Idle Mittuniversitetet