Student Question on using a PID as a Dimmer to Control a Light Bulb!!! This is a fun one!!!!!!

Hello,

My name is Dave and I am a student at SDSU. I am not an engineering major, so I cant speak the engineering language too well, but I have taken level 2 college physics and 2 years of chemistry.

I origionally wrote this question to the esteemed Tim Wescott, who offered some great advice and suggested that I post my question up here. I believe he will post his origional response up here as well.

With that said, I am trying to build a heater that uses a 35w halogen light bulb as the heating element to heat an object. The thermocouple sensor I am using is a type "J" sensor. I was wondering if you could offer some advice on how I could regulate the temperature of my light bulb with a digital PID controller.

Essentially I want the PID to surve as a dimmer switch that smoothly increases or decreases the power to the light bulb in ordere to have the object maintain a set temperature.

Since the temperature of the object will be changing temperatures due to external forces, I want the light bulb to remain on for the duration of the heating. And because I am looking for accuracy, I don't want to use the basic on-off style regulation. I was hoping to find a way to use the differential integral method (PID) of precisely giving power to the bulb.

However, in order to do this, I have been told that I need a very expensive and complicated PID device that has a linear output (0-5V) or (2-20mA) and then build a DC power amplifier that can convert the DC low power signal to a 35 watt output, and/or use an SCR. This sounds way too awkward and expensive, and I was wondering if anyone knew of a more simple and sophisticated way of accomplishing my task? I would even go as far as building the circuit myself if knew what components to use!!

Ultimately, I just want the device to be as accurate and consistent as possible. There are a million PID controllers out there, and I am just having the trouble of figuring out what I need to make it work as a dimmer with a 35w halogen light bulb.

Can anyone answer to this call???

Respectfully,

Dave Deriso

Overview:

Input: 110v AC (house) Sensor: Type "J" Thermocouple Controller: hopefully PID that can eventually function as a dimmer Element: 35w halogen lamp Interface: 2 line lcd with current and set temp plus ability to set new temperatures easily with up, down, and set buttons for the lcd display Budget:

Reply to
deriso
Loading thread data ...

Here are 2 pages for dimmer circuits that may of help:

formatting link
formatting link

Reply to
deriso

You can purchase PID controllers with continuous analog outputs for less than $200, and much less for used ones on eBay. you convert the analog output to phase control (lamp dimmer type) with a solid state relay made for that purpose.

Here is a page from the Mouser catalog that lists some, including suffix "C" that are controlled by 0 to 10 volts.

formatting link
may find something similar for about half that, rated for the low current you need, if you shop around.

Reply to
John Popelish

So, I would:

1) find a PID that has a continuous analog output (0-10v dc) (can you explain what that is a little more :) ... does it output a voltage from 0-10v dc according to what it thinks my lamp needs to heat to? ex. set temp is 200deg C current object temp is 150deg C

the PID will give a voltage output of lets say 8.789 volts (my guess) and decrease the voltage to say 5.565 as the temp nears the setpoint (or however the graph goes...). The idea is that it gives its approximation of how far my temperature is from my set temp in terms of an analog (dc?) voltage. i might be very lost here...

2) use an SSR that converts the analog voltage output to a phase control (dont really know what that is either... but it looks expensive) What is a phase control??

3) take that phase output and put it into some kind of dimmer circuit like this one

formatting link
What goes to the lamp? the phase output? is that a voltage potential? please explain...

Reply to
deriso

AND THANK YOU!!!!!!!!!!!!!!!!

Reply to
deriso

Yes, the controller has to have either a voltage output or a current output (that can be converted to a voltage with a load resistor) that is compatible with the phase power controller relay. It also has to accept the type of thermocouple you have or can get.

Yes. 0% output is zero volts, and 100% output is 10 volts.

The PID algorithm compares the present value of the input (temperature) with the stored setpoint value and computes the three terms (proportional, integral and derivative) and combines the three factors to produce the output. You give the controller a model of the response of the system, so it uses the correct amount of each factor to push the measured value toward setpoint without overshooting or oscillating. If you want to read a nontechnical tutorial about how to tune a PID controller and how the three factors act, one I wrote is available at:

formatting link

It is a solid state switch that holds back the line voltage for some part of each half line cycle and then turns on and conducts for the rest of the half cycle. The fraction of each half cycle that line voltage is applied to the load is controlled by the DC input voltage. So, if the power comes from a 60 Hz line frequency, you get 120 power pulses per second, which is fast enough for the lamp to have very little flicker.

