You are on page 1of 6

Implementation Software / Real-Time Interface

Real-Time Interface
Implementation software for running models on dSPACE hardware

Highlights
n Automatic implementation of MATLAB/Simulink/ Stateflow models on dSPACE hardware n Automatic code generation n Graphical I/O configuration via comprehensive Simulink block libraries n Easy and safe to use due to automatic consistency checks n Support of model referencing hierarchies1)

Application Areas No matter whether you are performing rapid control prototyping or hardware-in-the-loop simulation: Real-Time Interface (RTI) is the link between dSPACE hardware and the development software MATLAB/Simulink/Stateflow from MathWorks. Key Benefits RTI lets you concentrate fully on the actual design process and carry out fast design iterations. It extends the C code generator Simulink Coder (formerly Real-Time Workshop)

for the seamless, automatic implementation of your Simulink and Stateflow models on the real-time hardware. The implementation time is greatly reduced. The hardware configuration for the real-time application is guided by automatic consistency checks to prevent parameterization errors. For maximum flexibility, each RTI version supports several different MATLAB releases (see www.dspace.com/ goto?Compatibility). Models from most previous MATLAB and RTI releases are migrated automatically when newer versions of RTI are used.

Working with RTI To connect your model to a dSPACE I/O board, just drag & drop the I/O module from the RTI block library and then connect it to the Simulink blocks. All settings, such as parameterization, are available by clicking the appropriate blocks. Simulink Coder (formerly Real-Time Workshop) generates the model code while RTI provides blocks that implement the I/O capabilities of dSPACE systems in your Simulink models, thus preparing the model for the real-time application. Your real-time model is compiled, downloaded, and started automatically on your real-time hardware, without you having to write a single line of code. RTI guides you during the configuration. RTI provides consistency checks, so potential errors can be identified and corrected before or during the build process.

Comprehensive Functionalities RTI handles any kind of continuous-time, discrete-time, and multirate system. Depending on the I/O hardware, different channels of the same I/O board can be used with different sample rates, and even in different subsystems. RTI supports asynchronous events and lets you set task priorities and task overrun strategies for executing the interrupt-driven subsystems. It also supports time-triggered tasks and timetables, which allow you to implement tasks and groups of tasks with variable or predefined delay times in relation to an associated trigger event. This makes task handling in your model very flexible. In addition, RTI offers checks which help avoid double or improper use of channels.

56

2013

1)

Please contact dSPACE for information on features and limitations.

dSPACE GmbH Rathenaustrae 26 33102 Paderborn Germany info@dspace.de www.dspace.com

Implementation Software / Real-Time Interface

Functionality Overview
Functionality I/O configuration Description
n Comprehensive block library for specifying the hardware setup n Configuration of dSPACE I/O simply by connecting the relevant blocks to the Simulink blocks n I/O

Generating real-time code

parameter specification, such as voltage ranges, resolutions, digital I/O, serial interface parameters, and PWM frequencies n Automatic checks on parameter ranges and consistency n I/O access anywhere in your model and at different sample rates n Separate blocks for different functions of complex I/O boards n Data typing and data-typed I/O n Asynchronous execution of Simulink subsystems triggered by hardware or software interrupts n S-functions and user-written code n Generation of C code by Simulink Coder (formerly Real-Time Workshop) n C code optimization for real-time implementations n Support of Simulink Coder (formerly Real-Time Workshop) code optimizations n Generation of initialization functions and I/O function calls
n Support of multirate systems and preemptive, priority-based multitasking n Single timer and multiple timer task mode n Asynchronous tasks n Software interrupts n Configurable priority and overrun handling for each task n Turnaround time measurement for each task n Optional synchronization of periodic timer tasks to external events n Time-triggered tasks and timetables n Non-real-time simulation modes n External hardware interrupts

Automatic task definition

Invoking the compiler Loading and starting the application

n Automatic compiler call that compiles and links the model n Program download to the real-time hardware n Simulation control n Interactive control, monitoring, and data acquisition with ControlDesk Next Generation (p. 96)

Order Information
Product Real-Time Interface Order Number
n RTI

2013
dSPACE GmbH Rathenaustrae 26 33102 Paderborn Germany info@dspace.de www.dspace.com

57

Support and Maintenance

Engineering

Hardware

n Data acquisition with time stamps

Software

Application Fields

Introduction

Implementation Software / Real-Time Interface

Relevant Software and Hardware


Software Required
n Microtec C Compiler (p. 90) for DS1103, DS1104, DS1005, and MicroAutoBoxII n GNU C Compiler for DS1006 n Operating system: www.dspace.com/goto?os_compatibility n MATLAB/Simulink/Simulink Coder (formerly Real-Time Workshop) from

Order Number
n CCPPPC n Included with DS1006

The MathWorks For maximum flexibility, each RTI release supports several different MATLAB releases (see www.dspace.com/goto?Compatibility) Optional
n Real-Time Interface for Multiprocessor Systems RTI-MP (p. 62) n Real-Time Interface Bypass Blockset (p. 64) n Real-Time Interface CAN Blockset (p. 68) n Real-Time Interface CAN MultiMessage Blockset (p. 70) n Real-Time Interface LIN MultiMessage Blockset (p. 73) n dSPACE FlexRay Configuration Package (p. 76) n RTI RapidPro Control Unit Blockset (p. 497) n RTI AUTOSAR Package (p. 82) n RTI FPGA Programming Blockset (p. 86) n Stateflow/Stateflow Coder from The MathWorks (p. 164) n Ethernet Blocksets (p. 88) n RTI_MP n RTIBYPASS_BS n RTICAN_BS n RTICANMM_BS n RTILINMM_BS n FCP n RTIRAPIDPRO_BS n RTIAUTOSAR_PKG n RTIFPGA_BS

See p. 88 Order Number

Hardware Required Optional


n Pentium 4 at 2 GHz (or equivalent) n 1 GB RAM (minimum), 2 GB RAM or more (recommended) n DS1103 PPC Controller Board (p. 294) n DS1104 R&D Controller Board (p. 300) n DS1005 PPC Board (p. 312) n DS1006 Processor Board (p. 316) n MicroAutoBox II (p. 472)1)
1)

n DS1103 n DS1104 n DS1005 n DS1006 n See p. 472

The former MicroAutoBox can also be used.

Implementing a Model with Real-Time Interface


Model Design In this example, the closed control loop of the positioning system for a hard disk drive is shown in the block diagram. Both the controller and the model of the controlled system are designed in the MATLAB/Simulink development environment.

58

2013
dSPACE GmbH Rathenaustrae 26 33102 Paderborn Germany info@dspace.de www.dspace.com

Implementation Software / Real-Time Interface

2013
dSPACE GmbH Rathenaustrae 26 33102 Paderborn Germany info@dspace.de www.dspace.com

59

Support and Maintenance

Engineering

Hardware

Software

Application Fields

Graphical I/O Configuration When you have finished testing your model in Simulink, it has to be prepared for implementation on the real-time hardware. The plant model is replaced by I/O blocks that form the interfaces to the real controlled system. To add an I/O model, simply drag a block from the RTI I/O library to the model and connect the block with the I/O of the controller.

Parameter Specification I/O parameters are specified by double-clicking an I/O block and entering the data in graphical user interfaces. In this example, the input signals are the feedback value and the reference signal. The reference signal now comes from an external signal generator and is read in by an ADC block. The output signal from the controller is the control signal u_M, which is output by the hardware via a DAC block.

Introduction

Implementation Software / Real-Time Interface

Implementation on dSPACE Hardware Automatic implementation of the Simulink model on dSPACE hardware is the key to rapid design iterations. With RTI you will not see a single line of code during this process. A single click on Build starts the implementation, including code generation, compiling, and downloading. You can select an integration algorithm and a step size in the solver page of the Simulation Parameters dialog. Build procedures can also be automated with the help of scripts. This is especially useful for large models.

Interaction with Experiment Software When your application is running on the real-time hardware, the whole dSPACE experiment software is at your disposal. RTI ensures that you have control over each individual variable immediately after the implementation process. ControlDesk Next Generation provides an instrument panel that enables you to change parameters and monitor signals without regenerating the code. ControlDesk Next Generation also displays the time histories of any variable used by your application.

60

2013
dSPACE GmbH Rathenaustrae 26 33102 Paderborn Germany info@dspace.de www.dspace.com

Implementation Software / Real-Time Interface

Blocksets for Real-Time Interface


Supporting dSPACE Hardware No matter whether you are using dSPACE systems with single-board hardware, modular hardware, or MicroAutoBoxII1): RTI supports all dSPACE real-time processors and allows convenient model and I/O configuration of your dSPACE system.

Real-Time Interface for Multiprocessor Systems

Real-Time Interface CAN Blockset

Real-Time Interface CAN MultiMessage Blockset Real-Time Interface AUTOSAR Package

Real-Time Interface RapidPro Control Unit Blockset Real-Time Interface FPGA Programming Blockset

Real-Time Interface Bypass Blockset

dSPACE FlexRay Conguration Package

Real-Time Interface LIN MultiMessage Blockset

Ethernet Blocksets

Real-Time Interface for Multiprocessor Systems For graphical setup of multiprocessor structures. n RTI-MP (p. 62) CAN Blocksets For combining dSPACE systems with CAN communication networks. n RTI CAN Blockset (p. 68) n RTI CAN MultiMessage Blockset (p. 70) dSPACE FlexRay Configuration Package For configuring dSPACE systems in FlexRay communication networks. n dSPACE FlexRay Configuration Package (p. 76)

RTI Bypass Blockset For configuring bypass applications. n RTI Bypass Blockset (p. 64) RTI LIN MultiMessage Blockset For combining dSPACE systems with LIN communication networks. n RTI LIN MultiMessage Blockset (p. 73)

RTI AUTOSAR Package Using AUTOSAR software components in a MATLAB/ Simulink environment n RTI AUTOSAR Package (p. 82) Ethernet Blocksets Connecting dSPACE hardware to other devices via Ethernet n Ethernet Blocksets (p. 88)

RTI FPGA Programming Blockset Integrating FPGA models in dSPACE systems. n RTI FPGA Programming Blockset (p. 86)

1)

The former MicroAutoBox can also be used.

2013

61

dSPACE GmbH Rathenaustrae 26 33102 Paderborn Germany info@dspace.de www.dspace.com

Support and Maintenance

Engineering

RTI RapidPro Control Unit Blockset Extensive I/O functionalities for the MicroAutoBox II1) or DS1005 used in combination with the RapidPro Control Unit, e.g., for engine, chassis, and drives control. n RTI RapidPro Control Unit Blockset (p. 497)

Hardware

Software

Real-Time Interface (RTI)

Application Fields

Introduction

You might also like