51单片机脉宽调制控制器外文文献及翻译
Design of PWM Controller in a MCS-51 Compatible MCU Yue-Li Hu, Wei Wang
Microelectronic Research & Development Center,Key Laboratory of Advanced Display and System Applications (Shanghai University), Ministry of Education Campus P.O.B.221, 149 Yanchang Rd, Shanghai 200072, China
E-mail: lwfree@youerw.com
Abstract
This paper presents a design of Pulse-Width Modulated(PWM) controller module in a MCU based on MCS-51structure. The design can generate 2-channel programmable periodic PWM signals. These output PWM signals from MCU can be used for a variety of applications including motor control. The function of the design allows users to select independent or complementary inversion timing relationships between 2 PWM wave forms. The latter mode selection also includes optional dead time function to support driving H-bridges and inverters. Therefore, users can control
the output PWM signals through setting the duty-cycle registers. After the successful simulation at the front end, practical experiments made on a NIOS development board verify the design.
1. Introduction
PWM technology is a kind of voltage regulation method by controlling the switch frequency of DC power with fixed voltage to modify the two-end voltage of load. This technology can be used for a variety of applications including motor control, temperature control and pressure control and so on. In the motor control system shown as Fig. 1, through adjusting the duty cycle of power switch, the speed of motor can be controlled. As shown in Fig. 2, under the control of PWM signal, the average of voltage that controls the speed of motor changes with Duty-cycle ( D = t1/T in this Figure ),thus the motor speed can be increased when motor power turn on, decreased when power turn off.
Fig.1 PWM control block diagram
Fig.2: The Relationship between Voltage of Armature and Duty-cycle
Therefore, the motor speed can be controlled with regularly adjusting the time of turn-on and turn-off. There are three methods could achieve the adjustment of duty cycle: (1)Adjust frequency with fixed pulse-width. (2) Adjust both frequency and pulse-width. (3) Adjust pulse-width with fixed frequency.
Generally, there are four methods to generate the PWM signals as the following: (1) Generated by the device composed of separate logic components. This method is the original method which now has been discarded. (2) Generated by software. This method need CPU to continuously operate instructions to control I/O pins for generating PWM output signals, so that CPU can not do anything other. Therefore, the method also has been discarded gradually. (3) Generated by ASIC. The ASIC makes a decrease of CPU burden and steady work generally has several functions such as over-current protection, dead-time adjustment and so on. Then the method has been widely used in many kinds of occasion now. (4) Generated by PWM function module of MCU. Through embedding PWM function module in MCU and initializing the function优-文^论'文.网http://www.youerw.com , PWM pins of MCU can also automatically generate PWM out signals without CPU controlling only when need to change duty-cycle. It is the method that will be implemented in this paper.
In this paper, we propose a PWM module embedded in a 8051 microcontroller. The PWM module can support PWM pulse signals by initializing the control register and duty-cycle register with three methods just mentioned above to adjust the duty cycle and several operation modes to add flexibility for user.
The following section explains the architecture of the PWM module and the architectures of basic functional blocks.Section3 describes two operation modes. Experimental and simulation results verifying proper system operation are also shown in that section. Depending on mode of operation, the PWM module creates one or more pulse-width modulated signals, whose duty ratios can be independently adjusted.
2. Implementation of PWM module in MCU
2.1 Overview of the PWM module优-文^论'文.网http://www.youerw.com
A block diagram of PWM module is shown in Fig.3. It is clearly from the diagram that the whole module is composed of two sections: PWM signal generator and dead-time generator with channel select logic. The PWM function can be started by the user through implementing some instructions for initializing the PWM module. In particular, the following power and motion control applications are supported:
• DC Motor
• Uninterruptable Power Supply (UPS)
Fig.3 Architecture of PWM Module
The PWM module also has the following features:
• Two PWM signal outputs with complementary or independent operation
• Hardware dead-time generators for complementary mode
• Duty cycle updates are configurable to be immediated or synchronized to the PWM
2. 2 Details of the architecture
2.2.1 PMW generator
The architecture of the 2-output PWM generator shown in Fig.3 is based on a 16-bit resolution counter which creates a pulse-width modulated signal. The system is synthesized by a system clock signal whose frequency can be divided by 4 times or 12 times through setting the value of T3M for PWM0 or T4M for PWM1 in the special register PWMCON as shown in Fig.4. To PWM0 generator, the clock to 16-bit counter will be pre-divided by 4 times by default when T3M is set to zero. And the clock will be divided by 12 times when T3M is set to 1. This is also true for PWM1. The other bits in PWMCON are explained in detail in Table 1.1615