Author Topic: Microcontroller TRIAC control  (Read 4286 times)

0 Members and 1 Guest are viewing this topic.

Offline DeltaTopic starter

  • Super Contributor
  • ***
  • Posts: 1221
  • Country: gb
Microcontroller TRIAC control
« on: May 31, 2016, 11:31:26 pm »
I'm looking to use an MCU and TRIAC to control a ~2kW 240VAC heater element.  I'm torn between two approaches:

1)  Use TRIAC control IC, and use a PWM output from the MCU to feed it its reference voltage.

2)  Use a zero-point-crossing detector feeding into the MCU, and have the MCU calculate the required delay / firing angle and drive the TRIAC's gate (probably through an smaller opto-isolated TRIAC).

I'm thinking of a BTA25-600CW, with a MOC3020 driving it.

I was initially edging towards method 1, but the more I think about it, the more I'm heading towards 2....


Your thoughts, please!
 

Offline mrpackethead

  • Super Contributor
  • ***
  • Posts: 2845
  • Country: nz
  • D Size Cell
Re: Microcontroller TRIAC control
« Reply #1 on: June 01, 2016, 12:07:55 am »
if you are looking to control a heater,  dont' bother trying to phase control it.. Just switch it on and off at the zero cross points.. will save you a bunch of filtering..

if you want 50%, just turn on for alternative cycles,  if you want 10%, turn on for 1 in 10..   you can create algorithms to give you pretty good average power over a second, if you do this, and a 2kW heater has a lot of thermal mass you'll probalby be fine.
On a quest to find increasingly complicated ways to blink things
 
The following users thanked this post: Delta

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 2328
  • Country: 00
Re: Microcontroller TRIAC control
« Reply #2 on: June 01, 2016, 12:19:33 am »
I'm doing exact the same thing to control a hot air,  on A hot air gun for SMD.

I'm using the MOC approach, One thing that i dislike in that the resolution of control will be 1/ 120 for one second , I need to model the Heater ar air flow to see if this will be a problem or not.

I'm using Psoc and the main processor
 

Offline DeltaTopic starter

  • Super Contributor
  • ***
  • Posts: 1221
  • Country: gb
Re: Microcontroller TRIAC control
« Reply #3 on: June 01, 2016, 09:17:18 am »
if you are looking to control a heater,  dont' bother trying to phase control it.. Just switch it on and off at the zero cross points.. will save you a bunch of filtering..

if you want 50%, just turn on for alternative cycles,  if you want 10%, turn on for 1 in 10..   you can create algorithms to give you pretty good average power over a second, if you do this, and a 2kW heater has a lot of thermal mass you'll probalby be fine.

That's a great idea!

So if I decide to go for 0-100 control, each zero-crossing is one half-cycle, and there are 100 half cycles per second (50Hz), is it as simple as:

For 75%
Zero-crossing 0, set gate drive high.
Count 75 zero-crossings.
Set gate drive low.
Count (remaining) 25 zero-crossings.
Repeat...

As we are using full half-cycles, I'm guessing the power relationship should be completely proportional and linear, ie 50 / 100 half cycles = 50% power developed in the load?

How does my choice of devices sound?
 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: Microcontroller TRIAC control
« Reply #4 on: June 01, 2016, 09:37:22 am »
Isn't the problem with cycle, 1/2 cycle skipping the long latency in the T correction
feedback loop, manifesting itself in wide swings of T up and down rather than a "stable"
temperature. Especially at low heat levels.

This of course is affected by thermal mass, if system has low thermal mass than you
would get wide swings, if high mass then that acts as a filter to remove swings.


Regards, Dana.
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 

Offline DeltaTopic starter

  • Super Contributor
  • ***
  • Posts: 1221
  • Country: gb
Re: Microcontroller TRIAC control
« Reply #5 on: June 01, 2016, 09:40:49 am »
There will be plenty of thermal mass, so nice long time constants are absolutely fine...
 

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6460
  • Country: nl
Re: Microcontroller TRIAC control
« Reply #6 on: June 01, 2016, 09:42:14 am »
I would use a decent SSR that has already the zero-crossing built in and are built to last.
Furthermore concerning the timecycle you want to switch, heating elements are really really slow  :=\ ,
what is the application? Thermal bath or room or oven or ? What is the accuracy you are looking for 0,1oC, 1C ?
Before you start programming, I suggest to do a manual testing finding out how the system responds from roomtemperature to desired endpoint temperature (time),
from desired temperature - accuracy to desired temperature (all at 100% power). That gives you information you need to set your controltime and PID parameters.
Oh well if you have had control theory you probably already know all this.
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12860
Re: Microcontroller TRIAC control
« Reply #7 on: June 01, 2016, 11:54:53 am »
For heavy loads, if you use cycle skipping, its important to only skip FULL CYCLES, to avoid DC imbalance and for more moderate loads, its still a good idea to ensure that the average numbers of +ve and -ve cycles skipped remain approximately equal.

Excessive DC imbalance (summed over all loads) tends to cause saturation of the distribution transformer providing the supply feed and will make you *VERY* unpopular with the electricity distribution company.   Fortunately in the UK, in urban areas, 240V single phase supplies to many customers are fed from one large distribution transformer so the chance of any individual customer causing a serious DC imbalance is small, but in remote rural areas where one distribution transformer may only feed a single customer, its a more serious concern.
« Last Edit: June 01, 2016, 09:25:48 pm by Ian.M »
 

Offline DeltaTopic starter

  • Super Contributor
  • ***
  • Posts: 1221
  • Country: gb
Re: Microcontroller TRIAC control
« Reply #8 on: June 01, 2016, 08:58:50 pm »
Before I say what this is for, please bear two things in mind.
1)  It is an educational project
2)  I've been watching too many poncy cookery programmes on telly....

 ::)

The plan is to make a "programmable hotplate".  I can program it for example to "Ramp from ambient up to 60C in 15mins.  Hold at 60C for one hour.  Increase to 90C as quickly as possible.  Hold for 30mins.... etc etc etc etc....
1C absolute temperature precision should be enough, but I would like quite slightly better relative control - ie I don't mind if it's only within 1 degree of its setpoint, but I would like it to stay pretty close to where-ever it settles.

Planning to use two PT100s, which will be in the cooking medium.  (Using the average of the two readings, with an alarm & shutdown if the deviation exceeds a certain limit.

Using only full cycles to avoid creating a DC offset on the mains makes sense.

I do indeed have a fair bit of controls knowledge, having spent many an hour tuning control loops on heavy automated hydraulic machinery...

Thanks for all the advice thus far.

 

Offline DmitryL

  • Regular Contributor
  • *
  • Posts: 242
  • Country: gb
Re: Microcontroller TRIAC control
« Reply #9 on: June 01, 2016, 09:11:53 pm »
..You can also make a small cooker from your triac or SSR, calculate how much it dissipates at ~10A when it is turned on for 100% duty cycle :)
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12860
Re: Microcontroller TRIAC control
« Reply #10 on: June 01, 2016, 09:38:59 pm »
That's going to be *INTERESTING* as the system consists of two thermal masses, the second of which is unknown, with a variable thermal resistance between them due to the condition of the interface surface between the hotplate and the pan, and variable losses to ambient from the pan.  Avoiding overshoot if you are doing something like caramalizing onions, or other items with little to no water content, while still being reasonably responsive when there is a litre of water in the pan is going to be *DIFFICULT*. 

Personally, I'd hack a portable induction hob to make the power level MCU controlled rather than use a conventional hob element so I didn't have so much lag in the thermal circuit. 
 
 

Offline EPTech

  • Regular Contributor
  • *
  • Posts: 168
  • Country: be
    • EP Technical Services
Re: Microcontroller TRIAC control
« Reply #11 on: June 02, 2016, 08:59:45 am »
Hi there,

I agree but HOB's already have quite responsive and intuitive feed-back. I doubt there is much improvement there. What would be cool though is to have a wireless temperature probe that one can stick in the medium to cook, like a steak or a pot of water and that would feed back to the HOB. What would be even greater is to have a temperature probe that can sense water boiling over in some way  ;). If that were to switch off the HOB, that would save me the occasional mess.   ;)
 
Kind greetings,

Pascal.
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 9950
  • Country: nz
Re: Microcontroller TRIAC control
« Reply #12 on: June 02, 2016, 09:16:42 am »
2)  Use a zero-point-crossing detector feeding into the MCU, and have the MCU calculate the required delay / firing angle and drive the TRIAC's gate (probably through an smaller opto-isolated TRIAC).

You can do mains zero crossing detection with a ATmega/tiny with just two 1M resistors to phase and neutral (240VAV).
It sounds dodgy but it's officially in an Atmel App note.
http://www.atmel.com/images/doc2508.pdf

The internal clamping diodes in AVRs are strong enough to handle mains through a 1Meg, no probs.
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 2328
  • Country: 00
Re: Microcontroller TRIAC control
« Reply #13 on: June 02, 2016, 11:41:06 am »
The photocopier already do the zero crossing does not need to use the processor for that
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf