Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Matlab/Simulink Real Time Windows Interface Tutorial | ME EN 5960, Assignments of Mechanical Engineering

Material Type: Assignment; Class: Microfluidic Chip Design & Fab; Subject: Mechanical Engineering; University: University of Utah; Term: Spring 2008;

Typology: Assignments

Pre 2010

Uploaded on 08/30/2009

koofers-user-ojd
koofers-user-ojd 🇺🇸

10 documents

1 / 6

Toggle sidebar

Related documents


Partial preview of the text

Download Matlab/Simulink Real Time Windows Interface Tutorial | ME EN 5960 and more Assignments Mechanical Engineering in PDF only on Docsity! Matlab/Simulink Real TimeWindows Interface Tutorial ME EN 5960 – Intro to Robot Control – Spring 2008 Page 1 of 6 Following are basic instructions for creating a Matlab Real Time Windows application: 1. Open up the Simulink model that you wish to run in real time (or create a new model file). A sample file is shown below: 2. Under the Simulation Menu, Select Configuration Parameters. On the Solver Tab as shown below, do the following: a. Select a fixed step integrator, b. Select an integrator such as ode5, c. Select a fixed step size (determines the sampling rate) d. Select “Single Tasking” 3. Now select the “Real-Time Workshop” tab. Click on the “Browse” button and select the “Real Time Workshop” target.as shown in the figures below. Click OK on both windows when completed. Matlab/Simulink Real TimeWindows Interface Tutorial ME EN 5960 – Intro to Robot Control – Spring 2008 Page 2 of 6 As an example of a system to simulate, consider the model of a first order transfer function shown on the previous page. 4. In order to display more than 1000 data points in the scope of this simulation several settings must be made: a. Open the scope window properties and turn off “Limit data points to last:” as shown below: b. Under the Tools menu, select “External Mode Control Panel”. In the window that opens, select the “Signal and Triggering” button. In the window that opens, change the Duration setting. If you are sampling every 0.001sec (i.e. your step size), then a setting of 10000 will show 10 seconds of data in the scope. Matlab/Simulink Real TimeWindows Interface Tutorial ME EN 5960 – Intro to Robot Control – Spring 2008 Page 5 of 6 e. To count encoder pulses, add a “Counter Input” block to the model from the Real Time Windows Target library. You will eventually need to add a gain block to convert to units of choice (revolutions or degrees or radians). Double click on the counter to configure it. f. Select the PCI-6024E board, change the “Sample time” to match your time step. Specify channel 1, which corresponds to Counter 0. Make sure the counter is set to never reset after read and to have a gate functionality of none. Also click on Board Setup and check the box for Bidirectional counter. The source input for Counter 0 is the PFI8 pin on the NI terminal block, which should be wired to the Clock Out pin on the decoder chip. The up/down input for Counter 0 is the DIO6 pin on the NI terminal block, which should be wired to the Up//Dn Out pin on the decoder chip. If the encoder has an index channel, you can wire that to the Counter 0 gate, which is pin PFI9 on the NI terminal block, and select a gate functionality of reset on rising or falling. g. If you have two encoders, you can change the input channels to an array: [1 2]. The source, up/down, and gate pins for channel 2 (Counter 1) are PFI3, DIO7, and PFI4, respectively. h. You can now rebuild the real time model, transfer it to the target, and then run it as described in the previous step. Matlab/Simulink Real TimeWindows Interface Tutorial ME EN 5960 – Intro to Robot Control – Spring 2008 Page 6 of 6 Note:  Any changes made to the model require that the model is rebuilt and transferred to the Real Time Windows Target before they will take effect.  See Matlab Help / Real Time Windows Target for more information.
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved