Session 1 Introduction to Data Acquisition and Real-Time Control

Similar documents
SRV02-Series. Rotary Pendulum. User Manual

SRV02-Series. Ball & Beam. User Manual

Lab 2: A/D, D/A, and Sampling Theorem

Transmitter Interface Program

ECE-320 Lab 5: Modeling and Controlling a Pendulum

Lab 2, Analysis and Design of PID

CDHD Servo Drive. Technical Training Manual. Manual Revision: 2.0 Firmware Version: 1.3.x Software Version: 1.3.x.x

ME EN 363 ELEMENTARY INSTRUMENTATION Lab: Basic Lab Instruments and Data Acquisition

Data Acquisition Using LabVIEW

Revision 1.2d

MICROMASTER Encoder Module

Lab 1 Introduction to the Software Development Environment and Signal Sampling

Pre-processing of revolution speed data in ArtemiS SUITE 1

USER MANUAL. Inverted Pendulum Experiment CAPTIVATE. MOTIVATE. GRADUATE.

Manual. Analog (U/I) Sendix M3661 / M3681. Sendix M3661R. Sendix M5861. Absolute multiturn encoder. Order code: 8.M36X1.XXXX.XX12

MIE 402: WORKSHOP ON DATA ACQUISITION AND SIGNAL PROCESSING Spring 2003

Part No. ENC-LAB01 Users Manual Introduction EncoderLAB

Computer Controlled Advanced Industrial Servosystems Trainer (for AC motors) SERIN/CA

Training Document for Comprehensive Automation Solutions Totally Integrated Automation (T I A)

The software concept. Try yourself and experience how your processes are significantly simplified. You need. weqube.

The software concept. Try yourself and experience how your processes are significantly simplified. You need. weqube.

Transducers and Sensors

Flat-Bed Module Recorders

Informatics Enlightened Station 1 Sunflower

DMC550 Technical Reference

R5 RIC Quickstart R5 RIC. R5 RIC Quickstart. Saab TransponderTech AB. Appendices. Project designation. Document title. Page 1 (25)

Noise Detector ND-1 Operating Manual

EM1. Transmissive Optical Encoder Module Page 1 of 9. Description. Features

EM1. Transmissive Optical Encoder Module Page 1 of 8. Description. Features

PCM-22 Rotary Knife Controller Operators Manual

DT9834 Series High-Performance Multifunction USB Data Acquisition Modules

Introduction To LabVIEW and the DSP Board

PCM-24 Press Feed Controller

SPECIFICATION NO NOTE

Getting Started with the LabVIEW Sound and Vibration Toolkit

The Micropython Microcontroller

SPECIFICATION NO Model 207 Automatic GTAW Welding System

Pole Zero Correction using OBSPY and PSN Data

UNIT V 8051 Microcontroller based Systems Design

FX0N-3A SPECIAL FUNCTION BLOCK

Configuring the Stack ST8961 VS Module when used in conjunction with a Stack ST81xx series display.

VIDEO GRABBER. DisplayPort. User Manual

Topic: Instructional David G. Thomas December 23, 2015

Lab experience 1: Introduction to LabView

This document describes the different ways to allow the automation system to close a gpi contact from the transmission list.

LabView Exercises: Part II

Scan Converter Quick Installation Guide

DT9857E. Key Features: Dynamic Signal Analyzer for Sound and Vibration Analysis Expandable to 64 Channels

BER MEASUREMENT IN THE NOISY CHANNEL

An Introduction to the Spectral Dynamics Rotating Machinery Analysis (RMA) package For PUMA and COUGAR

DSP Laboratory: Analog to Digital and Digital to Analog Conversion *

Electronic Panel Meters DIGEM Preference Program Process control, automation & laboratory uses Class 0.01 to 1 Current, Voltage, Frequency,

LX3V-4AD User manual Website: Technical Support: Skype: Phone: QQ Group: Technical forum:

W0EB/W2CTX DSP Audio Filter Operating Manual V1.12

High Speed Counter. Table of Contents

Using different reference quantities in ArtemiS SUITE

Digital Effects Pedal Description Ross Jongeward 10 December 2014

Activity P32: Variation of Light Intensity (Light Sensor)

