lab0_v3

lab0_v3 - University of California, Santa Barbara...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: University of California, Santa Barbara Department of Electrical & Computer Engineering ECE 147b: Digital Control Lab 0: Introduction to Sampling This lab is an introduction to the experimental equipment and a review of some of the principles of sampling. No writeup is due. 1 Hardware The control board used in this lab has 3 encoder inputs on the top row, and three PWM outputs on the bottom row. The back has digital inputs and outputs. 2 Software The functionality of the control board can be completely controlled via SIMULINK and Real Time Workshop (RTW). RTW is a real-time Windows application that runs SIMULINK generated code on a PC. To use the control board, go to the Simulink Library Browser and 1. Select the Quarc/Generic/Data Acquisition library. 2. Select HIL Write PWM, HIL Read Encoder, HIL Initialize blocks from the selections on the right. 3. Drag the selected block onto your Simulink Model. 1 4. Double click the HIL Initialize block, set board type to q3-controlpaq-fw, set board number to HIL-1 and save settings. 5. Double click the HIL Encoder Input and HIL PWM Output blocks. 6. Set board number to HIL-1, set sample time, (ie. 0.001), set channel numbers (note: matlab channel numbers run from 1-3, board numbers run from 0-2, so channel 1 in simulink corresponds to channel 0 on the board). 2 3 2.1 Data Logging In the Real Time Windows Target, data is logged by scope blocks. Like an oscilloscope, to start the data logging procedure, a trigger is needed to initiate the process. A simple approach is to define a dedicated scope block, with one trigger signal entering it as illustrated below. This shows a step function set with a step time of 0.001 seconds, which corresponds to one sample time. This set-up will save all but the very first data point. To record data, follow the procedure below....
View Full Document

Page1 / 14

lab0_v3 - University of California, Santa Barbara...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online