EXPERIMENT 1 Control System Using Simulink

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

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

DC SERVO MOTOR CONTROL SYSTEM

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

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

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

EE 482 : CONTROL SYSTEMS Lab Manual

CHAPTER 7 HARDWARE IMPLEMENTATION

5 Lab 5: Position Control Systems - Week 2

MEM01: DC-Motor Servomechanism

Teaching Mechanical Students to Build and Analyze Motor Controllers

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

SERVO MOTOR CONTROL TRAINER

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

Lab 2: Introduction to Real Time Workshop

GE 320: Introduction to Control Systems

Mechatronics. Analog and Digital Electronics: Studio Exercises 1 & 2

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

University of North Carolina-Charlotte Department of Electrical and Computer Engineering ECGR 3157 Electrical Engineering Design II Fall 2013

Lab 23 Microcomputer-Based Motor Controller

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

Lab 2: Quanser Hardware and Proportional Control

CHAPTER 2 PID CONTROLLER BASED CLOSED LOOP CONTROL OF DC DRIVE

IT.MLD900 SENSORS AND TRANSDUCERS TRAINER. Signal Conditioning

Experiment 9. PID Controller

Observer-based Engine Cooling Control System (OBCOOL) Project Proposal. Students: Andrew Fouts & Kurtis Liggett. Advisor: Dr.

Active Vibration Isolation of an Unbalanced Machine Tool Spindle

Servo Closed Loop Speed Control Transient Characteristics and Disturbances

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

The DC Machine Laboration 3

EKT 314/4 LABORATORIES SHEET

Analogue Servo - Fundamentals Trainer

Sensors and Sensing Motors, Encoders and Motor Control

Laboratory Tutorial#1

Motomatic Servo Control

CSE 3215 Embedded Systems Laboratory Lab 5 Digital Control System

DC Motor Speed Control using PID Controllers

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

When input, output and feedback voltages are all symmetric bipolar signals with respect to ground, no biasing is required.

ELG3336 Design of Mechatronics System

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

Digital Control of MS-150 Modular Position Servo System

Sensors and Sensing Motors, Encoders and Motor Control

Introduction to MS150

ECE ECE285. Electric Circuit Analysis I. Spring Nathalia Peixoto. Rev.2.0: Rev Electric Circuits I

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

SENSOR AND MEASUREMENT EXPERIMENTS

-binary sensors and actuators (such as an on/off controller) are generally more reliable and less expensive

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

Controllers with Multisim

Brushed DC Motor PWM Speed Control with the NI myrio, Optical Encoder, and H-Bridge

Fundamentals of Servo Motion Control

Lab Exercise 9: Stepper and Servo Motors

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

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

Embedded Control Project -Iterative learning control for

JUNE 2014 Solved Question Paper

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

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

Experiment Of Speed Control for an Electric Trishaw Based on PID Control Algorithm

Introduction To Temperature Controllers

ME375 Lab Project. Bradley Boane & Jeremy Bourque April 25, 2018

Speed Feedback and Current Control in PWM DC Motor Drives

PID-control and open-loop control

7 Lab: Motor control for orientation and angular speed

Industrial Control Equipment. ACS-1000 Analog Control System

INTEGRATED CIRCUITS. AN1221 Switched-mode drives for DC motors. Author: Lester J. Hadley, Jr.

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

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

Technological Studies. - Applied Electronics (H) TECHNOLOGICAL STUDIES HIGHER APPLIED ELECTRONICS OP-AMPS. Craigmount High School 1

L E C T U R E R, E L E C T R I C A L A N D M I C R O E L E C T R O N I C E N G I N E E R I N G

UNIT 2: DC MOTOR POSITION CONTROL

Data acquisition and instrumentation. Data acquisition

Introduction to PID Control

CHAPTER-III MODELING AND IMPLEMENTATION OF PMBLDC MOTOR DRIVE

DC motor control using arduino

MCE441/541 Midterm Project Position Control of Rotary Servomechanism

Rectilinear System. Introduction. Hardware

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

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

Basic Analog Circuits

Quanser Engineering Trainer for NI-ELVIS. QNET User Manual. QNET: HVACT, DCMCT, ROTPENT, MECHKIT, VTOL, and MYOELECTRIC

Cantonment, Dhaka-1216, BANGLADESH

Laboratory set-up for Real-Time study of Electric Drives with Integrated Interfaces for Test and Measurement

Operational amplifiers

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

Applied Electronics II

Design of PID Control System Assisted using LabVIEW in Biomedical Application

Figure 1.1: Quanser Driving Simulator

Generator Operation with Speed and Voltage Regulation

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

Penn State Erie, The Behrend College School of Engineering

Lecture 5 Introduction to control

Motor Modeling and Position Control Lab 3 MAE 334

Using Magnetic Sensors for Absolute Position Detection and Feedback. Kevin Claycomb University of Evansville

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

Precalculations Individual Portion Introductory Lab: Basic Operation of Common Laboratory Instruments

CHAPTER 2 D-Q AXES FLUX MEASUREMENT IN SYNCHRONOUS MACHINES

Basic Electronics Learning by doing Prof. T.S. Natarajan Department of Physics Indian Institute of Technology, Madras

Transcription:

German Jordanian University School of Applied Technical Sciences Mechatronics Engineering Department ME 3431 Automatic Control systems Lab EXPERIMENT 1 Control System Using Simulink Objective: - To introduce Simulink; its tools and application in simple control cases. - To develop strength points in building, understanding, analyzing and simulating systems using Simulink. - Tune a controller gain to achieve a desired output level in the presence of disturbance, with and without feedback from a sensor. PART (I): SIMULINK ENVIRONMENT Introduction Simulink is a software that accompanies MATLAB. It serves as a platform for designing and simulating models of time-varying systems like control systems and communications systems. It differs from MATLAB in its graphical user interface, which consists of building blocks and interconnections. The hierarchical property of the block set allows for both top-down and bottomup design techniques. Each block is expandable and its details can be viewed and altered by double-clicking it. Simulink also provides visual tools (sinks), which help in understanding the system's response. These tools include oscilloscopes and spectrum analyzers. Other significant tools in Simulink are model analysis tools that include linearization and trimming. Those can be accessed from MATLAB or Simulink; providing flexibility of simulation, analysis and further revision of any system. Basic Interface and Features: To start Simulink, type its name in the MATLAB prompt or click on the Simulink icon in the top tool bar. >> simulink The main screen appears, showing the block library. To see the content of any toolbox, click on + sign next to it. Fig.1-a shows the main screen, while Fig.1-b & Fig.1-c show most important two libraries and it components. 1

Figure 1-a: Simulink Library Figure 1-b: Source Library 2

Figure 1-c: Continuous Library PART (II): CONTROL SYSTEM Open Loop System: One of the most common used system in testing new experiments is open loop system. Open loop system gives an indication about the process, how it will work, and what are the factors that may effect on the process. In other words the output quantity has no effect upon the input to control process, it helps user to design the appropriate controller that ensure system stability in case of noise or disturbance. The figure below shows the open loop system. Figure 2: Open Loop System 3

Closed loop system: A Closed-loop Control System, also known as a feedback control system is a control system which uses the concept of an open loop system as its forward path but has one or more feedback loops (hence its name) or paths between its output and its input. The reference to feedback, simply means that some portion of the output is returned back to the input to form part of the systems excitation. Closed-loop systems are designed to automatically achieve and maintain the desired output condition by comparing it with the actual condition. It does this by generating an error signal which is the difference between the output and the reference input. In other words, a closed-loop system is a fully automatic control system in which its control action being dependent on the output in some way. So for example, consider our electric clothes dryer from the previous open-loop tutorial. Suppose we used a sensor or transducer (input device) to continually monitor the temperature or dryness of the clothes and feed a signal relating to the dryness back to the controller as shown below. Closed-loop Control Example Figure 3: Feedback System Example This sensor would monitor the actual dryness of the clothes and compare it with (or subtract it from) the input reference. The error signal (error = required dryness actual dryness) is amplified by the controller, and the controller output makes the necessary correction to the heating system to reduce any error. For example if the clothes are too wet the controller may increase the temperature or drying time. Likewise, if the clothes are nearly dry it may reduce the temperature or stop the process so as not to overheat or burn the clothes, etc. 4

Disturbances: Usually control system does not remain constant throughout its life cycle, so there are always changes in system parameters because of environmental effects and other perturbations and disturbances. Disturbances are undesirable inputs signals in a control system. Attenuation of load disturbances is often a primary goal for control. The control system cannot reject the disturbance perfectly because the disturbance is detected only after it moves the output; the controller cannot react until system output has been disturbed. A properly placed proportional gain with tuning will totally reject DC (static) disturbances in open loop, while this is not efficient with dynamic disturbance inputs unless feedback used. Figure 4: Closed-Loop with Disturbance Exercise: Use Simulink to simulate a heating system in a room with a constant rate of heat loss (due to heat leaking though the windows), in addition to random heat loss (due to the door being opened and closed). In a brief report, show your observations by describing the models used and their results. Build models similar to the following: 1. For Open-Loop Temperature Control with constant disturbance. How much must the gain be to achieve a room temperature of one? 5

