CSE 3215 Embedded Systems Laboratory Lab 5 Digital Control System

Similar documents
COSC 3215 Embedded Systems Laboratory

Sensors and Sensing Motors, Encoders and Motor Control

ME 461 Laboratory #5 Characterization and Control of PMDC Motors

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

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

Procidia Control Solutions Dead Time Compensation

Experiment 9. PID Controller

PYKC 7 March 2019 EA2.3 Electronics 2 Lecture 18-1

Lecture 2 Exercise 1a. Lecture 2 Exercise 1b

EE 308 Lab Spring 2009

EE 461 Experiment #1 Digital Control of DC Servomotor

Lab 11. Speed Control of a D.C. motor. Motor Characterization

Experiment 9 : Pulse Width Modulation

COMPARISON OF TUNING METHODS OF PID CONTROLLER USING VARIOUS TUNING TECHNIQUES WITH GENETIC ALGORITHM

International Journal of Research in Advent Technology Available Online at:

TC LV-Series Temperature Controllers V1.01

DC Motor Speed Control using PID Controllers

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

EE 4314 Lab 3 Handout Speed Control of the DC Motor System Using a PID Controller Fall Lab Information

Sensors and Sensing Motors, Encoders and Motor Control

Rotational Speed Control Based on Microcontrollers

Exercise 5: PWM and Control Theory

Lab 5 Timer Module PWM ReadMeFirst

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

Voltage Current and Resistance II

Figure 1: Unity Feedback System. The transfer function of the PID controller looks like the following:

Different Controller Terms

Digital Control of MS-150 Modular Position Servo System

Analog-to-Digital Converter. Student's name & ID (1): Partner's name & ID (2): Your Section number & TA's name

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

OVEN INDUSTRIES, INC. Model 5C7-362

Lab 23 Microcomputer-Based Motor Controller

PID Controller tuning and implementation aspects for building thermal control

T6+ Analog I/O Section. Installation booklet for part numbers: 5/4-80A-115 5/4-90A-115 5/4-80A /4-90A-1224

Chapter 3 : Closed Loop Current Mode DC\DC Boost Converter

MEM380 Applied Autonomous Robots I Winter Feedback Control USARSim

GE 320: Introduction to Control Systems

Lab 2, Analysis and Design of PID

Configuration Example of Temperature Control

University of Texas at El Paso Electrical and Computer Engineering Department

RC Circuit Activity. Retrieve a power cord and a voltage sensor from the wire rack hanging on the wall in the lab room.

DC SERVO MOTOR CONTROL SYSTEM

CHAPTER 4 FUZZY LOGIC CONTROLLER

Feedback Systems in HVAC ASHRAE Distinguished Lecture Series Jim Coogan Siemens Building Technologies

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

UNIVERSITY OF JORDAN Mechatronics Engineering Department Measurements & Control Lab Experiment no.1 DC Servo Motor

Motor Control. Suppose we wish to use a microprocessor to control a motor - (or to control the load attached to the motor!) Power supply.

Feb. 1, 2013 TEC controller design experts offer tips to lower the cost and simplify the design of the devices, and to increase their ease of use.

UNIVERSITY OF CALIFORNIA, DAVIS Department of Electrical and Computer Engineering. EEC 180A DIGITAL SYSTEMS I Winter 2015

Introduction to the Op-Amp

Optimal Control System Design

Motomatic Servo Control

Ver. 4/5/2002, 1:11 PM 1

7 Lab: Motor control for orientation and angular speed

-binary sensors and actuators (such as an on/off controller) are generally more reliable and less expensive

Design of PI controller for Positive Output Super- Lift LUO Converter

The DC Machine Laboration 3

EE 233 Circuit Theory Lab 3: First-Order Filters

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

Report on Dynamic Temperature control of a Peltier device using bidirectional current source

IMPLEMENTATION AND DESIGN OF TEMPERATURE CONTROLLER UTILIZING PC BASED DATA ACQUISITION SYSTEM

