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

Similar documents
ECE 5671/6671 Lab 3. Impedance Measurement and Parameter Estimation of a DC Motor

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

ECE 5670/6670 Project. Brushless DC Motor Control with 6-Step Commutation. Objectives

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

E x p e r i m e n t 3 Characterization of DC Motor: Part 1

Lab 2: Introduction to Real Time Workshop

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


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

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

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

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

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

E x p e r i m e n t 2 S i m u l a t i o n a n d R e a l - t i m e I m p l e m e n t a t i o n o f a S w i t c h - m o d e D C C o n v e r t e r

5 Lab 5: Position Control Systems - Week 2

Lab 1: Simulating Control Systems with Simulink and MATLAB

ECE 5670/ Lab 5. Closed-Loop Control of a Stepper Motor. Objectives

Experiment 9. PID Controller

Lab 1: Steady State Error and Step Response MAE 433, Spring 2012

LECTURE 2: PD, PID, and Feedback Compensation. ( ) = + We consider various settings for Zc when compensating the system with the following RL:

Electric Drives Experiment 5 Four-Quadrant Operation of a PMDC Motor

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

Brushed DC Motor Microcontroller PWM Speed Control with Optical Encoder and H-Bridge

1. Consider the closed loop system shown in the figure below. Select the appropriate option to implement the system shown in dotted lines using

7 Lab: Motor control for orientation and angular speed

Dr Ian R. Manchester Dr Ian R. Manchester Amme 3500 : Root Locus Design

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

ECE 5670/ Lab 6. Parameter Estimation of a Brushless DC Motor. Objectives

CDS 101/110: Lecture 8.2 PID Control

Experiment 1 Introduction to Simulink

Digital Control Lab Exp#8: PID CONTROLLER

Frequency Response Analysis and Design Tutorial

CSE 3215 Embedded Systems Laboratory Lab 5 Digital Control System

Penn State Erie, The Behrend College School of Engineering

EE 482 : CONTROL SYSTEMS Lab Manual

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

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

DEPARTMENT OF ELECTRICAL AND ELECTRONIC ENGINEERING BANGLADESH UNIVERSITY OF ENGINEERING & TECHNOLOGY EEE 402 : CONTROL SYSTEMS SESSIONAL

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

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

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

A M E M B E R O F T H E K E N D A L L G R O U P

MCE441/541 Midterm Project Position Control of Rotary Servomechanism

TF Electronics Throttle Controller

CSMIO/IP-A motion controller and Mach4

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

Cantonment, Dhaka-1216, BANGLADESH

Dr Ian R. Manchester

Introduction to Simulink Assignment Companion Document

Basic Tuning for the SERVOSTAR 400/600

Lab 1: First Order CT Systems, Blockdiagrams, Introduction

Chief Architect X3 Training Series. Layers and Layer Sets

DEGREE: Biomedical Engineering YEAR: TERM: 1

Practical Assignment 1: Arduino interface with Simulink

Fundamentals of Servo Motion Control

Introduction to Modeling of Switched Mode Power Converters Using MATLAB and Simulink

ECE 5670/6670 Lab 7 Brushless DC Motor Control with 6-Step Commutation. Objectives

SECTION 6: ROOT LOCUS DESIGN

Open Loop Frequency Response

ECE411 - Laboratory Exercise #1

Motor Modeling and Position Control Lab 3 MAE 334

EE 461 Experiment #1 Digital Control of DC Servomotor

Switch Mode Power Conversion Prof. L. Umanand Department of Electronics System Engineering Indian Institute of Science, Bangalore

EEL 4350 Principles of Communication Project 2 Due Tuesday, February 10 at the Beginning of Class

Engine Control Workstation Using Simulink / DSP. Platform. Mark Bright, Mike Donaldson. Advisor: Dr. Dempsey

CHM 152 Lab 1: Plotting with Excel updated: May 2011

Motomatic Servo Control

Position Control of DC Motor by Compensating Strategies

Software User Manual

An Introduction to Proportional- Integral-Derivative (PID) Controllers

User Guide IRMCS3041 System Overview/Guide. Aengus Murray. Table of Contents. Introduction

Magnetic Levitation System

Laboratory Tutorial#1

Module 08 Controller Designs: Compensators and PIDs

Servo Tuning Tutorial

ECE 5671/6671 LAB 6. Wound-Field Synchronous Generators

Assignment 5 due Monday, May 7

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

Application Note CTAN #287

Advanced Servo Tuning

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

Modelling for Temperature Non-Isothermal Continuous Stirred Tank Reactor Using Fuzzy Logic

MEM01: DC-Motor Servomechanism

GE423 Laboratory Assignment 6 Robot Sensors and Wall-Following

MM7 Practical Issues Using PID Controllers

Experiment Number 1. Revised: Fall 2018 Introduction to MATLAB Simulink and Simulink Resistor Simulations Preface:

CHAPTER-III MODELING AND IMPLEMENTATION OF PMBLDC MOTOR DRIVE

EMG Electrodes. Fig. 1. System for measuring an electromyogram.

SignalCalc Drop Test Demo Guide

Lesson number one. Operational Amplifier Basics

Design of a Simulink-Based Control Workstation for Mobile Wheeled Vehicles with Variable-Velocity Differential Motor Drives

Lab 2, Analysis and Design of PID

CONTROLLER DESIGN FOR POWER CONVERSION SYSTEMS

Chapter 3: Multi Domain - a servo mechanism

Laboratory Project 1: Design of a Myogram Circuit

Introduction to Servo Control & PID Tuning

GE 320: Introduction to Control Systems

Pre-lab Show that the filter shown at right has transfer function

EC CONTROL SYSTEMS ENGINEERING

Name: Date: Score: / (75)

Transcription:

University of Utah Electrical & Computer Engineering Department ECE 3510 Lab 5b Position Control Using a Proportional - Integral - Differential (PID) Controller Note: Bring the lab-2 handout to use as a dspace tutorial. M. Boson, A. Stolp, 2/19/08 rev,2/24/09, 2/23/17 B. Mukunda Objectives! Analyze a type of PID control system.! Modify the dspace programming to implement he PID control law.! Observe the step response with different zero locations (as set by the feedforward gain).! Compare the tuned PID response to the simple proportional response. Equipment and materials from stockroom:! DC Permanent-magnet Motor (If you can, get the same motor you used last time.)! Dual Power Amp! DSPACE kit Experiment 3, PID Position Control In this experiment you will construct a position controller, so you ll need to modify the model of the DC motor to be angular position over voltage rather than angular velocity over voltage. Write your motor transfer-function as: θ(s) k P(s) = = 1 V(s) s(s + a )(s + a ) 1 2 In lab 3 you used a proportional control law to control the motor position. v = k ( r θ) p In this experiment you will use a variation of the proportional-integral-derivative control law. d v = k ( r θ) + k r dt k r P I ( θ) + ( θ) D dt The integral term will minimize the steady state error as you saw with velocity control in experiment 2. The derivative term can be viewed as a proportional feedback acting on the velocity error. Responding to this additional error can increase the speed of the response-- a good thing. Ah, would that life were so simple... Think what would happen if you input a step response? What is the derivative of a step? Mathematically no big deal, the control system delivers an impulse to the motor which certainly speeds up the response. The problem arises with the limits of a system implemented with real parts. No real amplifier can deliver an impulse, so instead, it rails for a very short time and has a minimal impact on the p1 ECE 3510 PID Lab

response. (Actually, this might be a blessing in disguise, given that an impulse would mean an infinite voltage probably not too safe.) In practice, the control law is often modified in two ways. First, to avoid the problem with step inputs. the derivative action is applied only to the output (θ), and not to the reference input (r). This also eliminates a zero in the overall (closed-loop) transfer function. (No, I don t expect you to just see that, it takes a bit of math to show that that is the case.) Second, the reference input to the proportional gain is modified by a feedforward gain (k F ). This is not done to adjust the DC gain (as in experiment 1), but rather to gain control over the placement of the remaining zero of the closed-loop transfer function. Again, this is not obvious, but you will see it come out in the math. The modified control law is given by: d v = k ( k r θ) + k r dt k P F I ( θ) θ D dt Verify that the resulting closed-loop transfer function for the system is: H CL k I k1k Pk F( s + ) θ( s) k Pk F ( s) = = 4 3 2 r( s) s + ( a + a ) s + ( a a + k k ) s + k k s + k k 1 2 1 2 1 D 1 P 1 I Now again, set the poles somewhat like those of critical damping, that is, make all the poles the same, say at -p. That would make: 4 3 2 s + ( a + a ) s + ( a a + k k ) s + k k s+ k k = ( s + p) 1 2 1 2 1 D 1 P 1 I = s + 4ps + 6p s + 4p s+ p 4 3 2 2 3 4 Find p, k D, k P, and k I. They should be about 180, 0.2, 30-42 and 1000-1900 respectively. Notice that the closed-loop transfer function has a zero at -k I /(k F k P ). With a neutral feedforward gain (k F = 1) the zero may have a small magnitude compared to the closed-loop poles, yielding overshoot in the step response even if the closed-loop poles are welldamped. (See page 37 in the text.) Find the position of the zero if k F = 1 then show that if k F <1, the zero will be further in the left-half plane and the step response will be better. Simulink Model Modifications Now you will need to modify the Simulink model and then the dspace layout to implement the PID controller. Open the Simulink model that you had previously downloaded for lab 5a. The following are the changes you will have to make: 4 p2 ECE 3510 PID Lab

