51LPC series microcontrollers are used to control AC motors

Publisher:创意火花Latest update time:2012-02-20 Source: 单片机与嵌入式系统应用 Keywords:P87LPC761 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 Overview

PHILIPS 51LPC series microcontrollers currently include seven models, P87LPC760/1/2/4/7/8/9. 51LPC provides high-speed and low-speed crystal oscillator and RC oscillator modes, which can be selected programmably; it has a wide operating voltage range of 2.7~6.0V, programmable I/O port line output mode selection, optional Schmitt trigger input, LED drive output; it has an internal watchdog timer and provides power-off detection simulation function, which minimizes the use of external components. These features combined with the improved C51 structure make it possible to have more choices when designing high-integration, low-cost and low-power control circuits. This series is mainly used in low-power application fields that have strict requirements on system cost and high anti-interference performance of the system. It has been widely used in industrial control fields such as electronic positive energy meters, IC card water meters, electronic scales, disinfection cabinets, LED displays, gas meters, etc.

This article introduces a method of using the LPC series microcontroller P87LCP761 and a three-quadrant bidirectional thyristor (Triac) to control an inductive load AC motor under AC power conditions. A new current zero-crossing detection method is used, and there is no need to add a bypass resistor in the load current line. A single correlation wave is used to provide power for the control circuit. The high anti-interference performance of the LPC allows this system to be completed with very few external parts. This solution can be implemented through the on-chip RC oscillator and comparison of the P87LPC761 series microcontroller, or other LPC series chips with on-chip PWM, ADC and DAC functions. This system can be used to control motors (AC/DC), valves, pump lights, etc., and is widely used in lighting, HVAC, power tools, instruments and industrial control. Table 1 is the pin function of the P87LPC761.

Table 1 P87LPC761 pin function
Pin Number Symbol

Function

1 P0.0/CMP2 Comparator 2 Output
16 P0.1/CIN2B Comparator 2 positive input B
15 P0.3/CIN1B Comparator 1 positive input B
14 P0.4/CIN1A Comparator 1 positive input A
13 P0.5/CMPREF Comparator Reference
11 P0.6/CMP1 Comparator 1 Output
12 VDD Power positive terminal
4 VSS Negative terminal of power supply
5 X1/P2.1 Oscillator amplifier input
6 X2/P2.0/CLKOUT Oscillator amplifier output
7 SDA/INT0/P1.3 I/C Data Input/Output
8 SCL/T0/P1.2 I2C clock input/output
3 RST/P1.5 External reset input
10 P1.0/TXD Serial port output
9 P1.1/RXD Serial port input
2 P1.7 General I/O port

2 Principle

2.1 Load voltage zero-crossing control - single input detection

Block diagrams 1 and 2 are the general block diagrams of this application. The circuit is powered directly from the mains, and the phase control timing depends on the mains voltage zero crossing detection (Voltage Zero Crossing) (see Figure 1) or the load current zero crossing detection (Current Zero Crossing) (see Figure 2). Which detection method is used depends on the actual application. The control module calculates the generation time, and the LPC can directly absorb the gate current of multiple Triacs. In order to reduce EMI, ensure safe operation and control the phase, it is necessary to trigger the Triac when the current crosses zero or a specific phase angle. For resistive loads, the current and voltage zero crossings are consistent; for inductive loads, the current lags behind the voltage. The state of the load determines whether the Triac triggers the thyristor based on the voltage zero crossing or the current zero crossing. [page]

The simplest way to detect the voltage zero crossing is to measure the change in polarity of the mains voltage. The +5V terminal of the LPC is connected to the power line (or neutral point), and the neutral point (or power line) is connected to any I/O port through a current limiting resistor. The voltage at the I/O port is clamped between 0V and +5V by internal clamping diodes, as shown in Figure 3. The microcontroller can read the input state of the input port and detect the zero crossing of the voltage when the state changes from 1 to 0 or from 0 to 1. The level jump point depends on the mode of the I/O port (TTL or Schmitt trigger), and the delay time from the zero crossing point to the detection point depends on the rate of change of the power supply voltage (for example, 230V or 110V system), which must be taken into account. The advantages of this circuit are simplicity and low cost, because only one additional resistor (requires high voltage resistance) is required and any I/O port of the LPC can be used.

2.2 Current Zero Crossing Detection - Current Zero Crossing Window Comparator

The current zero crossing (CZC) is the commutation point of the Triac. CZC detection is particularly important in nonlinear loads because the current zero crossing point and the voltage zero crossing (VZC) point are not consistent; however, monitoring CZC is not as easy as monitoring VZC because the usual detection method requires a resistor in series with the load, which isolates the load circuit and wastes power. The usual method is through amplification and level conversion, and then connected to the microcontroller, which requires at least an additional operational amplifier and its related components. LPC uses a new method to detect the current zero crossing: monitoring the voltage from the gate (VG) to the anode (T1) of the Triac. VG-T1 gives a signal that the Triac is about to commutate because VG-T1 crosses zero at CZC. Depending on the load current and the characteristics of the Triac, VG-T1 can be as low as 0.1V or greater than 1.2V. The circuit shown in Figure 4 uses a window comparator to monitor this voltage to complete the CZC function. Figure 4 Window comparator is used for gate voltage and current zero crossing detectors. VG-T1 can be positive or negative relative to the line voltage, depending on the direction of the load current. That is to say, VG-T1 can be positive or negative relative to VCC+5V. Therefore, before LPC can be monitored, it must be divided by R4 and R5 to make it lower than VCC and within the operating voltage range of the comparator. R1, R2 and R3 limit the voltage near the zero crossing point.

3. Complete LPC+Triac+Motor(AC) Circuit Implementation

In the control application of P87LPC761 and Triac, the whole system has very low power consumption and high anti-interference performance, so it can be directly powered by the mains through RC step-down and single-phase half-wave rectification, without the need for expensive and bulky transformers, and with very few external parts. This solution is low-cost. Figure 5 shows a general circuit for inductive loads, which is also suitable for resistive loads. Triac can use BTA216 600E. As shown in Figure 4, the load current zero crossing is detected by querying the comparator of P87LPC761 and re-triggering Triac. Interrupt drive can also be used. When starting the motor, the voltage zero crossing is measured and the gate pulse of Triac is triggered to reduce electromagnetic interference, and the software can be controlled and redefined from the beginning of the main cycle to wait for a whole half cycle between starting the load. In this example, the load is turned on by the user button after reset, and the phase angle can be controlled by the button to control the different speeds of the motor. As shown in Figure 5, the speed of the LED light-emitting tube flashing can reflect the motor speed. The faster the LED flashes, the faster the motor rotates, and vice versa; the motor stops and the LED goes out. This circuit can be used in many other similar situations with slight modifications.

http://www.51kaifa.com/upload/eWebUpload/20051218174617531.gif

Source program list:

The software is compiled on Keil C51 V6.02 and runs normally on the target board. If other compilers are used, some modifications must be made.

#include

#define uchar unsigned char

#define uint unsigned int

uchar s,x,y=0;

void timer0(void)interrupt 1 using 1 {/*T0 interrupt service routine*/

x=x+1;

if(x/10>s){

if(y= =0){P1=P1&0xfb; /*LED lights up*/

x=0;y=1;}

else {P1=P1|0x04; /*LED turns off*/[page]

y=0;x=0;}}

TF0=0;TH0=-(28/256);

TL0=-(28%256);

}

void speed(s){ /*Motor conversion control subroutine*/

uchar pulsecount, pulseduration=0;

uint i=0;

uint j=0;

if (((CMP1&0x02))&&!(CMP2&0x02)/*query comparator*/

{for (i=0;i

{for(j=0;j<210;j++);} /*Delay trigger*/

CMP1 = CMP1 & 0xfc;

CMP2 = CMP2 & 0xfc;

pulsecount=1;

{P1=P1&0xfe;

pulseduration=12; /*trigger pulse width*/

while(pulseduration){pulseduration- -;}

P1=P1|0x01;

pulsecount- -;

}

}

}

void Initcomparatior(void){ //Initialize P87LPC761//

PT0AD=0x6f; /*Disable the digital function of P0 port*/

P0=0xff;

P0M1=0x2a; /*P01, P03, P05 are set to high impedance input*/

P0M2=0xd5; /*P00, P04, P06 are set to push-pull mode*/

P1=0xff;

P1M1=0x82; /*P17 is used for VZC detection*/

P1M2=0x05;

CMP1 = 0x34;

CMP2 = 0x34;

}

void main(void)

{uchar pulsecount ,pulseduration=0x00;

uint j;i=0;

SP=0x5f;EA=0;

TH0=-(28/256);

TL0=-(28%256);

TF0=0;EA=0;TR0=0;

ET0=1;CMP1=CMP2=0;

Initcomparator();

CMP1=CMP1&0xfc;

CMP2=CMP2&0xfc;s=0;

while(P1_1) {;}

while(!P1_1){;}

while(P1&0x80){};

while(!(P1&0x80)){};

while(P1&0x80){}

while(!(P1&0x80)){};

while(P1&0x80){};

P1=P1&0xfe; //Start the motor

while(1)

{if(P1_1= =0) {

x=0;

while (!x){;}

if(P1_1=0)

{P1=0xff;s=s+1;} //Stop the motor

if(s= =8){s=0;}

while(!P1_1){;} //Wait for the button to be released

while(P1&0x80){};

while(!(P1&0x80)){};

while(P1&0x80)();

whie(!(P1&0x80)){};

while(P1&0x80){};

P1=P1&0xfe;} //Start the motor

EA=1;TR0=1;

speed(s); }

} //Finish

Keywords:P87LPC761 Reference address:51LPC series microcontrollers are used to control AC motors

Previous article:Automatic Generation Technology of Single Chip Microcomputer Table Lookup Program
Next article:Large capacity external RAM expansion technology using segment management

Recommended ReadingLatest update time:2024-11-16 16:18

How to choose EN55022 standard low EMI power supply
  introduction   As the market demands for improved performance of information technology and communication equipment, today's system designers are faced with the challenge of having to design EMI compliant products. Before being sold, all information technology equipment (ITE), which is usually specified as having a
[Power Management]
How to choose EN55022 standard low EMI power supply
Silicon introduces stereo Class-D amplifier that effectively reduces EMI
Silicon Laboratories, a leader in high-performance analog and mixed-signal ICs, today announced the industry's first 5-watt stereo Class-D amplifier that effectively reduces electromagnetic interference ( EMI ), bringing high-fidelity audio to consumer audio electronics. As the first member of Silicon Labs' Class-D am
[Analog Electronics]
Detailed explanation of automotive EMI/EMC test standard ISO7637-2
At present, the popular automotive electronics standard ISO7637 is often encountered, so I think it is necessary to give you a simple and clear introduction to the general content of this standard so that you can use the solution in a targeted manner. (I) Test pulse classification: W/A/S/T/E T
[Embedded]
Detailed explanation of automotive EMI/EMC test standard ISO7637-2
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号