Pwm with zero crossing detector

Thread Starter

nathomas

Joined Mar 3, 2011
82
I have a PIC18f13k50 and I need to control my heating element using the PIC. I understood that I can use an optocoupler and a triac. I am using a zero crossing detector MOC3061 and a triac. My question is whether I can use PWM to control the optocoupler? I understand that zero crossing is good for a resistive heating element. The heating element is a 110V AC. around 2A. If I cannot use the PWM to control the heater, any opinions on how I could use the PIC with the heater. Thanks.
 

R!f@@

Joined Apr 2, 2009
9,918
PWM and triac does not work, meaning PWM cannot control AC, it works only for DC.

You have to code it to control phase angle.

Google it, there are plenty
 
Last edited:

Thread Starter

nathomas

Joined Mar 3, 2011
82
PWM and triac does not work, meaning PWM cannot control AS, it works only for DC.

You have to code it to control phase angle.

Google it, there are plenty
When you say control phase angle, do you mean that I have to trigger the optocoupler and the triac after I realise the zero crossing of the ac power? So I have to produce pulse waves according to the zero crossing and then i can decide when I need to give a high output, ie if I should trigger every alternate zero crossing or every five zero crossings? Is my understanding right?
 

R!f@@

Joined Apr 2, 2009
9,918
If you have a zero crossing opto then you do not have to worry about triac dive side

All you have to do is turn on and off the Optocoupler.
You have to sample the AC voltage angle by the pic and decide when to turn and turn off the opto to control the actual power transferred to the load.

Read this to get a better idea on phase angle chopping.

Actually you have no Idea on AC power control do u?
 

ErnieM

Joined Apr 24, 2011
8,377
How precise do you need to control the heater? I have a very nice kitchen counter grill that the entire controller for the heating element consists of a bi-metallic strip and an eccentric cam as the temperature sensor and set-point adjustment. No electronics at all.

What I mean is can you accept turning the power on for 5 seconds and off for 5 seconds when you want 50% of max power? Lots simpler then making a phase angle control.

I used a very similar PIC as a DMX lighting dimmer, but as I connected the circuit in many ways to the AC line I'd violate the TOS to describe it here. Too bad.
 

THE_RB

Joined Feb 11, 2008
5,438
You can buy a "sold state relay" that has inbuilt zero-crossing switching, and can be controlled from a 5v logic signal (which is isolated from the mains).

Then you can use a low freq PWM (a couple of Hz) from the PIC to control the solid state relay.
 

Thread Starter

nathomas

Joined Mar 3, 2011
82
How precise do you need to control the heater? I have a very nice kitchen counter grill that the entire controller for the heating element consists of a bi-metallic strip and an eccentric cam as the temperature sensor and set-point adjustment. No electronics at all.

What I mean is can you accept turning the power on for 5 seconds and off for 5 seconds when you want 50% of max power? Lots simpler then making a phase angle control.

I used a very similar PIC as a DMX lighting dimmer, but as I connected the circuit in many ways to the AC line I'd violate the TOS to describe it here. Too bad.
The controller has to be precise. I would need the controller to keep the temperature steady and that is why i am thinking of a pwm and PIC. i am using an rtd to measure the temperature. plus i need a digital display.
 

Alberto

Joined Nov 7, 2008
169
Since it is your intention to use a zero-crossing optodevice then you can use a low frequency PWM to drive your optotriac. Tray with 1hz and if necessary lower it till you achìeve the precision you need. A PID control is recommended if you need high precision.

Cheers

Alberto
 

ErnieM

Joined Apr 24, 2011
8,377
"Precise" in not a precise term. An acceptable error range expressed in percent or degrees is.

The rate you change the power does not affect the precision of the setting. It does affect the instantaneous temperature; a shorter period in an on/off control has a lower variation between "just turned on" and "just turned off." Note that a cycle by cycle phase angle control is the fastest period PWM you can achieve, but may be an over design.

Unless you have a very tiny mass to be controlled by a very powerful heater a simple on/off scheme should work.
 

Thread Starter

nathomas

Joined Mar 3, 2011
82
"Precise" in not a precise term. An acceptable error range expressed in percent or degrees is.

The rate you change the power does not affect the precision of the setting. It does affect the instantaneous temperature; a shorter period in an on/off control has a lower variation between "just turned on" and "just turned off." Note that a cycle by cycle phase angle control is the fastest period PWM you can achieve, but may be an over design.

Unless you have a very tiny mass to be controlled by a very powerful heater a simple on/off scheme should work.
My apologies for not being clear. I need a +-1degC precision for the heater. So will an on/off control do? And I have to control the heat of a medium sized manifold.
 

Thread Starter

nathomas

Joined Mar 3, 2011
82
Since it is your intention to use a zero-crossing optodevice then you can use a low frequency PWM to drive your optotriac. Tray with 1hz and if necessary lower it till you achìeve the precision you need. A PID control is recommended if you need high precision.

Cheers

Alberto
Thanks Alberto. Will try it and let you know the outcome.
 

THE_RB

Joined Feb 11, 2008
5,438
My apologies for not being clear. I need a +-1degC precision for the heater. So will an on/off control do? And I have to control the heat of a medium sized manifold.
Those figures are quite reasonable for a 110v 2A heater element provided it has some decent thermal mass (like a hotplate, iron, frypan etc).

I would just get the PIC to do on/off setpoint control and the zero-cross solid state relay will turn the heater on and off. If you get the sensor as close to the heater as possible it will probably cycle over a couple of seconds or less and the thermal mass of the plate will smooth that to generally much less than 1'C thermal ripple at the top of the plate.
 
Top