1. Introduce kd (k D ) in the PI Controller block: >> Double click on the PI Controller block. You will see the function that was used for lab 5a. Consult the figure above and make the indicated changes to the input variable declaration and the function itself. Here dy will be the derivative of your reference signal y, y being the position and consequently dy being the speed. Once done, save and exit the function. You should be able to see an additional post for an input signal on the PI Controller block. 2. Create the section on model shown here. Note that the Switch block shown (found in the Simulink Library Browser, in the Signal Routing section has a >= threshold of 0.5. Here s how to set that: Once the block is dragged and dropped from the signal routing section, >> double click on the block >> in the Criteria for passing first input:, choose u2 >= Threshold >> in the Threshold section, enter 0.5 and hit OK. The kd, PID Controller and Contant3 blocks pictured below are just constant blocks you can find in the Commonly used blocks section of the Simulink library browser. You will need to double-click these blocks and enter the desired value (0 here) in the Constant value section to change their values. Name them (it is important to name kd and PID Controller) by clicking on the text under the blocks and changing it. 3. Once the section above is built, the output (red dotted connection) will be fed to the kd input on the PI Controller block. With this done, you will need to make a few minor modifications as shown. The Sum block can be found in the Simulink library browser under the Commonly used blocks, the Math Operations section or you may just type Sum into the search bar of the Simulink library browser. 4. For the final few edits, recall that lab 5a was designed with the intention of controlling velocity and not position. So the reference input signal (R) and the actual signal (y) were both velocity inputs. You will need to change this into position inputs. The dy input is then the velocity input. Shown below is a section of the PI Controller block with the changes explained. Note that the reference input (r) is a constant block named Pos_ref passed into a Gain block (found among the commonly used blocks) with its value changed to pi/180 (double click the dragged and dropped gain block and change the gain value to pi/180. The input you will be specifying reflects the Pos_ref p3 ECE 3510 PID Lab

block. Since you will be entering the reference position in degrees, the pi/180 gain block converts it into radians before it enters the PI Controller block. You probably noted that the y and dy inputs are fed by from blocks. Every Goto block can have one or more complementary From blocks. These can be found in the Signal Routing section and make the models much cleaner by eliminating winding connections. Note that there are already two Goto blocks with the tags th_rad and wm on the top right-hand section of the model. Now drag and drop two From blocks from the Simulink library. Double click the first one, under the Parameters, in the Goto dropdown list, where you can see all the tags assigned to Goto blocks. Select th_rad and click on update tags. Now this from block collects the signal from the Goto block with the same tag, in this case the position information in radians. Click on OK and connect the output of this block into y port of the PI Controller. Similarly, assign the tag wm to the second From block and connect the output to the dy port of the PI Controller block. The final form of the edited PI Controller block is provided for your reference in the appendix. Ensure that Ts, nd are defined in the model properties. Note that a Ts of 2e-3 s gives you the same resolution in data as a Ts of 1e-4 with a downsampling of 20 (in dspace). You can choose to do either. Make sure all the Model Configuration Parameters are defined appropriately, save and then build the model. Now in dspace: >> Open dspace > Click on Open Project+Experiment. This will allow you to open and existing project. Go on ahead and open the project that was created for lab 5a. You will be making a few adjustments to this layout. But before that, since new changes were built into the Simulink model, you will need to reload the variables into dspace. In the Project tab on the left side of the window, right click on the.sdf file and click on Reload Variable Description. All your new variables and changes should carry over to this experiment. You will now need two additional instruments, one for a control type selection (PID) and one to enter the value for kd. 1. Click on the Instrument Selector tab on the right side of the layout window. Choose a check button, click p4 ECE 3510 PID Lab

and drag it on the Control Type panel such that you now have three check boxes in the panel. In the Model Root, click on PID Controller, drag and drop the value into the new check box. 2. In the Instrument Selector again, select a Numeric Input instrument and draw it onto a comfortable spot on the layout. In the Model Root, click on kd, drag and drop the value into the new numeric input instrument. 3. Draw an On/Off button instrument for the encoder reset variable. You will notice that by default, there are two buttons. Right click on the instrument, and under the On/Off button settings, click on the browse option. Select button 2 on the left and click on the red X mark to remove it. Then, click on OK. The On/Off button window can be seen above. Map the RESET ENCODER value to this button. 4. In the Model Root, click on Pos_ref and map the value to the numeric instrument that contained Vel_ref in lab 5a. That instrument should now be blank since the model no longer has a constant named Vel_ref, but if there were a variable already mapped, to replace it with a new one, simply drag the new variable and drop it on the instrument. The previously mapped variable will be removed automatically (but the settings on that instrument will be retained, so make sure you reduce the increment size from1000 back to 1). The display instrument that sits beside this numeric input instrument will now be mapped to the Out1 signal from theta_deg, since this is what we will need to keep an eye on. 5. Also drag and drop Pos_ref and theta_deg on the small colored squares in the plotter, one in each. Your layout should now look something like the figure. Make sure you set all the data capture settings as instructed to in the previous labs. Set the data capture length to the same as that used in lab 3. Check your plots if you need to be sure. p5 ECE 3510 PID Lab

Proportional-Integral-Derivative (PID) Control Make sure to set up your recorder as you see fit. Once online, turn ON the simulation, hit Start, check the PID Controller in the Control Type panel and set the Feed-forward gain to 1 and all the other gains to your calculated values. The reference input is now the Pos_ref (degrees) and is angular position. Set this to 90 degrees. As soon as you enter this ref value, the motor should spin to 90 degrees and stop, giving you a step response with considerable overshoot due to the zero. The settling time should be about 100ms. You may run it again by simply unchecking the PID controller, the "start button", checking on the RESET ENCODER button to make sure the encoder position is at 0. Now check the start and PID controller buttons and re-enter the Pos_ref value. To shut the experiment down, uncheck the PID controller, zero out your Pos_ref, Uncheck Start, turn off the simulation and go offline to shut the experiment down. Adjust the parameter k F to get a better response (make k F smaller). Try several values of k F to get less than 5% overshoot and the fastest time to within 5% of the final position value. (Having trouble or don t have numbers yet? Use conservative values of 0.2, 30 and 1000 for k D, k P, and k I.) Use Matlab to plot the results for a few values of k F on a single graph (don t print it yet). If you still have the data from lab 3 (critical damp.) add that to the same plot. If not, make another run with k F =1, k P =3.66, and both k I =0 and k D =0. This should recreate that data and you can add it to the plot. Print the plot. Indicate what value of k F gives the best response and compare the PID response to the simple proportional response. Reset all your gains to your best values and make one last run, only this time don t hit Stop. Grab the coupler of the motor in such a way that if it unexpectedly begins to spin, it won t hurt you. If this worries you, temporarily remove the motor coupler. The naked shaft is pretty harmless. Try to turn the motor shaft. Can you feel (or see) the integral control fight the change and eliminate the steady-state error? Don t use too much force or do this too long. It seems that this can force the system into some weird state where it just keeps running. Conclusion Check-off and conclude as always. p6 ECE 3510 PID Lab