DOC PREVIEW
Rose-Hulman ECE 320 - ECE 320 Lab 7

This preview shows page 1-2 out of 6 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 6 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 6 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 6 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

ECE-320 Lab 7: Discrete-Time PID and PI Controllers and sisotoolECE-320 Lab 7: Discrete-Time PID and PI Controllers and sisotoolOverviewIn this lab you will be controlling both of the one degree of freedom systems you previously modeled using discrete-time PID and PI controllers. Both one degree of freedom systems must be controlled, and if there are two people in your lab group each lab partner should do a different system.You will need to download the files for Lab 7 from the class website.Design Specifications: For each of your systems, you should try and adjust your parameters until you have achieved the following:Rectilinear Systems (Model 210)- Settling time less than 1.5 seconds.- Steady state error less than 0.1 cm for a 1 cm step, and less than 0.05 cm for a 0.5 cm step- Percent Overshoot less than 25%Your memo should include four graphs for each of the 1 dof systems you used (a PID controller and a PI controller for each system, two different sampling intervals Your memo should compare the differencebetween the predicted response (from the model) and the real response (from the real system) for each ofthe systems. Background/ReviewThe file DT_PID.mdl is a Simulink model that implements a discrete-time PID controller. It is somewhat unusual in that the plant is represented in state-variable form, but this is the usual form we will using in this class. The Simulink model looks like the model shown in Figure 1: Figure 1. Simple feedback loop with a discrete-time PID controller.1The file DT_PID_driver.m is the Matlab file that runs this code. We will be utilizing Matlab’s sisotool for determining the pole placement and the values of the gains.Before we go on, we need to remember the following two things about discrete-time systems:-For stability, all poles of the system must be within the unit circle. However, zeros can be outside of the unit circle.- The closer to the origin your dominant poles are, the faster your system will respond. However, the control effort will generally be larger.The basic transfer function form of the components of a discrete-time PID controller are as follows:Proportional (P) term : ( ) ( )pC z K E z=Integral (I) term: 1( )1 1i iK K zC zz z-= =- -Derivative (D) term : 1( 1)( ) (1 )ddK zC z K zz--= - =PI Controller: To construct a PI controller, we add the P and I controllers together to get the overall transfer function:( )( )1 1p i pipK K z KK zC z Kz z+ -= + =- -In sisotool this will be represented as 2( ) ( )( )( 1) ( 1)K z az K z aC zz z z+ += =- -In order to get the coefficients we need out of the sisotool format we equate coefficients to get: ,p i pK Ka K K K=- = -PID Controller: To construct a PID controller, we add the P, I, and D controllers together to get the overall transfer function:2 2 2( 1) ( 1) ( ) ( 2 )( 1)( )1 ( 1) ( 1)p i d p i d p d di dpK z z K z K z K K K z K K z KK z K zC z Kz z z z z z- + - - + + + - - +-= + + = =- - -In sisotool this will be represented as 2( )( )( 1)K z az bC zz z+ +=-In order to get the coefficients we need out of the sisotool format we equate coefficients to get: , 2 ,d p d i p dK Kb K Ka K K K K K= =- - = - -2For the PID controller, we can have either two complex conjugate zeros or two real zeros.Sisotool (Brief) ExampleRun the Matlab program DT_PID_driver.m. This program is set up to read the data file bobs_210_model.mat, which is a continuous time state variable model for a one degree of freedom rectilinear system, construct an equivalent discrete-time system using a sample and hold with a delay (the sample time is given by Ts), and implement a P controller with gain 0.0116. It will put the value of the transfer function for your system,( )pG z, in your workspace. Now we are ready for sisotool.Getting Started- Type sisotool in the command window- Click close when the help window comes up- Click on View, then Design Plots Configuration, and turn off all plots except the Root Locus plot (set the Plot Type to Root Locus for Plot 1, and set the Plot Type to None for all other Plots) Loading the Transfer Function- In the SISO Design window, Click on file → import.- We will usually be assigning Gp(z) to block G (the plant). Under the System heading, click on the line that indicates G, then click on Browse. - Choose the available Model that you want assigned to G (Click on the appropriate line) and then click on Import, and then on Close.- Click OK on the System Data (Import Model) window- Once the transfer function has been entered, the root locus is displayed. Make sure the poles and zeros of your plant are where you think they should be. Note that there will be three poles (one atzero) for our second order system since for this system there is a delay inserted by the Simulink model.Generating the Step Response- Click on Analysis → Response to Step Command (the system is unstable at this point)- You will probably have two curves on your step response plot. To just get the output, type Analysis → Other Loop Responses. If you only want the output, then only r to y is checked, and then click OK. However, sometimes you will also want the r to u output, since it shows the control effort for P, I, and PI controllers.- You can move the location of the pole in the root locus plot by putting the cursor over the pink button and holding the left mouse button down as you move the pole locations. You should note that the step response changes as the pole locations change.- The bottom of the root locus window will show you the closed loop poles corresponding to the cursor location if you hold down the left mouse button. However, if you need all of the closed loop poles you have to look at all of the branches.3Entering a Compensator (controller): We will implement a PI controller here- Click on Designs, then Edit Compensators. - Right click in the Dynamics window to enter real poles and zeros. You will be able to changes these values very easily later. Since we want a PI controller, we need a pole to be a 1 and we need to be able to change the value of the zero. For now assume the zero is at -1.- Look at the form of C to be sure it's what you intended, and then look at the root locus with the compensator.- You can again see how the step response changes with the compensator by moving the locations of the zero (grab the pink dot and slide it) and moving the gain of the system (grab the squares and …


View Full Document

Rose-Hulman ECE 320 - ECE 320 Lab 7

Documents in this Course
Load more
Download ECE 320 Lab 7
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view ECE 320 Lab 7 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view ECE 320 Lab 7 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?