Based on the C8051F330 MCU related knowledge analysis solution

Publisher:灵感之翼Latest update time:2012-07-02 Source: 61icKeywords:C8051F330 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

0 Introduction

In some applications, the motor used is required to be small, high-efficiency, and high-speed. Micro permanent magnet brushless DC motors can better meet these requirements. Because the motor is small in size and it is difficult to install a position sensor, position sensorless control of micro brushless DC motors is particularly necessary.

The difficulty of position sensorless control of brushless DC motor lies in the detection of rotor position signal. At present, domestic and foreign researchers have proposed many methods, among which the back electromotive force method is the simplest, most reliable and has the widest application range. The commonly used control schemes are DSP-based control and ASIC-based control, but they are expensive and large in size, which is not conducive to use in micro motor controllers. This article introduces a controller for position sensorless brushless DC motor based on C8051F330 microcontroller and back electromotive force detection method. The system has a simple structure, ultra-small size, low price and good operating performance.

1. Control method of sensorless brushless DC motor

The inverter main circuit for realizing electronic commutation and PWM control of brushless DC motor is shown in Figure 1a. It adopts two-by-two energization mode, that is, two power tubes are turned on at every moment, and the commutation is performed once every 60° electrical angle, and each power tube is turned on for 120° electrical angle. The turn-on sequence of the power tubes is: V6V1→V1V2→V2V3→V3V4→V4V5→V5V6.

In a square wave brushless DC motor, the back electromotive force waveform (i.e., the air gap flux waveform) of the stator winding is a positive and negative symmetrical trapezoidal wave, as shown in Figure 1b. It can be seen from the figure that when the back electromotive force of the non-energized phase winding is detected to be zero, the optimal phase change moment is obtained by taking this as the starting point and lagging 30° electrical angle. Therefore, as long as the zero crossing point of each back electromotive force is measured, the six key position signals required by the three-phase motor can be obtained, thereby realizing the correct commutation of the stator winding. The neutral point 0 of the motor winding is generally not brought out, so it is difficult to directly measure the phase value of the back electromotive force of the winding. What is easy to measure is the terminal voltage of the three-phase stator winding to the ground. The time when the terminal voltage passes through the midpoint (half of the DC power supply voltage) coincides with the time when the back electromotive force passes through the zero point, so finding the 30° electrical angle after the zero crossing point of the back electromotive force is equivalent to finding the 30° electrical angle after the midpoint of the terminal voltage.

2 Control system design

2.1 Hardware Circuit Design

The hardware circuit diagram of the system is shown in Figure 2, which consists of a C8051F330 single-chip microcomputer, an inverter bridge circuit, a terminal voltage detection circuit, a voltage stabilization circuit, etc. This circuit is very simple in design, and various components are packaged in small SMD packages, which is very suitable for micro motor controllers that are sensitive to cost and size.

In the inverter bridge circuit, the upper arm is a P-type MOSFET device FDS6679, and the lower arm is an N-type MOSFET device M4410B, both of which are low-voltage driver devices. FDS6679 is driven by an NPN transistor, while M4410B is directly driven by the P1 port of C8051F330 (P1 port is set to push-pull output). The PWM control mode is defined as: PWM is only applied to the lower MOSFET of the half-bridge, and the upper (diagonal) MOSFET of the commutation only plays the role of phase switching on and off control.

Detection of power supply voltage and current: When the UV phase is energized, the terminal voltage Uu of the U phase is detected during the PWM on period. Since the on-state voltage of the MOSFET is very small (less than 0.1V), the terminal voltage uu can be approximately regarded as the power supply voltage UD; a sampling resistor is connected in series between the source of the lower bridge arm and the power ground, and the current value is obtained by detecting the resistor voltage at the P0.4 port. The input signal is first amplified by the internal programmable gain amplifier and then A/D converted.

2.2 Software Design

The software mainly consists of initialization program, motor starting program, terminal voltage detection and commutation program, voltage and current protection program, operation control program, etc. There are four interrupts: PWM interrupt, ADC interrupt, T1 interrupt, and T2 interrupt. Among them, T2 interrupt implements the motor starting program, PWM interrupt starts ADC interrupt during PWM opening, terminal voltage detection is performed in ADC interrupt, and T1 interrupt is started to complete commutation when the back electromotive force crosses zero.

2.2.1 Initialization of G8051 F330

Since the C8051F330 microcontroller and the 8051 microcontroller have different internal resources, their initialization is different. There are two main differences: the configuration of the cross switch for the external pins; the configuration of the system clock source. Considering that it is cumbersome for users to write initialization programs by themselves, Silicon Labs has launched the C8051F microcontroller initialization code generation program software Config2Version 1.30. Users can easily generate the C8051F330 initialization program by simply clicking and selecting with the mouse on the graphical interface. This greatly speeds up the user's development speed.

2.2.2 PWM wave output control

The programmable counter array (PCA) of C8051F330 consists of a dedicated 16-bit counter/timer and three 16-bit capture/compare modules, which can realize 3-way 8-bit PWM or 16-bit PWM functions. The high byte PCAOH and low byte PCAOL of the 16-bit counter/timer of PCA determine the frequency of the PWM wave, and the duty cycle of the PWM wave can be changed by changing the high byte PCAOCPHn and low byte PCAOCPLn of the capture/compare module.

2.2.3 Terminal voltage detection and phase change

Back-EMF commutation signal detection: Start the ADC during the PWM on period to detect the terminal voltage of the phase winding that is not energized. When its value is equal to half of the power supply voltage, it is the back-EMF zero-crossing signal. Consider: a. The ADC detection time should be synchronized with the PWM, and the midpoint of the PWM on time should be selected to avoid the transient voltage noise of the switching state. b. The first few back-EMF sampling points after commutation should be discarded in the software, because the winding current will not be zero immediately after commutation, and it will drop to zero after a continuous flow process. The program is shown in Figure 4. Use timer 0 to record the time when the two terminal voltages are continuously monitored to cross zero points. Dividing it by 2 is the time of 30° electrical angle. This time is loaded into timer 1. Timer 1 triggers an interrupt after 30° electrical angle time, and calls the commutation subroutine for electronic commutation.

3 Experimental results and conclusions

The experimental prototype uses a sensorless brushless DC motor produced by Changsha Fangyuan Model Factory, model 1208436, with rated parameters of speed: 4100r/V, 2 pairs of poles, maximum current: 4A, internal resistance: 0.59Ω, and no-load current: 0.3A.

When the power supply voltage is 10V, the PWM duty cycle is 20%, and there is no load, the terminal voltage waveform is shown in Figure 6. As can be seen from the figure, the commutation time is about 0.6ms, and the terminal voltage waveform is a good trapezoidal wave. According to the rated parameters of the motor, the commutation time is calculated to be 0.609ms (60° electrical angle), which shows that the commutation time is relatively accurate. Experiments have proved that with the above control technology, the motor system starts smoothly without vibration and loss of step. At the same time, the system has the advantages of simple structure, miniaturization, low cost, reliable operation, and good speed regulation performance.

Keywords:C8051F330 Reference address:Based on the C8051F330 MCU related knowledge analysis solution

Previous article:The interface between single chip microcomputer and MODEM and the scheme of controlling MODEM by AT commands
Next article:Analytical solution of electronic timing and scoring system with 89C51 single chip microcomputer as core device

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号