2. For Open-Loop Temperature Control with random disturbance (sine wave bias by one). Can you tune the gain to stabilize the room temperature at one? 3. For Closed-Loop Temperature Control with random disturbance (sine wave bias by one). Can you tune the gain to stabilize the room temperature at one? Your report should include: 1. Three screen shots per scenario using three different gains 2. A discussion about each case. Were you able to achieve an output value of one by tuning the gain? Explain. 6

German Jordanian University School of Applied Technical Sciences Mechatronics Engineering Department ME 3431 Automatic Control systems Lab EXPERIMENT 2 Mass-Spring Damper System Objectives: - To introduce MATLAB as mathematical program that support many fields like industrial, mechanical, electrical, electronic and so. - To study the performance characteristics of mass-spring damper system using MATLAB. PART (I): MATLAB ENVIRONMENT Introduction: MATLAB is a high-level technical computing language and interactive environment for algorithm development, data visualization, data analysis, and numeric computation. Using MATLAB products, give you the chance to solve technical computing problems faster than with traditional programming languages, such as C and C++. It has wide range of application, such as image processing, control designing of dynamic and electrical systems and graphical interface, another features was it can be using in animations. MATLAB name related to matrix laboratory, the basic elements used in MATLAB are matrices. MATLAB System: MATLAB System contains five main parts: Desktop Tools and Development Environment. Mathematical Function Library. Graphics. External Interfaces. Programming. 1

Basic Interface: When you start MATLAB, four main screens will open.shown in Fig.1 Figure 1: MATLAB Main Screen 1- Command windows; where all command must be written and executed row by row. 2- Command history; shows the list of commands executed in the previous sessions with a date and time tag for each session. 3- Current directory /workspace; consist of two part which can be alternatively viewed by clicking at either of their header tabs.. First current directory - gives the directory at which the user is working now. Second workspace display all variables that were used in your Command and its values, types and names. Note: MATLAB has a powerful library and help browser at which you can find more details about each topic and command you want. Just write help on command window to enter. 2

Transfer Function 1- Create a transfer function by using two functions. ( ) ( ) First, by using MATLAB transfer function sys = tf(num,den), the command will be: >>sys1=tf([2 0-8],[1 3 3 1]) Second, by using gain/ zero /pole equation sys = zpk(z,p,k) Where z and p are the vectors of zero and pole values in the complex plane z = [z1 z2 ] p = [p1 p2 ] And K is the gain. The command will be: >> k=2; >> z=[2-2]; >> p=[-1-1 -1]; >> sys1=zpk(z,p,k) Or sys1= zpk ([2-2],[-1-1 -1],[2]) PART (II): Time Domain Specifications. Introduction System response s design specifications come in many forms. One of these forms are the Time Domain Specifications. They based on the response of the system to a unit step input (the step response) and can be used for any order system. The time domain specifications translate into constraints on the coefficients of the denominator of the transfer function. 3

Graphical Interpretation of Time-Domain Specification Figure 2: Time domain specifications The performance measures could be described as follows: 1) Rise Time: The time for a system to respond to a step input and attains a response equal to a percentage of the magnitude of the input. The 0-100% rise time, Tr, measures the time to 100% of the magnitude of the input. Alternatively, Tr1, measures the time from 10% to 90% of the response to the step input. 2) Peak Time: The time for a system to respond to a step input and rise to peak response. 3) Overshoot: The amount by which the system output response proceeds beyond the desired Where M P is the peak value of the time response, and fv is the final value of the response. 4) Settling Time: the time required the system is output to settle within a certain percentage of the input amplitude (which is usually taken as 2%). 5) Steady-State Error (e ss ): The difference between the final values of the response (based on Some specified input) and the final value of the input. [ ( )] [ ( )] 4

Exercise 1: Create the transfer function of the following systems using the easiest method: 1- ( ) 2- ( ) ( )( ) ( )( )( )( ) Exercise 2: Use MATLAB to perform the following procedures. In a brief hardcopy report, show your observations by describing commands used and their results. 1- For the system shown, derive the transfer function G(s) = X(S)/F(s). The final answer is: ( ) 2- Show the pole-zero plots of G when: (Hint: Using tf( ) and pzmap( ) commands) m=2 kg, b=3 Ns/m, and k=13 N/m m=2 kg, b=4 Ns/m, and k=13 N/m (more damping) 5

3- What are the poles of transfer functions in #2? Hint: place the Data Cursor on the poles in the pole-zero figures. 4- On a single figure, plot the step responses of the two cases given in #2. (Hint: Using step( ), hold on( ), legend( ), title( ), xlabel( ), and ylabel( ) commands) 5- Explain relationship between the pole movement and the step response characteristics for the two cases given in #2. Your report should include: 1. All results and discussions for each part in exercise 2. 6

German Jordanian University School of Applied Technical Sciences Mechatronics Engineering Department ME 3431 Automatic Control systems Lab Objective: EXPERIMENT 4 Servo System Identifying servo system and Building Controller - To become familiar with simple mechanical systems and their speed control techniques by studying the 33-002 Feedback system in its mechanical and analogue units. - To learn: the DC motor, DC tacho-generator and brake characteristics. - To learn how to control both speed & angle (position) of servomotor. - To practice how PID controller effect on system behavior & characteristic. System Introduction 1- The Mechanical Unit Shown in Fig.1, the 33-100 mechanical unit comprises a permanent magnet DC motor that drives the output shaft through a 32:1 belt reduction. The motor shaft (input shaft) also carries a magnetic brake disc and a Tacho-generator. A Tacho-generator is a simple analog speed transducer. The output shaft carries angle transducers of two types: Analog (potentiometers). Digital (64-location Gray Code shaft encoder). Figure 1 : 33-100 Mechanical Unit 1

2- The Analog Unit The 33-110 analog unit contains configurable circuit components that can be assembled into a simple control system as the one in figure (3). The components include operational amplifiers, potentiometers, capacitors and resistors for feedback and gain selection. The unit also includes a switched step signal and two other test signals (triangular and square waves). In this experimental procedure, we will focus our studies toward the analog unit, because it gives more insight about basic control mechanisms. A power amplifier drives the motor from an analog or switched input. A simple generator provides the input signal with low frequency, this test signal integrated within the unit. Signal options include DC, triangular, and square waves. The unit is powered by an external power supply to provide: +15V, 0, -15V at 1.5A +5V, 0 at 0.5A The following section (adopted from Feedback Servo Fundamentals Trainer Manual) studies the characteristics of the operational amplifier, and its various configurations that provide specific desired functions. The main three functions to be analyzed in depth are: Inverting. Scaling. Summing. It concludes with a simple practical that allows you to investigate the scaling and summation operations on the trainer. Figure 2 : 33-110 Analog Unit 2

Operational Amplifier (OP-AMP) An Operational Amplifier, or op-amp for short, is fundamentally a voltage amplifying device designed to be used with external feedback components such as resistors and capacitors between its output and input terminals. These feedback components determine the resulting function or operation of the amplifier and by virtue of the different feedback configurations whether resistive, capacitive or both, the amplifier can perform a variety of different operations, giving rise to its name of Operational Amplifier. An Operational Amplifier is basically a three-terminal device which consists of two high impedance inputs, one called the Inverting Input, marked with a negative or minus sign, ( - ) and the other one called the Non-inverting Input, marked with a positive or plus sign ( + ). The third terminal represents the Operational Amplifiers output port, which can both sink and source either a voltage or a current. In a linear operational amplifier, the output signal is the amplification factor, known as the amplifiers gain ( G ) multiplied by the value of the input signal and depending on the nature of these input and output signals. The circuit operates from a dual supply +Vsupply and Vsupply, which ensures a constant supply. The voltage that appears at the output, Vout of the amplifier is the difference between the two input signals as the two base inputs are in anti-phase with each other. Figure 3 : Equivalent Circuit of an Ideal Operational Amplifier 3

Types of OP-AMPs: 1. Inverting Amplifier The positive input is grounded. A feedback network composed of resistors R1 and R2 is connected between the inverting input, signal source and amplifier output node, respectively. Gain (G) = R 2 R 1 Figure 4 : Inverting OP-AMP If R2 = R1, G = 1 (Inverter) If R2 > R1, G >1 (Scaling) In general, the relationship for figure 4 could be Gain (G) = Z 2 Z 1 2. Non-Inverting Amplifier Figure 5 : Non-Inverting OP-AMP Gain (G) = 1 + R 2 R 1 4