2.017 DESIGN OF ELECTROMECHANICAL ROBOTIC SYSTEMS Fall 2009 Lab 4: Motor Control. October 5, 2009 Dr. Harrison H. Chin

DEPARTMENT OF ELECTRICAL AND ELECTRONIC ENGINEERING BANGLADESH UNIVERSITY OF ENGINEERING & TECHNOLOGY EEE 402 : CONTROL SYSTEMS SESSIONAL

The Discussion of this exercise covers the following points: Angular position control block diagram and fundamentals. Power amplifier 0.

LABORATORY EXPERIMENT. Infrared Transmitter/Receiver

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

ME375 Lab Project. Bradley Boane & Jeremy Bourque April 25, 2018

University of Portland EE 271 Electrical Circuits Laboratory. Experiment: Digital-to-Analog Converter

INTERFACING WITH INTERRUPTS AND SYNCHRONIZATION TECHNIQUES

EE 308 Spring Preparation for Final Lab Project Simple Motor Control. Motor Control

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

EE 233 Circuit Theory Lab 2: Amplifiers

STATION NUMBER: LAB SECTION: RC Oscillators. LAB 5: RC Oscillators ELECTRICAL ENGINEERING 43/100. University Of California, Berkeley

Introduction to Digital Control

Design of PID Control System Assisted using LabVIEW in Biomedical Application

CCD temperature control. CTIO 60 inches Chiron CHI60HF 4.1

EXPERIMENT 6 CLOSED-LOOP TEMPERATURE CONTROL OF AN ELECTRICAL HEATER

CHAPTER 2 PID CONTROLLER BASED CLOSED LOOP CONTROL OF DC DRIVE

University of California at Berkeley Donald A. Glaser Physics 111A Instrumentation Laboratory

Optimizing Performance Using Slotless Motors. Mark Holcomb, Celera Motion

Experiment Of Speed Control for an Electric Trishaw Based on PID Control Algorithm

ENGS 26 CONTROL THEORY. Thermal Control System Laboratory

InstaSPIN-BLDC Lab. DRV8312 Setup Jumpers and switches must be setup properly or the kit will not function correctly!

Experiment 5.A. Basic Wireless Control. ECEN 2270 Electronics Design Laboratory 1

CCD temperature control. CTIO 60 inches Echelle ECH60HF 4.1

Introduction to BLDC Motor Control Using Freescale MCU. Tom Wang Segment Biz. Dev. Manager Avnet Electronics Marketing Asia

Example KodeKLIX Circuits

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

Introduction To Temperature Controllers

TODO add: PID material from Pont slides Some inverted pendulum videos Model-based control and other more sophisticated

EE 482 : CONTROL SYSTEMS Lab Manual

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

CHAPTER 7 HARDWARE IMPLEMENTATION

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

1. Consider the closed loop system shown in the figure below. Select the appropriate option to implement the system shown in dotted lines using

ADVANCED DC-DC CONVERTER CONTROLLED SPEED REGULATION OF INDUCTION MOTOR USING PI CONTROLLER

Lock Cracker S. Lust, E. Skjel, R. LeBlanc, C. Kim

Temperature Monitoring and Fan Control with Platform Manager 2

Automate. Hardware: Software: 1. Somove Lite V (or latest version available) for drive configuration optional

AN EXPERIMENTAL INVESTIGATION OF THE PERFORMANCE OF A PID CONTROLLED VOLTAGE STABILIZER

Transcription:

Introduction CSE 3215 Embedded Systems Laboratory Lab 5 Digital Control System The purpose of this lab is to introduce you to digital control systems. The most basic function of a control system is to take a measurement of the current state, and through a combination of software and hardware drive a system to the desired state. Advanced control theory is quite complex and relies on advanced mathematical techniques. In this lab we will analyze a simple first order thermal system and learn how to implement a feedback controller. Figure 5.1 Temperature control system CSE 3215 Winter 2011 Lab 5 1

Your task will be to design a PI (Proportional, Integral) control based temperature controller using the Dragon12 board that will maintain the temperature of an object at 24+/-0.1 C. Figure 5.1 shows a block diagram of control system for our temperature control process. Control Systems A control system is a system, electrical, mechanical or otherwise designed to maintain a process variable (for instance the speed of a motor, temperature in a boiler, ). A feedback control system has a means of varying the process variable, and some method of determining the current value of the process variable (a feedback signal). The feedback signal is compared to the desired value of the process variable ( the set point ) and used to adjust the process variable to reduce the error between desired and actual value of the variable. Our temperature controller attempts to maintain a set point temperature in a block of aluminum despite the fact that it is being heated by a resistive heater. This is analogous to the problem of maintaining acceptable CPU temperatures based upon measurements of package temperature. The controller uses an electrical heater/cooler known as a Peltier Cooler to vary the temperature of the block of aluminum. A semiconductor temperature sensor, the AD592, is thermally coupled to the aluminum block to determine the current value of the process variable, the temperature. A typical block diagram of a control system in its simplest form is shown in Figure 5.2. Figure 5.2 Typical plant process control system A control system can be classified by how it quickly it can respond to a change in set point (or to an outside disturbance). The system is critically damped when the system response to a step change in the set point is quick with no oscillations. The system is said to be over damped when the response to the change is slow compared to the natural response of the plant process. The system is under damped when, although CSE 3215 Winter 2008 Lab 5 2

the response to the change is quick, the process variable overshoots and oscillates around the set point before finally settling down. The purpose of the PI controller is to tune the system to a point where the response is quick and with minimal overshoot and oscillations. PI Controller Mathematically a PI controller can be represented as: The pseudo code for the above PI equation can be as follows: Begin Define set point: Θ set Do Forever Measure system output: y(t) Calculate the error: e(t) = Θ set y(t) Calculate the Integral term: p(t) = K I e(t) + p(t-1) Calculate the PID output: u(t) = K P e(t) + p(t) Update Control variable Save variable: p(t-1) = p(t) End End Do Here t represents time. The time difference between t-1 and t is the sampling interval. CSE 3215 Winter 2011 Lab 5 3

Design Specification The program must function as follows: 1. The temperature controller has an adjustable setting from 20.0 C to 28.0 C with a default setting of 24.0 C. VR2 on the Dragon12 is used to vary the set point. 2. The temperature is monitored continuously using channel 6 of the onboard ATD converter and displayed on the 4-Digit 7-Segment display. Pressing push-button SW2 displays the set point temperature. 3. The temperature is controlled by varying the current through the Peltier Cooler using the pulse width modulated output (channel 7) of the HCS12. Peltier Coolers are semiconductor devices that transfer heat from one surface to the other when supplied with a current. Pre Lab Develop a program according to the design specifications. The software can be readily decomposed into functional components: 1) Temperature measurement. 2) Peltier Cooler current control. 3) Temperature and set point display. 4) Set point adjustment. 5) Temperature control. 1. The output of the temperature sensor-conditioned amplifier (hardware provided in the lab) must be connected to the ATD channel 6 of Dragon12. The ATD must be configured as 10-bit unsigned (input signal range between 0 and 5.12 Volts). The digitized voltage code is (V 0 ). Develop your temperature control program to read the voltage level on ATD channel 6 under interrupt, convert it to ºC and display the temperature value precise to 0.1ºC on the 4-Digit 7-Segment display, again under interrupt. You should average several readings to get smoother measurements. Note the temperature in degrees Celsius is calculated as follows: T = V 0 /10. 2. Varying the current through the Peltier Cooler controls the temperature. Setup your control program to output a free 118 Hz signal on PWM channel 7. Adjusting the duty cycle of this signal (e.g. between 0% and 50%) controls the current. 3. The actual temperature and the set point are both displayed on the four-digit 7- segment display. The default display is the actual temperature. The set point is displayed while actuating the momentary switch SW2. 4. The set point is adjustable from 20.0 C to 28.0 C. Design your program to adjust the set point using the potentiometer VR2 on the DRAGON12 display. Once again you CSE 3215 Winter 2008 Lab 5 4

should average several readings using the ATD peripheral and get smoother measurements. (Hint: one possibility is to have a timer that gives an interrupt every 1 ms to time the display update. After n display updates (where n depends on your sampling period), you could initiate an ATD conversion that will generate an interrupt upon completion. You could maintain a counter in the timer ISR, to keep track of the number of display updates and thus know when to do the conversions. The mainline can concentrate on controlling the temperature without having to worry about the details). 5. The main function of your temperature control module is to sample the temperature at a regular interval, and use the measured temperature values to update the PWM duty cycle. Implement a method of generating the sampling interval, and perform the PWM duty cycle calculations based on the algorithm for the Parallel PI controller. ( Hint: A sampling period of 3 seconds seems to work well.) 6. Read the lab procedure. You will be making several measurements to characterize the devices used. You should develop code and strategies to facilitate this process. You should also develop your software so that you can test all the functional components separately. In Lab Note: Ensure that you are wearing your antistatic wrist strap prior to handling the DRAGON12 board. Failure to do so could result in severe damage to the DRAGON12. Make appropriate notes and answer all questions clearly in your lab book. The Connection diagram is shown in Fig. 5.1.A. For the heater and thermolelectrical (Peltier) cooler the two regulated sections of PS-3330 power supply are used. Observe the polarity connections for the battery power supply and the Peltier cooler. Adjust the voltage to the heater by measuring it directly on the heating resistor using a digital voltmeter. Adjust the current through the Peltier cooler using the panel amperemeter of the PS-3330 at 50% duty cycle of the PWM control signal. CSE 3215 Winter 2011 Lab 5 5

Fig. 5.3. Connection diagram Part 1 Measuring the Open Loop Response 1. Have your prelab assignments approved by the T.A. prior to commencing the lab. 2. Once you have approval from the T. A. to continue, download and debug your assembled or compiled programs. Once you feel comfortable that your programs are working move on to the experiments below. Before making any electrical connections turn ON the power supply PS-3330 and verify that the two sections are in Independent mode. Adjust initially the voltage for the heater at O V and the voltage for Peltier cooler CSE 3215 Winter 2008 Lab 5 6

at about 3 V. Put the current limit dial for the Peltier cooler at middle position. Turn OFF the PS-3330 power supply. Make all connections according to Fig. 5.3. 3. Verify your PWM frequency is 118 Hz and adjust the duty cycle to 50%. The pulse amplitude must be no less than 4.3 V. 4. Turn ON the power supply of the fan and the PS-3330. Adjust the current through the Peltier cooler to 1.3 A by gradually increasing the voltage. Ensure the power supply is not going into current limiting. Note this voltage. Wait for a few minutes the temperature measured by the temperature sensor to stabilize and note the temperature. 5. Set the PWM duty cycle to 0%. Verify that the current through the Peltier cooler is zero. 6. Adjust the voltage to the power resistor, the heat source, to give a steady state temperature of the device of 34.00 C. The approximate voltage on the heat source s power supply is listed in Table 5.1 for each device number. 7. Once you have attained a stable temperature vary the PWM duty cycle between 0% and 50% using the (e.g. using the DIP switch onboard DRAGON12). Measure the temperature/duty-cycle relationship of at least eight different duty cycles. a. What type of relationship was there between duty cycle and temperature? b. Was there any indication of hysteresis? 8. Using your observations above implement an open loop controller (i.e. mapping from VR2 set point to PWM output) that attempts to set the temperature of the aluminum block as close as possible to 24 C. Demonstrate your controller to the TA. Part 2 Implement the Closed Loop PI controller 1. Adjust the set point using the potentiometer VR2 to setting of 24.0 C. Pressing SW2 should toggle the 7 segment display between the set point and the actual temperatures. 2. Tune the Proportional and Integral gain constants of your program, using the details provided below to bring the actual temperature of the aluminum block to 24.0 C. Let the temperature stabilize. 3. Make an adjustments to the set point and measure the temporal response of your controller to this change. Demonstrate your system to the TA. Evaluation CSE 3215 Winter 2011 Lab 5 7

This is a two-week lab; there will be no grade for week 1 unless you have completed the entire lab. You must demonstrate a working version of your code to the lab demonstrator (note this means you must show convincing evidence that it works) and have acceptable written documentation about your programs performance. You should be able to answer questions about the program, the use of the test equipment and your test and debugging techniques. The performance of your controllers and the results of the lab experiments should be neatly and fully documented and you should be prepared to answer questions about these results. Reference Reading PWM user s guide Enhanced Capture Timer user s guide (S12ECT16B8V1.pdf) ATD Converter user s guide (S12ATD10B8CV2.pdf) Data Sheets for Analog devices AD592AN Temperature Sensor(AD592.pdf) Dragon12 schematics Unit Number 34 C Power Setting (V) (nominal) 1 10.5 2 10.7 3 12.7 4 13.8 5 9.5 6 13.5 Table 5.1: Resistive Heater Power Settings. Note these are nominal values. Hints Temperature Measurement The quickest way to measure the temperature and the temporal response is to send the temperature readings to the console using the DeBug12 PutChr function at a known time interval. This information can then be copied or logged from the HyperTerminal CSE 3215 Winter 2008 Lab 5 8

communications window and pasted into MatLab (preferred) or OpenOffice. Subsequent graphs can be drawn in either program. The temperature sensor and the cooler have a long thermal time constant. Remember to allow some time for settling when doing your measurements. Tuning the PI controller Figure 5.2 shows the transient response of the temperature controller for certain values of K P and K I. Your PI controller will attempt to reduce the rise time and overshoot while trimming down the steady state error to within 0.1 C of the set point (24 C). Figure 5.2 Transient response Procedure 1.Unit Step Set the temperature of the aluminum block to 30 C. Let the temperature stabilize then start your PWM with duty cycle set to 50%. Measure the transient response of the temperature controller (See the Hints section of the lab document on how to do this). Collect data till the response stabilizes. Use Matlab to graph temperature change vs time, your graph should resemble figure 5.3. From the numerical values or by observing CSE 3215 Winter 2011 Lab 5 9

the graph determine approximately the point of inflection for the response. Draw a tangent to the curve at the point of inflection (again approximately, you can use Insert->Line from the toolbar in Matlab to do this) and determine T and L as shown in Figure 5.3. Set the initial value of K P as 0.9 (T / L) and K I as 0.27 (T / L 2 ). tangent at point of inflection point of inflection Figure 5.3 Transient response for unit step 2.Tuning the proportional gain (K P ) The proportional term K P e(t)dt sets the system response directly proportional to difference (the error e(t)) between the measured temperature and the set point. Table 5.2 describes the effect of K P on the system. To tune K P to get the desired system response, start with K I set to zero and with K P initialized to the value computed in the unit step. Start your program and observe the response. If the rise-time is too slow increase K P by factors of 10, if it is oscillating too much or the overshoot is large, decrease by factors of 10. Adjust K P to the point where where the transient just starts to oscillate about the set point and then reduce its value gradually by factors of 2 till the response settles down with a reasonably small steady state error. CSE 3215 Winter 2008 Lab 5 10

3.Tuning the integral gain (K I ) The integral term K I e(t)dt provides a contribution proportional to the amount of time the error has been present and helps eliminate the steady state error. To tune K I, initialize it to the value you determined in the unit step. With K P fixed, vary the integral gain K I gradually, using table 5.2 as a guide. You should be able to find a K I that gives you the desired result without too much overshoot or oscillations. PI controller response characteristics The following table summarizes the effects of increasing the proportional and integral gains: Gain Rise time Overshoot Settling time Steady-state error K P decreases increases no significant effect decreases Table 5.2 K I decreases increases increases eliminated if tuned correctly References: [1] Van de Vegte J., Feedback Control Systems (Prentice Hall Inc., 1994) [2] http://www.embedded.com/2000/0010/0010feat3.htm CSE 3215 Winter 2011 Lab 5 11