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

Similar documents
Excel Tool: Plots of Data Sets

PASS Sample Size Software. These options specify the characteristics of the lines, labels, and tick marks along the X and Y axes.

Excel Lab 2: Plots of Data Sets

MATHEMATICAL FUNCTIONS AND GRAPHS

Page 21 GRAPHING OBJECTIVES:

Physics 253 Fundamental Physics Mechanic, September 9, Lab #2 Plotting with Excel: The Air Slide

Appendix B: Autocad Booklet YR 9 REFERENCE BOOKLET ORTHOGRAPHIC PROJECTION

PASS Sample Size Software

Getting Started. Right click on Lateral Workplane. Left Click on New Sketch

How to Create Website Banners

Volume of Revolution Investigation

NCSS Statistical Software

with MultiMedia CD Randy H. Shih Jack Zecher SDC PUBLICATIONS Schroff Development Corporation

Name: Date Completed: Basic Inventor Skills I

University Libraries ScanPro 3000 Microfilm Scanner

1. Start with scatter plot: 2. Find corner points. 3. Capture image. 4. Corners

EXPLORING POLAR COORDINATES WITH THE GEOMETER S SKETCHPAD

6. Multivariate EDA. ACE 492 SA - Spatial Analysis Fall 2003

Drawing a Plan of a Paper Airplane. Open a Plan of a Paper Airplane

Module 1G: Creating a Circle-Based Cylindrical Sheet-metal Lateral Piece with an Overlaying Lateral Edge Seam And Dove-Tail Seams on the Top Edge

Using Google SketchUp

Module 1C: Adding Dovetail Seams to Curved Edges on A Flat Sheet-Metal Piece

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

CAD Orientation (Mechanical and Architectural CAD)

Step 1: Set up the variables AB Design. Use the top cells to label the variables that will be displayed on the X and Y axes of the graph

Magnitude and Phase Measurements. Analog Discovery

FlashChart. Symbols and Chart Settings. Main menu navigation. Data compression and time period of the chart. Chart types.

Honors Chemistry Summer Assignment

Bode plot, named after Hendrik Wade Bode, is usually a combination of a Bode magnitude plot and Bode phase plot:

AutoCAD 2020 Fundamentals

After completing this lesson, you will be able to:

Solving Equations and Graphing

AutoCAD Tutorial First Level. 2D Fundamentals. Randy H. Shih SDC. Better Textbooks. Lower Prices.

Math Labs. Activity 1: Rectangles and Rectangular Prisms Using Coordinates. Procedure

INTRODUCTION TO AGILENT VEE

The version 2.0 of Solve Elec allow you to study circuits in direct current.

New Sketch Editing/Adding

Introduction to CATIA V5

AutoCAD 2018 Fundamentals

Drawing Layouts Paper space & Model Space

TeleTrader FlashChart

A graph is an effective way to show a trend in data or relating two variables in an experiment.

AutoCAD 2D I. Module 6. Drawing Lines Using Cartesian Coordinates. IAT Curriculum Unit PREPARED BY. February 2011

Plot cylinder pressure against crank angle

7.0 - MAKING A PEN FIXTURE FOR ENGRAVING PENS

Generations Automatic Stand-Alone Lace By Bernie Griffith Generations Software

The Revolve Feature and Assembly Modeling

AutoCAD LT 2012 Tutorial. Randy H. Shih Oregon Institute of Technology SDC PUBLICATIONS. Schroff Development Corporation

Laboratory Experiment #1 Introduction to Spectral Analysis

Importing and processing gel images

Chapter 6 Title Blocks

SDC. AutoCAD LT 2007 Tutorial. Randy H. Shih. Schroff Development Corporation Oregon Institute of Technology

Table of Contents. Lesson 1 Getting Started

ET 304A Laboratory Tutorial-Circuitmaker For Transient and Frequency Analysis

Create a Flowchart in Word

Tutorial 2: Setting up the Drawing Environment

MAKING THE FAN HOUSING

Introduction to Simulink Assignment Companion Document

SolidWorks Tutorial 1. Axis

3.2 Measuring Frequency Response Of Low-Pass Filter :

MEASUREMENT CAMERA USER GUIDE

Apex v5 Assessor Introductory Tutorial

Student Exploration: Standard Form of a Line

Year 11 Graphing Notes

Assignment 12 CAD Mechanical Part 2

Tiling. 1. Overlapping tiles with fixed number of tiles. Tutorial

Laboratory 2: Graphing

AutoCAD LT 2009 Tutorial

Quilt Pro 6 Lesson Quilt in a Quilt

