ME 461 Laboratory #5 Characterization and Control of PMDC Motors

Similar documents
Introduction to the Op-Amp

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

MSK4310 Demonstration

ME 3200 Mechatronics I Laboratory Lab 8: Angular Position and Velocity Sensors

Motomatic Servo Control

Electronics I. laboratory measurement guide

GE 320: Introduction to Control Systems

ECE3204 D2015 Lab 1. See suggested breadboard configuration on following page!

ME 461 Laboratory #3 Analog-to-Digital Conversion

Lab 2 Operational Amplifier

University of Michigan EECS 311: Electronic Circuits Fall 2009 LAB 2 NON IDEAL OPAMPS

Electronics Design Laboratory Lecture #6. ECEN2270 Electronics Design Laboratory

ENGR 1110: Introduction to Engineering Lab 7 Pulse Width Modulation (PWM)

MAE106 Laboratory Exercises Lab # 3 Open-loop control of a DC motor

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

Massachusetts Institute of Technology. Lab 2: Characterization of Lab System Components

Intro To Engineering II for ECE: Lab 7 The Op Amp Erin Webster and Dr. Jay Weitzen, c 2014 All rights reserved.

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

Teaching Mechanical Students to Build and Analyze Motor Controllers

ELECTRICAL ENGINEERING TECHNOLOGY PROGRAM EET 433 CONTROL SYSTEMS ANALYSIS AND DESIGN LABORATORY EXPERIENCES

Laboratory 6. Lab 6. Operational Amplifier Circuits. Required Components: op amp 2 1k resistor 4 10k resistors 1 100k resistor 1 0.

Section 2 Lab Experiments

Exercise 2: Temperature Measurement

Prelab 6: Biasing Circuitry

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

Experiment A8 Electronics III Procedure

Lab 4: Analysis of the Stereo Amplifier

Sirindhorn International Institute of Technology Thammasat University at Rangsit

LABORATORY 5 v3 OPERATIONAL AMPLIFIER

ME 461 Laboratory #2 Timers and Pulse-Width Modulation

UNIVERSITI MALAYSIA PERLIS

PreLab 6 PWM Design for H-bridge Driver (due Oct 23)

EE 210 Lab Exercise #5: OP-AMPS I

DC Motor Speed Control using PID Controllers

ESE 150 Lab 04: The Discrete Fourier Transform (DFT)

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

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

University of Pittsburgh

Experiment A8 Electronics III Procedure

ME 333 Assignment 7 and 8 PI Control of LED/Phototransistor Pair. Overview

ESE 150 Lab 04: The Discrete Fourier Transform (DFT)

Integrators, differentiators, and simple filters

6.01 Fall to provide feedback and steer the motor in the head towards a light.

BME 3512 Bioelectronics Laboratory Five - Operational Amplifiers

LABORATORY 3 v3 CIRCUIT ELEMENTS

ECE 220 Laboratory 3 Thevenin Equivalent Circuits, Constant Current Source, and Inverting Amplifier

Lab 2: Linear and Nonlinear Circuit Elements and Networks

ECE 2274 Lab 2. Your calculator will have a setting that will automatically generate the correct format.

Lab 6: Instrumentation Amplifier

Lab #7: Transient Response of a 1 st Order RC Circuit

EE320L Electronics I. Laboratory. Laboratory Exercise #2. Basic Op-Amp Circuits. Angsuman Roy. Department of Electrical and Computer Engineering

CSE 3215 Embedded Systems Laboratory Lab 5 Digital Control System

OPERATIONAL AMPLIFIERS LAB

BME/ISE 3512 Bioelectronics. Laboratory Five - Operational Amplifiers

Lab E5: Filters and Complex Impedance

EE283 Electrical Measurement Laboratory Laboratory Exercise #7: Digital Counter

Experiment 2. Ohm s Law. Become familiar with the use of a digital voltmeter and a digital ammeter to measure DC voltage and current.

