controlling a mains-powered oven

Has anybody used a Pi to control a mains-powered device? I'm looking for some tips.

The electronic controller of our electric double oven is no longer reliable -- temperature varies far too much, according to the

replace the controller, I fancy using a Pi instead. It could live inside a nearby cupboard door, with a nice big screen at eye level instead of the present little thing for which I have to don specs.

Seems to me the Pi's job would basically be to read a temperature sensor in each oven (smaller upper one and larger lower one) and trigger relays (or nowadays maybe thyristors?) to switch various heating elements on and off accordingly. (That's top and bottom element in each oven plus a fan element in bottom oven.)

Would this be feasible? Anybody done it already?

--
Jim Nagel                        www.archivemag.co.uk 
>> "from" address is genuine but will change.  website has current one.
Reply to
Jim Nagel
Loading thread data ...

Yes, very feasible, but there is a lot you may need to know about closed-loop control systems, otherwise you may end up with temperature oscillations that outshine those that you describe.

Reply to
gareth

This may be a helpful starting point

does a Pi have any PWM controlled I/O?

Reply to
Andy Burns

since the response time is minutes, it doesn't need a high frequency PWM controlled output.

Essentially anything that says '10 degrees below desired, two elements, less than 10 degrees below : one element, above: no elements' is going to be a good starting point.

If you get massive overshoot, then start looking at rate of change feed forward stuff.

But I doubt it would be needed

--
New Socialism consists essentially in being seen to have your heart in  
the right place whilst your head is in the clouds and your hand is in  
someone else's pocket.
Reply to
The Natural Philosopher

In the process of putting stuff together to do this myself.

thermocouples:

formatting link

thermocouple amps:

formatting link

then there's the hard bit: controlling the power.

Solid state relays are what I'm looking at. Something like ebay item No. 121748369571 if I can find a UK source for them.

I'm looking to add a microswitch to detect when the door opens so I can kill both the heater and fan.

Then there's the software...

Gordon

Reply to
Gordon Henderson

p-1152.html

SSRs are great. An alternative is to use an optically-isolated triac to trigger a big triac (via a resistor) to control the element. At least that way you can make the control voltage and output current anything you like - but watch the isolation!

Reply to
mick

Don't forget to make sure your relay or equivalewnt provides a complete break between the pi and the mains. Mechanical relays do this of course, and opto-isolators controlling triacs will do so too. Solid state relays may include this, but you need to check.

--
Alan Adams, from Northamptonshire 
alan@adamshome.org.uk 
http://www.nckc.org.uk/
Reply to
Alan Adams

Interesting. Some time back when the rPi was just a gleam in the eye of the developers, I conversed with someone about just such a controller. It would have a number of isolated SSR outputs as well as isolated digital inputs and several thermocouple inputs. That was when I learned that a thermocouple doesn't measure temperature, it measures a difference in temperature and the temperature of the cold junction has to be subtracted out (or added in depending on how you look at it).

If there were much interest in this unit I would be happy to build a few. The original design was for a BeagleBone, but would be easy to adapt to an rPi. I don't recall if it used I2C or SPI, but could easily be bit banged if nothing else.

--

Rick
Reply to
rickman

In comp.sys.raspberry-pi message , Sun,

6 Sep 2015 15:20:49, Jim Nagel posted:

If, rather than switching things on and off every few seconds or minutes, you alter the point in each mains half-cycle at which the mains is applied to the elements, you _may_ increase the life of the elements.

--
 (c) John Stockton, nr London, UK.   E-mail, see Home Page.    Turnpike v6.05. 
 Website   - w. FAQish topics, links, acronyms 
 PAS EXE etc. :  - see in 00index.htm 
 Dates - miscdate.htm estrdate.htm js-dates.htm pas-time.htm critdate.htm etc.
Reply to
Dr J R Stockton

Ovens don't normally have PID controllers.

--
Bernard Peek 
bap@shrdlu.com
Reply to
Bernard Peek

