I created a computer-controlled frypan to assist me with surface mount soldering. I was inspired by the project from Ladyada (part 1 and part 2).
The new Generation 3 electronics for the Reprap and Cupcake CNC controller is out, but they've moved almost exclusively to surface mount technology. Whilst I've soldered surface-mount components by hand before, I'd much prefer a more automated way of doing so.
Professional PCB manufacturers use special million dollar conveyor fed multiple-thermal-zone ovens in order to ensure circuit boards are soldered optimally. If I can emulate this in my kitchen for a hundred bucks, I'll be pretty happy.
The performance of the thermostat is, to put it bluntly, crap. Here are the results of heating using each of the 5 dial positions:
thermistor sensor from the RepRap foundation. It has a range up to mid 200 degrees, but isn't that accurate at lower temperatures. However it's a lot simpler to use than thermocouple based solutions (no extra chips or zero-point compensation circuitry) and it seems less susceptible to noise.
I used JB-weld to glue the thermistor to the bottom centre of the pan. It holds strongly and should be good up to the temperatures I need.
To control the skillet I used a solid-state relay. It was very simple to use, the microcontroller can drive it directly, without even a limiting resistor! It's difficult to get more simple than that. The downside is cost, it was about $50.
For display I used a Hitachi LCD and the serial backpack from SparkFun electronics.
A way to 'neaten up' the response from the controller is to use something called Hysteresis. For example if the controller is supposed to turn on at 100*C, then with a 10*C hysteresis it won't turn off until it drops below 90*C. This sort of behavior is good at stopping the system chattering around the setpoint, but it doesn't address my problem with overshooting the mark. For that I needed a way to throttle the output to the heater....
To get around this we use a technique known as Pulse-Width-Modulation (PWM). This means that the relay is switched ON and OFF rapidly, but the length of the ON and OFF times are adjusted. The ratio between the ON time and the total ON & OFF times is known as the Duty Cycle. If the duty cycle is 30% then it means that 30% of the time the relay is ON, and 70% of the time it is OFF.
A word of warning: Don't try this technique unless you A) use a solid-state relay, and B) have a load that doesn't 'mind' being switched on and off rapidly. Some things I would never try dimming using PWM include fluorescent lights, some motors, and anything with a filament or that may suffer thermal shock. Using a old-style non solid-state relay will quickly result in the relay dying due to overuse (old relays had moving contacts which would wear out. Newer ones have no moving parts and hence are known as solid-state).
In this case I chose to use a period of 1 second for the output cycling. This is quite large by PWM standards. The arduino actually has dedicated hardware outputs to do PWM at 500Hz, however it is tricky to use this with mains frequencies. It is possible to do this, but it typically requires extra circuitry to allow the microcontroller to sync its outputs to the starts of the mains cycles, and frankly I couldn't be bothered.
So now, using the PWM technique on the output, we have a sort of 'virtual dial' that we can use to control the output to the heater.
I ran the test again, using 'Bang-Bang' control, a target temperature of 50*C, and having the heater output constantly throttled to 50% duty cycle. This helped reduce the overshoot, instead of peaking at 95*C, it stopped just above 70*C. However the 'rise-time' was really increased.
So, we need a control strategy which allows us to get to the target temperature faster, but has less overshoot. That brings us to...
To be done.
To be done.
Ziegler and Nichols are full of shit. Since their method has been used by 3 generations of engineers without issue, I think the problem lies with me.
So, I stole a $50k thermographic camera and started taking pictures.
Before I started. Warm laptop and cool beverage: After warming up a little, pretty uneven: