Digital Control Semester Project

Similar documents
Positioning Servo Design Example

Laboratory 11 Control Systems Laboratory ECE3557. State Feedback Controller for Position Control of a Flexible Joint

State Feedback Controller for Position Control of a Flexible Link

Mechatronic System Case Study: Rotary Inverted Pendulum Dynamic System Investigation

2.004 Dynamics and Control II Spring 2008

Quanser NI-ELVIS Trainer (QNET) Series: QNET Experiment #02: DC Motor Position Control. DC Motor Control Trainer (DCMCT) Student Manual

SRV02-Series Rotary Experiment # 1. Position Control. Student Handout

FEEDBACK CONTROL SYSTEMS

DOUBLE ARM JUGGLING SYSTEM Progress Presentation ECSE-4962 Control Systems Design

Lab 3: Quanser Hardware and Proportional Control

THE REACTION WHEEL PENDULUM

Position Control Experiment MAE171a

1 x(k +1)=(Φ LH) x(k) = T 1 x 2 (k) x1 (0) 1 T x 2(0) T x 1 (0) x 2 (0) x(1) = x(2) = x(3) =

EL2450: Hybrid and Embedded Control Systems: Homework 1

Manufacturing Equipment Control

Example: DC Motor Speed Modeling

Control of an Induction Motor Drive

UNIVERSITY OF WASHINGTON Department of Aeronautics and Astronautics

MECHATRONICS ENGINEERING TECHNOLOGY. Modeling a Servo Motor System

PID Control. Objectives

DC Motor Position: System Modeling

Inverted Pendulum System

EE 476 DC Motor Control Lab

Example: Modeling DC Motor Position Physical Setup System Equations Design Requirements MATLAB Representation and Open-Loop Response

Lab 1: Dynamic Simulation Using Simulink and Matlab

ECE3510 Lab #5 PID Control

Rotary Motion Servo Plant: SRV02. Rotary Experiment #11: 1-DOF Torsion. 1-DOF Torsion Position Control using QuaRC. Student Manual

Double Inverted Pendulum (DBIP)

Department of Mechanical Engineering

Department of Electrical and Computer Engineering. EE461: Digital Control - Lab Manual

Automatic Control Systems. -Lecture Note 15-

Lab 3: Model based Position Control of a Cart

6) Motors and Encoders

Implementation Issues for the Virtual Spring

System Parameters and Frequency Response MAE 433 Spring 2012 Lab 2

ECE 5670/6670 Lab 8. Torque Curves of Induction Motors. Objectives

Stepping Motors. Chapter 11 L E L F L D

Bangladesh University of Engineering and Technology. EEE 402: Control System I Laboratory

Experiment # 5 5. Coupled Water Tanks

EXPERIMENTALLY DETERMINING THE TRANSFER FUNCTION OF A SPRING- MASS SYSTEM

Lab 6a: Pole Placement for the Inverted Pendulum

DC-motor PID control

Mechatronics Modeling and Analysis of Dynamic Systems Case-Study Exercise

ECE 320 Linear Control Systems Winter Lab 1 Time Domain Analysis of a 1DOF Rectilinear System

Dr Ian R. Manchester Dr Ian R. Manchester AMME 3500 : Review

Spontaneous Speed Reversals in Stepper Motors

Index. Index. More information. in this web service Cambridge University Press

Lecture 12. Upcoming labs: Final Exam on 12/21/2015 (Monday)10:30-12:30

Two-Mass, Three-Spring Dynamic System Investigation Case Study

Lecture 14 - Using the MATLAB Control System Toolbox and Simulink Friday, February 8, 2013

FALL UNIVERSITY OF NEVADA, LAS VEGAS DEPARTMENT OF MECHANICAL ENGINEERING MEG 421 Automatic Controls Design Project

Lecture 6: Control Problems and Solutions. CS 344R: Robotics Benjamin Kuipers

Deriving a Fast and Accurate PMSM Motor Model from Finite Element Analysis The MathWorks, Inc. 1

Chapter 5 HW Solution

SRV02-Series Rotary Experiment # 7. Rotary Inverted Pendulum. Student Handout

100 (s + 10) (s + 100) e 0.5s. s 100 (s + 10) (s + 100). G(s) =

Computer Aided Control Design

Belt Tension Clamp. Drive Motor. Friction Brake. Load. Encoder 2. Drive. (4000 lines/rev incremental) Encoder 1. (4000 lines/rev incremental)

MECH 3140 Final Project

Mechatronics Engineering. Li Wen

Lab 1g: Horizontally Forced Pendulum & Chaotic Motion

Lab 5a: Pole Placement for the Inverted Pendulum

Trajectory Planning, Setpoint Generation and Feedforward for Motion Systems

Multivariable Control Laboratory experiment 2 The Quadruple Tank 1

MAE106 Laboratory Exercises Lab # 6 - Vibrating systems

Mechatronics Assignment # 1

Project 1: Analysis of an induction machine using a FEM based software EJ Design of Electrical Machines

Feedback Control of Linear SISO systems. Process Dynamics and Control

MATHEMATICAL MODELING OF OPEN LOOP PMDC MOTOR USING MATLAB/SIMULINK

Video 5.1 Vijay Kumar and Ani Hsieh

sc Control Systems Design Q.1, Sem.1, Ac. Yr. 2010/11

Rotary Flexible Joint

Laboratory Exercise 1 DC servo

Introduction to Control (034040) lecture no. 2

(b) A unity feedback system is characterized by the transfer function. Design a suitable compensator to meet the following specifications:

Model of a DC Generator Driving a DC Motor (which propels a car)

Lab #2: Digital Simulation of Torsional Disk Systems in LabVIEW

Predictive Cascade Control of DC Motor

Rotary Motion Servo Plant: SRV02. Rotary Experiment #01: Modeling. SRV02 Modeling using QuaRC. Student Manual

Digital Pendulum Control Experiments

YTÜ Mechanical Engineering Department

SAMPLE SOLUTION TO EXAM in MAS501 Control Systems 2 Autumn 2015

Industrial Servo System

CYBER EXPLORATION LABORATORY EXPERIMENTS

ENGG4420 LECTURE 7. CHAPTER 1 BY RADU MURESAN Page 1. September :29 PM

Lab 5a: Magnetic Levitation (Week 1)

Hands-on Lab 3. System Identification with Experimentally Acquired Data

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Department of Physics Spring Experiment 5: Faraday s Law

Design Engineering MEng EXAMINATIONS 2016

Friction. Modeling, Identification, & Analysis

6.1 Sketch the z-domain root locus and find the critical gain for the following systems K., the closed-loop characteristic equation is K + z 0.

CHAPTER 1 Basic Concepts of Control System. CHAPTER 6 Hydraulic Control System

ME 3210 Mechatronics II Laboratory Lab 4: DC Motor Characteristics

Laboratory handout 5 Mode shapes and resonance

C(s) R(s) 1 C(s) C(s) C(s) = s - T. Ts + 1 = 1 s - 1. s + (1 T) Taking the inverse Laplace transform of Equation (5 2), we obtain

UNIVERSITY OF WASHINGTON Department of Aeronautics and Astronautics

IfA Fachpraktikum - Experiment 3.7A : Flexible Shaft A

Application Note #3413

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Rectilinear System. Introduction. Hardware

Transcription:

Digital Control Semester Project Part I: Transform-Based Design 1 Introduction For this project you will be designing a digital controller for a system which consists of a DC motor driving a shaft with a rigid beam mounted to it. A pulse-width modulation (PWM) current amplifier is used to drive the motor, and the angular position of the motor is measured by an incremental encoder. This is representative of an angular position control system common in industrial applications. Figure 1 shows a photograph of the system with the major components. (a) Motor and encoder. (b) Current amplifier and power supply. (c) Link, motor, and bumpers. Figure 1: Single-link system and components. 1.1 Motor The permanent-magnet DC motor shown in Figure 1(a) can generate 155 oz-in stall torque, and has some internal viscous friction and brush friction. The brush friction is Coulomb friction, and as such is nonlinear. The motor has a maximum current rating of 9A continuous and 12A peak. 1

1.2 PWM Amplifier This amplifier, shown in Figure 1(b), accepts a voltage input and generates a current output in pulse-width-modulated form. The PWM waveform is more effective than a DC waveform for slow-speed control, and also more efficient in terms of power dissipation. PWM drive is very common in modern motor control. The amplifier accepts inputs in the range ±5V. The amplifier has a nominal gain of 2.5 A/V. Your controllers should not exceed an amplifier command of 4V (1A motor current). 1.3 Beam The beam is an aluminum channel section 22 inches in length, and is assumed to be rigid. The beam is shown in Figure 1(c) along with the styrofoam bumpers to prevent the beam from colliding with the support bracket. 1.4 Encoder The incremental encoder, also shown in Figure 1(a), provides a measure of motor shaft (and therefore link) angular position. Using quadrature decoding, it has an effective resolution of 4 counts per revolution (almost exactly equal to a 12-bit quantization of one revolution). All of our analysis and design will use angular position measurement in encoder counts (not radians or degrees). It is simple to convert to degrees or radians if that were needed. 1.5 Required Project Tasks Successful completion of the Semester Project (Part I) will require completion of the following tasks, each of which will be discussed in greater detail later in this document: 1.5.1 Plant Model Identification Using the techniques of Chapter 8 you will be required to identify a transfer-function model G(z) of the plant. 1.5.2 Reference Trajectory The control system will be required to move the beam through the following trajectory: 9 in 1 second 9 9 in 2 seconds 9 in 1 second a settling period at of 1 second Each segment will be a cubic polynomial, resulting in smooth motion. 1.5.3 Transform-Based Controller Design You will design a controller D(z) such that the controlled system has acceptable performance. There is no particular specification you must meet, but we expect good tracking of the input. You may wish to explore the following controller designs (e.g. you are encouraged to investigate and submit multiple designs): 2

1. Lead compensator 2. Proportional + derivative (PD) control 3. PID control (and a variant PIDlead ) Some controllers have been omitted (P and PI) because they do not yield good performance and are a waste of our valuable time. You may wish to include design, analysis, and simulation of these two controller to illustrate their poor performance. The lab equipment will be set up to implement the three controllers in the above list. 1.5.4 Simulation and Evaluation You must simulate the performance of all of your systems using the reference trajectory of Section 1.5.2, and predict the RMS tracking error in units of encoder counts. If everything is done properly, there should be good agreement between the results of your simulation and the experimental evaluation in the laboratory. 2 Plant Model Identification Figure 2 below shows a block diagram of the lab setup. Variables r, e, and y are in units of encoder counts, while u is in units of V (volts), while θ is in units of radians. The components within the red dashed rectangle are inside the Inside computer will be in discretized plant model G(z) R(z) E(z) U(z) D(z) K + ZOH PWM Amp. Motor & beam θ(z) Encoder Y (z) Figure 2: Block diagram of angular positioning system. computer, while the components within the blue dashed rectangle will be included in the G(z) plant model you will be identifying, that is: G(z) = Y (z) U(z) counts V (1) The sampling frequency will be f s = 25 Hz, thus the sampling period is T =.4 second. 2.1 Model Order A system with inertia from basic principles will be at least second order. However, additional dynamic effects may cause a higher-order model to be a better fit. Part of the challenge in system identification is to find the proper order model. Generally speaking, the lowest-order model that is sufficiently accurate is best. The methodology of Chapter 8 requires you to use models of the form G(z) = where (2) is the model structure if you assumed a third order model. b 1z 1 + b 2 z 2 + b 3 z 3 1 a 1 z 1 a 2 z 2 a 3 z 3 = b 1 z 2 + b 2 z + b 3 z 3 a 1 z 2 a 2 z a 3, (2) 3

2.2 Input-Output Data On my website there will be a dataset in the form of a MATLAB binary file (filename data.mat) compatible back to MATLAB v6. Once downloaded and placed in your MATLAB working directory, this file can be loaded into the MATLAB workspace by executing the following command: >> load data; You should then see six variables in your workspace. In the example below I loaded the data, then typed who to show the variables: >> load data >> who Your variables are: T kb kn ks tb tn ts ub un us yb yn ys Vectors un and ub are the random normal and random binary inputs (units of V), while vectors yn and yb are the corresponding outputs (units of encoder counts). These inputs were scaled and biased to use as much range as possible of the quantization (The D/A converter is 12-bit). Finally, vectors us and ys are a step input and the response to that step input. The step input is 1.5V in magnitude (not a unit step, but a 1.5V step). The k and t vectors are sample indeces and times for the binary, normal, and step responses, and T is sample period. Plots of the input and output data are shown in Figure 3. NOTE: The data shown are an example, and are not the actual data you will receive! 2 Random Binary Input 5 Random Normal Input Amplifier Input (V) 1 1 2 Amplifier Input (V) Angular Position (counts) 3 5 1 15 2 2 1 1 Random Binary Output 2 5 1 15 2 Angular Position (counts) 5 5 1 15 2 3 2 1 Figure 3: Input-output data for identification. Random Normal Output 1 5 1 15 2 There will be 51 samples in each ID dataset, thus k =...5. You should be able to fit an adequate model with a subset of these samples. You may wish to compare the step response of your model to the experimental step response 4

