Top Banner
Hardware-In-The-Loop Configuration using Matlab/SIMULINK By: Vimal Rau
13

HIL Configuration Using Matlab

Sep 28, 2015

Download

Documents

Vimal Rau

This file explains on the system configuration of xPC target using matlab SIMULINK
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript

Hardware-In-The-Loop Configuration using Matlab/SIMULINK

Hardware-In-The-Loop Configuration using Matlab/SIMULINKBy: Vimal RauIntroductionHILS is known as hardware-in-the-loop simulation testing where uses interaction between hardware and software.xPC Target is a real-time software environment from MathWorks which runs on a separate workstationxPC Target is used as part of the real-time control system for the projects. In real-time control systems, the act of reading sensors, generating feedback, and changing the corresponding control input is guaranteed within a set response time.

MATLAB/Simulink is used to create a model of the control system to communicate with real-time workstation. Simulink compiles your model and uploads it into the xPC Target workstation. xPC runs the real-time model, which ships data back to the HOST PC(laptop) while reading inputs and issuing commands with the Data Acquisition boards (Ex: IMC board, NI board, MCC DAQ). InstallationxPC installation is a one-time process, after which you will have the freedom to work on simulation and control design on your laptop while using the desktop to test hardware implementation.

EquipmentsHost PC (operate SIMULINK system)Target PC (xPC real-time target station)Ethernet cablexPC Target Bootable DiscMatlab Software 2009b and above (any other compatible software for xPC)Microsoft Visual Studio 2010 (beyond this version)

5Host PC compiler setupIn the MATLAB command window, type xpcexplr to open the xPC Target Explorer. In the left panel, under Host PC Root > Compiler Configuration, make sure VisualC is selected as the compiler and the path.

xPC Bootable DiscBring up xPC Explorer, under xPC Target Hierarchy you will see TargetPC1 (if no target is present go to File>Add Target). Look for Configuration > Communication, to the right will a window labeled Target PC1 Communication Component at the top. Set the drop-down menus as and go for configuration to create BootCD:

xPC Target workstation setupThe following steps have already been completed on each workstation. Please do not alter the setup in any manner. (a) Installation of the DAQ card. (b) Installation of xPC compatible Ethernet card. (c) Internal Network Interface Card (NIC) disabled (if another Ethernet card installed). (d) Boot sequence changed with CD ROM priority

Configuration of Host PC LANGo to Control Panel > Network and Internet > Network and Sharing Center > Manage network connections (for Vista) or Change adapter settings (Windows 7).Select Local Area Connection > Properties.Go to TCP/IP v4 Properties.Select Use the following IP address and click Advanced without filling in the details.Set IP address to 192.168.1.1Set the subnet to 255.255.255.0

9xPC Workstation LAN SetupIn the MATLAB command window, type xpcexplr to open the xPC Target ExplorerUnder TargetPC1 > Configuration > Communication, make the following changes : (a) Select TCP/IP as the communication protocol. (b)Set the Target TCP/IP address to 192.168.1.2 (c) Set the LAN Subnet Mask to 255.255.255.0

Select Apply.Go to Target > Connect to Target to connect. Successful connection is confirmed by checking TargetPC1. The Connected status should be Yes.

10Testing ProcedureCreate a mdl file in SIMULINK to interlink Host PC and Target PC using the analog input (for ex: PCI 6221 since this the NI DAQ board serial name)Build the system to Target PC by clicking Control+BThe xPC Target compiled the system and upload in Target PC.

11

Thank you..