PART I: Steady-state Characteristics (Brake Load) Considering the ideal motor model shown in Fig.7 when the motor is unloaded the back emf (Vb) substantially equals the applied voltage (Va). The current in this case is very small. When the motor is loaded the speed falls, the back emf falls, and the armature current increases and the voltage drop in the armature resistance (Vr = Ia.Ra) added to Vb matches Va. V a = V r + V b V a = I a R a + V b Figure 7: Ideal Motor Model In operation the reference is set to a required value, which drives the motor to generate Vb, which reduces the error until the system reaches steady speed, if the motor is loaded ( with the magnet brake ) the speed falls,this tends to increase the error,increasing the motor drive and thus reducing the speed fall for a given load. Note this implies negative feedback around the loop. By adjusting P3, set the motor to 2000RPM (62.5RPM at the output shaft) 1. Connect the DVM to the Armature Current socket (1V/A) on the Mechanical Unit. 2. Set the brake to each of its six positions in turn and for each setting record the reading of Armature Current, speed of output shaft & the breaking voltage (Vb) in the table below. 3. Plot the back emf (Vb), and armature current. The plot should have the general form of Fig.7 4. Calculate the value of Ra at both full load and no load, and then write your comments on the results. 5

Figure 8: Motor characteristics related to load Table 1 Load Armature Current (Ia) Back emf (Vb) Applied voltage (Va) 0 1 2 3 4 5 6 Ra @ no-load = Ra @ full-load = 6

Part II: Angle control System A control system with input and output shafts, such as the 33-002, requires some method of measuring the input and output shaft angles and determining the difference or error between them. The error must then produce a voltage, or may be measured directly as a voltage, suitable to drive the power amplifier. A very convenient method to measure the shaft angles electrically is to attach a potentiometer to each shaft, as in Figure 9. The signals Vi and Vo can then be combined in an operational amplifier to produce an error signal to operate the power amplifier. Figure 9: Connection between Motor s shaft and Potentiometer Error Signal Polarity To correct system operation, it is essential that the error signal rotate the motor in the appropriate direction to reduce the error this is negative feedback. If the error signal rotates the motor to increase the error, this is positive feedback and the system is useless. The two-potentiometer signals are added in an operational amplifier. With Vi at zero, the amplifier output will be Vo. For the system to operate correctly this signal must rotate the output shaft anti-clockwise and the amplifier must be connected to the upper power amplifier socket. This will provide negative feedback. 7

Procedure: 1. Make the connections shown in Figure 10, ignoring for the moment the connection shown as a shadow line, which gives the circuit of Figure 9, setting P1 to zero before connecting to the power amplifier. Figure 10: Angle Feedback Connection 2. Switch on the power supply. 3. Set the input potentiometer & P1 to 0. Use the power amplifier zero adjustment to rotate the output shaft to set the 0 line on the scale to be horizontal and to the right. 4. Set Ɵi to 90 and P1 to 20%. How do both direction & time response affect? 5. Reset both Ɵi and P1. Then Set Ɵi to 90 and P1 to 100% consequently. How do both direction & time response affect? 8

Part III: Speed control System Objectives: When you have completed this assignment, you will know that: 1. Velocity feedback can be used (without position feedback) to enable a speed to be closely regulated. 2. The polarity of the feedback is important (as for position feedback). 3. The effectiveness of the control depends mainly on the gain employed. Speed Control - Closed loop System PID Controller Figure 6: Closed Loop Speed Control Figure 7: Closed loop System with PID The PID controller works in a closed-loop system using the schematic shown above. The variable ( ) represents the tracking error, the difference between the desired input value ( ) and the actual output ( ). This error signal ( ) will be sent to the PID controller, and the controller computes both the derivative and the integral of this error signal. The control signal ( ) to the plant is equal to the proportional gain ( ) times the magnitude of the error plus the integral gain ( ) times the integral of the error plus the derivative gain ( ) times the derivative of the error. 9

This control signal ( ) is sent to the plant, and the new output ( ) is obtained. The new output ( ) is then fed back and compared to the reference to find the new error signal ( ). The controller takes this new error signal and computes its derivative and its integral again, ad infinitum. The transfer function of a PID controller is found by taking the Laplace transform of Eq.(1). u(t) = K p e(t) + K i ʃe(t)dt + K d de Kp= Proportional gain Ki= Integral gain Kd= Derivative gain Electronic Circuit for PID Controller dt (1) Figure 8: Electronic Circuit for PID Controller 10

Exercise 3: PID Controller In this exercise, you are going to connect the circuit of PID controller and change the value of P, I and D. 1. Before you start set P3 to 5V (Use DMM on kit to measure voltage) and then measure the speed from the display. This speed represent the speed in case of open loop system, record it in table 2. 2. Build PID controller, and then ask your lab supervisor to correct it, and then connect the actual kit as you did on the graph. 3. After connection, determine the value of K P(total), K I(total) & K D(total). 4. Fill your results in Table 2. 11

Table 2 Controller Type Setpoint (rpm) Output (Speed) -ve Feedback +ve Feedback Note PID Exercise 4: MATLAB Using Simulink to build a block diagram that represents the servo system in exercise 3, and insert the same PID controller as ex.3. Given that: G(s) = 0.8 s+1.32 Your report should include: 1. Your complete results & discussion for all parts. 2. Write a paragraph in your own language to summarize this experiment & give examples for servo system from your life. 3. Exercise 4 (Simulink with results) 12

German Jordanian University School of Applied Technical Sciences Mechatronics Engineering Department ME 3431 Automatic Control systems Lab EXPERIMENT 5 DC-Motor Trainer

Objectives: To be familiar with DC-Motor system. Control the speed and position of the system using PID controller. Introduction: The DC Motor Control Trainer (DCMCT) is a versatile unit designed to teach and demonstrate the fundamentals of motor servo control in a variety of ways. The system can readily be configured to control motor position and speed. The system consists of a direct-current motor with an encoder and an inertia wheel on the motor shaft. The motor is driven using a pulse-width modulated (PWM) power amplifier. The power to the amplifier is delivered using the QNET power cable from a wall transformer and the encoder is powered by the ELVIS unit. Signals to and from the system are available on a header and on standard connectors for control via a Data Acquisition (DAQ) card. The control variable is the voltage to the drive amplifier of the system and the output is either the wheel speed or the angle of the wheel. Disturbances can be introduced manually by manipulating the wheel or digitally through LabVIEW. Figure 1 : DC Motor Control Trainer (DCMCT) 2

DCMCT Components: The 24-Volt DC motor with graphite commutation, a speed constant of 286 rpm/v, and winding resistance of 8.70 Ohms. Figure 2 : DC Motor Trainer Components Table 1 ID # 1 DC Motor 2 High-resolution encoder 3 Motor metal chamber 4 Inertial load Description 3

PART I : SPEED CONTROL The speed of the DC motor is controlled using a proportional-integral control system. The block diagram of the closed-loop system is shown in Figure 3. Figure 3 : DC Motor PI closed-loop block diagram The transfer function representing the DC motor speed-voltage relation in equation below is used to design the PI controller. The input-output relation in the time-domain for a PI controller with set-point weighting is where kp is the proportional gain, ki is the integral gain, and bsp is the set-point weight. The closed loop transfer function from the speed reference, r, to the angular motor speed output, ωm, is The standard desired closed loop characteristic polynomial is Where ω0 is the undamped closed loop frequency and ζ is the damping ratio. The characteristic equation in the transfer function (the denominator of the transfer function), can match the desired characteristic equation in 3.3 with the following gains: Large values of ω0 give large values of controller gain. The damping ratio, ζ, and the set-point weight parameter, bsp, can be used to adjust the speed and overshoot of the response to reference values. There is no tachometer sensor presented on the QNET DC motor system that measures the speed. Instead the amplifier board has circuitry that computes the derivative of the encoder signal, i.e. a 4

digital tachometer. However to minimize the noise of the measured signal and increase the overall robustness of the system, the first-order low-pass filter is used. Parameter Tf is the filter time constant that determines the cutoff frequency and ωmeas is the measured speed signal. Procedure: 1. Open the QNET_DCMCT_Speed_Control.vi, and make sure the correct Device is chosen. 2. In signal generator section, set the following: Signal Type = Square Wave Amplitude = 25.0 rad/s Frequency = 0.40 Hz Offset = 100.0 rad/s 3. In the Control Parameters section, set Kp to 0.05 V/(rad/s), and Ki to 1 V/rad. 4. Run the QNET_DCMCT_Speed_Control.vi. then stop the VI when you collected one sample cycle by clicking on the Stop button. 5. Capture the measured speed response. Make sure you include both the Speed (rad/s) and the control signal Voltage (V) scopes. 6. Measure the peak time and percentage overshoot of the measured response, and calculate the value of ζ, and ω0; knowing that τ=0.155 and K=31. 7. Change the Control Parameters, Kp to 0.0877 V/(rad/s), and Ki to 1.28 V/rad. 8. Repeat steps 4, 5, and 6. 9. What effect does increasing the specification ζ have on the measured speed response? How about on the control gains? 10. What effect does increasing the specification ω0 have on the measured speed response and the generated control gain? 11. Stop the VI by clicking on the Stop button. 5

