Sfwr Eng/TRON 3DX4, Lab 4 Introduction to Computer Based Control

Similar documents
Rotary Motion Servo Plant: SRV02. Rotary Experiment #02: Position Control. SRV02 Position Control using QuaRC. Student Manual

Rotary Motion Servo Plant: SRV02. Rotary Experiment #03: Speed Control. SRV02 Speed Control using QuaRC. Student Manual

Ver. 4/5/2002, 1:11 PM 1

MEM01: DC-Motor Servomechanism

SRV02-Series Rotary Experiment # 3. Ball & Beam. Student Handout

Interfacing dspace to the Quanser Rotary Series of Experiments (SRV02ET)

5 Lab 5: Position Control Systems - Week 2

Lab 11. Speed Control of a D.C. motor. Motor Characterization

EE 4314 Lab 3 Handout Speed Control of the DC Motor System Using a PID Controller Fall Lab Information

EE 3TP4: Signals and Systems Lab 5: Control of a Servomechanism

Linear Motion Servo Plants: IP01 or IP02. Linear Experiment #0: Integration with WinCon. IP01 and IP02. Student Handout

MCE441/541 Midterm Project Position Control of Rotary Servomechanism

PID Control with Derivative Filtering and Integral Anti-Windup for a DC Servo

Motor Modeling and Position Control Lab 3 MAE 334

4 Experiment 4: DC Motor Voltage to Speed Transfer Function Estimation by Step Response and Frequency Response (Part 2)


Massachusetts Institute of Technology. Lab 2: Characterization of Lab System Components

SRV02-Series. Rotary Servo Plant. User Manual

Experiment 9. PID Controller

GE 320: Introduction to Control Systems

MAE106 Laboratory Exercises Lab # 5 - PD Control of DC motor position

Figure 1.1: Quanser Driving Simulator

Root Locus Design. by Martin Hagan revised by Trevor Eckert 1 OBJECTIVE

Industrial Control Equipment. ACS-1000 Analog Control System

Lab 2: Introduction to Real Time Workshop

Teaching Mechanical Students to Build and Analyze Motor Controllers

Phys Lecture 5. Motors

Sensors and Sensing Motors, Encoders and Motor Control

Course Outline. Time vs. Freq. Domain Analysis. Frequency Response. Amme 3500 : System Dynamics & Control. Design via Frequency Response

sin(wt) y(t) Exciter Vibrating armature ENME599 1

Ball and Beam. Workbook BB01. Student Version

Sensors and Sensing Motors, Encoders and Motor Control

Penn State Erie, The Behrend College School of Engineering

GE420 Laboratory Assignment 8 Positioning Control of a Motor Using PD, PID, and Hybrid Control

Advanced Servo Tuning

Open Loop Frequency Response

Digital Control Lab Exp#8: PID CONTROLLER

Tech Note #3: Setting up a Servo Axis For Closed Loop Position Control Application note by Tim McIntosh September 10, 2001

CHAPTER 7 HARDWARE IMPLEMENTATION

PID-control and open-loop control

Servo Tuning. Dr. Rohan Munasinghe Department. of Electronic and Telecommunication Engineering University of Moratuwa. Thanks to Dr.

Modeling and System Identification for a DC Servo

MEM 01 DC MOTOR-BASED SERVOMECHANISM WITH TACHOMETER FEEDBACK

The Discussion of this exercise covers the following points: Angular position control block diagram and fundamentals. Power amplifier 0.

Laboratory Assignment 5 Digital Velocity and Position control of a D.C. motor

Fundamentals of Servo Motion Control

ANNA UNIVERSITY :: CHENNAI MODEL QUESTION PAPER(V-SEMESTER) B.E. ELECTRONICS AND COMMUNICATION ENGINEERING EC334 - CONTROL SYSTEMS

Compensation of a position servo

Active Vibration Isolation of an Unbalanced Machine Tool Spindle

EE 3CL4: Introduction to Control Systems Lab 1: Introduction

Control Design for Servomechanisms July 2005, Glasgow Detailed Training Course Agenda

