ST AN392 Application note

AN392
Application note
Microcontrollers and TRIAC-based dimmers
Introduction
Today, electronics is used in home appliances for applications as widely varying as motor regulation in a washing machine, control of a vacuum cleaner, dimming of a lamp or heating in a coffee machine. This evolution has increased pace rapidly because appliances require enhanced features that are easy to build and modify while electronics-based solutions become cheaper and more sophisticated.
Within this evolution, microcontrollers (MCU) progressively replace analog controllers and discrete solutions even in low cost applications. MCUs are more flexible, often need less components and provide shorter time to market. With an analog IC, the designer is limited to a fixed function frozen inside the device. With a DIAC control, features like sensor feedback or enhanced motor drive cannot be easily implemented. With an MCU the designer can include his own ideas and test them directly using EPROM or one time programmable (OTP) versions.
The TRIAC is the least expensive power switch to operate directly on the 110/240 V mains. Thus it is the optimal switch for most of the low-cost power applications operating online. The logic level or snubberless TRIACs can operate with low gate current and can be directly triggered by the MCU.
This application note describes two different MCU based applications: a universal motor drive, and a light dimmer. They all operate with the same user interfaces and almost the same software and hardware.
April 2009 Doc ID 1863 Rev 2 1/11
www.st.com
Universal motor drive AN392

1 Universal motor drive

1.1 Power control

The power device is a TRIAC because it is the most economical online switch. In a TRIAC­based controller the output power, and, for example, the motor speed, are controlled by the phase delay of the TRIAC drive. This delay is referred to the zero crossing of the line voltage which is detected by means of a connection to the mains neutral (Figure 1). Changing operation from 60 Hz to 50 Hz can be achieved by making simple modifications to the MCU EPROM/ROM table defining the TRIAC conduction angle versus power level. Automatic selection of the 50 Hz/ 60 Hz tables can be implemented.
The TRIAC can be directly driven by the MCU. A very short gate current pulse (~ 100 µs) could be enough to trigger the TRIAC for rms load currents above 2 A. Such pulse control allows the low voltage MCU power supply consumption to be reduced. The snubberless TRIAC is driven in quadrants QII and QIII with a 60 mA gate current provided by three I/O bits of the ST6210 in parallel. This pulse is sufficiently long to ensure the TRIAC is latched at the end of the pulse. Pulse length can be modified if another TRIAC or motor is used.

Figure 1. Mains synchronization

1.2 User interfaces

Different user interfaces can be implemented - a touch control, a push button or a
2/11 Doc ID 1863 Rev 2
potentiometer. The circuit diagram in Figure 2 show that the three modes are implemented on the board to let the system designer choose the preferred user interface.
Control action is obtained when the sensor or the button is touched for more than 330 ms. If the touch duration is between 50 ms and 330 ms, the circuit is switched on or off. A contact of less than 50 ms causes no action.
AN392 Universal motor drive

Figure 2. Motor drive circuit diagram

Optional
GND
user interface
4.7 M
4.7 M
Push button
GND
+5 V
Potentiometer
Touch sensor
4.7 M
Line
Load
Neutral
Fuse
Fuse
47
47
BTA16-600CW
-
1M
1M
5.6 V
5.6 V
820-1/2W
820-1/2W
220 nF/400 V
GND
Version
1N4148
1N4148
19
19 18
18 17
17 16
16
13
13
12
12
11
11
+5 V
100 uF/10 V
1
1
VDD
VDD
PA 0
PA 0 PA 1
PA 1 PA 2
PA 2 PA 3
PA 3
PB2
PB2
PB3
PB3
PB4
PB4
OSCIN
OSCIN
3
3
8 MHz
8 MHz
22 pF 22 pF
+5 V
ST6210
ST6210
OSCOUT
OSCOUT
4
4
1 2
1 2
GNDGNDGND GNDGND
RESET
RESET
PB0
PB0
PB1
PB1
NMI
NMI VPP
VPP VSS
VSS
7
7
10 nF
15
15
14
14
5
5 6
6 20
20

1.3 Circuit components

The MCU chosen (ST6210) includes an 8 bit accumulator, 2 k ROM, 64 bytes RAM, an 8 bit A/D converter that can be connected to 8 different inputs, 4 I/O lines with 40 mA sink current capability and a timer. Hysteresis protection is included in series with each I/O pin. The ST6210 is packaged in DIL or SMD packages. The ports, the timer and interrupt configurations can be chosen by software, providing high flexibility. The ST6210 has been designed to operate in very disturbed environments. Each I/O line contains internal diodes which clamp the input voltage between V continuous current of 1 mA (typ.).
The snubberless TRIAC (BTA 16-600CW) has been specially designed to drive loads which generate very strong dynamic constraints such as a vacuum cleaner motor. This TRIAC can be triggered in quadrants QI, QII or QIII with gate and latching current of 35 mA and 80 mA respectively. In this application it is driven by three I/O lines of the ST6210 in parallel. This TRIAC has high current switching capability ((dI/dt)c > 8.5 A/ ms and 5.5 A/ms for BTA10600CW), and high static dv/dt ((dV/dt) > 500 V/ms). So, in this circuit, it can operate without any snubber.
Total consumption of the board is 3 mA with an 8 MHz oscillator. The board supply comes from the mains through a simple RCD circuit. The +5 V is referred to anode 1 of the TRIAC in order to provide the negative gate current necessary to drive the TRIAC in quadrants QII and QIII. The 5 V supply capacitance is connected as near as possible to the MCU with very short interconnecting traces to maximize RFI immunity.
The touch sensor is a voltage divider between line and neutral. It works only if the +5 V supply input of the circuit is connected to the line. This connection to the mains must be ensured according to local electrical safety rules.
and Vss. These diodes are sized to withstand a
dd
Doc ID 1863 Rev 2 3/11
Universal motor drive AN392

1.4 Software

All operating features are contained in a 700 byte program. So more than 1 byte of ROM is available for additional features.
A look-up table relating delay time to the power requirement contains 64 different levels. The conduction time of the TRIAC can vary from 1.7 ms to 6.7 ms for a 60 Hz application and from 2 ms to 8 ms to a 50 Hz application. The user can easily adjust the minimum and maximum power levels because the corresponding delay times are slowly changing at the top and bottom of the table.
It is recommended that all MCU inputs be filtered so that an input is validated only if it remains constant for 15 s or more so that passive filter components can be saved. The mains supply carries disturbances (glitches, telecommand signals, ...) which could disturb the TRIAC drive. For this reason, a mains voltage zero crossing is only validated if it occurs during a window of time (1.7 ms each 16.6 ms for 60 Hz operation and 2 ms each 200 ms for 50 Hz operation) selected by the internal timer of the MCU. This block acts as a filter and again eliminates external components (Figure 3).
This circuit can be used in the following applications:
Vacuum regulation in a vacuum cleaner
Speed control in a food processor
Speed regulation with torque limiting in a drill
Unbalance detection in a washing machine
Washing machine door opener with remote control

Figure 3. Major steps of the software

RESET
Initialization
Read version
Line synchronization
Sensor acquisition
Power level requirement
Delay time td1 in timer
Calculation next delay
TRIAC firing
Delay time td2 in timer
Calculation next delay
TRIAC firing
Window for zero
crossing mains
4/11 Doc ID 1863 Rev 2
Loading...
+ 7 hidden pages