Mechatronics Laboratory Assignment 3 Introduction to I/O with the F28335 Motor Control Processor

LAB #10: Analog Interfacing

Laboratory Project 1a: Power-Indicator LED's

Lab 6: Exploring the Servomotor Controller Circuit

EE 308 Spring S12 SUBSYSTEMS: PULSE WIDTH MODULATION, A/D CONVERTER, AND SYNCHRONOUS SERIAN INTERFACE

University of Jordan School of Engineering Electrical Engineering Department. EE 204 Electrical Engineering Lab

University of Portland EE 271 Electrical Circuits Laboratory. Experiment: Op Amps

EE 3305 Lab I Revised July 18, 2003

DEPARTMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE MASSACHUSETTS INSTITUTE OF TECHNOLOGY CAMBRIDGE, MASSACHUSETTS 02139

DEPARTMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE MASSACHUSETTS INSTITUTE OF TECHNOLOGY CAMBRIDGE, MASSACHUSETTS 02139

ECE 53A: Fundamentals of Electrical Engineering I

ECE 2274 Lab 2 (Network Theorems)

LABORATORY 7 v2 BOOST CONVERTER

Laboratory 9. Required Components: Objectives. Optional Components: Operational Amplifier Circuits (modified from lab text by Alciatore)

CHARACTERISTICS OF OPERATIONAL AMPLIFIERS - I

University of North Carolina, Charlotte Department of Electrical and Computer Engineering ECGR 3157 EE Design II Fall 2009

Design Document. Analog PWM Amplifier. Reference: DD00004

ECE 231 Laboratory Exercise 3 Oscilloscope/Function-Generator Operation ECE 231 Laboratory Exercise 3 Oscilloscope/Function Generator Operation

Class #3: Experiment Signals, Instrumentation, and Basic Circuits

Group: Names: (1) In this step you will examine the effects of AC coupling of an oscilloscope.

Experiment 1: Instrument Familiarization (8/28/06)

DC SERVO MOTOR CONTROL SYSTEM

ECEN Network Analysis Section 3. Laboratory Manual

Quantizer step: volts Input Voltage [V]

EE 368 Electronics Lab. Experiment 10 Operational Amplifier Applications (2)

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

When you have completed this exercise, you will be able to relate the gain and bandwidth of an op amp

ECE 203 LAB 6: INVERTED PENDULUM

Modeling, Simulation and Implementation of Speed Control of DC Motor Using PIC 16F877A

EE 2274 DIODE OR GATE & CLIPPING CIRCUIT

Electronics. RC Filter, DC Supply, and 555

CHAPTER 6. Motor Driver

Exercise 2: Temperature Measurement

UNIVERSITI MALAYSIA PERLIS

CENG4480 Embedded System Development and Applications The Chinese University of Hong Kong Laboratory 1: Op Amp (I)

Practical 2P12 Semiconductor Devices

EE 233 Circuit Theory Lab 3: First-Order Filters

Assignment 8 Analyzing Operational Amplifiers in MATLAB and PSpice

Project Proposal. Low-Cost Motor Speed Controller for Bradley ECE Department Robots L.C.M.S.C. By Ben Lorentzen

Lab E5: Filters and Complex Impedance

DATASHEET. SMT172 Preliminary. Features and Highlights. Application. Introduction

Figure 1: Motor model

ECE2049: Embedded Systems in Engineering Design Lab Exercise #4 C Term 2018

Transcription:

ME 461 Laboratory #5 Characterization and Control of PMDC Motors Goals: 1. Build an op-amp circuit and use it to scale and shift an analog voltage. 2. Calibrate a tachometer and use it to determine motor speed. 3. Control a PMDC motor using two methods (by varying voltage and duty cycle). 4. Understand the function of an H-Bridge motor amplifier. 5. Use motor current to estimate angular position in static equilibrium. 6. Perform open-loop control on a PMDC motor and evaluate performance. NOTE: It is very important that you follow the directions in this lab carefully. You will be working with voltages outside the operating range for your microcontroller, so an incorrect connection could damage the microcontroller. Each exercise has different wiring, so follow each exercise description carefully to setup the correct wiring. If you are unsure of anything, ask your TA before guessing. Damaging the hardware will obligate you to re-solder an entirely new microcontroller setup. Exercise 1: In this exercise, you are going to build the op-amp gain and shift circuit you designed as part of Prelab 5 using the LM741. The goal is to linearly map a voltage in the range of [-12V, +12V] to a voltage in the range [0V, 3V]. Solder the gain and shift circuit on the given op-amp board located in the parts boxes by the soldering irons. Use the schematic below, the values of R 1 and R 2 you found in the homework assignment, and the demo board in lab as a guide. Op-amp circuit schematic ME 461 1

Your TA will show you where the bipolar power supply is located and give you a cable that easily connects ±12V to your op-amp board. The op-amp board connects -12V to the LM741 s pin #4, +12V to pin #7 and the power supplies common to ground. Vcc and GND of the op-amp board should already be soldered to Vcc and GND of the microcontroller. DO NOT connect VOUT of the op-amp board to one of the microcontroller s ADC pins until you are told to later in the lab. If the op-amp board s offset is not yet set, the output of the op-amp could be large and damage the ADC of the microcontroller. There are three vertical potentiometer connections to the left of the motor. Connect the top and bottom terminals to +12V and -12V. Then, connect the middle terminal (potentiometer output) to the V in banana jack of the op-amp board. Ground is already connected through the three wire ±12V cable. Show your wiring to your TA. In Exercise 2 you will use the potentiometer to provide input voltages between ±12 V in order to verify the gain and shift of the op-amp circuit. Exercise 2: First, set V in = 0 V by rotating the motor and potentiometer while measuring the potentiometer output with the digital multimeter (DMM) or oscilloscope. Then, without disturbing the V in setting, measure the output voltage of your gain and shift circuit, V out. Now, adjust V ref by adjusting the 20-turn 10KΩ pot on your op-amp board so that V out 1.5 V. Next, set V in according to the table below by rotating the motor shaft-mount potentiometer. Record V out for each case. Use the DMM to measure the input and output voltages. V in (V) -12-8 -4 0 4 8 12 V out (V) Plot the data (V out vs. V in ) in Excel and fit a linear trend line to the data. Record the exact gain and offset below. Gain: Offset: Show your results to your TA. Once you TA ok s your value, disconnect your wiring and solder V out of the op-amp board to ADC channel 1 (A1) of the MSP. ME 461 2

Exercise 3: Now you are ready to determine the relationship between motor RPM and the tachometer s output voltage. As asked at the end of Exercise 2, you should have wired ADC10 channel 1 (A1) to the op-amp board s output. Write a program to sample A1 every 1 ms and display the reading in mv to the terminal window every 250 ms. As always, leverage previously written code. To minimize wiring mistakes we are going to start back at the beginning. Disconnect all the wires you connected in exercise 2. Then as before connect the top and bottom terminals of the motor s potentiometer to +12V and -12V. This time connect the output of the motor s potentiometer to only the oscilloscope with the oscilloscope s ground connected to common (either at the ±12V COM terminal or the banana jack connected to your MSP s GND). The potentiometer s output will be used to calibrate the tachometer s gain. Also make sure the special power cable for the Op Amp board is connected to the +/- 12v supply and to the Op Amp board. Connect the motor s motor+ (red) and motor (black) terminals to the HP programmable power supply. Finally, connect the tachometer ground (grey terminal) to common ground (the MSP430 board s ground) and the tachometer output (orange terminal) to the V in banana jack of the op-amp board. Show your TA your wiring and your code for sampling the connected ADC channel. By varying the voltage across the motor terminals, it is possible to drive the motor at different speeds. You can reverse the direction of rotation by reversing the polarity of the voltage applied to the motor power terminals (by swapping the + and leads at the motor). Ensure that there are no wires laying over any rotating parts. Set the programmable power supply s current to 2A and the voltage to 0 V to start. Make use of the Output On/Off button on the programmable power supply to start and stop your motor. With the motor stationary, the output of the gain and shift circuit should be roughly 1.5V. With positive velocity it should decrease toward 0V and with negative velocity it should increase toward 3V. Observe the waveform generated by the spinning potentiometer on the oscilloscope. You can measure the rotational speed of the motor by measuring the frequency of the sawtooth waveform on the oscilloscope. Select Measure Time Frequency to display an automatic reading of the motor s speed in Hz. For the motor voltages listed below, record the gain and shift output voltage as well as the motor speed in RPM. Motor Voltage (V) -12-10 -8-6 0 6 V out (mv) Motor Speed (RPM) ME 461 3

8 10 12 Plot the data (RPM vs. V out (mv)) in Excel or Matlab and fit it with a linear trend-line. Record the slope of the line (in RPM per millivolts) and y intercept below. RPM = (RPM/mV)*Millivolts + The published gain for this tachometer is 3V/1000rpm. Does your gain (the slope above) make sense given that it has gone through your gain and shift circuit? Check the values with your TA. Modify your program to print the speed of the motor in RPM to the terminal window using integers/longs only. Demonstrate to your TA for several positive and negative applied motor voltages. Exercise 4: First, disconnect all the wires connecting the ±12V supply to your board and to the motor s potentiometer. You are done using the ±12V supply and the op-amp board so cut the wires connecting op-amp board to your microcontroller board. Solder a banana jack to your board that connects to Vcc (you could use the same wire that connect Vcc to the op-amp board). You are going to be powering the motor s potentiometer with your board s Vcc in this section and following sections. Also make sure a banana jack is soldered to ADC channel 2 (A2) and a black banana jack is connected to ground (from Lab 4). Wire the pins of a 1-by-5 male header to your board in the following fashion: 1 Digital I/O pin; 2 Not connected; 3 Timer B1; 4 ADC channel 6 (A6); 5 GND. ADC channel 6 must also be connected to GND through a 2.2-3.0 kω resistor. In the previous exercises, you learned how to calibrate and use the tachometer to measure angular speed of the motor. Now, you are going to calibrate the potentiometer to measure angular position. Connect the output of the potentiometer to ADC channel 2 s banana jack, but this time power the potentiometer with the board s V CC and GND. Write a program to display the millivolts read on ADC10 channel A2. Ask your TA to attach a weighted link to the motor s output shaft. Rotate the link to three angles: +90 o, 0 o, and -90 o relative to the vertical and record the potentiometer voltage. Link Angle (degrees) -90 0 90 V pot (mv) Plot the data (Link Angle vs. V pot ) and determine the best-fit line that relates angle to potentiometer voltage. Fill in the parameters in the equation below. ME 461 4

θ = V pot + (degrees) Change your MSP430 program to display the angular position (in degrees) of the link attached to the motor. Demonstrate to your TA. Exercise 5: Until now, you have driven the DC motor by varying the supply voltage. However, as you learned in lecture, it is possible to exploit the baseband characteristics of PMDC motors to control them. In this exercise, you are going to use the National Semiconductor LMD18200 H-bridge module to control the motor with a PWM signal. Connect the HP programmable power supply to the power supply jacks on the H-bridge but do not turn it on yet. Connect the OUT1 and OUT2 leads on the H-bridge to the motor+ and motor jacks. Connect your 5-pin header to the female jack on the H-bridge (GND to GND). Keep the potentiometer connected to ADC channel 2. Leverage the code you wrote in Lab 2 to develop a program for outputting PWM signals to the H- bridge. Set the PWM frequency to 20kHz. Use two of the four switches to control the duty cycle in the following manner: both off 0% duty cycle; both on 50% duty cycle; switch 1 on 17% duty cycle; switch 2 on 33% duty cycle. Use a third switch to control the state of the digital I/O pin wired to the Direction input on the H-bridge. You do not need to use pin interrupts for the switches in this case; simply read P2IN in the TimerA0 ISR or elsewhere in your program. Maintain your code from exercise 2 sampling A2 and displaying the angular position in degrees. Load the program onto your microcontroller. After you verify your wiring with your TA, turn on the HP power supply and set the current to 4A and the voltage to 12V. Press the switches in different combinations and observe as the link moves to each static equilibrium state. Also observe the angle reading in the terminal window. Demonstrate to your TA. Exercise 6: In this exercise, you will develop another method for estimating the static position of the linkage. You determined the equation for static equilibrium of the motor plus linkage in Prelab 5 and found that the torque applied to the motor by the linkage arm (gravity) was balanced by the torque applied to the linkage arm by the motor. τ L θ Linkage free-body diagram ME 461 5

Recall that motor torque τ m = K m i m. As you know from prelab 5, the LM18200 H-bridge makes measuring motor current easy because the H-bridge outputs a current on the Sense pin that is proportional to the motor current. Thus, i sense = K sense i m. If a resistor is connected between the Sense pin and GND, the voltage across the resistor can be measured by the ADC on the MSP430F2272 and used to determine the Sense current: V sense = R sense i sense. You used this knowledge in the homework to show that the Sense voltage is linearly proportional to the sine of the linkage angle: V = Ksin θ, sense where K is a constant that lumps together the relevant physical parameters (i.e., K sense, R sense, mass m, acceleration due to gravity g, length L, and motor constant K m ) responsible for the static response of this system. As you might have guessed, you are going to estimate the lumped parameter in the above equation using data measurements. Attach the DMM or oscilloscope to A6 to measure the Sense voltage. Configure the pin as an input (digital or analog, for now) so that it is high-impedance, but do not worry about sampling the channel yet (you have not yet learned how to sample multiple ADC channels and we still need to sample the potentiometer). Load the program to your MCU. Send several duty cycle commands to your motor using the three switches and record the resulting angles from the terminal window and Sense voltages from the DMM or oscilloscope. Direction Duty Cycle 50% Link Angle (degrees) V sense (V) Forward 33% 17% 0% 17% Reverse 33% 50% Plot sinθ vs. V sense and θ vs. V sense on the same plot. Notice that for small angles, θ (in Radians) is a good approximation of sinθ. Determine the slope of the sinθ vs. V sense plot and record it below. Also plot V sense vs. duty cycle and record the slope below. Check with your TA. sinθ = V sense V sense = duty cycle (V) The equation you just found for link angle is called a grey-box model because it is based on physical laws and parameters, but it does not explicitly identify all of the physical parameters. ME 461 6

Modify your microcontroller program to sample the voltage across the Sense resistor (comment out the previous configuration; you will need it again). Use the model you found and the assumption that θ is small to estimate the link angle from the motor current. Print the link angle to the terminal. Demonstrate to your TA as you vary the input with the switches. Exercise 7: Now, modify your program so that instead of specifying a duty cycle with the switches, you specify an angle in [-40, +40 ]. Then, in your program, calculate the duty cycle required to produce that angle by using the equations you found in exercise 6. Send that duty cycle to the H-bridge. Additionally, revert back to sampling the potentiometer reading. Print the angle command from the switches next to the angle measured from the potentiometer reading. With your hand, simulate the effect of adding extra weight to the linkage by gently pressing downward on the suspended link. What happens to the angle reading and the command? Set the angle command to 0 o and move the linkage. What happens to the angle reading and command? Explain this discrepancy to your TA. You have just observed the motivation for closed-loop control and sensor feedback. Open-loop control is sensitive to both disturbances and parameter uncertainty. Also, if you compare your results to those of your lab mates, you will likely recognize that the identification procedure must be performed on an individual basis. This is another drawback of open-loop control; closed-loop control allows for some model variation. You will learn more about closed-loop control in future labs. What do you think some advantages of the current-sensing configuration might be? Hint: think cost, size, and sensor reliability. ME 461 7