A Case Study of Rotating Sonar Sensor Application in Unmanned Automated Guided Vehicle

MASSACHUSETTS INSTITUTE OF TECHNOLOGY /6.071 Introduction to Electronics, Signals and Measurement Spring 2006

ME 3200 Mechatronics I Laboratory Lab 8: Angular Position and Velocity Sensors

Equipment and materials from stockroom:! DC Permanent-magnet Motor (If you can, get the same motor you used last time.)! Dual Power Amp!

Automatic Control Systems 2017 Spring Semester

The Embedded System. - Development and analysis of an Embedded DC-motor controller - by Embedded System Team

DC motor control using arduino

MTE 360 Automatic Control Systems University of Waterloo, Department of Mechanical & Mechatronics Engineering

JUNE 2014 Solved Question Paper

Feedback Systems. Many embedded system applications involve the concept of feedback. Sometimes feedback is designed into systems: Actuator

Loop Design. Chapter Introduction

2.017 DESIGN OF ELECTROMECHANICAL ROBOTIC SYSTEMS Fall 2009 Lab 4: Motor Control. October 5, 2009 Dr. Harrison H. Chin

Figure 1: Unity Feedback System. The transfer function of the PID controller looks like the following:

, answer the next six questions.

USER MANUAL. SRV02 Rotary Servo Base Unit. Set Up and Configuration

ME 461 Laboratory #5 Characterization and Control of PMDC Motors

UNIT 2: DC MOTOR POSITION CONTROL

Motomatic Servo Control

UNIVERSITY OF JORDAN Mechatronics Engineering Department Measurements & Control Lab Experiment no.1 DC Servo Motor

PROCEEDINGS OF THE SECOND INTERNATIONAL CONFERENCE ON SCIENCE AND ENGINEERING

EECS40 RLC Lab guide

Lecture 9. Lab 16 System Identification (2 nd or 2 sessions) Lab 17 Proportional Control

Effective Teaching Learning Process for PID Controller Based on Experimental Setup with LabVIEW

Development of a MATLAB Data Acquisition and Control Toolbox for BASIC Stamp Microcontrollers

and using the step routine on the closed loop system shows the step response to be less than the maximum allowed 20%.

7 Lab: Motor control for orientation and angular speed

T.J.Moir AUT University Auckland. The Ph ase Lock ed Loop.

ME 5281 Fall Homework 8 Due: Wed. Nov. 4th; start of class.

1.What is frequency response? A frequency responses the steady state response of a system when the input to the system is a sinusoidal signal.

Position Control of DC Motor by Compensating Strategies

Rotary Motion Servo Plant: SRV02. Rotary Experiment #17: 2D Ball Balancer. 2D Ball Balancer Control using QUARC. Instructor Manual

By Vishal Kumar. Project Advisor: Dr. Gary L. Dempsey

CSE 3215 Embedded Systems Laboratory Lab 5 Digital Control System

MSK4310 Demonstration

Project Proposal. Low-Cost Motor Speed Controller for Bradley ECE Department Robots L.C.M.S.C. By Ben Lorentzen

Robust Control Design for Rotary Inverted Pendulum Balance

2. Experiment s Title: The Linear and Rotary Potentiometer - AMEM 211

Feedback Devices. By John Mazurkiewicz. Baldor Electric

Poles and Zeros of H(s), Analog Computers and Active Filters

EEL2216 Control Theory CT2: Frequency Response Analysis

Lab 2A: Introduction to Sensing and Data Acquisition

EE 482 : CONTROL SYSTEMS Lab Manual

CHAPTER 6 INTRODUCTION TO SYSTEM IDENTIFICATION

SERVO MOTOR CONTROL TRAINER

Experiment 3. Performance of an induction motor drive under V/f and rotor flux oriented controllers.

Motor Control. Suppose we wish to use a microprocessor to control a motor - (or to control the load attached to the motor!) Power supply.

Lab Exercise 9: Stepper and Servo Motors

Developer Techniques Sessions

