



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




ME EN 5960 – Intro to Robot Control – Spring 2008 Following are basic instructions for creating a Matlab Real Time Windows application:
ME EN 5960 – Intro to Robot Control – Spring 2008
As an example of a system to simulate, consider the model of a first order transfer function shown on the previous page.
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.
ME EN 5960 – Intro to Robot Control – Spring 2008
b. After adding the block, you must configure it to use the data acquisition board. The board in the computer is a National Instruments PCI 6024E if the option is not available. This is shown below after double clicking the Analog Output block.
c. Set the “Sample time” to correspond to the step size of your simulation, e.g. 0.001. Make sure the “Output channels” is set to 1. This will correspond to AO CH on the National Instruments BNC-2090 terminal block, which should be wired to the reference input of the amplifier. Finally, specify an “Initial Value” of 0 and “Final Value” of 0 so that the output always resets to 0 Volts at the beginning and end of your simulation. d. If you have a second amp, you can wire it to AO CH and change the output channels to an array: [1 2].
ME EN 5960 – Intro to Robot Control – Spring 2008
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 PFI 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.