Sesión 2: PL 1b: Gestión de sistemas en tiempo real para prototipado rápido de controladores (MathWorks).

Similar documents
Experiment 3. Getting Start with Simulink

How to install the software of ZNS8022

xpc Target User s Guide Version 1 For Use with Real-Time Workshop Modeling Simulation Implementation

Real-Time Windows Target

EPC-1000 Embedded PC Controller

Rotary Motion Servo Plant: SRV02. Rotary Experiment #00: QuaRC Integration. Using SRV02 with QuaRC. Student Manual

Quick Installation Guide: QUARC TM on NI ELVIS III

TOP SERVER V5 CLIENT CONNECTIVITY ROCKWELL FACTORYTALK VIEW STUDIO. Table of Contents

INTRODUCTION TO MATLAB, SIMULINK, AND THE COMMUNICATION TOOLBOX

How to configure the Matlab interface

Sharing and Deploying MATLAB Programs Sundar Umamaheshwaran Amit Doshi Application Engineer-Technical Computing

xpc Target Tutorial Control System Design Feb. 15, 2004 For more detailed information, see the xpc target manual at:

Documentación GT_Complemento_Exportaciones xsd Factura Electrónica en Línea

CaliberRM 5.1 Integration for Describe Enterprise

ELEC ENG 4CL4 CONTROL SYSTEM DESIGN

Operating Instructions

Lecture 10: Simulink. What is Simulink?

DOCUMENT TRACKING INSTALLATION GUIDE

Introduction to Matlab Simulink. Control Systems

Colligo Contributor File Manager 4.3. User Guide

UNIT 5. Simulink. 1. Introduction

8438/8838 User Manual User Manual of the 8438/8838 MATLAB Embedded Controllers

Oracle OpenWorld: Labs for Oracle User Productivity Kit and Oracle Tutor Student Guide

SMARTdoc v2 User Manual

LPR for Windows 95/98/Me/2000 TCP/IP Printing User s Guide

Windows 95/98 Infoway Connection Instructions 1/4/2002; rev. 1/9/2002

QuaRC 2.0. Installation Guide. Single-User and Network Installations/License Configuration (Windows, QNX, and Gumstix Verdex)

DataPro Quick Start Guide

Data Resource Centre, University of Guelph CREATING AND EDITING CHARTS. From the menus choose: Graphs Chart Builder... 20/11/ :06:00 PM Page 1

ASSET TRACKING SYSTEM INSTALLATION GUIDE

SAS Simulation Studio 14.1: User s Guide. Introduction to SAS Simulation Studio

STS INSTALLATION GUIDE

KX-TG5566 KX-TG5576 KX-TGA552

ME scope Application Note 17 Order Tracked Operational Deflection Shapes using VSI Rotate & ME scope

BDM Hyperion Workspace Basics

xpc Target 4 User s Guide

Tutorial - Exporting Models to Simulink

DM6. User Guide English ( 3 10 ) Guía del usuario Español ( ) Appendix English ( 13 ) DRUM MODULE

Starting the KVM Console

Introduction to Microchip-SIMULINK Blocksets and MATLAB Plug-in for MPLAB IDE

Operating Instructions

xpc Target For Use with Real-Time Workshop User s Guide Version 2

UNIVERSITI TEKNIKAL MALAYSIA MELAKA FAKULTI KEJURUTERAAN ELEKTRONIK DAN KEJURUTERAAN KOMPUTER

Griffin Training Manual Grif-WebI Introduction (For Analysts)

C O M P U T E R S C I E N C E S U P P O R T G U I D E F O U R T H G R A D E T H I R D T E R M

To complete this project, you will need the following folder:

Objectives. Simulink Basics

Sun VirtualBox Installation Tutorial

Introduction to ARDUINO/SIMULINK

Thank you for choosing Loadstar Sensors. Need additional help? Call us at or us at

MICROSOFT Course 20411: Administering Windows Server 2012

Code Composer Studio Operation Manual

Lab 6 : Introduction to Simulink, Link for CCS & Real-Time Workshop

PC-Display and AVImark

Session 3 Introduction to SIMULINK

TECHNICAL NOTES NETWORK CD/DVD SERVERS. AXIS StorPoint CD Servers. CD Recording. Created: December 8, 2000 Last updated: December 8, 2000 Rev: 1.

Microsoft Office Outlook 2007: Intermediate Course 01 Customizing Outlook

Fairfield University Using Xythos for File Storage

SharePoint 2010 Instructions for Users

xpc Target communication efficiency when multiple targets are involved

Hands-On Lab. Windows Azure Virtual Machine Roles. Lab version: Last updated: 12/14/2010. Page 1

Welcome to the DriveWindow basics training module.

Quick Start Guide. Cole-Parmer USB-based Data Acquisition Software

KVM Console. KVM Console

CERTIFICACION SAGE Enterprise Management (X3)

Cisco Remote Expert Manager Agent s Workstation Setup Guide

WINDOWS SERVER - SERVICIOS AVANZADOS

This is a GENERAL Servant Keeper Network Installation help sheet. If you need further assistance, please contact your network administrator.

Getting Started. In This Chapter

FUNDAMENTOS DEL DISEÑO DE

SMAC LAC-X Editor quick start guide.

FMI Kit for Simulink version by Dassault Systèmes

Sedao Ltd. Content User Manual. User Manual to cover all basic functions of Content Manager version 1.5.4

Experiment 6 SIMULINK

25. DECUS Symposium THE Application Development Environment for OpenVMS

User Guide. Introduction. Requirements. Installing and Configuring. C Interface for NI myrio

Quick Start Guide for OP4200 Thank you for choosing RT-LAB as your real-time simulation platform.

Experiment 8 SIMULINK

Managing Multi-Hypervisor Environments with vcenter Server

VMware vsphere with Operations Management: Fast Track

SOFTCR PRO SOF-722 USER S MANUAL. DOC-204 Rev Copyright 2016 All Rights Reserved. Med Associates, Inc. P.O. box 319 St. Albans, Vermont 05478

Performing real-time BCI experiments

[PDF] MANUAL PORTABLE ADOBE PHOTOSHOP CS3 EN ESPAOL DOWNLOAD

Copyright 2016 ForensicSoft Inc. SAFE Block Win10 To Go User s Guide

WINZIP MANUAL epoint.edu.vn WINZIP MANUAL. page 1 / 5

AutoCAD 2009 User InterfaceChapter1:

Reset the Admin Password with the ExtraHop Rescue CD

Toolkit Activity Installation and Registration

Walkthrough Using the New CLR Interop Feature of Microsoft Dynamics AX

Exploring the Custom Analysis Interface for use with MATLAB on Tektronix Oscilloscopes

SequencePro Data Analysis Application. User Guide

3 USING NERO BURNING ROM

Learning the Pro/ENGINEER Interface

InspectionWare. Quick Start Guide. Version: QSG-BC-rev1.5

Central Management System

JMobile Suite User Manual

AEMLog Users Guide. Version 1.01

1. Remove any previously installed versions of the Offline Image Viewer by dragging and dropping the Offline Image Viewer icon into the Trash.

APPENDIX B: INSTALLATION AND SETUP

Software Introduction

Transcription:

Sesión 2: PL 1b: Gestión de sistemas en tiempo real para prototipado rápido de controladores (MathWorks). 1

Objetivo... 3 Hardware description... 3 Software Setup... 3 Setting an Initial Working Folder... 5 xpc Target Explorer... 5 CD/DVD Boot... 6 Kernel Creation Prechecks... 6 Create boot CD/DVD... 6 C Compiler Configuration and test... 7 Create Simulink Model: non real... 7 Transform Simulink Model to Target Application... 8 Add xpc Target Scope Block... 8 Set Configuration Parameters... 9 Build and Download Target Application... 10 Execute Target Application Using xpc Target Explorer... 10 Signal Tracing... 10 Configure Target Scope (xpc) Blocks... 10 xpc Target Scope Usage... 11 Configure Host Scope (xpc) Blocks... 11 Host Scope Usage... 11 Ejercicio xpc target (Ejercicio PL1b 1)... 12 2

Objetivo. El objetivo de esta práctica es familiarizarse con la estructura hardware y software de un sistema en tiempo real para el prototipado rápido de controladores. Veremos la herramienta xpctarget (MathWorks). La plataforma electrónica a utilizar será una computadora x86 El hardware que se utilizará en esta práctica consta de un PC host y un PC target en el que se ejecutará el modelo de simulink elegido. Hardware description The hardware environment consists of a host computer, target computer, I/O boards in the target computer, and a serial or network connection between the host and target computers. You can use a computer that runs a Windows operating system supported by MathWorks as the host computer. The xpc Target software supports concurrent access to up to 64 target computers with one host. A target computer can connect to only one host computer at a time. A target computer cannot connect to multiple host computers A target computer, Desktop Computer, is booted from a special target boot kernel created by the xpc Target software and stored on a target boot disk, removable boot drive, or network boot image. Software Setup The real-time test environment is a place to design, build, and test a target application in nonreal time and real time. It also includes communication between the host and target computers. 3