PART II : POSITION CONTROL Control of motor position is a natural way to introduce the benefits of derivative action. In this experiment a Proportional-Integral-Derivative (PID) controller is designed according to specifications. The closed-loop PID control block diagram is shown in Figure 4. Figure 4: DC Motor PID closed-loop block diagram The two-degree of freedom PID transfer function inside the PID block in Figure 4 is Where kp is the position proportional control gain, kd is the derivative control gain, ki is the integral control gain, bsp is the set-point weight on the reference position r(t), and bsd is the set-point weight on the velocity reference of r(t). The dotted box labeled Motor in Figure 4.1 is the motor model in terms of the back-emf motor constant km, the electrical motor armature resistance Rm, and the equivalent moment of inertia of the motor pivot Jeq. The direct disturbance applied to the inertial wheel is represented by the disturbance torque variable Td and the simulated disturbance voltage is denoted by the variable Vsd. PD Control Design The behaviour of the controlling the motor position is first analyzed using a PD control. By setting ki = 0 in the PID control equation above and taking its Laplace transform, the PD transfer transfer function is Combining the position process model with the PD control equation gives the closed-loop transfer function of the motor position system 6

Similarly to the speed control laboratory, the standard characteristic function shown in Equation 3.3 can be achieved by setting the proportional gain to and the derivative gain to PART III : DISTURBANCE REJECTION Response to Load Disturbance Next, the behaviour of the PID closed-loop system when it is subjected to a disturbance is examined. The block diagram shown in Figure 5 represents the load disturbance to position response when bsp and bsd in the PID in PID transfer function equation are both set to 1. Figure 5: PID closed-loop block diagram to a load disturbance input The closed-loop disturbance to position transfer function is Given a step disturbance with an amplitude of Td0 the steady-state angle of the closed-loop system is 7

The steady-state angle of the PD control, that is when ki = 0 in 4.5, is and the steady-state angle with integral action is Thus when the system is subjected to a disturbance, a constant steady-state error is observed when using the PD control system. However, the disturbance is rejected when integral control is used and the steady-state angle eventually goes to zero. PID control design involves using the standard characteristic equation for a third-order system Where ω0 is the natural frequency, ζ is the damping ratio, and p0 is a zero. The characteristic equation of the closed-loop PID transfer function, i.e. the denominator of the transfer function, is By matching the two above equations, we obtain: By varying the zero location, p0, the time required by the closed-loop response to recover from a disturbance is changed. 8

Procedure: 1. Open the QNET_DCMCT_Position_Control.vi, and make sure the correct Device is chosen. 2. In signal generator section, set the following: Amplitude = 2.0 rad Frequency = 0.40 Hz Offset = 0.0 rad 3. In the Control Parameters section set: Kp = 2 V/rad Ki = 0 V/(rad.s) Kd = 0.02 V.s/rad bsp= 25 4. Run the QNET_DCMCT_Position_Control.vi. then stop the VI when you collected one sample cycle by clicking on the Stop button. 5. Capture the position response found in the Position (rad) scope and and control signal used in the Voltage (V) scope. 6. Measure the peak time and percentage overshoot of the measured position response, and calculate the value of ζ, and ω0; knowing that τ=0.155 and K=31. 7. Tune D-controller to eliminate observed overshoot with acceptable error for the final value, by setting a value between (0.03 0.11). Hint: Take a step by 0.03 8. In the Control Parameters section, set Kp to 3.12 V/rad, and Kd to 0.118 V/(rad/s). 9. Repeat steps 4, 5, and 6. 10. What effect does changing the specification zeta have on the measured position response and the generated control gains? 11. What effect does changing the specification ω0 have on the measured position response and the generated control gains? 9

Response to load disturbance: 12. In signal generator section, set the following: Amplitude = 0 rad Frequency = 0.40 Hz Offset = 0 rad 13. In the Control Parameters section set: Kp = 2 V/rad Ki = 0 V/(rad.s) Kd = 0.02 V.s/rad 14. Apply the disturbance by clicking on the Disturbance toggle switch situated below the Signal Generator. 15. Examine the effect of the disturbance on the measured position. Attach a response of the motor position when the disturbance is applied and record the obtained steady-state angle. 16. Turn OFF the Disturbance switch. 17. In the Control Parameters section set: Kp = 2 V/rad Ki = 2 V/(rad.s) Kd = 0.02 V.s/rad 18. Apply the disturbance by clicking on the Disturbance toggle switch. 19. Examine the effect of the disturbance on the measured position. Explain the difference of the disturbance response with the integral action added and compare to the result you obtained in Step 12. 20. Stop the VI by clicking on the Stop button. Requirements 1. For each part, you should follow the procedures and answer all question. 2. Attach all charts with discussion. 10

German Jordanian University School of Applied Technical Sciences Mechatronics Engineering Department ME 3431 Automatic Control systems Lab EXPERIMENT 6 Two Tank System Process Control 1 Figure 1 : Components of the PT001-06 Process Trainer 1. Compact Field Point 4. Tank 2 7. Thermocouple Tank 2 10. Flow Meter (Lower) 13. Heater 2. Electric Control Box 5. Pressure Sensor 8. Thermocouple Tank 1 11. Electric Flow Control Valve 14. Pump 3. Tank 1 6. Ultrasonic Level Meter 9. Flow Meter (Upper) 12. Manual Flow Control Valve 15. Level Switch 1

Part 1 : Acquiring Physical Phenomena Objectives: - To introduce the principles of computer-based signal acquisition of physical phenomena using Compact Field Point. - To introduce and acquire signals from the different types of sensors used in the PT001-06 Process Trainer. Introduction: Computer-based measurement systems are used in a wide variety of applications: laboratories, field services and on manufacturing plant floors. These systems act as general purpose measurement tools. Many real world sensors and transducers require signal conditioning before a computer-based measurement system can acquire the signal effectively and accurately. The frontend signal conditioning system can include functions such as signal amplification, attenuation, filtering, electrical isolation, simultaneous sampling, and multiplexing. In addition, many transducers require excitation currents or voltages, bridge completion, linearization, or high amplification for proper and accurate operation. Therefore, most computer-based measurement systems include some form of signal conditioning in addition to plug-in data acquisition DAQ devices. Transducers Data acquisition begins with the physical phenomenon to be measured. This physical phenomenon could be the temperature of a room, the intensity of a light source, the pressure inside a chamber, the force applied to an object, or any other physical quantity. A transducer is a device that converts a physical phenomenon into a measurable electrical signal, such as voltage, current, or frequency. The ability of a DAQ system to measure different phenomena depends on the transducers to convert the physical phenomena into signals measurable by the DAQ hardware. The table below shows a short list of some of the transducers used in the PT001-06 Process Trainer and the phenomena they can measure. Table 1: Transducers & Sensors used in PT001-06 Physical Phenomenon Transducer Signal Temperature Thermocouple mv Signal Distance (Level) Ultrasonic Level Meter 4 20 ma Fluid Flow Propeller Flow Meter NPN Pressure Piezoelectric Transducers 4 20 ma Flow Control Valve Position Feedback Potentiometer 0 10 V 2

Thermocouples used in the PT001-06 Process Trainer are J Type thermocouples, they provide a Mv signal that corresponds to temperature, this signal needs some kind of amplification and conversion to find the corresponding temperature. The thermocouples in the PT001-06 Process Trainer are connected to the Cfp-TC-120 Module that converts the Mv signal to its corresponding temperature. In addition, the TC module performs some kind of filtering and CJC (Cold Junction Compensation). Other kinds of transducers, such as the Level Meter, and Pressure Sensor have their own signal converting algorithms. Such transducers are called transmitters. These transmitters have microprocessors that converts the raw electrical signal (mv, mv, ma, Frequency, etc ) and converts it to a scaled industrial standard signal, such as: 0 20 ma, 4 20 ma, 0 10 V, 0 5 V, etc These signals are all scaled to the measuring range of the sensor. As an example, the Level Meter has a measuring range from 5 120 cm. The transmitter delivers a 20mA signal if the object lies 5cm away from it and 4Ma if it lies 120cm away from it. Figure 2 : Ultrasonic Level Meter Measuring Range The water level in Tank 2 can be calculated as follows: Knowing that: The Level Meter is placed on the upper edge of the tank; i.e. at (29 cm). Level Meter Output Signal: 4-20 ma The equation: L(cm) = 29 Water Surface Distance from the Sensor The distance from the sensor can be calculated from the following equation: Distance (cm) = 151-7.3i Then, Water Level in the upper tank becomes: L (cm) = 7.3i 121 Where, L = Water Level in Tank 2 (cm) I = Signal Acquired from the Level Meter (ma) 3

All the sensors used in the PT001-06 Process Trainer have their own conversion equations, these equations can be found in the Explanation Box in the front panel of Experiment 1: Acquiring Physical Phenomena. Signals: The appropriate transducer converts the physical phenomena into measurable signals. However, different signals need to be measured in different ways. For this reason, it is important to understand the different types of signals and their corresponding characteristics. Signals can be categorized into two groups: Analog & Digital signals 1. Analog Signals An analog signal can be at any value with respect to time. A few examples of analog signals include voltage, temperature, pressure, and sound. The three primary characteristics of an analog signal include level, shape, and frequency. Figure 3 : Primary Characteristics of an Analog Signal 4

2. Digital Signals A digital signal cannot take on any value with respect to time. Instead, a digital signal has two possible levels: high and low. Digital signals generally conform to certain specifications that define characteristics of the signal. Digital signals are commonly referred to as Transistor-to-Transistor Logic (TTL). TTL specifications indicate a digital signal to be low when the level falls within 0 to 0.8 Volts, and the signal is high between 2 to 5 Volts. The useful information that can be measured from a digital signal includes the state and the rate. Figure 4 : Primary Characteristics of a Digital Signal Signal Conditioning: Sometimes transducers generate signals too difficult or too dangerous to measure directly with a DAQ device. For instance, when dealing with high voltages, noisy environments, or simultaneous signal measurement, signal conditioning proves essential. Signal conditioning maximizes the accuracy of a system, allows sensors to operate properly, and guarantees safety. It is important to select the right hardware for signal conditioning. Signal conditioning can be used in a variety of applications including: a. Amplification b. Attenuation c. Isolation d. Bridge Completion e. Simultaneous Sampling f. Sensor Excitation g. Multiplexing 5

DAQ Hardware The DAQ hardware acts as the interface between the computer and the outside world. It primarily functions as a device that digitizes incoming analog signals so that the computer can interpret them. Other data acquisition functionality includes: a. Analog Input/ Output b. Digital Input/ Output c. Counter/Timers d. Multifunction a combination of analog, digital, and counter operations on a single device Driver and Application Software Software transforms the PC and the DAQ hardware into a complete data acquisition, analysis, and display system. Without software to control or drive the hardware, the DAQ device will not function and perform properly. The majority of DAQ applications use driver software. Driver software is the layer of software that directly programs the registers of the DAQ hardware, managing its operation and its integration with the computer resources, such as processor interrupts, DMA, and memory. Driver software hides the low-level, complicated details of hardware programming, providing the user with an easy-to-understand interface. Properly selected driver software can deliver an optimal combination of flexibility and performance, while significantly reducing the time required developing the DAQ application. 6

Procedure: 1. Run the PT001-06 software then choose Experiment 1: Acquiring Physical Phenomena. Figure 5 : Acquiring Physical Phenomena 2. Study the front panel carefully and observe the buttons on the screen. In this experiment, each sensor will be handled separately. 3. Level Meter: a. Click on the Level Meter. Monitor its readings on the chart. b. Set the Flow Control Valve to Fully Closed by entering 0% in its value box or by dragging the Valve Opening Slider to 0%. c. Turn the Pump on and keep it operating until the level approaches (12 cm) in Tank2. Meanwhile observe the relationship between the output current (Ma) and the measured level (cm), attach the graph in the report. d. Set the Flow Control Valve to Fully Open by entering 100% in its value box or by dragging the Valve Opening Slider to 100%. 7

e. Observe the level as it goes down to its lowest limit. You can also compare the actual water level with the measured level by observing the ruler sticker on Tank 2 in the trainer. 4. Pressure Sensor: a. Click on the Pressure Sensor. Monitor its readings on the chart. b. Set the Flow Control Valve to Fully Closed by entering 0% in its value box or by dragging the Valve Opening Slider to 0%. c. Turn the Pump on and keep it operating until the level approaches (12 cm) in Tank2. Meanwhile observe the relationship between the output current (ma) and the measured pressure (mbar), attach the graph in the report. d. Take the water level value, either from the measured level value on the screen or by measuring it using the scale attached to Tank 2,and apply it to the following equation: Where, ρ 1000 kg/m 3 g = 9.81 m/s 2 h = (Water Level 3) cm P = ρgh/100 Where P in Pascal, 1 bar = 10 5 Pascal Record the result: P = ----------------------- mbar e. Record the pressure value that is being measured by the Pressure Sensor. P = --------------------------- mbar f. Compare the two values obtained. What did you notice? 8

g. Set the Flow Control Valve to Fully Open by entering 100% in its value box or by dragging the Valve Opening Slider to 100%. h. Observe the pressure as the level goes down to its lowest limit. 5. Thermocouple: a. Click on Thermocouple Tank 1. Monitor its readings on the chart. b. Set the Flow Control Valve to Fully Closed by entering 0% in its value box or by dragging the Valve Opening Slider to 0%. c. Turn the Pump on and keep it operating until the level approaches (12 cm) in Tank 2. d. Observe the water temperature in Tank 1. Turn the Heater on until the temperature raises 3ºC. Observe the relationship between the acquired thermocouple voltage and calculated temperature. You can find the linearization equation on the lower left corner of the screen. Attach the graph in the report. e. After the temperature in Tank 1 raises 0.3ºC, open the Flow Control Valve, turn the pump on and set it to 50% of its total power. This operation mixes the waters in the two tanks and reduces the temperature of the water in Tank 1. During this operation, you can observe the change in Voltage Temperature on the chart. 6. Flow Meter: a. Click on the Flow Meter Lower. Monitor its readings on the chart. b. Turn the pump on. c. Change the operating power of the pump using the slide near the pump s picture on the flow process schematic. Observe the readings of the Flow Meter Lower and its relationship with the pulses. Attach the graph in the report. 7. Stop the process and press the Quit button to go back to the experiments menu. 9

Part 2 : On/Off Control Objectives: - To introduce the principle of On/Off control as the simplest form of control in industry. - To introduce some of the terms used in On/Off Control such as the Switching Differential and the Operating Differential. Introduction: An On/Off controller is the simplest form of control device. The output from the device is either On or Off, with no middle state. An On/Off controller will switch the output only when the controlled parameter crosses a set point. On/Off is the most commonly used form of control, and for most applications, it is perfectly adequate. It s used where a precise control is not necessary, in systems which cannot handle the energy being turned On and Off frequently, and where the mass of the system is so great that temperatures change extremely slowly. On/Off control advantages include simplicity and low cost. In this section, you will have the chance to perform two experiments in On/Off Control: On/Off Level Control On/Off Temperature Control We will illustrate the idea of On/Off Control by the following example Considering the tank of water shown previously, the objective is to heat the water in the tank using the energy given off a simple steam coil. In the flow pipe to the coil, a two-port valve and an actuator are fitted, complete with a thermostat, placed in the water in the tank. The thermostat is set to 60 C, which is the required temperature of the water in the tank. Logic dictates that if the switching point were actually at 60 C the system would never operate properly, because the valve would not know whether to be open or closed at 60 C. From then on it could open and shut rapidly, causing wear. For this reason, the thermostat would have an upper and lower switching point. This is essential to prevent over-rapid cycling. In this case the upper switching point might be 61 C (the point at which the thermostat tells the valve to shut) and the lower switching point might be 59 C (the point when the valve is told to open). Thus there is an in-built switching difference in the thermostat of ±1 Cabout the 60 C set point. This 2 C (±1 C) is known as the switching differential. (This will vary between thermostats). A diagram of the switching action of the thermostat would look like the graph shown in figure 8. The temperature of the tank contents will fall to59 C before the valve is asked to open and will rise to 61 C before the valve is instructed to close. 11

B C 61 ⁰ C A D E 59 ⁰ C Figure 6 : On/Off Switching Action for Thermocouple Fig.6 shows straight switching lines but the effect on heat transfer from coil to water will not be immediate. It will take time for the steam in the coil to affect the temperature of the water in the tank. Not only that, but the water in the tank will rise above the 61 C upper limit and fall below the 59 C lower limit. This can be explained by cross-referencing Fig.6. First, however it is necessary to describe what is happening. At point A (59 C) the thermostat switches on, directing the valve wide open. It takes time for the transfer of heat from the coil to affect the water temperature, as shown by the graph of the water temperature in Fig.6. At point B (61 C) the thermostat switches off and allows the valve to shut. However the coil is still full of steam, which continues to condense and give up its heat Hence the water temperature continues to rise above the upper switching temperature, and overshoots at C, before eventually falling. From this point onwards, the water temperature in the tank continues to fall until, at point D (59 C), the thermostat tells the valve to open. Steam is admitted through the coil but again, it takes time to have an effect and the water temperature continues to fall for a while, reaching its trough of undershoot at point E. The difference between the peak and the trough is known as the operating differential. The switching differential of the thermostat depends on the type of thermostat used. The operating differential depends on the characteristics of the application such as the tank, its contents, the heat transfer characteristics of the coil, the rate at which heat is transferred to the thermostat, and so on. 11

Essentially, with On/Off control, there are upper and lower switching limits and the valve is either fully open or fully closed. There is no intermediate state.the main advantages of On/Off control are that it is simple and very low cost.this is why it is frequently found on domestic type applications such as central heating boilers and heater fans.its major disadvantage is that the operating differential might fall outside the control tolerance required by the process. For example, on a food production line, where the taste and repeatability of taste is determined by precise temperature control, On/Off control could well be unsuitable. 2.1 On/Off Level Control Objectives: - To learn the concept of feedback control in its simplest forms by taking the analog level reading and using it in the control process. - To calculate and predict the behavior of the control system. - To apply the concepts and methods of On/Off control in controlling the water level in Tank 2. - To observe the performance of the controller at different set points. Procedure: 1. Click on Experiment 2: On/Off Control >> another menu will appear >> choose On/Off Level Control Experiment. Figure 7 : On/Off Level Control 12

Tip: During the operation of the On/Off Level Control Experiment, you can change the opening of the flow control valve to introduce disturbances to the system. 2. Drag the Set point slider to 30% of its value. Observe the values of the upper and lower limits of the Set point band (On/Off switching differential). Record them in the report. 3. Press the Start Process button. Observe the operation of the pump (controller output) until the level (PV) reaches the desired value. Note how the controller turns the Pump off if the level is higher than the upper limit and turns it on if the level is below the lower limit. 4. Save the result response of the control signal and the behavior of the system and add them later in your report with a complete discussion. 5. Observe the chart and record the controller s cycle time: a. Cycle time = ----------------------- s b. Pump on-time = ------------------- s c. Pump off-time = ------------------ s 6. Drag the Set point slider to 35% of its value. Observe the operation of the Pump (controller output) until the level (PV) reaches the desired value. 7. Observe the chart and record the controller s cycle time: a. Cycle time = ----------------------- s b. Pump on-time = ------------------- s c. Pump off-time = ------------------ s 8. Stop the process and press the Quit button to go back to the experiments menu. 13

2.2 On/Off Temperature Control Objectives: - To learn the concept of feedback control in its simplest forms by taking the analog level reading and using it in the control process. - To calculate and predict the behavior of the control system. - To apply the concepts and methods of On/Off control in controlling water Temperature in Tank 1. Procedure: 1. Click on Experiment 2: On/Off Control >> another menu will appear >> choose On/Off Temperature Control Experiment. Figure 8 : On/Off Temperature Control 2. Drag the Set point slider 3ºC higher than the measured temperature in Tank 1. Observe the values of the upper and lower limits of the Set point band (On/Off switching differential). 3. Set the Flow Control Valve to Fully Closed by entering 0% in its value box or by dragging the Valve Opening Slider to 0%. 14

4. Turn the Pump on, and keep it operating until the level approaches (20cm) in Tank 2. 5. Press the Start Process button. Observe the operation of the heater (controller output) until the temperature (PV) reaches the desired value. 6. Note how the controller turns the Heater off if the temperature is higher than the upper limit and turns it on if the temperature is below the lower limit. 7. When the Heater is turned off, do the following steps: a. Set the flow control valve to Fully Open by entering 100% in its value box, or by dragging the value opening slider to 100%. b. Turn the Pump on and set it to 55% of its total operating power. This will circulate the water in the trainer s tanks and speed up the cooling process. Note: Water heating is a very slow process; therefore, the On/Off switching band is larger than that of the On/Off level control. 8. Stop the process and press the Quit button to go back to the experiments menu. Your report should include: 1. Introduction includes: a. Difference between actuators & transducers b. Applications of On/Off Controller and its advantages/disadvantages 2. Your complete results (snapshots and questions answer) & discussion for parts one and two; in details. 3. The aim of this process. 15

German Jordanian University School of Applied Technical Sciences Mechatronics Engineering Department ME 3431 Automatic Control systems Lab EXPERIMENT 7 Two Tank System Process Control 2 Part 1: PID Feedback Control 1.1 PID Feedback Level Control Objectives: - To introduce the principle of PID Feedback Level control and its difference from On/Off Level control. - To observe the behavior and performance of PID controllers at different set Points. - To observe the behavior and performance of PID controllers at different set Points tracking abilities of PID Level controllers. Procedure: 1. Click on Experiment 3: PID Feedback Control >> another menu will appear >> choose PID Feedback Level Control. Figure 1 : PID Feedback Level Control 1

2. Check the PID controller s parameters. What type of a controller is it? a. P Controller b. PD Controller c. PI Controller d. PID Controller 3. Drag the Set point slider to 30% of its value & the Flow Control Valve s 0%. Press the Start Process button to start the control process. 4. Observe and discuss the behavior of the (PV) and the controller s output on the chart. Save the chart to include it in your report. 5. Is it close to the output of the On/Off Level Controller from the previous Experiments? Why? 6. After the controller and (PV) settle down and stabilize, apply a disturbance to the system by changing the Flow Control Valve to fully open. Observe the disturbance rejection and the reaction of the controller, save the chart and discuss the result. 7. Stop the process and press the Quit button to go back to the experiments menu. 2

1.2 PID Feedback Pressure Control Objectives: - To introduce the principle of PID Feedback Pressure control and its difference. - To observe the behavior and performance of PID controllers at different set points. - To give the student an understanding about disturbance rejection and set point tracking abilities of PID Level controllers. Procedure: 1. Click on Experiment 3: PID Feedback Control >> another menu will appear >> choose PID Feedback Pressure Control see Fig.2. Figure 2 : PID Feedback Pressure Control 3

2. Check the PID controller s parameters. What type of a controller is it? a. P Controller b. PD Controller c. PI Controller d. PID Controller 3. Drag the Set point slider to 30% of its value & the Flow Control Valve s 0%. Press the Start Process button to start the control process. 4. Observe and discuss the behavior of the (PV) and the controller s output on the chart. Save the chart to include it in your report. 5. After the controller and (PV) settle down and stabilize, apply a disturbance to the system by changing the Flow Control Valve to fully open. Observe the disturbance rejection and the reaction of the controller. Save the char then write your comments. 6. Stop the process and press the Quit button to go back to the experiments menu. 4

Part 2: Lead-Lag Compensation (Level Control) Introduction Lead and lag compensators are used quite extensively in control. A lead compensator can increase the stability or speed of response of a system; a lag compensator can reduce (but not eliminate) the steady state error. Depending on the effect desired, one or more lead and lag compensators may be used in various combinations. Objectives: - To introduce the concept of Lead/Lag compensation. - To demonstrate the difference between the two types of controllers (Lead and Lag). - To demonstrate the Lead/Lag Controller s ability to reject disturbances. Theory: Lead, lag, and lead/lag compensators are usually designed for a system in transfer function form. Both lead compensators and lag compensators introduce a pole-zero pair into the open loop transfer function. The transfer function can be written in the Laplace domain as: Y s z = X s p Where X is the input to the compensator, Y is the output, s is the complex Laplace transform variable, z is the zero frequency and p is the pole frequency. The pole and zero are both typically negative. In a lead compensator, the zero is right of the pole in the Argent plane, z < p, while in a lag compensator z > p. A lead-lag compensator consists of a lead compensator cascaded with a lag compensator. The overall transfer function can be written as: Y X = (s z 1)(s z 2 ) (s p 1 )(s p 2 ) Typically p1 > z1 > z2 > p2, where z1 and p1 are the zero and pole of the lead compensator and z2 and p2 are the zero and pole of the lag compensator. The lead compensator provides phase lead at high frequencies. This shifts the poles to the left, which enhances the responsiveness and stability of the system. The lag compensator provides phase lag at low frequencies which reduces the steady state error. The lead compensator will increase the bandwidth of the system and will increase the gain at higher frequencies. The increase in the bandwidth will increase the effect of the noise on the system. Therefore, the lead compensator can be used in applications that need fast transient response. On the other hand; the lag compensator will decrease the bandwidth of the system, and will also reduce the steady-state error. However, the lag compensator will slow down the transient response. Lead-lag compensator combines the effects of a lead compensator with 5

