El Producto Temperature Controller



Introduction - The El Producto Beamline is equiped with a thermo-electrically controlled sample stage. The stage holds X-ray capillary mounted samples and permits their temperature to routinely be ranged from -40C to 150C. With slight modifications sample temperatures can be controlled from -60C to 250C. Sample temperature, Tsample, is accurate to roughly 0.05C. Sample temperature may be remotely set via TV6, the current X-ray data acquisition software.
 
 

Details about the system are contained in the sections below,

Temperature Control Schematic
Controlling the Temperature From TV6
Tuning the PID Controller
Progamming the Melcor Controller
Current Performance of Stage
Current Settings on Melcor Controller
Thermo-electric Element
RTD Sample Thermometer
Measuring Thermo-electric Response
Measuring Thermal Lag
Temperature Calibration
Synopsis of TV6-Melcor Interaction
Additional Resources



Temperature Control Schematic -

Figure One - Schematic of Temperature Control

Water Cooler - This is a NESLAB ENDOCAL RTE400 water circulation cooler. The mount temperature may comfortably be set from 1C up to about 80C.

Thermo-electric Element - A set of "Ferrotec 95 Series" high temperature thermoelectric elements (International Thermoelectic USA.) control the sample stage temperature. For each element the current limit is 6 Amps, the temperature should not exceed 200C and the maximum heat transfer is approximately 30W.

RTD - This a 100 Ohm Platinum Resistor - model 3105 RTD from Omega Engineering Inc.

Temperature Controller - Series MTCA Thermoelectric Cooler Controller from Melcor Inc.

Beamline Controlling Computer - A Pentium II PC running the lab X-ray data acquisition software, TV6. It uses the RS232 protocol to communicate with the Melcor Controller.
 
 

Controlling the Temperature from TV6 -

Within TV6 two commands are available to communicate with the Melcor controller.

     gtemp - This queries the Melcor controller for the current sample temperature.

             eg. *gtemp

                 The temperature is 40.32C.

     stemp - This sets the desired sample temperature.

             eg. *stemp

                 The temperature is set to 20C.

             or. *stemp 40

                 The temperature is set to 40.0C.

If the Melcor does not know the temperature it returns an error message.

Tuning The PID Controller - Our goal for the controller is that should sit accurately at the set point, rapidly respond to changes in set-point and never overshoot. The PID parameters for adjustment are Tproportional, tintegral and tderivative and they determine the output power according to the equation,

If |Tsample-Tset|>Tproportional the first term is reset and if |Tsample-Tset|>2*Tproportional the third term is neglected. tintegral and tderivative are measured in minutes.  Our tuning method relies on analysing the system's response to a step in set point temperature.

Step One - Set tderivative=0 and tintegral=infinity (zero on the Melcor).

Step Two - Adjust Tproportional so the response to a step in set point temperature is monotonic. If you know the dead time tdead and the Peltier efficiency A (C/s) a good starting point is,

The rate at which the temperature monotonically adjusts to a set point change should be roughly given by,

If Tproportional is too small dead time will cause overshoot or oscillations. When finished, Tproportional should be set to twice the minimum value needed to prevent overshooting. The rate at which the controller responds under proportional signal alone will be the "fast" response of controller when set point change occurs. To ensure stability, the temperature step should be performed at the temperature for which A is at its maximum value.

Step Three - Adjust the integral term, tintegral. Response from proportional control alone leaves the temperature drooping below the set point. Integral action causes a "slow" settling to the set point exactly. The smaller tintegral the faster this response. However, the integral term destabilizes the system from overwinding and dead time overshooting. A hard restraint on tintegral is,

and this should be imposed for the smallest value of A. Overshoot is inevitable with integral action but by adjusting tintegral a tradeoff can be made between "slow" settling time and overshoot on set point changes. At worst, the rate of slow settling time will be,

Step Four - Tweaking the system. The system should respond to a set point change with a rapid movement most of the way to the new set point followed by a slower relaxation into the final value. These rates are given by Equations Three and Five. Under many conditions some overshoot is inevitable. Here are some quick tips.

Changing tintegral - Increasing tintegral increases controller stability but also increases the slow relaxation to each new set point. Decreasing tintegral will tend to worsen overshoot.

Changing Tproportional - Decreasing Tproportional will speed up the rapid response to set points and also improve response to thermal disturbances. It will reduce the risk of overshoot due to integral action, but if decreased too far will cause overshoot through dead-time. Increasing Tproportional decreases the risk of direct overshoot through dead time, but can cause instability due to tintegral. If this is the case, adjusting tintegral by the same factor as Tproportional will solve the problem.

Changing Peltier Efficiency - Only Tproportional should be modified. If Peltier efficiency doubles so should Tproportional.

Changing Dead Time - The dead-time, Tproportional and tintegral are all linearly related. If dead-time increases so must Tproportional and tintegral.

Use the Ramping feature to set maximum temperature scan rates if small overshoot is critical.

Theory behind Tuning - Normal PID tuning assumes that the sample stage response is well characterized by the equation,

where Tbath is the temperature of the bath, B represents the rate at which the sample can thermally equilibrate with the bath, P is the power of the thermoelectric element (where 1 is full heating and -1 full cooling) and A(Tsample) is efficiency of the thermoelectric element. Substituting the controller description of Equation One gives a dual exponential response to disturbances with decay rates of,

if B<<A/Tproportional and tderivative remains as zero (tderivative just slows everything down).

In an ideal PID, tintegral is adjusted so that the surd in Equation Seven is almost zero. Tproportional is set to be as small as possible prior to causing overshooting because of dead-time. Finally, when the set point is changed the temperature is either gradually increased (all integral action) or temperature rate of change is confined below A.(Temperature Change)/(2Tproportional). This prevents overshooting.

Unfortunately this is not feasible for this controller. Firstly, A varies by a factor of ten over the controlled range. There is no way to even roughly approximate critical damping over that range. Instead, at one extremal point the two settling rates will differ by ten times.

Secondly, when a set point change (DT) occurs with this controller, the rate of change of temperature shifts by an amount A DT/ Tproportional. Nomatter what controller settings are selected, the two settling rates are both less than A/Tproportional so overshoot is inevitable. Finally, if the temperature is stepped beyond the width of the proportional band the integral term is set to zero. This makes overshoot inevitable for two of the four possible temperature jumps (cold to less cool and hot to less hot).

Conclusion - Don't waste time fine tuning this PID. It will only be valid for a very narrow temperature range. Also, remember that unless you identify the extremal points of your temperature range, a stable controller in one range will be unstable in another. Low Peltier efficiency makes the system prone to integral overshooting while High Peltier efficiency makes it prone to overshooting through dead-time. Also, be considerate of past users. If you find the system is not working, there should be a good reason. Either the sample stage has undergone significant modification or you are operating in a very different regime to the previous user. At least record their settings and consider why you need to change the controller.

Programming the Melcor Controller - There is a very good description of the temperature controller in Sections 4.2-4.5 of the MELCOR Instruction Manual. Here's a brief synopsis.

The controller has two modes. In MANUAL, you set the output power and the MELCOR monitors the temperature. In AUTO mode you set the temperature set-point and the MELCOR juggles the output power to achieve that.

Input One is the RTD sensor.

Output One is the process used when COOLING is required. It is controlled by PID One.

Output Two is the process used when HEATING is required. It is controlled by PID Two.

Output Four is the RS232 port that connects to the Beamline computer.

There are four buttons on the front of the controller - <ADVANCE> (shaped like a circle), <HOME> (shaped like infinity), and the <UP> and <DOWN> keys. There are two displays.

The controller has four "pages" of information that you can view and alter. The default page is the "Home Page". You can get to it at any time by pressing <HOME>.

"Operations Page" has the controller mode and PID settings. Starting from "Home Page", press the <UP> and <DOWN> arrows simultaneously for 3 seconds to get to it.

"Setup Page" has the input and output settings along with the global settings. Starting from "Home Page", press <UP> and <DOWN> keys simultaneously for 6 seconds.

"Factory Page" has a grab-bag of rarely used features. Hold the <ADVANCE> and <HOME> keys down simultaneously for 6 seconds to get there.

For a given page, <UP> and <DOWN> move from subject to subject, <ADVANCE> cycles through the settings for that subject while <UP> and <DOWN> then let you change that particular setting.

Changing the Set Point - Go to "Home". Press the up or down keys.

Changing PID settings - From "Home", press the Advance key to get at the PID settings. Press <HOME> when done.

Turning Temperature Ramping ON/OFF - This is set on the "SETUP Page" under the global subject.
 


Current Performance of Stage -

Temperature Range - Tested between -40C and 140C.

Stability - Appears to hold to +/ 0.1C at any set-point in this range.

Overshooting - At 60C less than 0.1C.

Rate of Change - Slew is bounded to 5 C/min maximum rate.

Settling time - For a 5C change settles to within 0.1C within 2 minutes.

This section needs to be revised (January, 2001)

Current Settings on MELCOR -

Here is a summary of all the settings that seem important

Operations Page - User - Auto Mode, Calibration = 0.0C

                  Pid1 - Pb1 = 20 C (Pass Band for cooling PID),
                         It1=2.00 (Integral time in minutes for Cooling PID)
                         dE1=0.0 (Derivative time in minutues for Cooling PID)
                         db1=0.0 (No hysteresis)

                  Pid2 - Pb2 = 20 C (Pass Band for heating PID),
                         It2 = 2.00 (Integral time in minutes of Heating PID),
                         dE2 = 0.0 (Derivative time in minutes for Heating PID)
                         db2=0.0 (No hysteresis on heating)

Setup Page - InP1 - SEn1=rtd
                    In1=din (RTD type DIN)
                    rL1=-60C (Set the lowest temperature to -60C)
                    rH1=260C (Set the highest temperature to 260C)
                    dEC1=0.0 (Display decimal point for temperature)
                    Ftr1=-1.5 (Perform an exponential average of the temperature for the past 1.5
                       seconds. The negative sign means use it for display and process.)

             Out1 - Ot 1= COOL
                              Prc1=0-10 (Supply 0 to 10 volts of cooling power)

             Out2 - Ot 2= HEAT
                    Prc2=0-10 (Supply 0 to 10 volts of heating power)
 
             Out4 - BAUD=9600 (RS232 communications rate)
                    ADDR=1

             GLBL - Unit=SI (use SI units)
                    C-F =C (Display in celcius)
                    Err = nLat (Do not latch off if a failure occurs and fixes)
                    FAIL=OFF (Switch power off if an error occurs)
                    PLSP=0 (The temperature, in degrees above which heating limits are applied
                          and below which cooling limits are applied)
                    Pl A = 70 (Limit heating power to 70% of full power.)
                    Pl B = 70 (Limit cooling power to 70% of full power. This is only effective
                          under some circumstances as output power is also voltage limited.)
                    rP  =StPt (When the set point is changed, ramp it to the new value to reduce
                          overshoot)
                    rP S=Min (Minutes is the unit of ramping time)
                    rAtE = 5.0 C/min
                    OPLP = OFF (This feature turns power off if the MELCOR suspects a fault.)

Thermo-electric Element - The thermo-electric element is a set of Ferrotec 95 Series high temperature Peltiers mounted between the water-cooled mount and sample stage. They are plugged into the MELCOR controller that supplies them with current. Although the Melcor controller reports the "Power" delivered, this is proportional to the current delivered. Furthermore, the Melcor is limited to 120W total power, 8 Amps total output and 15 Volts maximum. Because of the current wiring of the Peltier's the voltage limit is reached long before full power. This puts an artificial limit on the maximum heating and cooling powers available. You can easily monitor these effects by placing an ammeter and voltmeter into the Peltier circuit loop at the back of the MELCOR.
 
RTD Sample Thermometer - A Model 3105 100 Ohm Platinum Resistance thermometer from Omega Engineering is mounted on the sample stage. Two wires are attached to each leg to permit 4-wire resistance measurements although the Melcor controller runs in 3-wire mode. The lack of shielding on the wires does lead to some readout noise.

Measuring Thermo-Electric Response - The response of the stage to Peltier current can be modelled by a two step process. We assume the stage response is given by,

B can be measured quickly by heating (or cooling) the sample stage to a set point and then turning off the Peltier. The rate of thermal equilibrium follows the linear approximation well over a 100C range and gives B=0.0028 Hertz or a decay time of 6 minutes.

The value of A may then be determined by setting the controller to various temperatures and measuring the power, P, needed to maintain that temperature. Equation (1) clearly is valid only for small temperature and power excursions so the differential form is used to give,

Figure Two - Efficiency of EP Peltiers

Figure Two shows that the Peltier performance is strongly resistive.


Measuring Thermal Lag - In an ideal world, a change in thermo-electric power would immediately change the temperature of the sample stage. Unfortunately, it takes some time for a temperature differential to be established. One simplistic characterization of the thermal response is to assume for a time tdead, the stage does not respond and that at this point, it abruptly switches to a full response. While crude, the dead-time model is quite effective. There are many ways to estimate tdead.

One is to simply unplug the thermo-electric current lead and observe the sample stage temperature. When it begins to fall at close to its maximum rate the dead time has elapsed. Doing this on EP gives a dead time of approximately 4 seconds.

Another is to set the controller to Bang-Bang mode (done by setting the Proportional bands on PID1 and PID2 to 0). The temperature will oscillate about the set point as the controller swings from full power heating to full power cooling. If the time in each cycle heating is theating and the time cooling is tcooling, the dead-time is given by,

Although this method should be more precise, there is the added complication that the solid-state relay controlling cooling and heating also has a switching time. This time must be estimated and subtracted from the measured dead time to give an accurate result.

Measuring dead time is helpful because it determines the theoretical limit at which temperature control can be carried out.

Temperature Calibration - The thermometer can be rapidly but inaccurately calibrated by opening the sample chamber and placing a drop of water on the sample stage. Cooling slowly through 0C causes the water to crystallize and heating slowly through 0C reverses the transition. This rapidly allows the OC offset to be estimated to an accuracy of 0.1C. The 0C offset can be set on the MELCOR controller as described in the MELCOR section.

A more thorough calibration requires the use of a reference thermometer. This process is described in the notes of lab book IV by Paul Harper.

Synopsis of TV6-Melcor Interaction

This is a very brief sketch of the elements involved in TV6 and the Melcor controller talking to each other. This work was all done by Dag and hopefully he'll add a detailed description.

TV6 functions like stemp and gtemp are all prototyped in
         tv6sys.pro

The call from the TV6 command line is processed by
         tv6.c and tv6.h

The actual C-code TV6 uses to speak to the Melcor is contained in the module,
         modbus.c and modbus.h

This speaks in a funny language described in the MELCOR MTCA Cooler Manual via the serial port. Note, the serial TSR needs to be in place for it to work and this was initially a problem on El Producto.

Additional Resources -

PID Tuning -

Most books are very bad on this.

Gil Toombes is a control freak. This is a rare opportunity to take advantage of that.

Melcor Controller -

Series MTCA Thermoelectric Cooler Controller Instruction Manual (filed in equipment cabinet).

Talk to Mark Tate or Gil Toombes.

Melcor/TV6 Interaction -

Information specific to programming the Melcor is in the Melcor Manual.

Dag's implimentation of modbus.c, modbus.h. Talk to Dag Arneson or Mark Tate. If you are desparate try Gil Toombes.

TV6. Talk to the lab guru or read the source code. What could be simpler?

Peltier Elements -

The Melcor Inc. (New Jersey) web site is excellent. There are printouts from there on p82, LBIII of Gil Toombes.

Information Specific to the Ferrotec Peltiers is in an Ilford Box labelled "High Temperature Thermoelectrics and Heaters" in the Electronics Room.

Finally, talk to the lab guru.

RTDs -

Omega Engineering has a manual entitled "Temperature" which is very helpful. They also have a lot of information on the web.

Water Coolers -

The manuals are good, and Cornell's own staff will do refrigerator repairs (as well as telling you about their exciting retirement plans).

Temperature Calibration -

The Omega Engineering "Temperature" manual is handy.

Paul Harper's Thesis has a good summary of the current lab technique.
 

January 5, 2001. Gil Toombes