Experiment 2: Sampling and Quantization

Analyzing and Saving a Signal

EM1. Transmissive Optical Encoder Module Page 1 of 8. Description. Features

Video Surveillance *

Integration of Virtual Instrumentation into a Compressed Electricity and Electronic Curriculum

AI-1664LAX-USB. Features. 100KSPS 16-bit Analog Input Unit for USB AI-1664LAX-USB 1. Ver.1.01

User Manual for ASSIST Evaluation & Programming Tool EPT002

ASK THE EXPERTS: Procedure for Verifying Magnetic Pickup Signal Integrity Using a Windrock Portable Analyzer

(Skip to step 11 if you are already familiar with connecting to the Tribot)

ECE 402L APPLICATIONS OF ANALOG INTEGRATED CIRCUITS SPRING No labs meet this week. Course introduction & lab safety

2 MHz Lock-In Amplifier

Installation / Set-up of Autoread Camera System to DS1000/DS1200 Inserters

Diamond Cut Productions / Application Notes AN-2

DAAB DB409 INSTRUCTION MANUAL FOR THE VFD-EL FREQUENCY CONVERTER. For the DAAB EP104 automatic control system with software version 4.

MTL Software. Overview

Major Differences Between the DT9847 Series Modules

Interactive Virtual Laboratory for Distance Education in Nuclear Engineering. Abstract

Operating Instructions for Throttle Valves Using VRC Valve Positioner

Activity P27: Speed of Sound in Air (Sound Sensor)

Installation & Operational Manual

JAMAR TRAX RD Detector Package Power Requirements Installation Setting Up The Unit

Modified Sigma-Delta Converter and Flip-Flop Circuits Used for Capacitance Measuring

ORM0022 EHPC210 Universal Controller Operation Manual Revision 1. EHPC210 Universal Controller. Operation Manual

Low-cost labelling system

Netzer AqBiSS Electric Encoders

Rotary Knife Controller

E X P E R I M E N T 1

PLASMA MONITOR (PT20 UVVis) USER GUIDE

Ensemble QLAB. Stand-Alone, 1-4 Axes Piezo Motion Controller. Control 1 to 4 axes of piezo nanopositioning stages in open- or closed-loop operation

Calibrate, Characterize and Emulate Systems Using RFXpress in AWG Series

B I O E N / Biological Signals & Data Acquisition

Absolute Rotary Encoder E6CP

EAN-Performance and Latency

Torsional vibration analysis in ArtemiS SUITE 1

Quick-Start for READ30

DT9837 Series. High Performance, USB Powered Modules for Sound & Vibration Analysis. Key Features:

Experiment 7: Bit Error Rate (BER) Measurement in the Noisy Channel

Software vs Hardware Machine Control: Cost and Performance Compared

SPA MICROPROCESSOR SPEEDOMETER INSTALLATION AND OPERATING MANUAL PAGE 2...INSTRUMENT FEATURES PAGE 3...OPERATING INSTRUCTIONS PAGE 3...

INDIAN INSTITUTE OF TECHNOLOGY KHARAGPUR NPTEL ONLINE CERTIFICATION COURSE. On Industrial Automation and Control

AD16-64(LPCI)LA. Non-isolated high precision analog input board for Low Profile PCI AD16-64(LPCI)LA 1. Ver.1.01

TL-2900 AMMONIA & NITRATE ANALYZER DUAL CHANNEL

Transcription:

EE-371 CONTROL SYSTEMS LABORATORY Session 1 Introduction to Data Acquisition and Real-Time Control Purpose The objectives of this session are To gain familiarity with the MultiQ3 board and WinCon software. Understand the basic I/O connections. Create a WinCon application for the encoder and measure the encoder angle. Create a WinCon application to run the motor and measure the tachometer and potentiometer signals. Introduction Digital control of a continuous-time system has become very popular as the price and reliability of digital computers has greatly improved. Analog controllers are replaced by a digital computer that performs calculations, which emulate the physical controllers. Very complicated control structures can be implemented easily using a digital controller, whereas an analog controller would require very complex hardware. Digital control offers important advantages in flexibility of modifying controller characteristics by changing the program if the design requirement changes or plant dynamic changes with the operating conditions. Furthermore, analog emulation and real-time control provides advanced features such as adaptive self-tuning, multivariable control, expert systems, and the ability to communicate over a local area network. Analog-to-digital Converter (ADC) and digital-to-analog Converter (DAC) Typically, the computer replaces the cascade controller. The measured data is converted from analog form to digital by means of the analog-to-digital converter (ADC). This is accomplished by the data acquisition system which is the eyes and ears of the digital computer. The digital computer receives and operates on the signal in digital form (numerical). The computer output is then converted to analog form by the digital-toanalog converter (DAC). This process is the hands and arm of the digital computer. The full-scale output is usually determined by an external reference voltage. The DAC resolution is defined as the smallest possible change in output. For an N-bit converter the resolution is 100 Resolution = % (2.1) 2 N 100 100 For example the resolution of a 10-bit DAC is = = 0.09766%. The resolution 10 2 1024 of an ADC is defined as the smallest detectible change in input, which is also given by (2.1). 1.1

When the computer reacts to external events as they occur it is referred to as a real-time control system. An important consideration in real-time control is the update rate. During one controller cycle three things must happen before the next cycle can begin (1) sensor are read (A/D inputs), (2) the microprocessor computes an updated commands, (3) the commands are converted to analog output (D/A outputs). Between cycles, the command outputs are held constant. So, if the controller is updated every 0.01 second, the output of the controller would look like a staircase, changing every 0.01 second. As you might expect, the faster the dynamics are of the system you are trying to control, the faster you must update the controller. Again these are important considerations in specifying a control system since high-speed systems can become very expensive. Modern real-time control systems use computer-aided software engineering (CASE) such as MATLAB Real-Time Workshop to automatically generate C code from the graphical control model such as Simulink together with vender-specific block such as WinCon for handling data transfer between MATLAB and the servo system. In this lab, we will focus on gaining familiarities the MultiQ3 DACB and WinCon software. In addition, you will explore the effect of A/D and D/A that are built into the MultiQ3 I/O board, through which all the control signals pass. Procedure 1. Wiring diagram Using the set of leads, universal power module (UPM), SRV-02 DC-motor, and the connecting board of the MultiQ3 data acquisition board, complete the wiring diagram as follow as shown in Figure 1.1. Connect the motor to the UPM From SRV02 Motor connecter To UPM/To Load Connect the tachometer to the UPM Cable 6 pin Din to 4 pin Din, Gain 1 Cable From Tacho on SRV02 To UPM /S3 6 pin mini Din to 6 pin mini Din Connect the potentiometer to the to the UPM From Potentiometer on SRV02 To UPM/S1 6 pin mini Din to 6 pin mini Din Connect the encoder on MultiQ terminal board to encoder signal on SRV02 To SRV02 From MultiQ encoder # 0 5 pin Din to 5 pin Din Encoder Connect the analog output from MultiQ terminal board to the power module input From analog output #0 D/A on To UPM From RCA to 5 pin Din MultiQ D/A Connect the A/D on the MultiQ to UPM From A/D # 0, 1, 2, 3, on MultiQ To UPM- To A/D 5 pin Din to 4xRCA 1.2

SRVO2- Motor Encoder Potentiometer S1 From D/A From D/A UPM TO A/D Analog Output #0 D/A MultiQ 3 2 1 0 W RB Y Analog input A/D Tacmometer S1 S3 To Load Encoder #0 Figure 1.1 Wiring diagram Do not power up the amplifiers. Make sure the LED on the MultiQ terminal board is illuminated. If it is not then the fuse needs replacement. 2. Sensor Measurements 2.1 Creating the encoder model and measuring Encoder angle The encoder is used to provide the digital phase information. Start MATLAB, launch Simulink and from the Simulink Library Browser File open a new model. Get the Encoder Input from the Quanser Toolbox/Quanser Consulting MultiQ3 Series as shown in Figure 1.2 Figure 1.2 Quanser Toolbox and Data Acquisition. Build a Simulink diagram as shown in the Figure 1.3. The encoder input is connected to Encoder 0 on the MultiQ wiring diagram. Double-click on the Encoder input block to open its dialog box and set the Channel to Use to 0. Save the model (say Lab1A.mdl) 1.3