HIL Simulation Lab Work

Transcription:

Announcements: Sfwr Eng/TRON 3DX4, Lab 4 Introduction to Computer Based Control First lab Week of: Mar. 10, 014 Demo Due Week of: End of Lab Period, Mar. 17, 014 Assignment #4 posted: Tue Mar. 0, 014 This lab has only a demonstration portion. To get your demonstration marks, every time the lab asks you to show your work/output to your TA, show your TA that portion of the lab, fully working. Goals: Introduction to computer based control of a simple voltage-controllable electomechanical system - the DC motor Learn how to create virtual input channels Estimate the steady state Gain A of a motor Experiment with different set points and constants of a PID contoller while controlling the DC motor Estimate the time constant τ Note: This lab consists of five (5) activities. Demo each part to get the lab marks. Before you go for your lab session, please read the following NI documents at your own convenient time, in addition to the class notes: Fundamentals of Motion Control http://zone.ni.com/devzone/cda/tut/p/id/3367 Universal Power Module (UPM) user manual (Available in labs/manuals folder on the course web page) SRV0 rotary servo plant user manual (Available in labs/manuals folder on the course web page) SRV0 rotary experiments series (Available in labs/manuals folder on the course web page) 1

Equipment Arrangement Quanser SRV0 rotary servo plant consists of a DC motor, a gear box, a potentiometer, a quadrature encoder and a tachometer. The potentiometer output is used to implement the proportional (P) part of the PID controller. This is an analog signal and must be converted into a digital signal before it is passed on to the computer. The potentiometer is connected through a 6-pin DIN connector to S 1 terminal on the Universal Power Module (UPM). UPM supplies voltage to the potentiometer and picks up the analog signal from its wiper proportional to the position of the motor shaft. The S 1 output from UPM is connected to one of the analog input channels on BNC 10 board. The tachometer produces a voltage signal proportional to the angular velocity of the shaft dθ and is used to implement the derivative (D) part of the PID controller. dt The 6-pin DIN connector of the tachometer is connected to S 3 terminal of UPM. The encoder is connected to the terminal board such that it gets a 5v input by connecting two of the wires in its cable to +5v and ground. The wires that have pulses corresponding to channels A and B (shown in encoder literature) are connected to the Source and up-down terminals of a counter in the DAQ6035E data acquisition card (ensure that this card is installed in the PC being used by you) by using PFI8 and DIO6 terminals respectively for counter 0 or PFI3 and DIO7 terminals for counter 1. Some of the PCs in the lab have DAQ61M card. If you are using one of these PCs, then connect the source to PFI8 as above but the wire that carries the counter UP/DN direction information has to be connected to PFI9 terminal. It is also necessary in this case, to select UP/DN terminal used (PFI9) on the VI in a field designated for this purpose. The output of quadrature encoder is used to implement the Integral (I) part of the PID controller ( you will also use it for estimation of angular velocity). Analog output of DAC on 10-board (AO0) provides the signal to the amplifer to adjust its output according to the difference between the set point and the actual position of the motor shaft. Output of the amplifier (LOAD terminal of UPM) is connected to power the motor. A Labview VI implements the PID controller. On its front pannel the user can set the desired position of the motor shaft. Proportional, derivative and integral signals are received from the potentiometer, the tachometer and the encoder as described above. These signals are fed to the Labview VI implementing the controller. The difference between the set point and the actual position results in an output signal from the controller that is fed to the amplifier in UPM for adjusting its output and suitably controlling the motor shaft position. Activities in the lab: IMPORTANT NOTE: IN ORDER TO AVOID EXPENSIVE DAMAGE, DO NOT TURN ON YOUR MOTOR WITHOUT APPROVAL FROM A TA. IF YOU DO NOT GET APPROVAL FROM THE TA AT THE APPROPRIATE POINTS, YOU MAY BE ASSIGNED A ZERO FOR THE LAB.

