top of page
  • Google+ Social Icon
  • Twitter Social Icon
  • LinkedIn Social Icon
  • Facebook Social Icon

AC Power Control with Thyristor: Phase Angle Control using triac with PIC16F628A

  • Paul Somoye
  • Jan 13, 2017
  • 5 min read

Phase angle control is a method of PWM applied to AC input voltages, usually the mains supply. Of course, the AC supply could be from a transformer or any other AC source, but the mains supply is the most common input – this gives the phase angle control method its greatest usefulness. It has of course become quite obvious from the title (and I’m sure most of you reading will already know this) that the purpose of phase angle control is to control or limit power to the load.


The power device used in phase angle controllers is a thyristor – mostly triacs or SCRs. (There are methods of phase controlling employing high frequency switching using a MOSFET or IGBT, but here I’ll talk about phase angle control with thyristors only). The power flow to the load is controlled by delaying the firing angle (firing time each half-cycle) to the power device.


We know that the thyristor is a latching device – when the thyristor is turned on by a gating signal and the current is higher than the holding current and the latching current, the thyristor stays on, until the current through it becomes sufficiently low (very close to zero). The thyristor turns off when current through it becomes zero, as happens at the AC mains zero crossing. This is the natural line commutation. (Another method of turning the thyristor off is by forced commutation. I won’t go into that now.) The assumption here is that the load is resistive and has little to no inductance. Of course, this is not always the case, as inductive loads are often used. However, I’ll work with this assumption for now.


I’ve added the circuit, code and simulation of an example later in this article. And that uses a triac as the power device. So, from now on, I’ll just refer to the triac instead of talking about a thyristor in general.


So, in phase angle control, a gate pulse is sent to the triac. This is sent at a time between one zero crossing and the next. Without the gate pulse sent to the triac, right after zero-crossing, the triac is off and no current flows through it. After a certain time, the gating signal is given to the triac and it turns on. The triac then stays on until the current through it becomes zero (natural line commutation). This is at the next zero crossing. For simplicity’s sake and as usually should be, assume that the current through the triac (when on) is larger than the latching current and the holding current. If you didn’t already know this, the latching current is the current that must pass through the triac right after it is turned on to ensure that it latches. The holding current is the current level through the triac below which the triac will turn off. So, the assumption that current through the triac is higher than the latching current and the holding current means that the triac stays on once it is fired on. It stays on until the current through it is zero.


This means that the voltage is supplied to the load for a fraction of the cycle, determined by how long the triac is on. How long the triac is on, is, in turn, determined by the delay time between the zero-crossing and the applying of the triac gating signal.


So, to sum it up, we adjust the voltage or power delivered to the load by delaying the trigger signal to the triac. One thing to remember is that, the delivered voltage and power are not linearly related to the firing phase angle.


There are two voltages here that we are concerned with – the RMS voltage and the average voltage. The RMS voltage governs the power output to resistive loads such as incandescent bulbs and resistive heaters. The average value relates to devices that function on the average voltage level. This is important because, when testing, your voltmeter will register the average voltage – and not the true RMS voltage – unless you have a “true RMS voltmeter”. Most inexpensive voltmeters are not true RMS meters but will respond to average value changes.


Now let’s take a look at my circuit setup and then the output waveform using this code


There isn’t much to it. The zero-crossing is first checked. After zero-crossing occurs, a small delay is present before the triac is fired. Here, I’ve used 2ms. So, the triac is fired 2ms after the zero-crossing occurs. The gating signal is removed 250µs after that. 250µs is enough time to ensure that the triac has turned on. Even though the gating signal is removed, the triac stays on until the next zero-crossing as it is a latching device. Now you may ask, why remove the gating signal? Just keep it on till the next zero-crossing. Well, that'd work too. The problem there would be that, there would be high switching losses of the thyristor. The gate drive resistance would dissipate immense amounts of power - all for no reason, since the triac would be on even if the signal was removed.


Here is the code below:

//Programmer: Paul Somoye

//Compiler: mikroC PRO for PIC v6.4.0

//Target PIC: PIC16F628A

//Program for phase angle control

//---------------------------------------------------------------------------------------------------------

unsigned char FlagReg;

sbit ZC at FlagReg.B0; void interrupt(){

if (INTCON.INTF){ //INTF flag raised, so external interrupt occured

ZC = 1;

INTCON.INTF = 0;

} } int const fit1=1 ; int const fit2=5; char take; void dim1(){ // high speed delay_ms(fit1);

PORTb.f4 = 1; //Send a pulse porta.f0=1;porta.f1=porta.f2=0; delay_us(250);

PORTb.f4 = 0;

ZC = 0;

} void dim2(){ // high speed delay_ms(fit2);

PORTb.f4 = 1; //Send a pulse porta.f1=1;porta.f0=porta.f2=0; delay_us(250);

PORTb.f4 = 0;

ZC = 0;

} void dim3(){ // high speed

portb.f4=0; porta.f2=1;porta.f0=porta.f1=0;

}

void main() { // Wait for UART module to stabilize

PORTB.f4 = 0; trisb.f4=0; trisb.f1=1; trisb.f2=0; TRISB.f0 =1; //RB0 input for interrupt porta.f0=porta.f1=0; porta.f2=1;

cmcon=7; //Disable ADC

TRISA =0x00; //Make all PORTA inputs pcon.oscf=1; cmcon=7;

//TRISa = 0; //PORTD all output

OPTION_REG.INTEDG = 0; //interrupt on falling edge

INTCON.INTF = 0; //clear interrupt flag

INTCON.INTE = 1; //enable external interrupt

INTCON.GIE = 1; UART1_Init(9600); // Initialize UART module at 9600 bps Delay_ms(100); while (1){ if (UART1_Data_Ready()) { // If data is received, take = UART1_Read(); // read the received data, UART1_Write(take); } if (ZC){ //zero crossing occurred if (take=='A'){ dim1(); } if(take=='B'){ dim2(); } if(take=='C'){ dim3(); }

} } }

The driver in the circuit is the MOC3021. This is a random phase optically isolated triac output driver. When the LED is turned on, the triac in the MOC3021 turns on and drives the main triac in the circuit. It is a “random phase” driver meaning that it can be driven on at any time during the drive signal, as is required for phase angle control. There are other drivers that only allow drive at the zero-crossing. These cannot be used for phase angle control as phase angle control requires drive after zero-crossing. For guaranteeing that the triac is latched, the LED side of the MOC3021 must be driven with at least 15mA current. The maximum current rating for the LED is 60mA. The peak current rating for the triac is 1A. You should find that we have stayed within these limits in the design.


Here in this article, I’ve talked about phase angle control with some background information on triacs. I’ve shown how to implement phase angle control with a PIC and also how to calculate the RMS voltage of the output. I hope I’ve been able to explain this extremely important topic to you clearly and hope that you can now successfully build your own power control circuits using phase angle control with triacs.












 
 
 

Comments


RECENT POST
  • Grey Google+ Icon
  • Grey Twitter Icon
  • Grey LinkedIn Icon
  • Grey Facebook Icon

© 2017 by Talking Tech

bottom of page