Use of the LTI Viewer and MUX Block in Simulink

Appendix 3 - Using A Spreadsheet for Data Analysis

Autodesk AutoCAD 2012: Fundamentals. Elise Moss. autodesk authorized publisher SDC PUBLICATIONS

10 GRAPHING LINEAR EQUATIONS

Experiment 8: An AC Circuit

Data Analysis Part 1: Excel, Log-log, & Semi-log plots

Working With Drawing Views-I

How to Draw a New York Beauty Block

Sketch-Up Project Gear by Mark Slagle

Chapter 6: TVA MR and Cardiac Function

EXPERIMENT NUMBER 10 TRANSIENT ANALYSIS USING PSPICE

Tinker Tuesday Project - Fabric Engraving

Reference Manual SPECTRUM. Signal Processing for Experimental Chemistry Teaching and Research / University of Maryland

NX 7.5. Table of Contents. Lesson 3 More Features

1. An Introduction to Transient Stability

Activity P52: LRC Circuit (Voltage Sensor)

Chapter 2. Drawing Sketches for Solid Models. Learning Objectives

Input of Precise Geometric Data

Key Terms. Where is it Located Start > All Programs > Adobe Design Premium CS5> Adobe Photoshop CS5. Description

Sante FFT Imaging Copyright 2018 Santesoft, all rights reserved

How To Graphically Analyze Production History Data

EQ7 Summer Drawing Series: Block 4

Guidance on Using Scanning Software: Part 5. Epson Scan

Computer Programming ECIV 2303 Chapter 5 Two-Dimensional Plots Instructor: Dr. Talal Skaik Islamic University of Gaza Faculty of Engineering

Embroidery Gatherings

Thermo ImageQuest Version 1.0.1

MicroLab 500-series Getting Started

Environmental Stochasticity: Roc Flu Macro

Chapter 5 Sectional Views

DeltaCad and Your Horizontal Altitude Sundial Carl Sabanski

Transcription:

Drawing Bode Plots (The Last Bode Plot You Will Ever Make) Charles Nippert This set of notes describes how to prepare a Bode plot using Mathcad. Follow these instructions to draw Bode plot for any transfer function. In these notes we will draw the Bode plots of a second order transfer function. However, after you have created the sample program, you can easily modify it to plot any transfer function. Therefore, this is the last Bode plot you need to draw from scratch! Another alternative is that you can use these notes to prepare Bode plots of any function merely by using that function, adjusting the scale factors for frequency and the coefficient in the Margin Response. The transfer function you will plot is: () G s = 0.2 ( 10s + 1)( 0.02s + 1) These notes will use an array of values of frequency to generate arrays of values of amplitude ratio, magnitude ratio and, phase shift. In order to produce a curve that appears smooth, you will use a large number of values of frequency in the arrays. You will then use Mathcad s plotting feature to draw graphs. You will make log-log plots and log plots that are the customary forms of Bode plots. Begin by Opening Mathcad 1. Open Mathcad in the usual fashion. Create a Range Variable 2. You will now create a Mathcad "range variable". A range variable is a variable containing integer values ranging from a low value to an upper value, such as the integers 0, 1, 2, 3, 50. In you Bode plot, the range variable will be used to create arrays and access the values in individual elements in those arrays as you create the plots. Name your range variable i. Type i about a half an inch below the top of your work page. The next step is to create the arithmetic assignment sign, (the ":= symbol). Do this in one of two ways: either: 1. Select "View/Toolbars/Calculator" from the menu. A toolbar will appear. Click on the button. Alternatively, you can 2. Type ":". A small black, rectangle should appear to the right of the := symbol as shown in figure 1. This rectangle is a placeholder and indicates that Mathcad is waiting for more information.

Figure 1 2. Next, indicate the range of the integers. Do this by first typing the lower limit of the range, in this case 0. Next, create the range symbol by doing one of the following: 1. Select "View/Toolbars/Matrix". A toolbar will appear. Click on the button. Alternatively you can 2. Type ";" Finally, finish the range variable by typing the upper limit, in this case 100. Should look like figure 2 Figure 2 You have now defined a range variable called "i" that contains all the integers from zero to 100.

Create an Array of Frequencies 3. You will now enter the equation that defines the range of frequencies to be used in the Bode plot. Frequency is generally represented by the Greek letter ω. Move the cursor somewhere below the range variable that you have already created. You can do this by moving the mouse cursor just below the range variable and clicking your left mouse button. You can create Greek letters by selecting "View/Toolbars/Greek" from the menu. A toolbar with Greek letters appears. Type the Greek letter that you wish, in this case ω. 4. The value ω will represent an array of numbers. Each number will be represented by a subscript, the value of the first subscript in the array will be zero, the value of the next subscript will be one and, the value of the last (the hundred and first) will be 100. Now create a subscript in one of two ways: 1. Click the button from the Matrix toolbar 2. Type [ in either case, your screen should now resemble Figure 3 Figure 3 5. The black rectangle is a placeholder a little lower than the Greek letter ω and slightly to the right. Type the letter i and then enter of the := symbol as you did in step 1 of these notes. The horizontal axis of a bode plot is generally a logarithmic scale. In order to have values of frequency regularly spaced a logarithmic axis, use the following formula: Where min = the smallest power of 10 on the Bode plot span = the range of the powers of ten. In this sample program, the smallest value of ω will be 10-5 and the largest value will be 10 5. Type the number 10. Remember to use the ^ symbol to create a superscript. In this case we will use a minimum value of -5 and a span of 10. Enter those numbers in the formula in place of the names so that your finished formula should look like Figure 4

Figure 4 Change the values of the minimum and the span if you wish to change the values of the horizontal axis. 6. You will now enter the transfer function given on the first page of these notes. Mathcad allows functions that written in the form of function_name(variable1, varaible2,. variablen) = mathematical expression Therefore it should be easy to enter the transfer function. () G s = 0.2 ( 10s + 1)( 0.02s + 1) Move the mouse cursor just below the formula for frequency. Begin typing the equation. Start with the left side, create the := symbol and type 0.2. Use the / key to create the division. Remember to use an * to indicate every multiplication (between the 10 and the s, the 0.02 and the s and between )(. The finished equation is shown in Figure 5. Figure 5 7. Bode plots are generated from the transfer function by replacing the s terms with iω. You will not compute the complex values of the transfer function for each frequency, placing them in an array that you will name g. This entire action is done with one equation that define each element in the array g. Use the mouse cursor to move to an area just below the transfer function. Click on the left mouse button and type g. Then create a subscript using either the button or the [ key. Type i. Next, create the := symbol using either the button or the : key. Finally, type the formula; type G(. You will find the square root symbol all on the calculator toolbar that you can make visible using the "View/Toolbars/Calculator" menu option. Type -1 under the square root sign.

Your formula should look like figure 6a. The frequency symbol must appear outside the square root sign and multiplies the square root of minus one. Tap right arrow key twice to move the inverted L cursor from under the square root symbol. The inverted L. cursor embraces the entire square root symbol as shown in figure 6b. Next hit the Asterix. Then hit the ω button on the toolbar. Create a subscript and type i. Finish with a ). The final equation is shown in figure 6c Figure 6a After typing -1 Figure 6b Tap Right Arrow Key Twice to Move the Cursor OUT OF the Square Root Figure 6c Finished! Make sure that the frequency is outside of the square root symbol. If you make a mistake, erase the equation and start over. 8. The amplitude response of a transfer function is simply the magnitude of the complex value of transfer function. The array g contains the complex values of the transfer function of evaluated at the wavelengths. We will now use Mathcad's functions to obtain both the magnitude and the angle of the phaser given by g i. Mathcad uses the absolute value symbol to return the magnitude of a complex number. Therefore, finding the amplitude response is simple. Underneath the formula for g create an array named AR to contain the amplitude response for the values of frequency given in the ω array. Press the absolute value button after creating the := symbol. The button is found on both the Calculator and Matrix toolbars. Move the inverted L. inside the absolute value symbol and type the rest of the letter g. and the subscript i. The finished equation is shown in figure 7 Figure 7

9. The Margin Response is the Amplitude Response divided by the process gain which is merely the coefficient of the transfer function when it is written with the constant terms will polynomial factors set to one, as illustrated by the sample transfer function. The process gain in this example is 0.2 so the margin response is obtained by dividing the amplitude response by 0.2. This equation is shown in figure 8. Figure 8 10. The equation for phase shift shown in figure 9 uses several Mathcad functions. The functions Re(x) and Im(x) return the real and imaginary components of a complex number, respectively. The atan2(x, y) function returns the angle from the x-axis to a line containing the origin and the point (x,y). Results are in radians between π and π, excluding π. Multiply the values returned by atan2 by 180/π to convert to degrees. Enter this equation just below the Margin Response. Figure 9 Draw the Graph 11. Press Enter to leave the last equation. Move the Red Cross cursor to a spot below your last equation. From the menu bar choose "View/Toolbars/Graph. The graph toolbar shown in figure 10 will appear. Figure 10 The Graph Toolbar 12. The two-dimensional graph is created by clicking the button in the upper left-hand corner of the toolbar. The button looks like a 2-D graph,. Click that button and a graph object will replace the Red Cross cursor. The object is shown in figure 11. The black rectangles on the outer border are "handles" you can "grab" by pressing and holding them with the mouse cursor to change the size and shape of the graph.. The inner, large, empty rectangle shows the size of the graph itself. The solid rectangles that are not attached to any shape our placeholders for the horizontal and vertical axes. The inverted L cursor appears at the horizontal axis.

Figure 11 The Graph Object Plot area Vertical axis Handle to change the size of the graph. Horizontal axis 13. You will make the elements of the array, ω, the values for the horizontal axis. If the inverted L cursor is not on the horizontal axis placeholder, move the mouse cursor over that placeholder and click the left mouse button. Type ω i to enter the horizontal axis. Be sure to use the real subscript (the button or the [ key). Next, click on the vertical axis placeholder to move the inverted all cursor over it. Mathcad allows you to plot either arrays that have been calculated already or values that are calculated "in place". The vertical axes will disoplay the arrays AR and MR. On the vertical axis type AR i, when you are finished, Mathcad will display a line using the 101 values from AR array and pair them with the appropriate values of ω i to plot a line. Your graph object should now resemble figure 12. Figure 12 After Entering the Horizontal and Vertical Axes 14. Mathcad only allows one set of values on the horizontal axis. You can plot as many arrays on the vertical axis as you wish. If the inverted L. cursor is not at the end of the variable AR, move the mouse cursor over the AR, click the left mouse button and, press the right arrow key until the cursor looks like the one shown in Figure 12. When the inverted L cursor is at the end of the AR i line, type, to create a new placeholder just below it. Your screen should look like figure

13. Then enter the second variable MR i and press Enter. The graph should resemble figure 13b Figure 13a The Vertical Axis Figure 13b The Finished Graph Modify the Graph 13. You will now make the plot look like a Bode plot by changing the axes from Cartesian axis to logarithmic axes. Move the mouse cursor over the graph and click on it once. The border with the handles should appear. Grab the handle in the lower right hand corner with the mouse and drag it down into the right to make the graph larger. Then double-click on the graph with the mouse cursor to call up the graph dialog box that a shown me in figure 14. When the box appears, the "grid lines" and Log Scale options are not checked. Check them now as shown in the figure.

Figure 14 X-Y Traces on the Graph Dialog Box 14. Click the "Traces" tab. This tab allows you to specify the appearance of the lines drawn on the screen. Move the mouse cursor over the line labeled "traced two" and click. The default setting for this line is a role dots. Move the mouse cursor to the pull down tab labeled line and click on "solid. Your screen should appear like figure 15 before you click on solid".

Figure 15 The Traces Tab 15. Click OK to close the dialog. The completed graphic shown in figure 16 Figure 16 Completed Bode Plot

16. Now plot the phase angle below your first plot by modifying the steps you used to plot the Margin Response and the Amplitude Response as outlined below: 1. Only plot φi on the vertical axis 2. In step 14, on the Y-Axis list of check boxes. leave the Log Axis box UNCHECKED The phase angle plot is shown in Figure 15 Figure 15 Phase Plot Modifying Your Bode Plots for New Functions SAVE THIS FILE! You can modify your file to give you Bode plots of any transfer function. Here are the things you must do to modify this file. 17. Change the function G(s). Click on this formula and enter your new formula. Click on this function. Move the mouse cursor over the equation near the lower right hand side. Press and hold the left mouse button as you drag the cursor to the left until the entire right hand side of the equation up to the := sign is shown in reverse video, as shown in Figure 16. Press delete to remove the old transfer function. Enter the transfer function you want to plot. If you mess up, just erase the old equation reenter your equation/ Figure 16 18. Change the gain in the Margin Response equation to the process gain of your transfer function. Click on the equation and use the arrow keys to move the inverted L cursor to the gain. Use the backspace key to remove the old gain. Then type the new gain.

19. Change the range of wavelengths. Recall the formula used to calculated is Edit this function by clicking on it and using the arrow keys to move the cursor to the parts of the equation you want to change. 19, The atan2 function returns values between π and π. A plot of G(s) = 0.2 exp(-2s) is shown in figure 16. The breaks in this function are artifacts of the atan2 function. The actual function continues down without any breaks. You can either leave the program as it is and just remember that any breaks in phase angles are artifacts or you can use Mathcad s programming feature to write your own function. The programming feature is described in other notes elsewhere. Some of my Bode plots use code to correctly plot phase angle. Figure 16