Quanser Consulting MQ3 ENC Gain Encoder Input Theta_o Figure 1.3 Diagram to measure encoder. Connecting to the client Before you run any real-time code, you need to launch the WinCon server and connect to the client PC where the experiment is going to run. Ensure that WinCon Client is running on the PC you want to connect to. Start WinCon server on your Laptop and then use Client Connect as shown in Figure 1.4 in the dialog box type the proper Client workstation IP address (The station IP addresses are s312-1 to s312-10). 1 Compiling the model Figure 1.4 Connect to the Client that is running the experiment. In order to run the diagram in real-time, you must first build the code for it. This is done using the WinCon/Build option in the diagram shown in Figure 1.5. Select Wincon/Option to open the Simulation parameter dialog box. Select the Solver tab and set the sampling rate on the controller to 0.01 second under Fixed Step Size. Select ode4 (Rung Kutta) for integration method. In the Simulation drop down menu set the model to External. Then Click WinCon/Build. This will generate the code and compile it. When the compile is done, the code will download to the WinCon Client. You can now use WinCon Server to start and stop the real-time code. 1.4

Figure 1.5 Set the WinCon option and Simulation parameters. Running the code Now that the code has been compiled, you are ready to run it in real-time. Click on the Start button in WinCon server. It will turn red and display STOP. Clicking on STOP will stop the real-time code and return to the Green button. Figure 1.6 WinCon Server If you have access to the host PC you can see the code in real-time, maximizing the WinCon Client on the host PC will show the following screen. Figure 1.7 Client Applications 1.5

The WinCon client is the real-time component of the software and it runs at the period specified under Simulation Parameters / Solver / Fixed Step. Plotting data Click on Plot/New/Scope in WinCon Server and in the Select variable to display menu click on Theta_o (i.e., the name you assigned to the Scope) to select the variable you want to plot and press OK. This opens a real-time plot. Click on the Start button on the WinCon Server. As you move the gear by hand the trace will follow your movement. Note the values are not in degrees- they are in counts. The encoder measures 1024 counts per revolution - in quadrature. That means 360 degrees result in 1024*4 = 4096 counts. The resolution of the encoder counter is then 360/4096 = 0.0878906250 degrees. In order to convert the measured value to degrees change the gain block in the Simulink diagram (Figure 1.3) to 360/4096 and the value coming out of the gain block will be in degrees. You also need to ensure that the sign of the measurements is correct. Select the sign of the gain block such that a counterclockwise rotation of the output shaft (middle gear) results in a positive change in the measurement. Adjust the output shaft (middle gear) so that the angle on Scope plot is near zero. Turn the center gear through any angle say about 45 ccw and note the trace value. Turn the middle gear cw and note the corresponding reading (a negative value). Turn the servo gear through a small angle slowly and smoothly back and forth; trace will follow your movement. The trace value will be constant when you stop the movement, In order to record, when you have a trace on the graph Press STOP on the WinCon Server. Figure 1.8 Gear movement trace by encode (in degrees) From the Window pull-down menu, you can use Legend to place a legend on the Figure. Click on any plot in the legend box to select the desired graph background, trace color and the text font. 1.6

2.2 Applying a voltage to the motor, and measuring speed with a tachometer and position with a potentiometer Creating the model The motor is driven by an amplifier that can deliver the desired power to it. In order to drive a voltage to the motor, you need to output the desired voltage to the desired D/A channel that is connected to the appropriate amplifier. From the wiring you performed, you know that D/A#0 drives the UMP1503, which in turn drives the motor. Click File/New in WinCon - do not save anything. Start a fresh Simulink diagram. Connect a constant block via a gain block to the Quanser analog output. This will output a constant voltage to the analog block that you specify. Next add an analog input block to measure the tachometer signal, set Channel to Use to 2. The tachometer generates an analog signal 1.5 V/1000 RPM. Get a gain block and set its gain to 1000/1.5. Get a digital display from the Simulink Sink library and attach it to the gain block. Finally add an analog input block to measure potentiometer signal, set Channel to Use to 0. The potentiometer generates an analog signal 1V/35.2 Deg. Get a gain block and set its gain to 35.2. Get a Scope from the Simulink Sink library and attach it to the gain block. Your completed model should look like the one in Figure 1.9. 1 Constant -1 Gain Quanser Consulting MQ3 DAC Analog Output Quanser Consulting MQ3 ADC Analog Input Channel 2-1000/1.5 CalTach 0 Display RPM Quanser Consulting MQ3 ADC -35.2 Analog Input Channel 0 CalPot Display Degree Figure 1.9 WinCon application, applying a voltage to servomotor and measuring with a tachometer and potentiometer 1.7