If you get one of the phase controlled relays, it controls the power to the lamp, directly. you just wire its two output terminals in a break in the lamp circuit.

That link shows you approximately what is inside the phase control relay, if you would rather buy than build.

Reply to
John Popelish

Often with temperature control problems you can get pretty good control by driving your heater with a very slow PWM signal -- I've personally seen one with a period of two seconds, and periods over a minute wouldn't surprise me. The two limiting factors are what will it do to the lamp to be turned on and off continually, and how rapidly will your plant (the thing you're heating) respond? You want a speed that will keep the lamp happy yet not induce too much variation in the plant -- and if the slowest speed that will not damage the lamp is faster than the highest speed you can tolerate in your plant, then you need to find another method.

You can implement the slow PWM method by buying an off-the-shelf temperature controller -- this is where my knowledge and experience stops helping. I know that nearly anyone who makes industrial control modules makes them, and I know that Omega is a good source for onesie-twosie lab-type controllers. Expect to pay $100 to $200, but I think you could get one that would handle a J-type input and 110V output off the shelf.

If the slow PWM approach isn't going to work for you then you may need to drive the lamp with a variable voltage. You can still use fairly slow PWM here, but drive it fast enough to keep the lamp on. At 35W I expect that it's a 12V lamp -- if this is the case then you should be able to take a 12V supply and PWM a MOSFET driver at speeds as low as

50Hz. The controller could be nearly anything, depending on what you're good at implementing -- in this day and age a Basic Stamp controller from Parallax would probably be best. You'd need input conditioning for the thermocouple, and a MOSFET output, but there's a good chance you could put the whole thing together with parts from Radio Shack. The Basic Stamps work with BASIC, so they'll be easy to code -- you should be able to port the code in my article
formatting link
pretty easily.

No matter what method you use to drive the lamp, you are correct that a PID controller should work. The whole point of integral action in a controller is to hold the average error to zero. This does mean that for every undershoot there's an overshoot, but once the temperature has stabilized that won't be a big issue. If you can't have big over- or under-shoots, let us know -- someone will help you out with at least one solution.

Reply to
Tim Wescott

I don't like being the bringer of bad news, but it seems often to be my role here. This thread is no exception.

You don't want to run a halogen bulb on a dimmer of any kind. It's not bad for the bulb to run it very dim, but a little bit of dimming will burn it out quickly. A halogen-cycle lamp is simple in concept, and not even tricky when it's understood, but it's subtle.

Light bulbs burn out because the substance of the filament sublimates. Tungsten has a very low vapor pressure, but it isn't zero. At incandescent temperatures, the vapor pressure increases somewhere between the fifth and seventh power of absolute temperature. You can see the darkening of the inside of an ordinary bulb from deposited tungsten vapor. The bulbs are made large to spread the tungsten over a large area and thus maintain transparency. As tungsten sublimates, some parts of the filament become thinner than the rest, thus becoming hotter and losing material faster. Then poof!

Tungsten-halogen bulbs take a different tack. The envelope is made very small, so that it gets very hot. (Originally, only fused quarts could withstand the temperature, but special glasses can now be used.) The temperature is high enough for tungsten deposited on the envelope to combine with the bromine or iodine sealed in. The tungsten halide is a gas that decomposes at the filament temperature, restoring the tungsten to to the filament and the halogen to the void. It gets even better. The decomposition rate is also temperature dependent, so tungsten deposits preferentially on the thin spots. As a result, the filament can be run much hotter, which results in higher luminous efficiency.

When the bulb is run very dim, sublimation is nil in any event. When it is dimmed only a little, the regeneration cycle ceases. Sublimation continues only slightly abated, and the bulb burns out relatively quickly. If the bulb has been run at reduced temperature only for a relatively short time, such as might happen in a brownout, subsequent full-output operation usually repairs most of the damage.

Conclusion: choose a different bulb or use a slow on-off cycle.

Jerry

Reply to
Jerry Avins

Wow Jerry. That's good to know. This must by why I told Dave to post his question to the group.

Am I correct in concluding that if he runs his bulb with some guaranteed on time (i.e. a modified form of the 'slow PWM' that I suggested in my reply) that it would work OK? Is there any way to know just how long this on time would need to be?

On choosing a different bulb: It's hard to say without knowing just what you're trying to heat, but if you switch to a 'normal' 35W incandescent light bulb it'll be dimmer, but it'll generate more heat. If you focus it with a reflector that reflects IR (like shiny metal), and if you don't put an IR absorptive material in between the bulb and the thing you're heating, it should be just as effective as a halide light.

Reply to
Tim Wescott

About the Bulb...

Jerry, wow, in a word. That was a very educational. Thank you, I would have definatley encountered some problems down the road. So, to find a replacement, I have sent the following message to several bulb experts:

"I am trying to build a heater that runs off of a 35w halogen bulb (the small, common ones). To adjust the temperature of the bulb, I am using a dimmer circuit. However, it has come to my attention that dimming a halogen bulb will make it burn out much quicker. I like the halogen bulbs because they get hot quickly and are small and inexpensive to replace. Is there another kind of bulb that I can use that gets just as hot, is just as small,is as easy and inexpensive to replace, and can be dimmed????

I know its an odd question, but I am a student, and any help would be greatly appreciated!!!"

So, the bulb problem will be handeled shortly!!

Reply to
deriso

I just wrote a great response, and lost it. Damn.

ANYWAY...

I am most intreseted in the MOSFET. I did a little research and found:

"Pronounced MAWS-feht. Acronym for metal-oxide semiconductor field-effect transistor, a common type of transistor in which charge carriers, such as electrons, flow along channels. The width of the channel, which determines how well the device conducts, is controlled by an electrode called the gate, separated from channel by a thin layer of oxide insulation. The insulation keeps current from flowing between the gate and channel." taken from

formatting link
Is the MOSFET like a PWM, except continous. In other words, instead of keeping the same voltage and releasing it on intervals to create a wattage, does the MOSFET just limit the voltage without inturrepting it?

Is this more practical?

And as for eliminating over and undershoots, I would just like a gradual continuous increase until the setpoint is reached and then corresponding increases if the object drops in temperature. Any ideas?

One again, Thanks Tim!!!

Reply to
deriso

I just wrote a great response, and lost it. Damn.

ANYWAY...

I am most intreseted in the MOSFET. I did a little research and found:

"Pronounced MAWS-feht. Acronym for metal-oxide semiconductor field-effect transistor, a common type of transistor in which charge carriers, such as electrons, flow along channels. The width of the channel, which determines how well the device conducts, is controlled by an electrode called the gate, separated from channel by a thin layer of oxide insulation. The insulation keeps current from flowing between the gate and channel." taken from

formatting link
Is the MOSFET like a PWM, except continous. In other words, instead of keeping the same voltage and releasing it on intervals to create a wattage, does the MOSFET just limit the voltage without inturrepting it?

Is this more practical?

And as for eliminating over and undershoots, I would just like a gradual continuous increase until the setpoint is reached and then corresponding increases if the object drops in temperature. Any ideas?

One again, Thanks Tim!!!

Reply to
deriso

Tim,

I have a few questions the PWM signal sounds like it may burn out most bulbs with all the flickering if its less than standard 60hz. Then again I wouldnt know. However, you mentioned a variable voltage method. Does the variable voltage method keep the bulb on the whole time and just limit the voltage instead of the wattage? How does current play a role in all of this??? The PWM sounds good, but if you drive it fast, doesnt that increase the wattage? From what I understand, its the same voltage just being averaged over a time interval to create a specified wattage.. am i correct?

Is there a -- I've personally seen one with a period of two seconds, and periods over a minute wouldn't surprise me. The two limiting factors are what will it do to the lamp to be turned on and off continually, and how rapidly will your plant (the thing you're heating) respond? You want a speed that will keep the lamp happy yet not induce too much variation in the plant -- and if the slowest speed that will not damage the lamp is faster than the highest speed you can tolerate in your plant, then you need to find another method.

You can implement the slow PWM method by buying an off-the-shelf temperature controller -- this is where my knowledge and experience stops helping. I know that nearly anyone who makes industrial control modules makes them, and I know that Omega is a good source for onesie-twosie lab-type controllers. Expect to pay $100 to $200, but I think you could get one that would handle a J-type input and 110V output off the shelf.

I looked up MOSFET, and found the following:

"Pronounced MAWS-feht. Acronym for metal-oxide semiconductor field-effect transistor, a common type of transistor in which charge carriers, such as electrons, flow along channels. The width of the channel, which determines how well the device conducts, is controlled by an electrode called the gate, separated from channel by a thin layer of oxide insulation. The insulation keeps current from flowing between the gate and channel." Taken from

formatting link
Is a MOSFET like a variable voltage controller that can increase or decrease the voltage supplied to a device on a continuous level? or are ther on-and-offs like the PWM.

Also, I cacan't have big over- or under-shoots. I want a gradual increase and then a stop at the set temperature and then an increase when the object temp decreases.

Thanks again Tim! This project is nuts.

Reply to
deriso

Real-world use has demonstrated that "soft-starting" a halogen bulb greatly extends its life, and that the halogen cycle, while useful for extending the life of the lamp at full power, certainly does not grant the bulb immortality (redeposition simply doesn't favor the thin spots enough, and the points of attachment benefit the least). The first question is, what is the expected duty cycle of the heater? If it's expected to run at >90% continuously to maintain the desired temperature, it's undersized for the task.

The second question is, what is the desired maintenance interval? Who cares if the bulb life is shortened by 50% if that outlasts the project by a year?

If this device is expected to operate continuously for more than a year, a ceramic cartridge or thin-film resistive heater should be used instead. If it only has to operate until graduation, a COTS bulb would be a very cost-effective solution.

--Gene

Reply to
Gene S. Berkowitz

Well...I didn't know about this dimming halogen bulb thing

So my house is full of halogen bulbs on dimmers...that last just as well as bulbs not on dimmers

Reply to
Fulliautomatix

It can be, but it's inefficient. A switch has low resistance, and therefore low power dissipation when current flows. It has no dissipation in its other state when no current flows. Both MOSFETs and bipolar transistors cam be used as switches, and both can be used for proportional control.

Consider what happens when a switch reduces a constant-resistance load* to quarter power. The switch is on for a quarter of the time and off for three quarters. The power in the switch is small. Now let's do that as you suggested. The effective resistance of the control transistor is set equal to that of the load, so that half the voltage appears across each. The current flows through both, so that the power to the load and the power dissipated in the transistor are the same. Half the power is wasted, but worse, the transistor needs to get rid of a lot of heat.

With cycling on-off control, you'll be able to run your heater from AC using a triac. With proportional control of current, you'll need a DC power supply.

Good control systems needn't overshoot. The more rapidly they respond to changes, the harder it becomes to keep them from overshooting. Tim has a new book on the subject. I haven't seen it yet, but it may be a tad too technical to be useful to you.

Your choice of Type-K thermocouple may prove troublesome. Any thermocouple needs cold-junction compensation; it measures not temperature, but temperature /difference/ between two points. Roughly, a Type-K delivers about .05 volts at 2200F (I can look it up if you need me to) and the temperatures you want to measure are much lower. To discern one degree, you will need to measure (and distinguish from noise) a difference of .000022 V (22 microvolts).

Thermistors are non-linear, but might be useful with proper calibration. I've had good success with ordinary silicon diodes -- the forward drop is a function of temperature -- but careful design is needed and replacement usually requires recalibration in high-precision applications.

Jerry _______________________________________________________________

  • The resistance of a light bulb is changes with the power level.
Reply to
Jerry Avins

The current into the bulb will depend on the voltage and the filament temperature. Cutting the voltage will reduce the current, although not as much on average as would be the case for a resistor.

You could just use a honking big DC amplifier to drive your bulb (I think this is what was suggested to you in the first place). The bulb would get dim, as desired.

The PWM drive that I was suggesting was one where you drive a switch at

50-500Hz. The voltage to the bulb will be a series of rectangular pulses. During a pulse the current will be high, but on average the power to the bulb will diminish as the duty cycle goes down. You wouldn't be able to drive a 'specified' power, but it would be a controllable one.

Yes and yes. A MOSFET is a transistor. You can either choose to drive it in a way that regulates the current to the bulb in a continuous manner (assuming a DC supply to the bulb) or you can choose to turn it on hard, then off hard. If you choose the continuous regulation method then you will have to dissipate significant power in the MOSFET -- choosing PWM allows you to significantly simplify both your circuitry and your heat sinking.

Don't we all.

If you can get by with moderate over- and under-shoots then a 'straight' PID controller should work for you. You can make the increases and decreases more gradual by increasing your derivative gain, but you can't completely stop the overshoot, and the system as a whole will settle slowly.

You _can_ play a trick with a PID controller by rearranging it to some extent. You can take the difference between your actual and target temperature and run it through a block to generate a desired temperature ramp. Then you take the derivative of the actual temperature and compare this to your desired ramp, and apply it to a PI controller. If you limit magnitude of your desired temperature ramp then you'll significantly limit the overshoot.

.---------. .------------. _ | -- | _ | | Set / \ | / | / \ | ki | Drive ----->| + |--->| / |---->| + |--->| kp + ----- |------->

Temp \_/ | / | \_/ | z - 1 | A | -- | A | | | '---------' | '------------' | | | | | | .-------. | | | | | | | z - 1 | Plant | '----| ----- |

Reply to
Tim Wescott

...

Probably too long, now that I think of it. It isn't the filament that needs to be hot enough for regeneration to take place, but the envelope. That might be a minute or more of on time.

I would consider a 75 W reflector flood (or spot). They are readily available and reasonably small, and having higher wattage than needed should be no problem in a control loop. There may be lower wattage non- halogen reflector bulbs for lighting wall-hung art work.

Jerry

Reply to
Jerry Avins

Then you must dim them deeply, or not for very long. Dimming a little -- running a 120V bulb at temperatures equivalent to 105 or so shortens their life most drastically, to less than an ordinary incandescent's approximately 1,000 hours. Do you get the rated hours from your dimmed bulbs? At 90 volts, any 120V bulb lasts nearly forever. Some low-voltage tungsten-iodine lamps are rated 10,000 hours and last longer, but most "halogen" nowadays is bromine and some such bulbs are rated as low as

1,500 hours.

This is from

formatting link
The halogen lamp

One invention that addressed the problem of short lamp life was the halogen lamp, also called the tungsten-halogen lamp, where a tungsten filament is sealed into a clear "capsule" filled with a halogen gas such as iodine or bromine. This type of incandescent lamp creates an equilibrium reaction where the tungsten filament that evaporates when giving off light is chemically re-deposited at the hot-spots, preventing the early failure of the lamp. This also allows halogen lamps to be run at higher temperatures (which would cause unacceptably low lamp lifetimes in ordinary incandescent lamps) allowing for greater brightness, whiter color temperature, and efficiency.

Because the lamp must be very hot to create this reaction, the halogen capsule is often made of fused quartz, instead of ordinary glass which would soften and flow too much at these temperatures. Thus, halogen lamps are sometimes called quartz-halogen lamps, or tungsten-halogen lamps (the filament is tungsten). They were once called quartz iodine lamps. Modern halogen lamps are made of 'doped' quartz with additives to reduce the UV output. Halogen lamps with integrated reflectors often include a transparent UV filter to seal the lamp.

A further development that has added to lamp efficiency is an infrared coating (IRC). The quartz envelope is coated with a multi-layered coating which allows visible light to be emitted while reflecting a portion of the infrared radiation back on to the filament. The result is that less power is needed to produce an equivalent light output. This efficiency increase can be as much as 40% when compared to its standard equivalent.

Perhaps the most significant side effect of using quartz instead of ordinary glass is that the lamp becomes a source of UV-B light, because the quartz is transparent to this spectral range and ordinary glass is not. Quartz halogen lamps are thus used in some scientific instrument as a UV-B light source. One consequence of this is that it is possible to get a sunburn from excess exposure to the light of a quartz halogen lamp. To mitigate the negative effects of UV exposure, some manufacturers add a coating of UV inhibitors on the capsule that effectively filters UV radiation. When this is done correctly, a halogen lamp with UV inhibitors will produce less UV than its standard incandescent counterpart.

Because the halogen lamp is hot, and poses a danger of fire or burns, and because of the risk from UV exposure, these lamps are usually protected by a lens of ordinary glass, which, as noted above, absorbs most of the UV-B light.

The quartz capsule can be damaged by any oils or residue from fingerprints. These lamps should be handled without touching the clear quartz, either by using a clean paper towel or carefully holding the porcelain base. If the quartz is touched, it must be cleaned with rubbing alcohol.

The incandescent lamp is still widely used in domestic applications, and is the basis of most portable lighting, such as table lamps, some car headlamps and electric flashlights. Halogen lamps have become more common in auto headlights and domestic situations, particularly where light is to be concentrated on a particular point. The fluorescent light, has, however, replaced many applications of the incandescent lamp with its superior life and energy efficiency. LED lights are beginning to see increased home and auto use, replacing incandescent lamps. Newer headlights are often high-intensity discharge lamps, such as metal halide lamps, which produce purple-tinted light instead of the usual yellowish color of a standard incandescent bulb.

formatting link
is also interesting reading.

Jerry

Reply to
Jerry Avins

A minute is probably too long for all but the most sluggish of plants. If he can heat it with a 35W bulb, it's almost certainly not that sluggish.

You can get 40W lamps with a medium-sized screw base (about 5/8 inch diameter, between Christmas tree size and 'regular' base size). With an adequate reflector that might do.

Dave:

What's your physical arrangement? Are you heating your thing directly? Through plastic? Glass? Is there a great need for the bulb to be compact? Does it have to heat with light? Does it have to heat with _visible_ light?

Reply to
Tim Wescott

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.