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.
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.
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)();
whie(!(P1&0x80)){};
while(P1&0x80){};
P1=P1&0xfe;} //Start the motor
EA=1;TR0=1;
speed(s); }
} //Finish
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
- Popular Resources
- Popular amplifiers
- Study on the Behavioral Model of Silicon Carbide MOSFET Power Module and EMI Prediction of Low-Voltage Auxiliary Power Supply
- Cable radiated EMI modeling considering mutual coupling effects_Junpeng Ji
- Design of broadband hybrid active EMI filter for switching power supply_Liao Yuehong
- Switching power supply conducted EMI simulation and filter circuit design_Jiang Yunfu
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- 【XMC4800 Relax EtherCAT Kit Review】+ Getting Started with DAVE, PWM Module Application
- Explain the circuit diagram, thanks
- STM32 branch can support flash chips larger than 16MB
- RSL10-SENSE-DB-GEVK Environmental Monitoring Node Design
- AT32F425-Evaluation Report-CANOpen Porting 05
- RSIC-V IDE MRS User Notes (V): Code Erasure Problem Before Debugging
- There are indeed many people who ask for money, and the most annoying ones are the brainless ones.
- About the compilation speed when compiling STM32 with MDK
- Auto repair oscilloscope measuring the oxygen sensor signal of the car zirconium oxygen belt heater
- Can the same-phase AC amplifier circuit be used for low frequencies?