Save the model (say Lab1B.mdl). See that you are connected to the proper client PC. Set the WinCon options (select the Solver tab and set the sampling rate on the controller to 0.001 seconds under Fixed Step Size. Select ode4 Rung Kutta for integration method). In the Simulation drop down menu set the model to External. Click WinCon/Build, this will generate the code and download it to the client. Run the model; this will output 1 volt to the analog output and drive the amplifier, which in turn drives the motor. The output shaft (middle gear) will turn in the clockwise direction. Changing the value of the Constant block will change the speed of the motor. Changing the sign of the constant block will change the direction. If we make the gain block = -1, then the output shaft will turn ccw when the constant is positive. If the amplifier is being used with a gain cable, a block should be inserted before the D/A of 1/(cable gain) in order to obtain overall unity gain. Measuring speed with the tachometer In order for the motor to turn ccw when a positive voltage is applied to it in the Simulink diagram set the gain block to 1. A positive voltage should result in a ccw rotation of the output shaft (middle gear), and a ccw rotation should result in a positive tachometer measurement. Adjust the signs of the gains to achieve this. You can display the speed on a digital meter. To display a digital meter, click on Plot/New/Digital meter in WinCon Server and in the Select variable to display click on Display RPM (i.e., the name you assigned to the Digital meter) to select the variable you want to display and press OK. This opens a real-time Digital meter. Figure 1.10 Tachometer reading The reading on the digital meter fluctuates due to a high frequency ripple in the tachometer - The ripple in this tachometer is about 7% peak to peak of the average value. So for 1000 RPM at the motor you will see a ripple of 70 RPM p-p. Furthermore the speed of this open loop system is sensitive to noise and small change in the load. Since the external gears impose nonuniform loading as the motor turns the motor speed is not constant over the rotational range. By passing the signal through a low pass filter the tachometer noise can be reduced. This is done in the speed control design project. Measuring position with the potentiometer The potentiometer is a single turn 10 KΩ sensor with no physical stops. Its electrical range is 352 degrees. The potentiometer generates an analog signal proportional to the 1.8

angle of rotation. The difference between a potentiometer and an encoder is that the encoder can measure several turns continuously while the potentiometer can only measure one full turn and then roll over. A ccw turn results in a positive measurement. Note that the potentiometer is an absolute position device while the encoder is a relative position device. You can adjust the potentiometer shaft rotation relative to the gear such that the zero measurement is at a desired angle always. You can plot the display on either a WinCon scope or digital meter. To open a scope, click on Plot/New/Scope in WinCon Server and in the Select variable to display dialog box, click on Display Degree (i.e., the name you assigned to the Scope) to select the variable you want to plot and press OK. This opens a real-time plot. In order to obtain a MATLAB Figure plot, from the File menu choose save the plot as M-file, and specify a file name. Now at the MATLAB prompt if you type the file name you can obtain the MATLAB Figure plot. You can type grid to place a grid on the graph or edit the Figure as you wish. Figure 1.11 potentiometer trace 3. Knowledge test As this is an introductory session, there is no report to write. You should however ensure that you have understood the principles of operation of WinCon. You should also have a good understanding of how angles are measured and how the voltages are applied to the motor. In order to ensure that you understand the systems ensure that you can reply to the following questions correctly (and confidently!). How many actuators and how many sensors does the system have? Which D/A channel drive the UMP? Which encoder channel measures the encoder? Why is the sign of the calibration constant important? Why is the sign of the voltage signal important? Why does the cable gain have to be compensated for in the motor model? 1.9