Controls/Lab/Instrumentation

From PrattWiki

(Redirected from ME 125/Lab/Instrumentation)
Jump to: navigation, search

This page contains information related to the Instrumentation Basics and Simulink Lab for Controls. It has been updated for Spring, 2012.

Contents

Typographical Errors / Clarifications

and all the other toolbars off. The toolbar with the edit/test/animation buttons is the Instrumentation toolbar.

Resources


Codes, Models, and Layout Images

Since you should never copy and paste text from a PDF (the quotes change and extra spaces are added), some of the code for the assignment parts will be included below. Also, there are pictures of the models and layouts that you will be building.

Assignment 1: RC Circuit Analysis

InitInstruments1.m

%% Initialize workspace
clear; format short e;
 
%% Sets global parameters
global Ts SR
 
% Defines sampling rate and - more importantly - sample time
SR = 1000;
Ts = 1/SR;
 
%% Opens and builds Simulink Model on dSPACE
ModelName = 'Instruments1'
open_system(ModelName)
rtwbuild(ModelName)

MakeInstrument1Handles.m

%% Select the board
mlib('SelectBoard', 'ds1104');
 
%% Define global variables for measurement and output channels
global ADC1 ADC5 DAC1 CONST
global Ts SR
 
%% Create handles to relevant blocks
ADC1   = mlib('GetTrcVar', 'Model Root/ADC1/In1');
ADC5   = mlib('GetTrcVar', 'Model Root/ADC5/In1');
DAC1   = mlib('GetTrcVar', 'Model Root/DAC1/In1');
CONST  = mlib('GetTrcVar', 'Model Root/C1/Value');

Assignment 2: Angular Measurements

InitAngMeasurement.m

%% Initialize workspace
clear; format short e;
 
%% Sets global parameters
global Ts SR
 
% Defines sampling rate and - more importantly - sample time
SR = 10;
Ts = 1/SR;
 
%% Opens and builds Simulink Model on dSPACE
ModelName = 'AngMeasurement'
open_system(ModelName)
rtwbuild(ModelName)

The following are links to larger images of the Simulink model and ControlDesk layout for Assignment 2 of this lab:


Assignment 3: Voltage Control

Questions

Post your questions by editing the discussion page of this article. Edit the page, then scroll to the bottom and add a question by putting in the characters *{{Q}}, followed by your question and finally your signature (with four tildes, i.e. ~~~~). Using the {{Q}} will automatically put the page in the category of pages with questions - other editors hoping to help out can then go to that category page to see where the questions are. See the page for Template:Q for details and examples.

External Links

References

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox