temperature control for hatching chicks

Upload: uma-mageshwari

Post on 03-Apr-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/28/2019 Temperature Control for Hatching Chicks

    1/11

    Temperature Control for Hatching Chicks

    2005 - 2008 Emant Pte Ltdwww.emant.com

    LabVIEW is a registered trademark of National Instruments

  • 7/28/2019 Temperature Control for Hatching Chicks

    2/11

    Table of ContentsTable of Contents.................................................................................................................2Objective..............................................................................................................................3Prerequisite.......................................................................................................................... 3

    Part List................................................................................................................................3Problem................................................................................................................................4Solution................................................................................................................................4PID Control..........................................................................................................................5Thermistor............................................................................................................................5Heater...................................................................................................................................6Build the circuit....................................................................................................................6Front Panel...........................................................................................................................9Block Diagram................................................................................................................... 10End of Exercise.................................................................................................................. 11

    Jul 2008 2005 - 2008 Emant Pte Ltd www.emant.com 2

    http://www.emant.com/http://www.emant.com/
  • 7/28/2019 Temperature Control for Hatching Chicks

    3/11

    Objective

    Learn Interfacing Electronics to the USB Data Acquisition Module.

    Control Lamp output using PWM (Pulse Width Modulation)

    Using PID VI

    Prerequisite

    Must be familiar with Data Acquisition and LabVIEW (preferably have completed the

    exercises in the Build the Light Intensity Logger instructional guide) Basic electronics (simple resistor and transistor circuits preferably have

    breadboarded simple circuits before)

    You should have the following folderPID Temperature Control. It can be copied fromthe CD or downloaded from www.emant.com

    Part List

    EMANT300 Low Cost USB DAQ module Protoboard or Solderless BreadBoard R1 1.5K W resistor RT1 Thermistor 10K NTC Q1 MPSA13 Darlington

    R2 22ohm 3W resistor R3 220 W resistor D1 LED

    LabVIEW Development System ver 7.0 or later

    Warning: The information described is for instructional use only and is not intended forindustrial purposes.

    Jul 2008 2005 - 2008 Emant Pte Ltd www.emant.com 3

    http://www.emant.com/http://www.emant.com/
  • 7/28/2019 Temperature Control for Hatching Chicks

    4/11

    Problem

    Peter was asked by his science teacher to incubate a few chicks for a science project.After searching through some websites, he found the following information:

    Maintain the temperature in the 37.2-38.2 C temperature range (37.7-38.3 C, if possible).Overheating the embryo is much more damaging than is under heating it; overheatingspeeds up embryo development, lowers the percentage of hatchability, and causesabnormal embryos. Long periods of low temperatures will reduce the rate of embryodevelopment. Excessively low temperatures will kill the embryos. Avoid temperaturesoutside the 36.1-39.4 C. range. If the temperature remains beyond either extreme forseveral days, hatchability may be severely reduced.

    Can you help Peter?

    Solution

    One way to heat up the incubator would be to use a heating element. However, it isdifficult to keep the temperature fairly constant using a lamp without some form ofcontrol. In our exercise, we will make use of a 22ohm 3W resistor to simulate the heatingelement.

    A basic control solution comprises the following

    We measure the temperature using a thermistor and heat up the incubator using a lamp.We will use the proportional (P), the integral (I), and the derivative (D) controls (PIDControl).

    Jul 2008 2005 - 2008 Emant Pte Ltd www.emant.com 4

    http://www.emant.com/http://www.emant.com/
  • 7/28/2019 Temperature Control for Hatching Chicks

    5/11

    PID Control

    First, let's take a look at how the PID controller works in a closed-loop system using theschematic shown above. The variable (e) represents the tracking error, the differencebetween the desired input value (R) and the actual output (T). This error signal (e) is sent

    to the PID controller. The signal (u) output from the controller is equal to the proportionalgain (Kp) times the magnitude of the error plus the integral gain (Ki) times the integral ofthe error plus the derivative gain (Kd) times the derivative of the error.

    Kp = Proportional gain

    Ki = Integral gain

    Kd = Derivative gain

    This signal (u) will be sent to the lamp, and the new output (T) will be obtained. This newoutput (T) will be sent back to the sensor again to find the new error signal (e). Thecontroller takes this new error signal and computes its derivative and its integral again.This process goes on and on.

    A proportional controller (Kp) will have the effect of reducing the rise time and willreduce, but never eliminate, the steady-state error. An integral control (Ki) will have theeffect of eliminating the steady-state error, but it may make the transient response worse.A derivative control (Kd) will have the effect of increasing the stability of the system,reducing the overshoot, and improving the transient response.

    ThePID.vi has already been created for you. Go to thePID Temperature Controlfolder

    and open PID.vi Study the VI if you wish. It is basically our LabVIEW implementationof the above formula.

    Thermistor

    Thermistors are widely used because of their sensitivity, small size, ruggedness and lowcost. Thermistors have an electrical resistance that varies non-linearly with temperature.The Resistance -Temperature characteristics of most thermistors can be described by theSteinhart-Hart equation:

    1/T = A + B*(Ln RT) + C*(Ln RT)3

    RT is the resistance of the Thermistor, T is the absolute temperature (in Kelvin) and A, B,and C are constants which can be determined by measuring three sets of resistance andtemperature values during calibration.

    Most thermistors have a negative temperature coefficient (NTC), their resistancedecreases with increasing temperature. Thermistors are specified according to its nominal

    Jul 2008 2005 - 2008 Emant Pte Ltd www.emant.com 5

    http://www.emant.com/http://www.emant.com/
  • 7/28/2019 Temperature Control for Hatching Chicks

    6/11

    resistance at 25 oC and commonly available thermistors range from 250 ohms to 100kohmsThe thermistor that we are using has the following characteristics

    Nominal resistance @ 25 oC: 10 kohms

    negative temperature coefficient (NTC)

    As the DAQ module Analog Input measures only voltage, we will need to provide acurrent source to convert the resistance to voltage. We will use the 8 bit current DAC(digital to analog converter) and set the current to 100uA.

    As the thermistor VI has been already developed and explained in the application note

    Measuring Temperature using Thermistor, we will use the sub VI Temp ControlThermistor.VI

    Heater

    We will be using a 22ohm 3W resistor to act as the heatingelement. To reduce the heat from the electronics, we willdrive the resistor by PWM (Pulse Width Modulation) using adarlington NPN transistor.

    A PWM circuit works by making a square wave with avariable on-to-off ratio; the average on time may be variedfrom 0 to 100 percent. In this manner, a variable amount of

    power is transferred to the load.

    The main advantage of a PWM circuit over a power amplifier is the efficiency. At a 50%

    level, the PWM will use about 50% of full power, almost all of which is transferred to theload.

    The darlington transistor is used over a regular NPN transistor to reduce the currentoutput requirement of the digital output.

    Build the circuit

    Construct the following circuit either using a solderless breadboard or a protoboard.

    Parts List

    R1 1.5K W resistorRT1 Thermistor 10K NTCQ1 MPSA13 DarlingtonR2 Heating Resistor 22 ohm 3W

    Optional ComponentsR3 220 W resistorD1 LED

    Jul 2008 2005 - 2008 Emant Pte Ltd www.emant.com 6

    http://www.emant.com/http://www.emant.com/
  • 7/28/2019 Temperature Control for Hatching Chicks

    7/11

    Connection diagram

    Circuit constructed using ProtoBoard

    Jul 2008 2005 - 2008 Emant Pte Ltd www.emant.com 7

    http://www.emant.com/http://www.emant.com/
  • 7/28/2019 Temperature Control for Hatching Chicks

    8/11

    1. DO NOT CONNECT THE EMANT300 TO THE USB PORT YET.

    2. Connect the components. Take note of the connections for the transistor. Connectthe 22 ohm load resistor and thermistor in a way that they make good thermal

    contact.

    3. Connect to the EMANT300. If you are using the Light Application Adaptor.PWM, IDAC, AIN3, VDD, GND are available as screw terminals.

    Note: If you are using the Light Application Adaptor, REFIN- is alreadyconnected to AGND. If you are connecting directly to the EMANT300, it isimportant that this connection is made, otherwise your analog input measurementswill be wrong. This connection allows the internal reference to be connectedcorrectly. Also in the Light Application Adaptor, AINCOM is already connectedto AGND.

    4. Connect the EMANT300 to the USB port.

    5. Open Temperature Control for Hatching Chicks.vi from thePID TemperatureControlfolder. You will use this VI to verify that your circuit is built correctly.

    Jul 2008 2005 - 2008 Emant Pte Ltd www.emant.com 8

    http://www.emant.com/http://www.emant.com/
  • 7/28/2019 Temperature Control for Hatching Chicks

    9/11

    Front Panel

    Jul 2008 2005 - 2008 Emant Pte Ltd www.emant.com 9

    http://www.emant.com/http://www.emant.com/
  • 7/28/2019 Temperature Control for Hatching Chicks

    10/11

    Block Diagram

    1. The VI first configures the EMANT300 to use the PWM output rather than thecounter.

    2. The sub VI Temp Control Thermistor.VIreturns the temperature in Celsius asmeasured by the thermistor.

    3. In normal operation, this measured temperature value is then compared with the setvalue to generate the PID output.

    4. The PID output is between 0 to 100% and is used to drive the PWM output.

    5. The VI also allows you to control the heater output manually by setting the manualoverride. Note that setting the PWM output to 0 turns off the heater and 100 turns onthe heater completely.

    6. One way to check the your circuit is to observe the temperature when you change thePWM output. The temperature should change. If you have connected the optionalLED, the LED intensity should also change as you adjust the heater output.

    7. As the load resistor is not designed to be a heating element, you may not be able toheat up the area around the thermistor to above 38 C (this will depend on theenvironment of the room you are working in).

    8. Click the Run button to run the VI.

    9. Switch the Manual Override down. This will set the heater output to manual override.When you change the manual heater setting dial, the gauge output and the LED

    Jul 2008 2005 - 2008 Emant Pte Ltd www.emant.com 10

    http://www.emant.com/http://www.emant.com/
  • 7/28/2019 Temperature Control for Hatching Chicks

    11/11

    intensity will change. If you observe the LED intensity changing,your circuit isconnected OK.

    10.Set the PWM to 0. Call the temperature measured Tamb. Set the PWM to 100. Call thetemperature measured Tmax.

    11.Observe the temperature reading, is it giving the correct values? If yes, then you areready to set the temperature and put the heater under PID Control. Set the controltemperature between Tamb and Tmax that you measured earlier. Use the P, I and Dvalues as shown in the front panel.

    12.You can experiment with different set points as well as different PID values. Tounderstand how to set the PID values is outside the scope of this exercise butinformation on PID tuning is readily available from the web or textbooks on control.

    13.Press to stop the VI.

    End of Exercise

    Jul 2008 2005 - 2008 Emant Pte Ltd www.emant.com 11

    http://www.emant.com/http://www.emant.com/