those of a lag compensator. The result is a system with improved transient response, stability and steady-state error. To implement a lead-lag compensator, the lead compensator is designed first to achieve the desired transient response and stability, and then a lag compensator is added to improve the steady-state response. Lead-lag compensators a reused in different fields, like: robotics, satellite control, automobile diagnostics, laser frequency stabilization, and many more. They are an important building block in analog control systems, and can also be used in digital control systems. In this experiment, Lead-Lag controllers receive the error signal (the difference between the Set point and the PV) and deliver an output to the pump that tries to drive the PV towards the set point (zero error). Figure 3 L Lead-Lag Controller 6

Procedure: 1. Click on Experiment 4: Lead-Lag Compensation (Level Control). Figure 4 : Lead-Lag Level Control 2. Record the Lead-Lag Compensator s parameters Lead Controller Gain = -------------------- Lead Time = ------------ min. Lag Time = ------------- min. Lag Controller Gain = -------------------- Lead Time = ------------ min. Lag Time = ------------- min. 7

3. Drag the Set point slider to 30% of its value& the Flow Control Valve s 0. Press the Start Process button to start the control process. 4. Observe and discuss the behavior of the (PV) and the controller s output on the chart. Save the chart to include it in your report. 5. Is it close to the output of the On/Off Level Controller or the PID Level Controller from the previous experiments? Why? 6. After the controller and (PV) settle down and stabilize, apply a disturbance to the system by changing the Flow Control Valve to fully open. Observe the disturbance rejection and the reaction of the controller. 7. Stop the process and press the Quit button to go back to the experiments menu. 8

Part 3: Feedback /Feed forward Control (Level Control) Figure 5 : Block diagram of Feed Forward Control System Introduction Feed forward control is a strategy used to compensate for disturbances in a system before they affect the controlled variable. A feed forward control system measures a disturbance variable, predicts its effect on the process, and applies corrective action. Objectives: - To introduce the concept of feed forward control. - To demonstrate the disturbance rejection features of feed forward controllers. - To demonstrate the advantages of adding a feed forward controller to the PID feedback controller. 9

Theory: Combined feed forward plus feedback control can significantly improve performance over simple feedback control whenever there is a major disturbance that can be measured before it affects the process output. In the most ideal situation, feed forward control can entirely eliminate the effect of the measured disturbance on the process output. Even when there are modeling errors, feed forward control can often reduce the effect of the measured disturbance on the output better than that achievable by feedback control alone. However, the decision as to whether or not to use feed forward control depends on whether the degree of improvement in the response to the measured disturbance justifies the added costs of implementation and maintenance. The economic benefits of feed forward control can come from lower operating costs and/or increased salability of the product due to its more consistent quality. Feed forward control is always used along with feedback control because a feedback control system is required to track set point changes and to suppress unmeasured disturbances that are always present in any real process. Fig.5 gives the traditional block diagram of a feed forward control system. Fig.6 shows the same block diagram, but redrawn to show clearly that the feed forward part of the control system does not affect the stability of the feedback system and that each system can be designed independently. Figure 7 shows a typical application of feed forward control. The continuously stirred tank reactor is under feedback temperature control. Feed forward control is used to rapidly suppress feed flow rate disturbances. Figure 6 : Block Diagram Equivalent to Upper Fig. 11

Feed forward control suffers from some disadvantages: It requires the identification of all possible disturbances and their direct measurement. Any changes in the parameters of a process cannot be compensated by a Feed forward controller. Feed forward control requires a very good model of the process. Feedback control, on the other hand, does not require knowledge or measurement of disturbances; it is not very sensitive to changes in process parameters or to errors in the process model.we would expect that a combined feed forward-feedback control system will have the performance advantages of the first, while retaining the insensitivity of the second to uncertainty and inaccuracies. Feedback/Feed forward Level Control is achieved by the use of a PID level controller and a Lead- Lag flow feed forward controller that detects the deviations and disturbances in the flow out of Tank 2, and accordingly delivers a control signal that is added to the PID level controller s signal in order to reject these disturbances. This type of control predicts the effect of the disturbance and tries to reject it before it affects the PV (water level). Figure 7 : Feedback-Feed Forward Control Implementation 11

Procedure: 1. Click on Experiment 4: Feedback /Feed Forward Control (Level Control). Figure 8 : Feedback /Feed Forward Control 2. Check the Feed forward controller s parameters. What type of a controller is it? a. P Controller b. PD Controller c. PI Controller d. PID Controller e. Lead Controller f. Lag Controller g. Lead - Lag Controller 3. Check the Feedback controller s parameters. What type of a controller is it? a. P Controller b. PD Controller c. PI Controller d. PID Controller e. Lead Controller f. Lag Controller g. Lead - Lag Controller 12

4. Drag the Set point slider to 50% of its value and Flow Control Valve to 0%. Press the Start Process button to start the control process. 5. Observe the behavior of the (PV) and the controller s output on the chart. Is it close to the PID Level Controller s behavior? Why? Save the chart to include it in your report. 6. After the controller and (PV) settle down and stabilize, apply a disturbance to the system by changing the Flow Control Valve to fully open. Save the chart and discuss the disturbance rejection and the reaction of the controller. 7. Did the system reject the disturbances that you applied completely? Why? 8. Set the Flow Control Valve to Fully Open, and change the set point to 60%. When the level settles at 60% of its full scale, apply disturbances to the system by changing the opening of the Flow Control Valve. Observe the disturbance rejection and the reaction of the controller. 9. Stop the process and press the Quit button to go back to the experiments menu. Requirements 1. For each part, you should follow the procedures and answer all question. 2. At the end of the report, put your own opinion about the types of controller used in this exp. (its applications, advantages and disadvantages). 3. Write an example of using both feedback and feed forward in details and the effects of each one on the process. 13

German Jordanian University School of Applied Technical Sciences Mechatronics Engineering Department ME 3431 Automatic Control systems Lab EXPERIMENT 8 Two Rotor Aero-Dynamical System Objectives: To take an overview about the MIMO systems and how to simplify it to a SISO systems. To verify the Twin Rotor models obtained using system identification. To study the Twin Rotor system in both cases: open and closed loop. To study the effect of applying different types of controllers on the performance of the system. System Introduction Two Rotor aero dynamical system (TRAS) is a laboratory set up designed for control experiments. In certain aspects its behavior resembles that of a helicopter, the helicopter position and velocity is controlled through the rotor velocity variation. In the real helicopter, the rotor velocity is less constant and the propulsion is varied through the rotor blades angle modification. From the control point of view it exemplifies a high order nonlinear MIMO system with significant cross coupling. The system is controlled from a PC, therefore it is delivered with hardware and software which can be easily mounted and installed in laboratory. Control experiments are programmed and executed in real time in the MATLAB /SIMULINK environment. Thus it is strongly recommended to a user to be familiar with RTW and RTWT toolboxes. One has to know how to use the attached models and how to create his own models. Figure 1: ORAS Laboratory Setup 1

A schematic diagram of a laboratory set-up is shown in fig.1 the TRAS consists of a beam pivoted on its base in such a way that it can rotate freely both in the horizontal and vertical planes. At both ends of the beam there are rotors (the main and tail rotors) driven by DC motors. A counterbalance Arm with a weight at its end is fixed to the beam at the pivot. The status of the beam is described by four process variables: horizontal and vertical angles measured by positions sensors fitted at the pivot, and two corresponding angular velocities of the beam. Two additional state variables are the rotational speed of the rotors measured by tacho-generators coupled with the driving DC motors. In a casual helicopter the aerodynamic force is controlled by changing the angle of attack of the rotors. The laboratory set-up from figure.1 is so constructed that the angle of attack is fixed. The Aerodynamic force is controlled by varying the speed of the dc motors. A changing in the voltage value results in a change of the rotation speed of the propeller which results in a change of corresponding position of the beam. Significant cross-couplings are observed between the actions of the rotors: each rotor influences both position angles.designing of stabilizing controllers for such a system is based on decoupling. For a decoupled system an independent control input can be applied for each coordinate of the system. TRAS Model Every control project starts with plant modeling; so as much information as possible is given about the process itself, Modern methods of design and adaptation of real time controllers require high quality mathematical models of the system. For the high order, nonlinear cross coupled systems classical modeling methods are very complicated. That is why a simpler is often used which is based on block diagram representation of the system which is very suitable for the SIMULINK environment.the TRAS system is an open type. It means that the user can design and solve any TRAS control problem based on the attached hardware and software.see figure.2 (refer to APPENDIX to see the notification). Figure 2: Block Diagram of TRAS Model 2

The following notation is used in Fig. 2 3

