Lab 1: Simulating Control Systems with Simulink and MATLAB

Similar documents
ECE411 - Laboratory Exercise #1

Experiment 1 Introduction to Simulink

Introduction to Simulink Assignment Companion Document

Lab 1: First Order CT Systems, Blockdiagrams, Introduction

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

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

Memorial University of Newfoundland Faculty of Engineering and Applied Science. Lab Manual

EE 482 : CONTROL SYSTEMS Lab Manual

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

Figure C-1 (p. 907) MATLAB window showing how to access Simulink. The Simulink Library Browser button is shown circled.

Experiment 1 Introduction to MATLAB and Simulink

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

Experiments #6. Convolution and Linear Time Invariant Systems

Lab 2: Introduction to Real Time Workshop

ENSC327 Communication Systems Fall 2011 Assignment #1 Due Wednesday, Sept. 28, 4:00 pm

Use of the LTI Viewer and MUX Block in Simulink

Introduction to Simulink

MATLAB and Simulink in Mechatronics Education*

Nonlinear Control(FRTN05)

SIGNALS AND SYSTEMS: 3C1 LABORATORY 1. 1 Dr. David Corrigan Electronic and Electrical Engineering Dept.

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


BSNL TTA Question Paper Control Systems Specialization 2007

1 PeZ: Introduction. 1.1 Controls for PeZ using pezdemo. Lab 15b: FIR Filter Design and PeZ: The z, n, and O! Domains

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

Lecture 18 Stability of Feedback Control Systems

C.8 Comb filters 462 APPENDIX C. LABORATORY EXERCISES

Experiment 6: Multirate Signal Processing

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

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

Frequency Response Analysis and Design Tutorial

MEM01: DC-Motor Servomechanism

Open Loop Frequency Response

Answers to Problems of Chapter 4

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

SECTION 7: FREQUENCY DOMAIN ANALYSIS. MAE 3401 Modeling and Simulation

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

JUNE 2014 Solved Question Paper

ES442 Final Project AM & FM De/Modulation Using SIMULINK

Reduction of Multiple Subsystems

MCE441/541 Midterm Project Position Control of Rotary Servomechanism

ELG3311: EXPERIMENT 2 Simulation of a Transformer Performance

EC CONTROL SYSTEMS ENGINEERING

MTHE 332/393 Lab Manual

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

LAB II. INTRODUCTION TO LABVIEW

COMMUNICATION LABORATORY

SMS045 - DSP Systems in Practice. Lab 1 - Filter Design and Evaluation in MATLAB Due date: Thursday Nov 13, 2003

Engineering 3821 Fall Pspice TUTORIAL 1. Prepared by: J. Tobin (Class of 2005) B. Jeyasurya E. Gill

JNTUWORLD. 6 The unity feedback system whose open loop transfer function is given by G(s)=K/s(s 2 +6s+10) Determine: (i) Angles of asymptotes *****

LECTURE FOUR Time Domain Analysis Transient and Steady-State Response Analysis

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

, answer the next six questions.

ECEGR Lab #8: Introduction to Simulink

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

Instruction Manual for Concept Simulators. Signals and Systems. M. J. Roberts

Experiment # 4. Frequency Modulation

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

Lab 6: Building a Function Generator

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

ECE 203 LAB 2 PRACTICAL FILTER DESIGN & IMPLEMENTATION

EES42042 Fundamental of Control Systems Bode Plots

Lab 4 An FPGA Based Digital System Design ReadMeFirst

ArbStudio Triggers. Using Both Input & Output Trigger With ArbStudio APPLICATION BRIEF LAB912

Unit 4: Block Diagram Reduction. Block Diagram Reduction. Cascade Form Parallel Form Feedback Form Moving Blocks Example

Lab 12 Laboratory 12 Data Acquisition Required Special Equipment: 12.1 Objectives 12.2 Introduction 12.3 A/D basics

1 ONE- and TWO-DIMENSIONAL HARMONIC OSCIL- LATIONS

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

EEL2216 Control Theory CT2: Frequency Response Analysis

LESSON 21: METHODS OF SYSTEM ANALYSIS

FUNDAMENTALS OF SIGNALS AND SYSTEMS

Optimal Control System Design

Laboratory Assignment 1 Sampling Phenomena

Introduction to R Software Prof. Shalabh Department of Mathematics and Statistics Indian Institute of Technology, Kanpur

DSP Laboratory (EELE 4110) Lab#10 Finite Impulse Response (FIR) Filters

Laboratory 5: RC Circuits and Filtering

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

MATLAB 6.5 Image Processing Toolbox Tutorial

EE 370/L Feedback and Control Systems Lab Section Post-Lab Report. EE 370L Feedback and Control Systems Lab

System analysis and signal processing

EE 461 Experiment #1 Digital Control of DC Servomotor

Experiment # 2. Pulse Code Modulation: Uniform and Non-Uniform

Drawing Bode Plots (The Last Bode Plot You Will Ever Make) Charles Nippert

THE SINUSOIDAL WAVEFORM

Spectrum Analysis: The FFT Display

Grid-Connected Full-Bridge Inverter Based on a Novel ZVS SPWM Scheme

Infinite Impulse Response Filters

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

Analog Discovery Arbitrary Function Generator for Windows 7 by Mr. David Fritz and Ms. Ellen Robertson

Electrical Engineering. Control Systems. Comprehensive Theory with Solved Examples and Practice Questions. Publications

Experiment Number 2. Revised: Summer 2013 PLECS RC, RL, and RLC Simulations

14:332:223 Principles of Electrical Engineering I Instructions for using PSPICE Tools Sharanya Chandrasekar February 1, 2006

This manuscript was the basis for the article A Refresher Course in Control Theory printed in Machine Design, September 9, 1999.

Class #16: Experiment Matlab and Data Analysis

Bode Plots. Hamid Roozbahani

Homework Assignment 06

EE 210 Lab Exercise #3 Introduction to PSPICE

Module 08 Controller Designs: Compensators and PIDs

Demonstrating in the Classroom Ideas of Frequency Response

SIMULINK for Process Control

Transcription:

Lab 1: Simulating Control Systems with Simulink and MATLAB EE128: Feedback Control Systems Fall, 2006 1 Simulink Basics Simulink is a graphical tool that allows us to simulate feedback control systems. 1.1 Placing Components Simulink can often by very finicky in regards to placement of components and connections. To place a component, drag it from the component browser to the model space. To make a connection, hold down CTRL and click on the arrows on each block that you wish to connect. To connect multiple lines to a single block, hold down CTRL and click on the line already attached to the block and then make the second connection. 1.2 Components For most of the systems we will encounter, we only need to be concerned with a small fraction of Simulink s component library. In particular, the components you should be familiar with are: Continuous library Integrator integrates a signal State-Space used to add a system block in state-space form Transfer Fcn used to add a system block in transfer function form Math Operations library Gain a constant gain Sum used to add two or more signals Trigonometric Function used to place non-linear trigonometric elements Signal Routing library Mux used to multiplex signals together in order to plot several on one graph Sinks library Scope used for viewing system output To workspace used to transfer a signal to MATLAB Sources library Ramp generates a ramp signal Sine Wave generates a sinusoid Step generates a unit step signal 1

1.2.1 Gain To modify a Gain component, double-click on the component. The Gain parameter can be either a number or, more useful, can be an expression. For instance, the Gain parameter can be set as 9.8/2.5 instead of having to calculate and then enter 0.45. 1.2.2 Sum The Sum component is equivalent to a summing junction in a block diagram. To add more input nodes or change the sign of an input node, double-click on the Sum component and modify the text in the List of Signs parameter. To make the sum have a + and a - node, change the List of Signs parameter to +. To add a third summing input node, change the text to + ++. 1.2.3 To Workspace The To Workspace component sends data to the MATLAB workspace where you can plot it or process it as you wish. To set this up, double-click on the component and change the Save format parameter to Array. Also, set the Variable name parameter to something descriptive, such as yout. Simulink also automatically exports the time in the MATLAB variable tout. This allows you to plot the output in MATLAB using the standard plot command, and also allows you to nicely label the plots. 1.2.4 Transfer Fcn To modify a Transfer Fcn component, double-click on the block. The Numerator and Denominator parameters are the coefficients of the polynomials of the numerator and denominator of the transfer function. The coefficients are in order of decreasing power. For instance, if Numerator is set to [1 2 3], then the numerator of the transfer function is s 2 + 2s + 3. The best way to learn Simulink is by doing. Let s try an example... 2 First Example Load simulink by simply typing simulink at the MATLAB prompt. Once simulink has loaded, create a new model by going to File, New Model (or alternatively press CTRL+N). Next, begin placing components on the empty window. Make your system look like the following: Now, replace the variable K with a 1 in the constant gain controller. Run the simulation by clicking on the triangle-shaped play icon in the toolbar and see what happens. Double-click on the scope to see the output of the simulation. Is the output stable? Increase the gain to 2 and re-run the simulation. Continue 2

increasing the gain to 10, and observe the results. Keep in mind that a linear system that is completely oscillatory, for a step or impulse input, is unstable. Convince yourself of this. Task 1. For what values of K is the system stable? For roughly what value of K is the system completely oscillatory? Now, change the gain to 8, and replace the step input with a ramp input. Re-run the simulation. Task 2. The steady-state error is defined as the difference between the input and output signals when t. Using the mouse, zoom in on the scope output at t = 10 seconds. Make an estimate of the steady-state error of this system due to a ramp input. Task 3. What is the closed-loop transfer function for this system (leave K as a variable)? What is the characteristic equation? What are the locations of the poles (i.e. s =?) Leave K as a variable in the characteristic equation and pole locations. Also, evaluate the expression for the pole locations for any value of K= unstable, K= oscillatory and K= stable. 3 Non-linear Example Using the equation of motion for a damped pendulum given by: θ + c ml θ + g l sin θ = T c ml 2, construct a system with input T c and output θ. Choose l = 2.5, m = 0.75, and c = 0.15. To construct this system, you will need to use the trigonometric function component which is found in the Math Operations library of Simulink. The only other components you will need are: a summer, constant gains, and integrators. In this system, multiples of 2π encode the same location. Is there any difference between θ = 0 and θ = 2π? Is there any difference between a system trajectory that starts at θ = 0 and goes to θ = 0 and a system that starts at θ = 0 and goes to θ = 2π? Task 4. Print your Simulink representation of this system. Task 5. Print the response of this system to a pulse having amplitude 20 and width 0.1 seconds. There are several ways to generate such a pulse; one easy way is to use a pulse generator with period= 100 and pulse width= 0.1. When you print the graph, show the response for 50 seconds of time. To change the simulation time, choose Simulation parameters... from the Simulation menu. Task 6. Replace the non-linear sin term with the standard linearization for sin θ. The linearization arises by first considering the Taylor expansion: sin θ = θ θ3 3! + θ5 5! +... and then disregarding higher order terms to yield the linearization (small-angle approximation): sin θ θ Again print the response of this system to the pulse input. Is this system still stable? Is the linear approximation a good approximation? Task 7. Now, put the non-linear sin term back into the simulation. Print the response of this system to a pulse having amplitude 200 and width 0.1 seconds. Again, show the response for 50 seconds. To what value is the output converging? Why? Task 8. Again replace the sin term with the linear approximation. Print the response of this system to a pulse having amplitude 200 and width 0.1 seconds. To what value is the output converging now? Why? Is the linear approximation a good approximation? 3

4 MATLAB Basics Before you begin the next sections, it would be a good idea to run the MATLAB Control System Toolbox demo. This is done by typing demo( toolbox, control ) at the MATLAB prompt. Aside from the basic MATLAB plotting commands, you should become familiar with the following commands: tf This command is used to enter transfer functions. For example, to enter the transfer function H(s) = s+2 s 2 +5, you would type H=tf([1 2],[1 0 5]). The first parameter is a row vector of the numerator coefficients. Similarly, the second parameter is a row vector of the denominator coefficients. conv This command is used to convolve two polynomials. It is particularly useful for determining the expanded coefficients for factored polynomials. For example, this command can be used to enter s+2 the transfer function H(s) = (s+1)(s 3) by typing H=tf([1 2],conv([1 1],[1-3])) series or * This command is used to combine two transfer functions that are in series. For example, if H(s) and G(s) are in series, they could be combined with the command T=G*H or T=series(G,H). feedback This command is used to combine two transfer functions that are in feedback. For example, if G(s) is in the forward path and H(s) is in the feedback path, they could be combined with the command T=feedback(G,H). step This command is used to plot the step response of a system. For example, step(t) would plot the step response of the system T (s). bode This command is used to plot the frequency repsonse. For example, bode(t) would plot the frequency response of the system T (s). rlocus This command is used to plot the root locus. For example, bode(g*h) would plot the frequency response of the system G(s)H(s). Keep in mind that this command is used on the loop gain of the system as opposed to the closed-loop transfer function. For example, consider the standard negative feedback system with forward path G and feedback path H. The loop gain would be G(s)H(s) whereas the closed-loop transfer function would be 5 MATLAB example Consider the following system: G(s) 1+G(s)H(s). 4

Task 9. Use MATLAB to find T (s) = C(s) R(s), the closed-loop transfer function. Show the MATLAB commands required to calculate T (s). Make use of the commands tf, conv, and feedback. Task 10. Print the step response, frequency response, and root locus for this system. 5