资源描述
苏州大学本科生毕业设计(论文)附件:外文文献资料与中文翻译稿外文文献资料收集:苏州大学 应用技术学院 电子班(学号1116405048)王凯Design of PWM Controller in a MCS-51 Compatible MCUDC motor (direct-current motor) is the electrical machinery to realize conversion between DC electric energy and mechanical energy. DC motor has a wide speed range,smooth stepless feature. Often used in the occasion of the higher requirements on starting and speed control,such as hotel of high speed elevator,longmen planer,locomotive,large precision machine tool and heavy lift and other manufacturing machine.This paper introduced a system of using the input voltage changes to control motor speed.In resent years,the DC motor is widely used,for its so many advantages,such as its speed can be adjust conveniently.There are many methods of DC motor speed control and PWM is the most widely used method for adjusting foe the DC motor.Here by changing the input voltage magnitude, to regulate the speed of the motor.The use of PWM (Pulse Width Modulation) the duty ratio of the pulse signal decided the size of average voltage output to the DC motor.duty ratio By the way of change the duty ratio of voltage on the DC motor armature to change the size of the average voltage so as to control the speed of the motor.This article describes the method of combining the use of hardware and software of the motor speed measurement and speed regulation.The hardware with STC89C51 as the core,with the drive circuit, speed measurement circuit, the keyboard and LCD display module compose a minimum system.The LCD uses a dynamic display mode,the keyboard using query mode to realize.The software output PWM signal is generated by the use of C language programming,by the way of adjust the duty ratio,can achieve the purpose of regulating the output voltage .Through the above design,realize the microcontroller output PWM pulse signal and adjust the speed of motor.Through the speed measuring circuit feedback to MCU(Micro Control Unit ) ,and display the speed on the LCD display. According to the displayed speed, people can operate the keyboard to reach the desired setting speed.Conditioning system is characterized in that output power to maintain stability. Different speed control system can use a different brake system, high starting and braking torque, quick response and quick adjustment range of degree requirements of DC drive system, the use of the electric braking mode. Depends on the speed control of DC motor armature voltage and flux. To zero speed, or U = 0 or = . The latter is impossible, it only changes through the armature voltage to reduce speed. To speed to a higher value can increase or decrease the U . A regulator system is one which normally provides output power in its steady-state operation. For example, a motor speed regulator maintains the motor speed at a constant value despite variations in load torque. Even if the load torque is removed, the motor must provide sufficient torque to overcome the viscous friction effect of the bearings. Other forms of regulator also provide output power; A temperature regulator must maintain the temperature of, say, an oven constant despite the heat loss in the oven. A voltage regulator must also maintain the output voltage constant despite variation in the load current. For any system to provide an output, e.g., speed, temperature, voltage, etc., an error signal must exist under steady-state conditions. In many speed control systems, e.g., rolling mills, mine winders, etc., the load has to be frequently brought to a standstill and reversed. The rate at which the speed reduces following a reduced speed demand is dependent on the stored energy and the braking system used. A small speed control system (sometimes known as a velodyne) can employ mechanical braking, but this is not feasible with large speed controllers since it is difficult and costly to remove the heat generated. The various methods of electrical braking available are: (1) Regenerative braking.(2) Eddy current braking.(3) Dynamic braking. (4) Reverse current braking(plugging) Regenerative braking is the best method, though not necessarily the most economic. The stored energy in the load is converted into electrical energy by the work motor (acting temporarily as a generator) and is returned to the power supply system. The supply system thus acts as a”sink”into which the unwanted energy is delivered. Providing the supply system has adequate capacity, the consequent rise in terminal voltage will be small during the short periods of regeneration. In the Ward-Leonard method of speed control of DC motors, regenerative braking is inherent, but thyristor drives have to be arranged to invert to regenerate. Induction motor drives can regenerate if the rotor shaft is driven faster than speed of the rotating field. The advent of low-cost variable-frequency supplies from thyristor inverters have brought about considerable changes in the use of induction motors in variable speed drives. Eddy current braking can be applied to any machine, simply by mounting a copper or aluminum disc on the shaft and rotating it in a magnetic field. The problem of removing the heat generated is severe in large system as the temperature of the shaft, bearings, and motor will be raised if prolonged braking is applied. In dynamic braking, the stored energy is dissipated in a resistor in the circuit. When applied to small DC machines, the armature supply is disconnected and a resistor is connected across the armature (usually by a relay, contactor, or thyristor).The field voltage is maintained, and braking is applied down to the lowest speed. Induction motors require a somewhat more complex arrangement, the stator windings being disconnected from the AC supply and reconnected to a DC supply. The electrical energy generated is then dissipated in the rotor circuit. Dynamic braking is applied to many large AC hoist systems where the braking duty is both severe and prolonged. IntroductionPWM 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.Figure 1: The Relationship between Voltage of Armature and Figure 2:Architecture of PWM ModuleTherefore, 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, 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.Implementation of PWM module in MCUOverview of the PWM moduleA 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 Uninterruptablel Power Supply (UPS)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 PWMFig.3 Architecture of PWM ModuleDetails of the architecturePMW generatorThe architecture of the 2-output PWM generator shown in Fig.4 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. Fig .4 Bit Mapping of PWMCONTable 1: The Bit Definition in PWMCONChannel-select logicThe follow Fig. 5 shows the channel-select logic which is useful in Complementary Mode. From this diagram, it is clear to know that signal CP and CPWM control the source of PWMH and PWML. And the details about the two control signals will be discussed in the section 3, and the architecture of dead-time generator will also be discussed in section 5 for the continuity of Complementary Mode.Fig. 5 Diagram of Channel-select LogicOperation Mode and Simulation ResultsThe design has two operation modes: Independent Mode and Complimentary Mode. By setting the corresponding bit CPWM in register PWMCON shown in Fig.6 user can select one of the two operation modes. When CPWM is set to zero, PWM module will work in Independent Mode, whereas, PWM module will work in Complimentary Mode. In the following of this section, the two operation mode will be explained respectively in detail and the simulation results of the PWM module from the Synoposys VCS EDA platform which verify the design will also be shown.Independent PWM Output ModeAn Independent PWM Output mode is useful for driving loads such as the one shown in Figure 6. A particular PWM output is in the Independent Output mode when the corresponding CP bit in the PWMCON register is set to zero.In this case, two-channel PWM outputs are independent of each other. The signal on pin PWM0/PWMH is from PWM0 generator, and the signal on pin PWM1/PWML is from PWM0 generator. The separate case is achieved by the channel-select logic shown in Fig. 6. The PWM I/O pins are set to independent mode by default upon advice reset. The dead-time generator is disabled in the Independent mode. The simulation result is shown in Figure 6 as the following Fig.6 Tr4 and tr3 are run bits to PWM0 and PWM1, respectively. Actually, from this diagram, Pin P15/ P14 of MCU is used for PWMH/ PWML or normal I/O ,alternatively.Fig6 the Waveform of PWM Outputs in Independent ModeComplementary PWM Output ModeThe Complementary Output mode is used to drive inverter loads similar to the one shown in Figure 7. This inverter topology is typical for DC applications. In Complementary Output Mode, the pair of PWM outputs cannot be active simultaneously. The PWM channel and output pin pair are internally configured through channel-select logic as shown in Figure7. A dead-time may be optionally inserted during device switching where both outputs are inactive for a short period.Fig 7 : Typical Load for Complementary PWM OutputsThe Complementary mode is selected for PWM I/O pin pair by setting the appropriate CPWM bit in PWMCON. In this case, PSEL is in effect. PWMH and PWML will come from PWM0 generator when PSEL is set to zero, when the signals from PWM1 generator is useless, whereas PWMH and PWML will come from PWM1 generator when PSEL is set to 1, when the signals from PWM0 generator is useless. In the process of producing the PWM outputs in Complementary Mode, the dead-time will be inserted to be discussed in the following section.Dead-time Control Dead-time generation is automatically enabled when PWM I/O pin pair is operating in the Complementary Output mode. Because the power output devices cannot switch instantaneously, some amount of time must be provided between the turn-off event of one PWM output in a complementary pair and the turn-on event of the other transistor. The 2-output PWM module has one programmable dead-time with 8-bit register.The complementary output pair for the PWM module has an 8-bit down counter that is used to produce the dead-time insertion. As shown in Figure 8, the dead time unit has a rising and falling edge detector connected to PWM signal from one of PWM generator. The dead times is loaded into the timer on the detected PWM edge event. Depending on whether the edge is rising or falling, one of the transitions on the complementary outputs is delayed until the timer counts down to zero. A timing diagram indicating the dead time insertion for the pair of PWM outputs is shown in Figure 8a.Fig 8a Dead-time Unit Block DiagramFig. 8b the Waveforms of PWM Outputs in Complementary ModeConclusionsIn this paper, we have designed PWM module based on an 8-bit MCU compatible with 8051 family. The design can generate 2-channel programmable periodic PWM signals with two operation mode, Independent Mode and Complementary Mode in which dead-time will be inserted. The simulation results on the EDA platform have proven its correctness and usefulness.第 17 页中文翻译稿翻译:苏州大学 应用技术学院 电子班(学号1116405048)王凯基于C51兼容微处理器单片机的PWM控制器设计直流电机是实现直流电能与机械能之间相互转换的电力机械,直流电动机具有宽广的调速范围,平滑的无级调速特性2。常应用于对启动和调速有较高要求的场合,如宾馆高速电梯、龙门刨床、机车、大型精密机床和大型起重机等生产机械中。本文系统介绍了利用输入电压的改变来控制电机的转速。当前,直流电机因其速度可调等种种优点,在实际生产中得到了广泛的应用。直流电机调速的方法有很多,直流电机的脉宽调制方法是直流电机调速方法中比较常见的。在这用改变输入电压的大小,来调节电机的转速。利用PWM脉冲信号的占空比决定输出到直流电机的平均电压的大小。通过改变直流电机电枢上电压的“占空比”来改变平均电压的大小,从而控制电动机的转速。本文阐述了利用硬件和软件相结合的方法来进行对电机的测速和调速,硬件方面以STC89C51型号的单片机为核心,与驱动电路,测速电路,键盘和LCD显示模块构成最小系统。其中LCD采用动态显示方式,键盘采用查询方式实现。软件上通过用C语言编程产生PWM信号的输出,通过调节占空比,可以实现调节输出电压的目的。通过以上的设计,就实现了由单片机输出PWM脉冲信号,调节电机速度。通过测速电路把转速反馈给MCU,并把转速显示在LCD显示器上。人员可根据显示速度操作键盘,最终达到想要设定的转速。调节系统的特征在于能保持输出功率的稳定。不同的速度控制系统可以使用不同的制动系统,在有高起、制动转矩,快速响应和快速度调节范围要求的直流调速系统中,采用的是电气制动的方式。直流电机的速度控制取决于电枢电压和磁通。要将转速降为零,或者U=0或=。后者是不可能的,因此只可通过电枢电压的变化来降低转速。要将转速增加到较高值,可以增大U或减小。调节系统是一类通常能提供稳定输出功率的系统。 例如,电机速度调节器要能在负载转矩变化时仍能保持电机转速为恒定值。即使负载转矩为零,电机也必须提供足够的转矩来克服轴承的粘滞摩擦影响。其他类型的调节器也提供输出功率,温度调节器必须保持炉内的温度恒定,也就是说,即使炉内的温度散失也必须保持炉温不变。一个电压调节其也必须保持负载电流值变化时输出电压值恒定。对于任何一个提供一个输出,例如,速度、温度、电压等的系统,在稳态下必须存在一个误差信号。在许多速度控制系统中,例如轧钢机、矿坑卷扬机等这些负载要求频繁地停顿和反向运动的系统。随着减速要求,速度减小的比率取决于存储的能量和所使用的制动系统。一个小型速度控制系统(例如所知的伺服积分器)可以采用机械制动,但这对大型速度控制器并不可行,因为散热很难而且很昂贵。 可行的各种电气制动方法有: (1) 回馈制动 (2) 涡流制动 (3) 能耗制动 (4) 反接制动 回馈制动虽然并不一定是最经济的方式,但却是最好的方式。负载中存储的能量通过工作电机(暂时以发电机模式运行)被转化成电能并返回到电源系统中。这样电源就充当了一个收容不想要的能量的角色。假如电源系统具有足够的容量,在短时回馈过程中最终引起的端电压升高会很少。在直流电机速度控制渥特-勒奥那多法中,回馈制动是固有的,但可控硅传动装置必须被排布的可以反馈。如果转轴速度快于旋转磁场的速度,感应电机传动装置可以反馈。由晶闸管换流器而来的廉价变频电源的出现在变速装置感应电机应用中引起了巨大的变化。 涡流制动可用于任何机器,只要在轴上安装一个铜条或铝盘并在磁场中旋转它即可。在大型系统中,散热问题是很重要的,因为如果长时间制动,轴、轴承和电机的温度就会升高。 在能耗制动中,存储的能量消耗在回路电阻器上。用在小型直流电机上时,电枢供电被断开,接入一个电阻器(通常是一个继电器、接触器或晶闸管)。保持磁场电压,施加制动降到最低速。感应电机要求稍微复杂一点的排布,定子绕组被从交流电源上断开,接到直流电源上。产生的电能继而消耗在转子回路中。能耗制动应用在许多大型交流升降系统中,制动的职责是反向和延长。 任何电机都可以通过突然反接电源以提供反向的旋转方向(反接制动)来停机。在可控情况下,这种制动方法对所传动装置都是使用的。它主要的缺点就是当制动等于负载存储的能量时,电能被机器消耗了。这在大型装置中就大大增加了运行成本。导言PWM技术,是一种电压调节方法,通过控制具有固定电压的直流电源的开关频率来调整两端负荷电压。这种技术能用于各种应用包括电机、温度、和压力的控制,等等。在电机系统中的应用,如图1所示,通过调整电源开关的占空比,来控制电机的速度,如图2所示,平均电压通过改变占空比来控制电机的速度(在图中D=t1/T),这样当电机的电源打开时,它的速度加快,相反,当电源关闭时,速度下降。图1 PWM控制框图 图2 电压的电枢和占空比之间的关系所以,通过定期地调整时间的开通和关断来控制电机的转速:这儿有三种方法可以完成占空比的调整(1) 通过脉宽来调整频率;(2) 通过同时调整频率和脉宽;(3) 通过频率来调整脉宽。一般情况下,有四中方法可以产生PWM信号,正如以下:(1) 由独立逻辑元件组成的装置产生,这种是原始的方法,现在已被淘汰;(2) 通过软件产生,这种方法需要CPU持续操作代码来控制I/O口,以致于CPU不能做其他任何事。所以,这种方法也渐渐被淘汰;(3) 通过ASIC产生,ASIC减少了CPU的负担,并获得了稳定的工作,一般有几个功能,如电流保护、死区时间调整等等;然而这种方法现在已被广泛用于许多场合;(4)通过单片机的PWM功能模块产生,只有当需要改变占空比的时候CPU失控,这样就不能产生PWM信号,否则通过在单片机里嵌入PWM功能模块,并使这功能初始化,单片机的PWM口也能自动产生PWM信号。这种方法将在文章中讲述。在本文中,我们建议在8051单片机里嵌入一个PWM模块。该PWM模块,通过初始化控制寄存器和寄存器的占空比,可以支持PWM脉冲信号,用刚才提到的上述三种方法调整占空比和几个操作模式,以增加用户弹性。以下这部分解释PWM模块和基本功能模块的结构。第三部分描述两种操作模式。这部分还讲述了实验和仿真的结果验证了合适的系统操作。通过操作模式,PWM模块产生一个或更多的脉宽模块信号,它们的比率可以自主调整。在单片机上执行PWM模块PWM模块的概述PWM模块如图3所示,从图中,可以很清楚得看到整个模块有两部分组成:PWM信号产生器和带有频道选择逻辑的死区时间产生器。用户可以通过执行一些代码使PWM模块初始化,从而启动其功能。在特殊情况下,支持以下电源和运动控制应用:1.直流电机2.持续电源供应PWM模块也有以下特征:1.两个PWM输出信号以互补或独立的方式运行2.带有互补模式的硬件死区电动机3.占空比更新设置应立刻或与PWM同步 图3 PWM模块的结构结构的详细组成PWM电动机二输出PWM电动机的结构如图2.1所示,该结构是基于能产生脉宽调制信号上的16位计数器。该系统由四分频或十二分频的系统时钟信号合成,时钟信号的频率可通过对在特殊寄存器PWMCON中的PWM0电机的T3M或PWM1电机的T4M的值进行设置而调整,如图4所示:对于PWM0电机,当T3M设置为零时,16位计数器时钟将被默认预分为四分频,当T3M设置为1时,始终将被十二分频;PWM同样有这种功能。在PWMCON中的其它位的定义,详见表1图4 PWMCON的位的位置表1:PWMCON的位的定义通道选择逻辑 通道选择逻辑在互补模式中很有用,如图5所示。从表中可以清楚得看出,信号的CP和CPWM控制PWM1和PWML的来源,这两个控制信号的详细情况将在第三部分讲述,死区时间电机的结构也将在一下部分的连续性互补模式中讲述。图5 通道选择逻辑表运行模式和仿真结果这种设计有两种运行模式:独立模式和互补模式。通过在PWMCON寄存器中设置相应的位CPWM,如图四所示,用户可以选择其中一个运行模式。当CPWM设置为0时,PWM模式将工作在独立模式,COWM设置为1时,将工作在互补模式。在这部分两种模式将分别被详细讲述,从VCS EDA平台的PWM模块的仿真结果证明这种设计。独立PWM输出模块独立PWM输出模块对于驱动负荷很有用,如图6所示。当在PWMCON寄存器中相应的CP位设置为0,特殊的PWM输出模块是在独立的输出模式里。在这种情况下,PWM的两种通道输出是相互独立的。在PWM0/PWML口的信号是从PWM0电机产生的。通道选择逻辑完成单独情况,如图6所示。PWM I/O口通过默认意见复位设置为独立模式,但死区时间电机不能在独立模式下工作。仿真结果如图6所示。Tr4和Tr3分别与PWM0和PWM1相连,实际上,从图看,单片机的P15/P4口被用做PWMH/PWML或是一般的I/O口。图6 独立模式下的PWM波形互补PWM输出模式互补输出模式可以用于驱动逆变器负载,如图7所示。这种逆变器拓扑学是典型的直流装置。在互补输出模式,PWM的两个输出不能同时用。PWM通道和输出口都是通过通道选择逻辑内部配置的,如图7所示。死区时间是在两端输出的开关装置没有工作的短时期时可以选择插入的。图7 PWM互补输出的典型电路PWM I/O口通过在PWMCON中设置适当的CPWM位选择互补模式,在这种情况下,PSWL是有效果的。当PSEL设置为0时,PWMH和PWML将来自PWM0电机,这时来自PWM1电机的信号是没用的,而当PSEL设置为1时,PWMH和PWML将来自PWM1电机,这时来自PWM0电机的信号是没用的。在互补模式时产生PWM输出信号的过程中,死区时间将被插入在以下这部分讲述。死区时间控制当PWM I/O口在互补输出模式运行时,死区时间是自动启用生成的,因为电源输出装置不能瞬间开关,在互补对模式下,一个PWM输出的关闭与其它晶体管打开之间要一定的时间,2输出的PWM模块有一个带有8位寄存器的可编程死区时间。PWM模块的互补输出对已有一个用于产生死区时间插入的8位计数器。死区时间单元有一个上升沿和下降沿探测器,而这个探测器与PWM电机产生的PWM信号连接。当到达PWM边沿时,死区时间被载入计时器,根据是否是上升沿或下降沿,在互补输出端口上的其中一个过度被延迟,直到计数器降为0。PWM输出对的死区时间表,如图8a所示:图8a 死区时间单元模块图图8b 互补模式的PWM输出波形总 结:本文,我们设计了基于8位兼容8051单片机的PWM模块,这种设计能产生2通道带有两种运行模式的可编程周期PWM信号,即可插入死区时间的独立模式和互补模式。这种在EDA平台的仿真结果已证明了它的和谐性和有用性。
展开阅读全文