DOC PREVIEW
GVSU EGR 345 - Lab 2 - A Feedback Controller

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

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 5 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 5 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

4.0.1 Lab 2 - A Feedback Controller4.0.1.1 - Purpose4.0.1.2 - Background/Theory4.0.1.3 - Prelab4.0.1.4 - Equipment4.0.1.5 - Experimentalegr345 lab guide - 4.14.0.1 Lab 2 - A Feedback Controller4.0.1.1 - PurposeTo use the 6811 microcontroller for velocity feedback control of a motor.4.0.1.2 - Background/TheoryA basic feedback control system is shown in Figure 4.1. In this system the 6811 will output a control voltage as a PWM signal. When the output is 0V, the transistor will be off, and act like an open switch. However, when the output is 5V, it will turn the transis-tor on, and allow current to flow to the motor. (Note: There will be a voltage drop across the transistor, in this case approximately 0.8V.) The motor shaft is connected to a tachom-eter to measure the motor speed. (Note: In this lab we will use another motor as the tachometer.) The tachometer will produce a voltage proportional to the motor speed.Figure 4.1 68HC11 based velocity feedback controller68HC11PWM outGNDPE1VHLtachometermotorV+V-shaft couplerTIP 120Axiom boardVCVSVtVPPA6analog inωWhere,VCEffective PWM output voltage=VSEffective motor voltage=VPPower supply voltage (3.8V)=VtTachometer voltage=ω Angular velociy of motor/tachometer=CC+C++egr345 lab guide - 4.2To complete the control system, a program is required. The program reads the motor speed input, Ct, from the analog voltage, Vt, and use it to adjust the out-put, Cc, to adjust the voltage, Vs, to control the motor speed. Normally a user may supply a setpoint, Cd. This setpoint indicates the desired speed. In this pro-gram care is required to ensure that the Cc value remains in the range from 0 to 255 because of the limitation of the PWM functions.Figure 4.2 The complete feedback loopThe PWM output to the motor is a square wave with a variable duty cycle. Equa-tion (1) below shows how to convert the PWM value to an effective output volt-age. It is worth noting that part of the voltage from the power supply is lost across the transistor, thus reducing the effective voltage to the motor.+-PmotorA/DWhere,CdDesired tach. speed - input via keyboard (0-255)=CtActual tach. speed read via A/D (unsigned char, 0-255)=CeCdCt– System error (int)==CcPCeControl value to output via PWM (unsigned char, 0-255)==P The controller gain (int)=CtCdωCcVtCeTIP120Tach.PWMexternalhardware68HC11C Program (interrupt driven)VSVCegr345 lab guide - 4.34.0.1.3 - Prelab1. Review the programs from the previous lab.2. Write a program that will allow keyboard commands to change the PWM, and output the analog input once a second. Please note that this may be noisy and multiple readings may be required to reduce the noise.3. Write a program that implements the feedback controller described in the back-ground section. Put the feedback loop in an interrupt subroutine, and use the main program for keyboard IO. Don’t forget to consider the number limitation of the chosen datatypes.4.0.1.4 - Equipmentcomputer with an gcc6811 compilerAxiom M68HC11 board2 motors2 multimetersstrobe tachometerTIP 120 Darlington NPN transistorheatsink for TIP 120 transistorexternal power supply4.0.1.5 - Experimental1. Build the motor speed controller pictured in Figure 4.3. Use Figure 4.4 when connecting the transistor. Use a heat sink on the transistor to help dissipate heat. Use the PWM program from the previous lab to control the PWM output and test the motor speed control.VSVPVCE–()CCCMAX--------------=VSThe effective voltage delivered to the motor=Where,VPThe power supply voltage (use 3.8V)=VCEThe voltage across the transistor when on (use 0.8V)=CMAXThe maximum count in the counter (255)=CCThe variable counter value (0-255)=(1)egr345 lab guide - 4.4Figure 4.3 PWM control of motor speedFigure 4.4 TIP 120 NPN Darlington pair transistor2. Use a second motor as the tachometer (not to be confused with the strobe tachometer, used for calibration). This is done by connecting the motor shafts using a light colored piece of tape. It is also advisable to fix both motors to a common base to reduce vibrations. DO NOT CONNECT THE TACHOME-TER LEADS TO THE ANALOG INPUT YET.68HC11PWM outGND3Vdc motorV+V-TIP 120Axiom boardVCVSVP3.8V=PA6CC++TIP 120BCEBCENote: When not running an experiment, turn the motor power sup-ply off for safety and to minimize over-heating issues.egr345 lab guide - 4.53. Label both leads of the motor V+ and V-. Connect these leads to a DMM. Con-nect the V+ lead to the positive input on the DMM, and V- to the common/ground on the DMM.4. Use the program developed for the prelab to vary the PWM output to control the motor speed. Take the following readings in a tabular form. The motor RPM can be measured using the strobe tachometer as a reference. Vt is measured from the motor tachometer using the DMM, and a second DMM is used to mea-sure Vs.5. If the voltages for Vt were negative swap the V+ and V- labels on the motor tachometer. FAILURE TO DO THIS MAY DAMAGE EQUIPMENT. Connect the motor tachometer to the 6811 analog input as shown in Figure 4.5. You may also change the signs for Vt in the table.Figure 4.5 Motor tachometer analog input6. Use the prelab program to vary the PWM output and read the resulting analog input. Add the values to the previous table.7. Enter and test the feedback control program developed in the prelab with a gain of P=2. Change the setpoint, Cd, to different values and measure the resulting speed, Ct. Record these values in a new table.8. Repeat the previous step twice for gains of P=1 and P=4.9. Graph the results from the three tests on a single graph.PWM Value (hex)VsVtRPM(V) (V)68HC11PE1VRLtachometerAxiom boardVtanalog inV+


View Full Document

GVSU EGR 345 - Lab 2 - A Feedback Controller

Documents in this Course
Y Axis

Y Axis

2 pages

Load more
Download Lab 2 - A Feedback Controller
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 Lab 2 - A Feedback Controller 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 Lab 2 - A Feedback Controller 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?