Controlling the system consists in stabilizing the TRAS beam in an arbitrary (within practical limits) desired position (Pitch and azimuth) or making it to track a desired trajectory. Both goals may be achieved by means of appropriately chosen controllers. The user can select between two types of PID controllers and a state feedback controller. Non-linear Model The mathematical model is developed with some simplifying assumptions: It is assumed that the dynamics of the propeller subsystem can be described by the first order differential equations. It is assumed that the friction in the system is of the viscous type. It is assumed also that the propeller- air subsystem could be described in accord with postulates of the flow theory. These assumptions allow us to define the problem clearly, consider the rotation of the beam in the vertical plane around the horizontal axis. Having in mind that the driving torques are produced by the propellers, the rotation can be described in principle as the motion of a pendulum. From the dynamics second law of Newton we obtain: Where: Mv = Jv d2 αv dt 2 Mv - total moment of forces in the vertical plane, Jv - the sum of moments of inertia relative to the horizontal axis, v - the pitch angle of the beam. To determine the moments of forces applied to the beam and making it rotates around the horizontal axis consider figure.3 and 4 Figure 3: Gravity forces in TRAS corresponding to the return torque which determines the equilibrium position of the system. 4

Figure 4: Propulsive force moment and friction moment in TRAS 5

Referring to the free body diagram in figure.3, we can find the return torque corresponding to the forces of gravity (Mv1) and the moment of the propulsive force produced by the main rotor (MV2), similar equations are written for the moment of the centrifugal force around the vertical axis and the moment of friction depending on the angular velocity (MV3, MV4 Respectively). State space Finally, the mathematical model of the TRAS becomes the set of the four nonlinear differential equations and two linear differential equations. In order to apply the model for control of the TRAS the parameters and nonlinear functions should be determined first. They can be divided into three groups: Physical parameters. Nonlinear static characteristics. Time constants of the linear part of the model. 6

PART I: Testing (Ask your Instructor) PART II: Control and real time experiments 2.1 PID Controllers 2.1.1 1-DOF controllers The task of the one degree-of freedom controllers is to move TRAS to an arbitrary position in the selected plane and to stabilize it there. Figure 5: PID Closed Loop System Procedure 2: Vertical 1-DOF control (pitch control experiment) 1. Set the TRAS in the natural position and wait until the all oscillations are damped. 2. Click the PID Pitch controller button, set all PID coefficients: as KP=20, KI=0.8 and KD =12.25. Also, set saturation of the integral part of the controller to 1.43. 3. Build the model and click on the simulation /connect to target option and start real time code option. 4. Export the displayed graphs. Write your notes about Pitch response. 5. Observe the results of the experiment. Why do we filter the control signal? Procedure 3: Horizontal 1-DOF control (azimuth control experiment) 1. Set the TRAS in the natural position and wait until the all oscillations are damped. 2. Click the PID Pitch controller button, set all PID coefficients: as KP=20, KI=0.5 and KD=15. Also, set saturation of the integral part of the controller to 1.43. 3. Build the model and click on the simulation /connect to target option and start real time code option. 4. Export the displayed graphs. Write your notes about azimuth response. 7

2.1.2 2-DOF controllers Simple PID controller The simple PID controller controls the vertical and horizontal movements separately. The influence of one rotor on the motion in the other plane is not compensated by the controller structure. Procedure 4: Figure 6: The block diagram of 2-DOF control system with a simple PID-controller 1. Click the PID Cross-coupled or Simple button. 2. Set the reference for both pitch and azimuth signal as sine wave with 0.2 rad amplitude and 1/30 Hz frequency. 3. Set the coefficients of the crossed PID controllers as follows: PID hh (the azimuth controller) KPhh=3.2465 KIhh =0.0367 KDhh=2.152 Set the integral saturation to 1. PID vv (the pitch controller) KPvv =0.4978 KIvv=0.4392 KDvv =0.4464. Set the saturation of the integral part of the controller to 1.43. 4. Set all parameters in both PD controllers to zero. 5. Build the model and click on the simulation/connect to target option and start real time code option. 6. Export both Azimuth and Pitch response. Write your comments. 8

Cross-coupled PID controller The cross-coupled PID controller steers the system in the pitch and azimuth planes. In this control system the influence of one rotor on the motion in the other plane, can be compensated by the cross coupled structure of the controller. See figures 7 and 8 Procedure 5: 7. Click the PID Cross-coupled or Simple button. 8. Set the reference for both pitch and azimuth signal as sine wave with 0.2 rad amplitude and 1/30 Hz frequency. 9. Set the coefficients of the crossed PID controllers as follows: PID hh (the azimuth controller) KPhh=3.2465 KIhh =0.0367 KDhh=2.152 Set the integral saturation to 1. PD hv (the cross pitch azimuth controller) KPhv=-0.9334 KDhv=-0.7845. PD vh (the cross azimuth pitch controller) KPvh =-0.0363 KDvh =-0.0223. PID vv (the pitch controller) KPvv =0.4978 KIvv=0.4392 KDvv =0.4464. Set the saturation of the integral part of the controller to 1.43. 10. Build the model and click on the simulation/connect to target option and start real time code option. See figure.7 and 8 Cross-coupled PID control loop. 9

Figure 7: The block diagram of 2-DOF control system with a simple PID-controller Figure 8: The block diagram of the cross-coupled PID controller 11. Compare between the results of the simple and cross-coupled PID controller. (Comment). NOTE: Include the pitch position and reference signal graphs in your report. 11

German Jordanian University School of Applied Technical Sciences Mechatronics Engineering Department ME 3431 Automatic Control systems Lab EXPERIMENT 9 HVAC Trainer

Objectives: To be familiar with HVAC system. Control the temperature of the system using both On/Off, and PI controller. Introduction: HVAC stands for Heating, Ventilation and Air Conditioning, three functions often combined into one system in today's modern homes and buildings. Warmed or cooled or dehumidified air flows through a series of tubes - called ducts - to be distributed to all the rooms of the building. The principles of Heating, Ventilation, and Air Conditioning (HVAC) are based on: a. Thermodynamics b. Fluid mechanics c. Heat transfer HVAC trainer that is used in this experiment, consist of plexiglass duct, with a heater in one end and a blower in the other end. The heater is a halogen lamp and the blower is a variable-speed fan. There is a thermistor sensor placed inside the duct to measure the temperature of the chamber and another thermistor sensor outside the chamber to measure the room temperature. Figure 1 : Heating and Ventilation Trainer (HVAC) 2

The temperature measured at the thermistor inside the chamber is to be controlled using the heater voltage while the fan is ran at a constant speed. Heat is transferred to the thermistor by radiation from the heater and by convection from the air stream. Radiative heat transfer is highly nonlinear and it is therefore difficult to model the system by first principles. As a result, empirical tuning will be used to control the system. This heat transfer plant is very similar to the systems that are used to control wafer temperature in semiconductor manufacturing. HVAC Trainer Components: The components comprising the Heating and Ventilation Trainer are labeled in Figure 2, and described in Table 1. Figure 2 : HVAC Chamber Components Table 1 ID # Description 1 Halogen light bulb (heater) 2 Fan: The blower is a 24-Volt variable-speed fan (For Cooling) 3 Thermistor chamber temperature sensor 4 Chamber (Duct) 5 Thermistor ambient temperature sensor In this experiment, two types of control will be used: On/Off Control PI control 3

PART I : ON/OFF CONTROL On-off control is one of the simplest control types. It is usually used in many basic controls, such as heating and cooling buildings to regulate temperature. In this experiment, on/off controller will be used to control the temperature inside the chamber. In the feedback loop used in HVAC, a temperature sensor continuously measures the temperature inside the chamber. This continuous measurement is critical because it allows the HVAC system to react to disturbances to maintain a stable temperature. Principle of Operation: The HVAC system is activated when the temperature outside is outside the desired range, and deactivate while within the range. The heater is switched on when the temperature is lower than the desired value, and switched off when the temperature is higher than the desired value. A block diagram of a system with relay feedback is shown in Figure 3. Figure 3 : Block Diagram of the Heater System To perform this control process, a sensor measures the current temperature and compare it to the set point. And so, the HVAC system would turn on or off to reach this point. This is one of the simplest temperature control systems. However, this type of controller generally produces oscillations in the output; meaning that room s temperature goes too high and too low continuously, this could be avoided by using PID based feedback control. 4

HVAC Trainer s Interface ( Front Panel): The HVAC On-Off Control virtual instrument implements a relay to control the temperature of the chamber. This instrument can also be used to model the dynamics between the heater voltage and the temperature. Table 2 lists and describes the main elements of the HVAC On-Off Control virtual instrument s user interface. Every element is uniquely identified through an ID number as located in Figure 4. 2 1 3 4 5 6 78 12 14 15 16 17 9 10 11 13 Figure 4 : HVAC On/Off Control Interface 5