Share this

Design of a Variable Frequency Speed ​​Control System Based on AT89C51 Microcontroller

2026-04-06 08:09:34 · · #1
Abstract: This paper introduces a variable frequency speed control system with an AT89C51 microcontroller as the main controller and an SA8281 as the sine wave generator. The main circuit adopts an AC-DC-AC voltage-type frequency converter circuit. Based on the discussion of the system's hardware structure and software design, flowcharts of the main programs are provided. Practice shows that the system has high reliability, flexible configuration, and good application prospects. Keywords: Single-chip microcomputer, SA8281 waveform generator, frequency conversion control Design of Frequency Variable Adjusting-speed Control System Based on AT89C51 Microcomputer Abstract: This paper introduces a frequency variable adjusting speed system based on the single-chip microcomputer AT89C51 as the master controller, using the SA8281 as a sine wave generator. Its main circuit is the AC-DC-AC voltage source frequency conversion circuit. Based on discussing the system hardware structure and the software design, we have presented the main program flow chart. Practice shows that this system has many merits such as high reliability, flexible assembly, and good viability. Key words: Single-chip microcomputer; SA8281 Waveform Generator; Frequency control 1. Overview In the field of electrical drives, with the continuous improvement of self-turn-off device technology, pulse width modulation technology (PWM technology) has also become increasingly mature. PMW AC variable frequency speed control has been widely used in equipment such as underground fans, water pumps, and paper machines due to its advantages of high efficiency, high power factor, good output waveform, and simple structure. Applying a microcontroller to the AC variable frequency speed control system can effectively avoid some of the shortcomings of traditional speed control schemes and achieve the goal of improving control accuracy [1]. Its characteristics are: (1) Using a microcontroller can enable most control logic to be implemented through software, simplifying the circuit. (2) The microcontroller has stronger logic functions, fast operation speed, high accuracy, and large capacity storage unit, which can realize more complex control. (3) No zero drift and high control accuracy. (4) It can provide a human-machine interface and multi-machine network operation. Based on the latest research results and research trends of variable frequency speed control at home and abroad, and referring to a large number of documents and materials, and adhering to the system design principles of combining advancement and maturity, standardization, reliability, continuity, and timeliness, the system structure block diagram shown in Figure 1 was designed. [align=center] Figure 1 System Structure Block Diagram Figure 2 Rectifier Circuit[/align] The entire circuit is divided into three main parts: the main circuit, the drive circuit, and the control circuit that uses a microcontroller to control the PWM generator. There is also an overcurrent detection and protection circuit, which makes the system more stable and reliable. 2. System Main Circuit Design 2.1 Rectifier and Filter Circuit Design To provide a stable DC voltage to the inverter, the AC power input from the grid needs to be rectified. Rectifier circuits are generally divided into controlled rectification and uncontrolled rectification. Controlled rectification can make the system power factor close to 1, and has small ripple, high frequency, and can reduce the amount of small-amplitude filter capacitors. However, using a controlled rectification circuit increases system cost and complicates the control circuit. Currently, the most economical and reliable solution is generally to use diode rectification, making the grid power factor close to 1 regardless of the inverter output voltage. In this system, we use a three-phase diode uncontrolled rectification, as shown in Figure 2. It requires no control circuit drive, is simple and reliable, and has low cost. The disadvantage is that the ripple is large, requiring a larger-amplitude filter capacitor. 2.2 Design of Three-Phase Inverter Circuit Three-phase AC loads require three-phase inverters. Among three-phase inverter circuits, the most widely used is the three-phase bridge inverter circuit [2]. The voltage-type three-phase inverter circuit using IGBT as the controllable element is shown in Figure 3. It can be seen that the circuit consists of three half-bridges. [align=center] Figure 3 Three-phase inverter circuit Figure 4 IR2110 driving half-bridge circuit[/align] The basic working mode of the voltage-type three-phase inverter bridge is the same as that of the single-phase inverter bridge. It is a conduction mode, that is, the conduction angle of each bridge arm is , and the upper and lower arms of the same phase (the same half-bridge) conduct alternately. The time when each phase starts to conduct is different in sequence. In this way, at any instant, three bridge arms will be conducting at the same time. It may be the upper arm and the lower two arms, or it may be the upper two arms and the lower arm conducting at the same time. Because each commutation is carried out between the upper and lower bridge arms of the same phase, it is also called longitudinal commutation. Using T as the period, we only need to note that the three phases are spaced T/3 apart (T is the period), that is, phase B lags phase A by T/3, and phase C lags phase B by T/3. The specific conduction sequence is as follows: 1st T/6: V1, V6, V5 conduct, V4, V3, V2 cut off; 2nd T/6: V1, V6, V2 conduct, V4, V3, V5 cut off; 3rd T/6: V1, V3, V2 conduct, V4, V6, V5 cut off; 4th T/6: V4, V3, V2 conduct, V1, V6, V5 cut off; 5th T/6: V4, V3, V5 conduct, V1, V6, V2 cut off; 6th T/6: V4, V6, V5 conduct, V1, V3, V2 cut off. 3 Design of drive circuit and system protection circuit 3.1 Design of drive circuit As a power switching device, the working state of IGBT is directly related to the performance of the whole machine, so it is particularly important to select or design a reasonable drive circuit. Using a high-performance drive circuit can enable IGBT to work in a relatively ideal switching state, shorten the switching time, reduce the switching loss, and have important significance for improving the operating efficiency, reliability and safety of the whole device. The drive circuit must have two functions: one is to realize the electrical isolation between the control circuit and the gate of the driven IGBT; the other is to provide a suitable gate drive pulse [3]. The requirements for the drive circuit can be summarized as follows: 1) IGBT and MOSFET are both voltage driven, both have a voltage of 2.5~5V, and a capacitive input impedance. Therefore, IGBT is very sensitive to gate charge, so the drive circuit must be very reliable and ensure a low impedance discharge circuit, that is, the connection between the drive circuit and IGBT should be as short as possible. 2) Use a drive source with low internal resistance to charge and discharge the gate capacitor to ensure that the gate control voltage Uge has a sufficiently steep leading and trailing edge, so that the switching loss of IGBT is as small as possible. In addition, after the IGBT is turned on, the gate drive source should be able to provide sufficient power to prevent the IGBT from exiting saturation and being damaged. 3) The drive circuit should be able to transmit pulse signals of tens of kHz. 4) Under large inductive loads, the switching time of the IGBT should not be too short to limit the voltage spikes formed by di/dt and ensure the safety of the IGBT. 5) The gate drive circuit of the IGBT should be as simple and practical as possible, preferably with built-in protection functions for the IGBT and strong anti-interference capabilities. This paper uses the IR2110 integrated driver from IR Systems, Inc. to drive the IGBT. It has the advantages of small size, high speed, and simple circuit, and is the preferred choice for driving devices in small and medium power conversion devices. The driver chip IR2110 is used to drive the half-bridge circuit as shown in Figure 4. 3.2 Current Detection and Overcurrent Protection Circuit When the current flowing through the IGBT exceeds the safe zone, the IGBT will be permanently damaged. Therefore, the system must be equipped with an overcurrent protection circuit. The system uses a current transformer in series in the DC section of the inverter to convert the current into a voltage signal, which is then compared by a comparator. After detecting the overcurrent signal, it is sent to the pulse blocking terminal (level signal) of the SA828l. The SA828l will then stop outputting PWM pulses to protect the IGBT. The IGBT overcurrent protection circuit is shown in Figure 5. [align=center] Figure 5 IGBT Current Protection Circuit[/align] The operational amplifier C814 forms a voltage follower, whose input comes from the output of the current transformer. Two voltage comparators C271 form a window voltage comparator, and the output of the comparator is connected to the input of an AND gate via a Schmitt inverter. When the IGBT has no overcurrent, the input voltage of C814 is relatively low, the window voltage comparator outputs a high level, therefore the EN signal is high, making the IGBT drive signal valid; conversely, when the IGBT has an overcurrent, the EN signal becomes low, blocking the IGBT drive signal and turning off the IGBT. Adjusting potentiometer RP can change the overcurrent threshold. The principle of the overvoltage protection circuit is similar to that of the current protection circuit. In addition, a 10A fast-blow fuse should be installed on the main circuit. When a serious overcurrent occurs, the fast-blow fuse will blow and cut off the mains power supply, ensuring the safety of the main circuit as much as possible. 4. Control Circuit Hardware and Software Design The three-phase SPWM generator is the core part of the control circuit. In this design, we selected the AT89C51 microcontroller to control the dedicated integrated chip SA8281 from MITEL (UK) as the SPWM waveform generator. This chip has convenient interface with the microprocessor, and a complete SPWM control circuit can be formed with almost no additional logic circuits. Its compact structure improves the system's integration and reliability, and helps reduce costs. 4.1 Introduction to SA8281 The SA8281 chip is designed by MITEL specifically for speed control of AC motors, UPS power supplies and other power electronic devices that require pulse width modulation as an effective power control[4]. The pins are shown in Figure 6: [align=center] Figure 6 Pin arrangement of SA8281 Figure 7 Connection diagram of microcontroller and SA8281[/align] It is a programmable microcomputer peripheral interface chip that can be used for three-phase PWM waveform generation. It uses a set of standard MOTEL buses and is suitable for Intel and Motorola bus interfaces. The interface is universal, and the programming and operation are simple, convenient and fast. SA8281 uses the commonly used symmetrical double edge sampling method to generate fully digital PWM waveforms. There is no time drift and no temperature drift. It has high accuracy and temperature stability. There are 6 standard TTL level outputs to drive the 6 power switching devices of the inverter. It has a wide operating frequency range, high accuracy and adjustable triangular carrier frequency. The inverter operates flexibly. Without changing the circuit, its performance can be altered by directly setting parameters such as carrier frequency, modulation frequency, modulation ratio, minimum pulse width, and dead time via software, allowing it to drive different loads or operate under different conditions. The motor's forward and reverse rotation can be achieved by changing the phase sequence of the output SPWM pulses. By modulating the output frequency to 0Hz, DC current can be supplied to the motor windings, achieving "DC-assisted braking." An independent latching terminal can instantaneously latch the output SPWM pulses, handling unexpected motor situations. The waveform is stored in the internal ROM, and the minimum pulse width and dead time can be selected and deleted. 4.2 Implementation of Control Hardware Circuit The control circuit uses the AT89C51 microcontroller from Atmel. It employs a CMOS structure, has low power consumption, strong anti-interference capabilities, is fully compatible with the MCS-51 series, and offers significantly more functionality than typical 51 series chips. It contains 128 bytes of RAM and 4K bytes of EPROM, which fully meets the system requirements. No external RAM or EPROM is needed to store data or programs. However, the parameters that need to be set and saved are stored in an EEPROM [5]. The schematic diagram of the sine wave generator is shown in Figure 7. It uses SA828l as the three-phase sine wave generation chip and AT89C51 microcontroller as the control chip of SA828l. SA828l integrates most of the peripheral circuits inside the chip. It can be seen that SA8281 has a simple interface with the microprocessor, and the control circuit is very simple and compact. This is helpful for the stability of the chip and improves the reliability. From the perspective of the whole circuit, the control of SA828l is achieved by inputting the corresponding information through the key. The design of this circuit requires inputting initialization parameters and control parameters to SA8281, so three keys 0#, 1# and 2# are used. The key number is judged in the main program by query. Pressing 0# key enters the initialization subroutine; pressing 1# key enters the acceleration subroutine; pressing 2# key enters the deceleration subroutine. The AT89C51 is a microcontroller with multiplexed address and data buses. To isolate potential noise interference, the output disconnect pin SETTRIP is grounded under normal circumstances. A switch is also set to facilitate the rapid shutdown of all PWM outputs in an emergency. To make the PWM output active, the output disconnect pin is connected to a high level [6]. The external clock CLK pin is connected to an independent 12M active crystal oscillator to provide a clock reference for the SA8281 chip to control the timing related to PWM. 4.3 Control Circuit Software Design The control of the SA8281 chip is achieved by sending the corresponding parameters into two 24-bit registers R4 and R3 inside the chip through the microprocessor interface. These are the initialization register and the control register. The data is first read into a series of temporary registers R0 to R2, and then the data is transferred to the corresponding R4 and R3 registers through a virtual write operation. The initialization register is used to set some basic parameters related to the motor and inverter. Under normal circumstances, these parameters are initialized before the motor starts working (e.g., before the PWM output is enabled) and are generally not allowed to be changed while the motor is working. The control register controls the state of the output pulse width modulation wave during operation, thereby further controlling the motor's operation, such as speed, forward/reverse rotation, start, and stop. The contents of this register are frequently rewritten during motor operation to achieve real-time motor control. The program flowchart is explained below: 4.3.1 Main Program The main program uses a polling method to determine the key number: Pressing the 0# key enters the initialization subroutine; pressing the 1# key enters the acceleration subroutine; pressing the 2# key enters the deceleration subroutine. Additionally, a delay-based debouncing step is added to re-determine the key number to prevent accidental operation. The main program flowchart is shown in Figure 8: [align=center] Figure 8 Main Program Flowchart Figure 9 SA8281 Initialization Subroutine Flowchart[/align] 4.3.2 Initialization Subroutine The initialization subroutine sets basic parameters related to the motor and inverter, including carrier frequency setting, modulation wave frequency range setting, pulse delay time setting, minimum deleted pulse width setting, modulation waveform selection, amplitude control setting, etc. The data for initializing the registers is first stored in temporary registers R0, R1, and R2 in 8-bit format, and then stored back into the initialization register through a virtual write operation R4. Normally, these parameters should not be changed during motor operation. The SA8281 initialization subroutine flowchart is shown in Figure 9. 4.3.3 Speed ​​Control Subroutine The speed control subroutine includes acceleration and deceleration subroutines. This paper only introduces the acceleration subroutine; the deceleration subroutine is similar to the acceleration subroutine. The acceleration subroutine flowchart is shown in Figure 9. The control parameters include the modulation wave frequency control word and the modulation wave amplitude control word, which are calculated. The method is as follows: first, obtain the frequency and amplitude of the modulation wave based on the motor's U/F curve; then, calculate the corresponding control words using formulas and create a table. In this program design, a lookup table method is used to transmit the two control parameters. The comparison of modulation wave frequency and amplitude is shown in Table 1. The flowchart of the acceleration subroutine is shown in Figure 10: Table 1 Comparison of Modulation Wave Frequency and Amplitude [align=center] Figure 10 Flowchart of Acceleration Subroutine[/align] 5 Summary In this paper, the control chip for the variable frequency speed control system is the AT89C51 microcontroller, the SA8281 is used as the sine wave generator, and the IR2110 chip is used for driving. In addition, considering the system's stability, a protection circuit was designed. Thus, the entire system is characterized by low cost, complete functionality, and significant practical value. Currently, China's variable frequency speed control market is gradually growing, and the demand is becoming increasingly widespread. Therefore, research on variable frequency speed control systems has important academic significance and application value. References [1] Zhang Haibin. SPWM frequency conversion speed regulation application technology [M]. Beijing: Machinery Industry Press, 2002. 55-80. [2] Zhang Fasheng, Wu Shuci. SPWM inverter controlled by SA8281 [J]. Foreign Electronic Measurement Technology, 2004 (1): 23-25. [3] He Feng. IGBT module driving and protection technology [J]. Electrical Switch 2003 (4). [4] Yang Qinghua. Principle of SA8281 type SPWM wave generator and its application in frequency converter [J]. Foreign Electronic Components, 2006 (5): 51-53. [5] Xu Yingfeng, Gong Min, Chen Baining et al. A DC speed regulation control device based on AT89C51 single-chip microcomputer [J]. Journal of Shenyang University of Technology, 2007, 26 (4): 71-73. [6] Lu Dan, Gao Caixia, Wang Fuzhong. Design of AC variable frequency speed control system based on AT89C51 [J]. Coal Mine Machinery, 2008, 29(7): 189-191.
Read next

CATDOLL Rosie Hard Silicone Head

The head made from hard silicone does not have a usable oral cavity. You can choose the skin tone, eye color, and wig, ...

Articles 2026-02-22