You create a nonreal time test environment by creating an initial model in regular Simulink. After creating your model, you can run simulations in nonreal time within the Simulink environment. You create a real time test environment for Simulink models by connecting a host computer, target computer, and the hardware you want to test. You run the following software on the host computer: xpc Target Simulink Simulink Coder MATLAB Coder Microsoft Visual C/C++ compiler And connect the host computer to the target computer via a single TCP/IP connection. Use xpc Target software with Simulink Coder, Embedded Coder (optional), and a C/C++ compiler to create executable code that represents your models. The executable code is downloaded from the host computer to the target computer running the xpc Target real time kernel. After downloading the executable code, you can run and test your target application in real time. Additionally, xpc Target software lets you add I/O blocks to your model to connect and communicate with your hardware under test 4

In the xpc Target software environment, the host computer is usually your desktop computer. Here you install the xpc Target and xpc Target Embedded Option products, along with MATLAB, Simulink, and other required and optional software. You install the xpc Target software only on the host computer. The host computer downloads the kernel software and target application to the target computer at runtime. You must have Microsoft.NET Framework 4.0 installed on the host computer. You must have a Microsoft C compiler installed on the host computer. The xpc Target kernel does not require that an operating system be installed on the target computer. Setting an Initial Working Folder Set your initial MATLAB working folder outside the MATLAB root folder. The default MATLAB root folder is c:\matlab. If your MATLAB working folder is below or inside the MATLAB root, files created by Simulink and Simulink Coder are mixed with the MATLAB folders. You can use the cd command to temporarily set your working folder, or set your initial working folder in the MATLAB shortcut: 1.- Right click the MATLAB desktop icon 2. Click Properties. In the Start in text box, enter the folder path that you want MATLAB to use initially. Make sure you choose a folder outside the MATLAB root folder 3.- Click OK, and then start MATLAB Recomendación: Por cada práctica generar una carpeta (Ejemplo: Práctica_1) que contenga una subcarpeta donde alojar los esquemas de Simulink (Ejemplo: Práctica_1>>Esquemas_1). Se elegirá como carpeta de trabajo Práctica 1. Así, todos los archivos que se generen como consecuencia de la compilación no se mezclarán con los esquemas. xpc Target Explorer The xpc Target software offers a graphical user interface (GUI) for configuring the host and target computers and interacting with a target application. To open the xpc Target GUI, in the MATLAB Command Window, type xpcexplr. 5

Targets pane The top left Targets pane lists the targets in your xpc Target hierarchy. Applications pane The bottom left Applications pane lists the target applications running on the targets. Scopes pane The top right Scopes pane lists the scopes defined on the active target applications, whether predefined or dynamically created Center pane The center pane displays under separate tabs information associated with nodes selected in one of the other panes The xpc Target Explorer environment consists of the property settings you define for the Targets pane. You can save your settings for the next session: Click the Save icon in the toolbar CD/DVD Boot Kernel Creation Prechecks Configure your xpc Target system before creating the target boot kernel. In the Targets pane, expand the target computer node On the toolbar, click the Target Properties icon In the Target Properties pane, click Host to Target communication. Check the host-totarget communication settings. In the Target Properties pane, click Boot configuration Check that Boot mode is set to the required value Click in the Target Properties workspace, then click the Save icon on the toolbar Create boot CD/DVD In the Targets pane, expand the target computer node 6

Select Boot configuration and set Boot mode to CD Click Create boot disk Select CD ROM Click Burn Disk. A progress bar is displayed Insert the bootable CD/DVD into your target computer CD/DVD drive and restart the target computer C Compiler Configuration and test In the MATLAB Command Window, type >> xpcsetcc('visualc', 'C:\Program Files (x86)\microsoft Visual Studio 10.0') >> xpctest noreboot Create Simulink Model: non real You use Simulink in normal mode to observe the behavior of the model in non real time. After you load the Simulink model, you can run a simulation. In the MATLAB Command Window, type simulink. In the Simulink library window, from the File menu, point to New, and then click Model. Configure Signal Generator: Wave form list, select: square In the Amplitude text box, enter 1 In the Frequency text box, enter 20 From the Units list, select Hertz 7

Configure Transfer Function In the Numerator text box, enter [1000^2] In the Denominator text box, enter[1 400 1000^2] Configure Scope Block Double-click the Scope block Click the Parameters icon. In the Scope window, click the General tab. In the Number of axes box, enter the number of graphs that you want in one Scope window. For example, enter 1 for a single graph. Do not select the floating scope check box In the Time range box, enter the upper value for the time range. For example, enter 0.2 second From the Tick labels list, choose all From the Sampling list, choose Sample time and enter 0 in the text box. Entering 0 indicates that Simulink evaluates this block as a continuous-time block. If the model has discrete blocks, enter the Fixed step size you entered in the Configuration Parameters dialog box In the Scope window, point to the y-axis and right-click it From the context menu, click Axes Properties. The Scope properties: axis 1 dialog box opens. In the Y min and Y max text boxes, enter the range for the y-axis in the Scope window. For example, enter 3 and 3. The Simulink software runs the simulation and plots the signal data in the Scope window Transform Simulink Model to Target Application To run a Simulink model as a target application under xpc Target, you must add and configure the xpc Target Scope block and set Configuration Parameters for code generation and target execution. Add xpc Target Scope Block click Library Browser In the left pane, browse to and double click node xpc Target Click node Misc Click and drag block Scope (xpc) to the Simulink block diagram 8