(remember it s from a 1.5V step input). You should select one model G(z) for subsequent use in controller design. Since you are commanding a current (torque) input to an inertia J which has some viscous friction B and Coulomb friction ( stiction which is nonlinear and very difficult to model) I would expect the transfer function from current to angular velocity to have the form K/(Js+B), with an integration added when you go from angular velocity to angular position. However, there are almost certainly unmodeled dynamics perhaps the beam has a structural resonance so the order of your assumed model should be explored thoroughly. 2.3 Evaluating your Identified Models There is a potential problem with evaluating your ID ed models. The actual system contains a pure integration (pole at z = 1). Your ID ed models will likely have a pole at z = 1.36, or z =.9996, or somewhere very close to 1., but not exactly at 1.!!. If you then take some of the random input and use it on your model, you may not get the same drift as the actual system. This can cause an extremely large cumulative error, which is not indicative of your model performance. Here are some thoughts: Reformulate the ID process to allow you to specify that the resulting model has a pole exactly at z = 1. This is actually not that hard, and I encourage you to consider it. Differentiate your G(z), apply the random input; then compare the response to the numerically differentiated experimental random output. This effectively removes the integration. Ignore the drift if the poles and zeros of your model make sense just use it. In the above discussion, random refers to either the normal or binary random data. 3 Reference Trajectory The trajectory that the system will be expected to follow is composed of three cubic polynomials one for each segment. The nature of the trajectory was described in Section 1.5.2. The units of the trajectory will be encoder counts, and a plot of the trajectory will be r (encoder counts) vs t (sec). A cubic polynomial allows you to specify endpoint constraints of both position and velocity, and is of the form r(t) = a + a 1 t + a 2 t 2 + a 3 t 3 (3) It can be shown that for initial position r i, final position r f, initial velocity ṙ i, final velocity ṙ f, and duration t f, the cubic coefficients are a = r i a 1 = a 2 = 3 t 2 (r f r i ) f a 3 = 2 t 3 (r f r i ) f You will be fitting three cubics of the form of (3) together to make up the complete trajectory. A plot of the resulting position and velocity is shown in Figure 4(a). NOTE: at the junction of two trajectories you will have one duplicate sample which should be deleted. The final reference trajectory should contain exactly 126 points (5. seconds in duration; from t =. to t = 5.). The final one second is a runoff area for overshoot and settling. If you are unable to create this reference input, I will give it to you (with a corresponding deduction not severe). 5

15 1 6 Position and Velocity (counts) 1 5 5 1 Position Velocity 15 1 2 3 4 5 (a) Position and velocity vs time. Fourier Magnitude 1 4 1 2 1 1 2 1 4 1 1 1 1 1 1 2 Frequency (Hz) (b) Fourier transform of position trajectory. Figure 4: Reference trajectory plots. 4 Transform-Based Controller Design You should design as many controllers as you wish (see the list on page 3) but we will only be using those four D(z) which give good performance. You should document all of your designs, including those which don t work too well (and your speculation on why they didn t work). Design your D(z) using MATLAB and the root locus for pole placement. 4.1 Some Guidelines So far your only design guideline is to achieve good tracking performance while keeping the voltage command to the amplifier < ±4V. To give you a little more insight, consider the following observations on damping ratio ζ and natural frequency ω n. Selecting a desired damping ratio ζ should be simple you want a reasonable amount of damping. However, selecting a desired natural frequency ω n is more difficult since you don t want ω n higher than necessary but it must be high enough for adequate performance. Excessive ω n is expensive it requires larger actuators, higher currents, etc. One strategy for selecting ω n is to examine the frequency content of the input; this may be done by finding the Fourier Transform of the cubic polynomial position trajectory of Figure 4(a). The MATLAB fft function (Fast Fourier Transform) is ideally suited for this operation. The resulting plot of Fourier magnitude vs frequency is shown in Figure 4(b). You should probably not try to place the natural frequency of your dominant closed-loop poles above all the harmonic content, but you should try to respond to most of it. Note that the Fourier Magnitudes of Figure 4(b) are plotted on a logarithmic scale. You may wish to use the MATLAB bode function to check the frequency responses of your open- and closed-loop transfer functions during the design. 5 Simulation and Evaluation Simulation of the behavior of your system is part of the design process of your controllers, so Sections 4 and 5 are related. You should simulate your system using the cubic trajectory input. You may use either MATLAB or Simulink. Since you will need to examine the peak level of voltage (to check for saturation), Simulink may be attractive since it s easy to pick off intermediate variables. An example Simulink model for a lead compensator D(z) is shown below. In your G(z) plant model there will be numerical coefficients for the a i and b i terms (from your ID runs). The terms From/To Workspace and Discrete Transfer Fcn are the Simulink block names for those elements. 6