1. Create NI-DAQmax Virtual Channels[5] Run the MAX tool (click on the National Instrument Measurement & Automation icon on the desktop) right click NI-DAQmax and select create new NI-DAQmax channel: Create a virtual input channel called position with units degrees with a range of [-180, +180] degrees, sensor type: voltage with range [-5, +5] Volts. Be sure to specify that it is range mapped and it is a singleended referenced signal. (Use custom scalling create new scale and select range mapped ) A virtual output channel called control with units degrees with a range of [-360, +360] degrees, with output voltage range [-10, +10] Volts. Be sure to specify that it is range mapped. Create another virtual input channel called velocity with units Deg/sec and a range of [-000, +000], sensor type: voltage with range [-5, +5] Volts. Be sure to specify that it is linear. (Use custom scalling create new scale and select linear ). Enter the slope value as: 85.7143 and the y-intercept as: 0. (The tachometer produces 1.5mv/rpm which translates to 4000 (deg/sec)per volt. The encoder is connected to the motor via a gear with a ratio of 14:1 which results in a linear slope of 4000/14 = 85.7143) Note: Make sure the signal input/output range for the channels is correct - scaled values with scaled units manually corrected as done in lab 1. Test the connections from within MAX: Connect the potentiometer sensor from the motor to Analog Input Channel 0. Make sure that the BNC/temp switch is set to BNC and the FS/GS switch is set to GS. Connect Analog Output Channel 0 to the input of the operational amplifier. (Ask your TA if necessary). Click the control channel under NI-DAQmax Global Virtual Channels Enter 60 as the output value Click the button Apply Value to Channel Click the button Run, abserve the motor is actually running To stop the motor, enter 0 as the output value and click Apply Value to Channel button. Show the working channels to your TA before proceeding further.. Estimate the steady state gain A[5] In this exercise estimate the angular velocity (θ = dθ ) of the motor shaft and dt θ use it to calculate the steady state gain A = input voltage 3

Background: The open loop transfer function of a motor can be written as: M θ (s) = θ(s) V (s) = A s(τs + 1) Where A is the steady state gain and τ is the time constant (both are positive real valued constants). The transfer function in terms of angular velocity can be written as: M θ = θ (s) V (s) = sm θ(s) = θ (s) = A τs + 1 V (s) Note that transfer function has a pole at 1 τ stable. Use Final Value Theorem: A τs + 1 sa lim t θ (t) = lim s 0 τs + 1 V 0 s = V 0A Where V 0 is the amplitude of the applied voltage. and τ > 0. Therefore system is In the lab, if we can estimate the angular velocity θ (t) for a given input voltage V 0, we can find out A. Recall that the Quanser rotary servo plant has an encoder that measures the relative position of the motor. We want to use the output of this encoder to experimentaly estimate the angular velocity. This can be done if we can record the change in the position of the motor shaft δθ and the corresponding elapsed time δt. Then the angular velocity ω = δθ δt. In this exercise we shall use a VI named openloop.vi (available at the labs/data folder on the course web page) for open-loop control of the motor. From the position channel of this VI for each iteration of a while loop, the time and position are passed on to shift registers. These values are used in the next iteration for calculating δt and δθ. The VI also displays a mean angular velocity both graphically as well as numerically. The signal from the tachometer is directly converted into velocity and displayed both graphically as well as numerically. Ensure that the motor s position encoder and the tachometer are connected as explained under equipment arrangement (the TA will do this for you). The motor s encoder has 104 pulses/revolution. Load the BNC-10 encoder example from the previous lab (QuadratureEncoder.vi). Save the file as MotorEncoder.vi and edit the example so that it reads the correct angle for the motor s position. 4