I haven't ever even met someone who has had an oven element go in the last 30 years....

--
New Socialism consists essentially in being seen to have your heart in  
the right place whilst your head is in the clouds and your hand is in  
someone else's pocket.
Reply to
The Natural Philosopher

I've had two go in the last 2 years. Awaiting the repair mine as we write.

--
Alan Adams, from Northamptonshire 
alan@adamshome.org.uk 
http://www.nckc.org.uk/
Reply to
Alan Adams

A friend had one of those under-glass range tops and a burner went out in the first year. I took a look and it clearly was a manufacturing defect although I don't recall the detail at the moment. I doubt there was anything that could have been done with a controller to prevent it burning out. I can't imagine how switching at 50/60 Hz zero crossings would make any difference to a heating element that takes on the order of seconds to reach operating temperature.

As pointed out, these things normally go for many, many years unless they were made badly.

--

Rick
Reply to
rickman

I've had 2 elements go in the past year.

Admittedly the oven in question was a very cheap one - Beko - both the main element round the fan and the top grill element have gone "phut". This was after a years use, 6 days a week heated up to 250C then having a lot of water/steam sprayed into it. (I'd only used the top grill element a few times to make pizza though and I've not replaced this element yet)

Easy and cheap enough to replace though - this is the oven I'm about to convert to Pi control...

I'm not sure about mid-cycle switching of the incoming mains though

- basically the same as a light dimmer in operation - prone to noise (suppressible though) and is it that efficient with a resistive/heating load?

Gordon

Reply to
Gordon Henderson

If you use an SSR you get zero-crossing switching.

Reply to
mm0fmf

That's the best kind of load for this kind of dimmer (inductive loads hate this treatment). Still it will be hard to suppress - a cut off near the peak will have a fearsome dI/dt - read big spike if there's any appreciable inductance around and plenty of energy for radiating interference. It is possible though - theatrical lighting boards switch similar loads regularly without crackling up the sound system.

Still given the inherently slow response of an oven I'd be inclined to go for essentially pulse width modulation with the width measured in half cycles of the mains and switch at zero crossing - perhaps using patterns in say 16 cycles to provide various power levels or just KISS and use slow bang/bang with hysteresis (but then why bother with a computer), either way zero crossing means no interference problems.

--
Steve O'Hara-Smith                          |   Directable Mirror Arrays 
C:>WIN                                      | A better way to focus the sun 
The computer obeys and wins.                |    licences available see 
You lose and Bill collects.                 |    http://www.sohara.org/
Reply to
Ahem A Rivet's Shot

But cost lots more than this project is worth (for me!)

Indeed

For me - bothering with the computer - because I can. Also most capillairy tube thermostats are utterly rubbish - when I replced the element in this oven I think I must have damaged the thermostat too as it also stopped working - the replacement is 15C cooler than the original one. It's also part of my master plan to automate all my ovens, mixers, etc. building a dough proofer/retarder too... Geek in a bakehouse!

-Gordon

Reply to
Gordon Henderson

Ah well in that case have some fun - pick your switching device(s) and connect as thinly as possible to an output pin(s), also feed transformed, and heavily clipped (ie. as near to square as possible) mains into another for an edge triggered interrupt to act as a zero cross detector. Write some fun sweet software. If you're going to have a computer you might as well minimise the extra hardware and do as much as possible in software.

--
Steve O'Hara-Smith                          |   Directable Mirror Arrays 
C:>WIN                                      | A better way to focus the sun 
The computer obeys and wins.                |    licences available see 
You lose and Bill collects.                 |    http://www.sohara.org/
Reply to
Ahem A Rivet's Shot

Pretty sure I'll be OK. I'll be writing it in BASIC using wiringPi.

Gordon

Reply to
Gordon Henderson

Speaking of which; I noticed the other day that wiringPi is now in the standard apt repository, so the dependency of rtb is met and both may be installed using apt-get. Thanks!

Reply to
A. Dumas

ElectronDepot 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.