Select Scope type Target In the block parameters dialog box, select the Start scope when application starts check box Select Scope mode Graphical redraw Select the Grid check box Type [0,0] in the Y axis limits text box. This value means that display scaling is auto Type 1000 in the Number of samples text box. For a Scope mode of Graphical redraw, this value means that 1000 samples are acquired before the graph is redrawn Type 0 in the Number of pre/post samples text box. This value means that samples are not saved before a trigger or skipped after a trigger. Type 1 in the Decimation text box. This value means that data is collected at each sample interval. Select Trigger mode FreeRun. This value means that the trigger event is automatic and no external trigger specification is required Set Configuration Parameters You enter the simulation and real-time run parameters in the Configuration Parameters dialog box. These parameters give information to Simulink Coder on how to build the target application from the Simulink model. In the Simulink window, click Simulation > Model Configuration Parameters In the Configuration Parameters dialog box, click the Code Generation node. The code generation pane opens To build a basic target application, in the Target selection section, click Browse at the System target file list. Click xpctarget.tlc, and then click OK The system target file xpctarget.tlc, the template makefile xpc_default_tmf, and the make command make_rtw are automatically entered into the page 9

Build and Download Target Application In the Simulink window, on the toolbar, click the Build Model icon on the toolbar. After compiling, linking, and downloading the target application, xpc Target creates a target object in the MATLAB workspace. The default name of the target object is tg. For more information about the target object, see Target Driver Objects. Execute Target Application Using xpc Target Explorer In the Targets pane, click the target computer icon for which you have downloaded the application and click the Connect icon on the toolbar The target computer icon turns to Connected. In the Applications pane, select the target application To start execution, click the target application and click the Start icon on the toolbar Signal Tracing Signal tracing acquires signal and time data from a target application. You can then visualize the data on the target computer or upload the data and visualize it on the host computer while the target application is running. You trace signals using target and host scopes and view them using xpc Target Explorer, Simulink External Mode, MATLAB language, and a Web browser interface. Configure Target Scope (xpc) Blocks xpc Target includes a specialized Scope (xpc) block that you can configure to display signal and time data on the target computer monitor. To do this, add a Scope (xpc) block to the model, select Scope type Target Do not confuse xpc Target Scope blocks with standard Simulink Scope blocks Type: addpath (fullfile(matlabroot, 'help', 'toolbox', 'xpc', 'examples')); In the MATLAB window, type my_xpc_osc2 Double click the block labeled Scope (xpc) The Block Parameters: Scope (xpc) dialog box opens 10

xpc Target Scope Usage To monitor an output signal from a Constant block by connecting it to an xpc Target Scope block, you must add a test point for the Constant block output signal: Click right in signal >> properties>> test point If the output of a Mux block is connected to the input of an xpc Target Scope block, the signal might not be observable. To observe the signal, add a unity gain block (a Gain block with a gain of 1) between the Mux block and the xpc Target Scope block. If you want the same data for the same signals on the host computer while the data is displayed on the target computer, define a second scope object with type host. Then synchronize the acquisitions of the two scope objects by setting TriggerMode for the second scope to 'Scope'. Configure Host Scope (xpc) Blocks xpc Target includes a specialized Scope (xpc) block that you can configure to display signal and time data on the host computer monitor. To do this, add a Scope (xpc) block to the model, select Scope type to Host and configure the other parameters. If you select Signal Triggering and select Scope Triggering In the Trigger scope number box, enter the scope number of a Scope block. If you use this trigger mode, you must also add a second Scope block to your Simulink model. Host Scope Usage Use host scopes to log signal data triggered by an event while your target application is running. The host scope acquires the first N samples into a buffer. The number of samples N to log after triggering an event is equal to the value that you entered in the Number of samples parameter. 11

Ejercicio xpc target (Ejercicio PL1b) Utiliza el esquema de Simulink creado en la práctica anterior. (Ejercicio PL1a b) Configura el esquema convenientemente para ejecutarlo en el target. (Configuration parameters) La simulación se realizará durante 20 segundos. El sample time será: 0.02 (Fixed step) La señal de entrada y salida deben observarse en el target y en el host (xpcscopes). Monitoriza las señales desde el Explorer. Configura las características del Scope teniendo en cuenta las muestras que se van a tomar. (20/0.02), y cuántas muestras deseas visualizar por pantallazo. Configura los scopes de forma que en el Target se vean ciclos de 4 en 4 y en el host los 20 simultáneamente. 12