To Workspace From Workspace Error e_sim Save Error to Workspace Voltage pos Cubic Position Trajectory r e z+b b1.z+b2 K e z+a u z 2 a1z a2 y +/ 4V limit D(z): Lead Compensator Compensator Gain G(z) Plant Theta Discrete Transfer Fcn Figure 5: Simulink diagram for simulation. 5.1 From/To Workspace Blocks These are convenient ways to import/export data to/from your workspace with Simulink models. 5.1.1 From Workspace This block should contain the cubic polynomial reference trajectory. When you open this block there is a dialog box with a Parameters section, which contains fields for Data and Sample Time. The Data field should contain the name of a two-column array in your workspace the two columns will be t (time) and r (reference position), respectively. The size of this array will be 126 2. The Sample time field should be set to.4. 5.1.2 To Workspace This block is used to archive the tracking error to your workspace for RMS error determination. This dialog box contains only one field you need to change, that s the Variable name field. Whatever name you enter here will be the name of the error stored subsequently in your workspace. The other thing you should check is the Save format menu it should be specified as Array. 5.2 Tracking Performance The single figure of merit for your designs will be the RMS tracking error in encoder counts. This is kind of an average tracking error. If vector e contains the time history of tracking error, and there are N samples, then e RMS = N k=1 (e(k))2 et e = N N (4) 5.3 A Word to the Wise Don t try to get too aggressive in trying to reduce the RMS error. There are always unmodeled dynamics in a system that will appear if you try to push the system too hard. One sign of trouble is having lots of chatter in the control force u sent to the plant. 7

5.4 Submission of Controller Parameters To simplify the evaluation of all your designs, I want you to email me textfiles for each D(z) you design that contain the parameters for that controller, as well as the predicted RMS error of that controller. The file will be used as a MATLAB script file, so its name should consist of a concatenation of: (1) your initials (lower case, please), (2) the controller type (PD, lead, PID), and (3) the suffix.m hence my file for the lead network D(z) would be a file called gpslead.m containing the following: % lead compensator rms error disp( rms error = xxx counts ); % Change the xxx to your error counts % lead compensator coefficients: a = xx.xx; b = xx.xx; K = xx.xx; Just in case there s any problem, bring your numerical values to the lab. Templates will soon be available online for the controller parameter files for all three cases. 6 Semester Project Report You will eventually prepare a full report on both Part I and Part II (state-space) of the Semester Project. This report will be due on Wednesday May 9, at 7:3 a.m. (this is the date of the scheduled Final Exam). I will evaluate the state-space controllers on Wednesday, May 2 (on my Simulink model). 6.1 Performance of your Controllers The transform-based controllers will be evaluated in the ME Laboratory on my Simulink model on Wednesday, April 4, at 9:. Therefore you MUST submit your controllers parameters by Monday, April 2 (before midnight). The performance of your controllers will be acquired during the actual simulation runs, and will be emailed back to you. Your semester report should comment on the agreement (or lack thereof) between your simulations and the actual evaluations my simulations. Your reports will be graded on just how much you have done, the thoroughness and validity of your analysis, and your discussion of what you did. I m actually as much concerned about the words you use to describe what you did (to see if you understood what you did) as the actual quantitative performance of your controllers. I always appreciate reports that are in a clear format which is easy to read. 6.2 A Threat (sigh...) NOTE: The experimental data from the validation runs is extremely important! Your project report MUST contain a discussion of your simulation s performance vs the actual experimental data my simulation s performance, or you will not pass this course. My simulation is a poor substitute for the actual experimental lab setup, but it s all I can do. 8