Download openloop.vi from the course web page. Use the VI to read the encoder for the position of the motor and the tachometer for the velocity of the motor. The VI uses the position to estimate the value of θ dθ. The dt VI should plot the estimate of the derivative and have a numeric display of the sliding average of the derivative over a user-setable number of samples. Corresponding velocity values are also read from the tachometer for comparison. In order to select both input channels from the control pannel of the VI, choose Browse from a drop down list and then use control key to select both the position and the velocity channels. Also select control channel from another drop-down list. Set the control channel for different set points -10,-90,-45, 0, 45, +90, +10 and for each setpoint record the value of your estimate of θ and the angular velocity read from the tachometer. Make a chart recording values: setpoint estimated velocity f rom encoder velocity value f rom tachometer. (Make sure that you stop the running VI, change the preset point and then run it again. Changing the preset point without first stopping the VI may result in unpredictable behaviour of the system.) Calculate the steady state gain for each set point and the mean value of the steady state gain and show them to your TA. 3. The importance of K i [5] The purpose of this exercise is to observe how an integral compensator (K i ) improves the steady state error. Note that when you asked below to load file PIDdemo.vi, you must have first also downloaded file simple PID.vi (downloadable from the labs/data folder on the course web page) as PIDdemo.vi requires it. In Labview, load the PIDdemo.vi (downloadable from the labs/data folder on the course web page) and save it as mypid.vi. Edit this file to make the controller suitable for use with the motor. Note that the lower and upper limits on the output should be changed to -360 and +360 respectively. Save the mypid.vi file and ask the TA to inspect it before running it. Once the TA has approved your design, have the TA help you connect your design to the motor. Set proportional gain K p to a value of 1. and set the integral K i and derivative K d gains to 0. Test the different set points -10,-90,-45, 45, +90, +10 and record any steady state offset in the output for each setpoint. Now set K i to be greater than zero, between say 1 and 5. Observe the change in the steady state errors at the previous set points. Record the steady state error values. Show the TA your recorded values for the last two steps (i.e. with and without K i ). 5

4. Estimating the time constant τ[5] This exercise examines two methods for estimating the time constant τ. Background: Consider the feedback control configuration with D(s) = K p (i.e. proportional control), K p > 0. The closed loop transfer function is: G θd = θ(s) R(s) = K p A τs + s + K p A When a system is critically damped, it has two equal values for poles. We can use this observation to calculate τ. Note the value of K p = K that results in critical damping of the system and use steady state gain A calculated in part of this lab. Another approach to calculate τ is to consider that the Root Mean Square (RMS) value of a signal f(t) that is periodic with period T is given by the equation: 1 T T 0 (f(t)) dt RMS values are often easier to measure and more accurate than trying to determine peak amplitudes. It can be shown that the RMS value of u(t) = B sin ωt is B. Suppose u(t) = B sin ωt is the input to a strictly stable transfer function G(s) = Y (s) U(s). In steady state, the RMS value of y(t) is G(jω) B. Thus RMS value of y(t) RMS value of u(t) = G(jω) This method of estimating τ is to experimentally determine the bandwidth of the closed loop system G θcl (s) corresponding to the -3dB frequency ω bw for a critically damped system. Then we have: G(jω bw ) = 1 For a critically damped system K p = K, at ω bw : K A (jω bw ) τ + jω bw + K A = 1 (1) If we know values of K and A, the above equation can be used to calculate τ. If we have a + jb, its magnitude is a + b 1. To convert into the form of c+dj a + jb, multiply top and bottom by the complex conjugate of c + dj. 6

Open your mypid.vi file and save it as a file called pidbode.vi. Edit this file to replace the setpoint control with a basic function generator. Add in controls to allow you to change the amplitude and frequency of a reference signal into the motor control loop. Add plots of the RMS value of the reference signal and the motor position as well as a numeric display of these values. Once the TA has approved your design, have the TA help you connect your design to the motor. Using this set up, make K i = K d = 0 and then tune the value of K p until the system is critically damped (i.e. just before overshoot occurs). Record the value. Use a square wave reference signal of a reasonably low frequency to help you tune the system. Note this value of K p = K Leave K i = K d = 0 and K p = K. Change the input to your system to a low frequency sinusoid of amplitude 90. Increase the frequency of the sinusoid until the RMS value of the output is 1 of the RMS value of the input. Record this frequency as ω bw. Use equation 1 to calulate τ. Show the TA your value for K, ω bw and τ. 7