Part Number Hot Search : 
NTHD4P02 RS102 1H273 1N4747 NCP5392Q 14000 100EL HN3B02FU
Product Description
Full Text Search
 

To Download AN1221 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
 (R)
AN1221 APPLICATION NOTE
A Simple Method to Drive a Triac With ST52x420 Directly From the Main
Authors: A. Cucuccio, M. Lo Presti
1. INTRODUCTION
The aim of this application note is to provide the user with a simple method to obtain a cheap circuitry for the driving of a Triac directly from the mains by using the ST52x420 microcontroller and the VB409 VIPower device acting as a 5.2V power supply. In particular, we will describe a possible solution to drive a load in Phase Angle Partialization mode. In this case we can use the following configuration: Figure 1. Application Block Diagram
Vcc=5V Zero cros s ing
VB409
Zero Cros s ing
S T52xx
230V~
GND
Loa d
TRIAC
Firing puls es
Here, we have the following blocks: ST52x420: a member of ST52 microcontroller family VB409: a VIPower device to obtain a 5.2V power supply directly from the mains Zero Crossing: a simple circuit to detect the zero crossing of the mains voltage Triac: a device working in the fourth quadrant to switch on the load Load: a generic resistive or inductive load . In phase angle the Triac is controlled each period of the main voltage. The power transferred to the load is proportional to the Current Flow Angle . This kind of triac control is suitable to drive the triac with inductive load (i.e. Universal or monophase motors) In Fig. 2 is shown the relation between the Phase Angle and the current flow angle . The target is to control the Phase Angle or equivalently the time T1 (see Fig. 3). When a motor is controlled by using this method the speed is changed by increasing or decreasing the phase angle. The Phase Angle must be synchronized with the main and it must be kept constant during the two main semi-periods. This means that, when the main voltage frequency is 50 Hz the phase angle can be changed each 20 mSec.
n n n n n
February 2000
1/12
AN1221 - APPLICAT ION NOTE
Figure 2. Phase Angle Partialization Mode
V
L
Loa d Il A2 A1
a
Pha s e Angle Il
N
g
Current Flow Angle
180
360
If the main voltage frequency is equal to 50 Hz, then Tr (see following Figure) is equal to 20 mSec. In order to avoid problems for the triac firing, when the load is inductive, several pulses must be generated. In our example 4 different pulses are used. This characteristic imposes to limit the Phase Angle or the time T1. Infact when T1 is close to Tr/2 the triac can be fired in the second half period of the main voltage. In our example the time T1max is fixed to 8.7 mSec. considering a 50Hz main voltage frequency.
Figure 3. Phase Angle Partialization Mode
Mains 1.5 Volta ge
Tr Tr/2 Ti
T1 T1 T1max
8 mS
10 mS
20 mSe c
2/12
AN1221 - APPLICATION NOTE
2. ELECTRIC SCHEMATIC
To have a complete idea of the connections between the various devices we can refer to the following schematic:
Figure 4. Electric schematic
3/12
AN1221 - APPLICAT ION NOTE
In the previous schematic we have used a micropower voltage supervisor TS831 that acts as a power-on reset generator for the microcontroller and as a power failure detector. The zero crossing circuit is realized with only two resistors and two diodes: R9 to limit the current, R3 to pull-up the zero crossing signal, D3 to cut a half-wave and D2 (a signal diode) to clamp to ground the zero crossing signal when it goes under the ground. The VB409 is a fully protected positive voltage regulator. The device is well suited for applications powered from the AC mains and requiring a 5.2V DC regulated output voltage without galvanic isolation.
3. DEVICES CONFIGURATION
Following you will find detailed information on the devices configuration used in this application. ST52x420 Microcontroller The fuzzy microcontroller is used simply to drive the triac in phase angle partialization mode. The ST52x420 reads the Phase Angle to be used, by the internal A/D converter and an external potentiometer. The synchronization with the main is obtained by using the ST52x420 external Interrupt (PC0/INT). The time T1 is fixed by the timer PWM/Timer 1. The 4 pulses are generated by a software routine and using two I/O lines to obtain the gate current needed by the triac during the switch on phase. The following steps are implemented by the ST52x420 (for more detailed information see the attached assembler code): Step 1: ST52x420 configuration; the Timer 1 is configured to have an output with a square waveform. The period of this signal is fixed by the prescaler value and by the Timer 1 counter value. The duty cycle is 50%. The interrupts are programmed to be generated on the falling edge of the Timer 1 output. Step 2: On the main program, wait for the external interrupt generated by the main voltage zero crossing. Step 3: When the external interrupt occurs (voltage zero crossing), inside the external interrupt routine, the desired phase angle is read by the potentiometer P1 and the A/D Channel 1. This value is stored on the RAM register 1. The desired value is saturated, in our example it was fixed to 170. A flag is set to `0'. The RAM register 1 is used to load the Timer 1 counter. Then the Timer 1 starts to count. The micro waits for the first PWM/Timer1 Interrupt. T1 can be calculated by using the following formula:
T 1=
(Timer 1_Counter xTclk x Pr escaler ) 2
Tclk is the clock master period; Prescaler is the value of the 16 bit prescaler of the PWM/Timer1. In our example Tclk=200nSec and Prescaler=512. Timer1_Counter is the value read by the potentiometer and stored on the RAM register 1. The maximum value of T1 is T1max=8.7mSec. Step 4: When the Timer 1 Interrupt occurs, inside the Timer 1 interrupt routines, the 4 pulses for the triac firing are generated. Considering that T1max is 8.7mSec, the maximum length of the 4 pulses must be less than 1.3 mSec. If the flag is `0' the Timer 1 is reloaded to count 10 mSec. a flag is set to `1'. The system waits for the next Timer 1 Interrupt.
4/12
AN1221 - APPLICATION NOTE
Step 5: When the Timer 1 Interrupt occurs, the 4 firing pulses are generated. Then the system waits for the External interrupt. The algorithm restarts from the point 2. All the previous steps are implemented in assembler. The code with a detailed description is shown in the appendix A. The Fig. 4 shows the program flow chart. It is important to configure correctly the Timer 1 and its interrupts. For more information see the ST52x420 data sheet. The figure 5 shows the Timer1 output and the relative interrupt generation. Figure 5. Program Flow Chart
S ta rt
In itializa tion
Wa it Ext. In terru p t
Ext. In te rru pt Ro u tin e s
1) S tart A/D 2) S tore A/D value onRAMReg1 3) RAM Reg 1 is saturated to 170 4) Timer 1 start counting RAM Reg1 5) Flag=0
Time r 1 In t. Rou tin e s
Yes Flag=0 No
Stop Timer1 Stop Timer1 StrTim1 =10mS Flag=1
Wait In te rrup t fro m Tim er 1
4 P ulses are generated
5/12
AN1221 - APPLICAT ION NOTE
Figure 6. Waveforms and Interrupts
Main
1
Ext. Int.
0.5 0 1.5 (0.5) 1 Timer1 (1)
Ext. Int. Time r1 Int.
Timer1 Int.
Output
0.5
Triac Pulses
Start to count T1 Flag='0'
Start to count 10 mSe c Flag='1'
Stop the timer and wait the Ext.Int.
(1.5)
10
20
mSe c.
Power Supply by VB409 In this section we will describe how to use the VB409 to obtain a stabilized power supply for the syste.The VB409 is a positive voltage regulator supplied by STMicroelectronics. VB409 provides up to 70mA output current (internally limited) at 5V. The device is well suited for applications powered from the AC mains and requiring a 5V DC regulated output voltage. The theoretical maximum current the device can source, can be derived considering that the minimum voltage on the CAP pin, at the end of the half-period in which the mains is not rectified, must be at least Vout(5V)+Vdropout(2V). The maximum voltage on the CAP Pin is changed internally to 12.8 V by the VB409. During this time there is a discharge of the external capacitor at a constant current , so the voltage variation on it is linear. Thus, the theoretical maximum current the device can source is: Imax=CVcapmax/(T/2) In this case T/2=10ms,Vcapmax=12.8-7=5.8V, C=47F and then Imax=27mA. Considering the current required to drive the linear part of the device, it is possible to say that Imax=23mA. With this configuration we have measured the maximum temperature on the device (without heatsink) to be lower than 65 C. If we consider an external electrolytic of 100F the maximum theoretical current is about Imax=55mA, but in practice only 40mA must be considered because at this current value the thermal shutdown acts. A software tool to help you with the thermal dimensioning of the VB409 by properly choosing the external capacitor and resistive divider values is available. It can be requested by electronic mail at the following address: VIPer.support@st.com. For further information on VB409, please refer to its relative data sheet.
6/12
AN1221 - APPLICATION NOTE
Triac With the power supply configuration used in our application, it is necessary to use a standard Triac in order to fire it in the fourth quadrant by applying a 5V positive pulse with respect to the ground (and therefore with respect to A1 Triac pin).
4. CONCLUSION
In this application note we propose an immediate solution to use a member of the ST52 family of microcontrollers without adding any additional component to realize the circuitry for the power supply or the Triac Driver. We suggest to use a simple zero crossing circuit if a partialization angle phase on the load is required.
7/12
AN1221 - APPLICAT ION NOTE
APPENDIX
;************************************************************ ; ; PROGRAM: un_mot.asm ; PURPOSE: Universal motor drive ; ; DATE: 12/1/2000 ; ;************************************************************ ;************************************************************ ; This program drives an universal motor ;************************************************************ * * * * * *
*
;***************** interrupt vector ************************* irq irq 2 4 TIMER_1 EXT_interrupt
;***** Start of program and testing of configurations ****
Start: ldrc ldcr ldrc ldcr ldrc ldcr ldrc 0 ldcr 3 0 0 0 1 0 2 0 0 228 0 1 0 58 0 ; interrupt mask configuration ; all disabled (default) ; interrupt priority configuration ; from the top: ADC, PWM0, PWM1, PWM2 ; watchdog configuration ; 62.6ms count ; ADC configuration ; Group Chan 0,1, clock divided, power down, ; continuous, stop conversion ; Port A configuration ; all pins in input
ldrc 0 ldcr 4
255 0
8/12
AN1221 - APPLICATION NOTE
ldrc 0 0 ldcr 5 0 ldrc 0 0 ldcr 6 0 ldrc 0 0 ldcr 7 0 ldrc 0 74 ldcr 8 0
; PWM-Timer 0 configuration ; default settings ; PWM-Timer 0 configuration ; default settings ; PWM-Timer 0 configuration ; default settings ; PWM-Timer 1 configuration ; Timer mode, interrupt on falling TIMEOUT edges, ; start and reset on edge, resetted, stopped ; PWM-Timer 1 configuration ; square waveform, fclock/512 ; PWM-Timer 2 configuration ; Timer mode, interrupt on falling TIMEOUT edges, ; start and reset on edge, resetted, stopped
ldrc 0 41 ldcr 9 0 ldrc 0 74 ldcr 10 0
ldrc 0 41 ldcr 11 0 ldrc 0 8 ldcr 12 0 ldrc 0 255 ldcr 13 0 ldrc 0 255 ldcr 14 0 ldrc 0 1 ldcr 15 0 ldrc 0 7 ldcr 16 0
; PWM-Timer 2 configuration ; square waveform, fclock/512 ; Port A mode configuration ; port A 8 bit ; Port B direction configuration ; all pins input ; Port B mode configuration ; all pin analog ; Port C direction configuration ; PC0=EXT_INT, PC1-PC3=output pins ; Port C I/O mode configuration ; loading from RAM
;********* end configuration register ********************
9/12
AN1221 - APPLICAT ION NOTE
ldrc 0 0 ldpr 2 0
; Pin 1-2 port_C are low
ldrc ldcr ldrc 0 62 ldcr 3 0
09 00
; Enable interrupt ext., timer1
; ADC configuration ; Group Chan 0,1 clock divided, power up, ; continuous, stop conversion ; ADC configuration ; Group Chan 0,1 clock divided, power up, ; continuous, start conversion
ldrc 0 63 ldcr 3 0
;********* Main Program ************************* Wait:
waiti End: jp Wait
;
EXT_interrupt: ldri 1 2 ldrc 5 170 sub 5 1 jpns no_sat ldrc 1 170 jp no_tim1 no_sat: ldpr 5 1 ldrc 1 69 ldcr 8 1 ; Load register1 value on timer1 counter reg. ; PWM-Timer 1 configuration ; Timer mode, interrupt on falling TIMEOUT edges, ; start and reset on edge, setted, started ; Read A/D converter ch. 1 and store on register1 ; Saturation value=170
; No enable timer 1, wait next external interrupt
10/12
AN1221 - APPLICATION NOTE
ldrc 12 1
; reg 12 is a flag to know if is the first ; half wave or the second halfwave
no_tim1: reti TIMER_1: ldrc 2 1 sub 2 12 jpz f_t jp s_t f_t: ldrc 12 0 ; First halfwave ; Check for the flag
ldrc 2 64 ldcr 8 2
; PWM-Timer 1 configuration ; Timer mode, interrupt on falling TIMEOUT edges, ; start and reset on edge, resetted, stopped ; Load 195 on timer counter1 -> count for 10mS
ldrc 2 195 ldpr 5 2
ldrc 2 69 ldcr 8 2 jp p_tr
; PWM-Timer 1 configuration ; Timer mode, interrupt on falling TIMEOUT edges, ; start and reset on edge, setted, started
s_t: ldrc 2 64 ldcr 8 2 p_tr: ldrc 10 4
; Second halfwave ; PWM-Timer 1 configuration ; Timer mode, interrupt on falling TIMEOUT edges, ; start and reset on edge, resetted, stopped ; Send 4 pulses to triac
11/12
AN1221 - APPLICAT ION NOTE
n_pul1: ldrc 2 6 ldpr 2 2 ldrc 11 20 rit_1: dec 11 jpnz rit_1 ldrc 2 0 ldpr 2 2 ldrc 11 20 rit_1a: dec 11 jpnz rit_1a ; Pin 1-2 port_C are low ; Pin 1-2 port_C are high
; Set the pulses lenght (high value)
; Set the pulses lenght (low value)
dec 10 jpnz n_pul1 reti
Information furnished is believed to be accurate and reliable. However, STMicroelectronics assumes no responsibility for the consequences of use of such information nor for any infringement of patents or other rights of third parties which may result from its use. No license is granted by implication or otherwise under any patent or patent rights of STMicroelectronics. Specification mentioned in this publication are subject to change without notice. This publication supersedes and replaces all information previously supplied. STMicroelectronics products are not authorized for use as critical components in life support devices or systems without express written approval of STMicroelectronics. The ST logo is a trademark of STMicroelectronics (c) 2000 STMicroelectronics - Printed in Italy - All Rights Reserved FUZZYSTUDIOTM is a registered trademark of STMicroelectronics STMicroelectronics GROUP OF COMPANIES http://www.st.com Australia - Brazil - China - Finland - France - Germany - Hong Kong India - Italy - Japan - Malaysia - Malta Morocco - Singapore - Spain - Sweden - Switzerland - United Kingdom - U.S.A.
12/12


▲Up To Search▲   

 
Price & Availability of AN1221

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X