DOC PREVIEW
Rose-Hulman ECE 320 - Real-Time Windows Target

This preview shows page 1-2-20-21 out of 21 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 21 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 21 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 21 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 21 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 21 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Real-Time Windows Target, Simulink, and the ECP Model 210 and Model 205 Every station in C-116 should be set up to run the ECP Model 210 (rectilinear system) and/or Model 205 (torsional system) from Simulink using the Real-Time Windows Target software. However, it often takes a little effort to make sure all components are communicating with each other. This is a brief guide to help you get started. Do not interchange the ECP Model 210 and ECP Model 205 Simulink blocks. They have scaling differences and are not interchangeable! Step 1. We need to inform the ECP system that we will be using Simulink and the real-time windows target. To do this, click Start -> Programs -> ECP The ECP window should pop up, something like the window shown below: First select Utility-> Download Controller Personality File. Then select C: -> Program Files -> ECP Systems -> cn 1Select m210_rtwt_3.pmc (to use the Model 210) or m205_rtwt_3.pmc (to the use Model 205) and click on open. Wait for the ECP system to load the personality file. Step 2. Select Utility -> Reset Controller. Step 3. Close the ECP Executive (click on the X) Do not just minimize it!!!! Step 4. You must be using Matlab 6.5.1 to use the real-time windows target with the ECP systems. Once you have started the correct version of Matlab, we need to get some communications started. Step 5. To install Matlab’s Real-Time Windows Target, type rtwintgt –setup Matlab should respond with You are going to install the Real-Time Windows Target kernel. Do you want to proceed? [y] : Since the whole point is the use the real time windows target, you should type y and hit the enter key. At this point, Matlab will respond with The Real-Time Windows Target kernel has been successfully installed. The real-time windows target usually remains installed, so after you type rtwintgt –setup you may get the message The current version of the Real-Time Windows Target kernel is already installed. Do you want to reinstall it? [n] You can just type n (and enter) if you get this message, since you do not need to reinstall it. 2Step 6. The real-time windows target utilizes Microsoft’s Visual C++ compiler. We need to tell Matlab to use this compiler. To do this, type mex -setup Matlab will respond with the message: Please choose your compiler for building external interface (MEX) files: Would you like mex to locate installed compilers [y]/n? You need to type y (and enter), since we want Matlab to identify the available compilers Matlab then responds with Select a compiler: [1] Digital Visual Fortran version 6.0 in C:\Program Files\Microsoft Visual Studio [2] Lcc C version 2.4 in C:\MATLAB6P5\sys\lcc [3] Microsoft Visual C/C++ version 6.0 in C:\Program Files\Microsoft Visual Studio [0] None Compiler: You need to type 3 (and enter), since we are going to use Microsoft’s Visual C++ Compier Matlab then responds with Please verify your choices: Compiler: Microsoft Visual C/C++ 6.0 Location: C:\Program Files\Microsoft Visual Studio Are these correct?([y]/n): And you should respond with a y (and enter) At this point Matlab responds with a long-winded reply which basically means it’s done. 3Step 7. Set the Matlab current directory to the folder where all of your files are located. Step 8. Start Simulink by typing Simulink in the Matlab window. 4Resetting the System Using Simulink We often have to reset/reinitialize the system. In order to do this from Simulink we use the ECPDSPresetmdl.mdl Simulink model file. This model is our friend, you will probably use it a lot. From Simulink select File->Open->ECPDSPResetmdl.mdl The following window should pop up. In order to make sure communications are OK, we need to be sure the address for the signal processing card is where we think it should be. To do this, double click on the ECP Reset block. You should get the following: This address should be ‘0xDE00’ on the old computers and ‘0xB400’ on the newer computers 5Next we need to compile ECPDSPResetmdl.mdl. To do this click on the compile icon Click here to compile A bunch of stuff will get written to to Matlab window, ending with the line: ### Successful completion of Real-Time Workshop build procedure for model: ECPDSPResetmdl >> 6Now we need to connect this model to the real system. To do this, first make sure the word External is showing in the box, and then click on the icon next to the box, as shown below. This should say External Click here to connect to the ECP system The play button should now be available, as shown below. In the Matlab window, you should get the message Model ECPDSPResetmdl loaded. Play button now available 7Now click on the play button. The window should look briefly like the following. The black box (where the play button was) is the stop button, you can use this to stop the simulation at any time. Stop button If you’ve done everything correctly, after the system has run in the Matlab window you should get the message Model ECPDSPResetmdl unloaded. This routine is just used to initialize and reset values, the ECP system will not move. 8Model210_Openloop.mdl The first thing we usually need to do is to identify the system by constructing a Bode plot and fitting the measured frequency response to the expected frequency response of the transfer function in our model. To do this we will usually use the Simulink file Model210_Openloop.mdl. This is shown below: This particular implementation has the input signal in cm and the position of the cart (y) is measured in cm. For this implementation, the position of the first cart is plotted as a function of time as the ECP system runs. (Note that the length of time the XY Graph plots the position of the first cart is hard coded, i.e. it cannot be a variable.) 9The first thing we need to do is be sure Simulink is communicating with the signal processing board correctly. This means we need to be sure the Simulink model thinks the signal processing board is at the correct address. To do this, first click on the ECP Model 210 block. You should get the following: This basically shows us that the ECP Model 210 block is made up of subsystems, most of which you don’t have to worry about. To check the address of the DSP card, click on the ESPDSP Driver block.


View Full Document

Rose-Hulman ECE 320 - Real-Time Windows Target

Documents in this Course
Load more
Download Real-Time Windows Target
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Real-Time Windows Target and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Real-Time Windows Target 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?