请问哪种单片机可以通过内部的配置来互补输出并且带有死区互补控制的PWM?谢谢

STM32的PWM控制_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
评价文档:
STM32的PWM控制
上传于||文档简介
&&s​t​m2​的​P​W​M​应​用
大小:17.19KB
登录百度文库,专享文档复制特权,财富值每天免费拿!
你可能喜欢外文资料翻译--基于C51兼容微处理器单片机的PWM控制器设计-海文库
全站搜索:
您现在的位置:&>&&>&电子/电路
外文资料翻译--基于C51兼容微处理器单片机的PWM控制器设计
毕业设计(论文)外文资料翻译
号: 机械工程学院 机械设计制造及其自动化Design of PWM Controller in a MCS-51 外文出处: Compatible MCU(用外文写)1.外文资料翻译译文;2.外文原文。 附
注:请将该封面与附件装订成册。
附件1:外文资料翻译译文基于C51兼容微处理器单片机的PWM控制器设计导
言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信号。这种方法将在文章中讲述。在
初始化控制寄存器和寄存器的占空比,可以支持PWM脉冲信号,用刚才提到的上述三种方法调整占空比和几个操作模式,以增加用户弹性。以下这部分解释PWM模块和基本功能模块的结构。第三部分描述两种操作模式。这部分还讲述了实验和仿真的结果验证了合适的系统操作。通过操作模式,PWM模块产生一个或更多的脉宽模块信号,它们的比率可以自主调整。
在单片机上执行PWM模块PWM模块的概述PWM模块如图3所示,从图中,可以很清楚得看到整个模块有两部分组成:PWM信号产生器和带有频道选择逻辑的死区时间产生器。用户可以通过执行一些代码使PWM模块初始化,从而启动其功能。在特殊情况下,支持以下电源和运动控制应用:1.直流电机2.持续电源供应PWM模块也有以下特征:1.两个PWM输出信号以互补或独立的方式运行2.带有互补模式的硬件死区电动机3.占空比更新设置应立刻或与PWM同步
PWM模块的结构结构的详细组成PWM电动机二输出PWM电动机的结构如图2.1所示,该结构是基于能产生脉宽调制信号上
的16位计数器。该系统由四分频或十二分频的系统时钟信号合成,时钟信号的频率可通过对在特殊寄存器PWMCON中的PWM0电机的T3M或PWM1电机的T4M的值进行设置而调整,如图4所示:对于PWM0电机,当T3M设置为零时,16位计数器时钟将被默认预分为四分频,当T3M设置为1时,始终将被十二分频;PWM同样有这种功能。在PWMCON中的其它位的定义,详见表
图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相连,实际上,从图看,单片机的P1[5]/P[4]口被用做PWMH/PWML或是一般的I/O口。
图6 独立模式下的PWM波形互补PWM输出模式互补输出模式可以用于驱动逆变器负载,如图7所示。这种逆变器拓扑学是典型的直流装置。在互补输出模式,PWM的两个输出不能同时用。PWM通道和输出口都是通过通道选择逻辑内部配置的,如图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输出波形
附件2:外文原文(复印件)Design of PWM Controller in a MCS-51 Compatible MCUIntroductionPWM 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
Fig.1: The Relationship between Voltage of Armature and
Fig.2Architecture of PWM
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, 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
Fig.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.
Bit Mapping of PWMCON
Table 1: The Bit Definition in PWMCON
Channel-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.
Diagram of Channel-select LogicOperation Mode and Simulation Results
The 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 P1[5]/ P1[4] of MCU is used for PWMH/ PWML or normal
I/O ,alternatively.
the Waveform of PWM Outputs in Independent Mode
Complementary 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 ControlDead-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.
Dead-time Unit Block Diagram
the Waveforms of PWM Outputs in Complementary Mode
ConclusionsIn 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.
上一篇: 下一篇:
All rights reserved Powered by
copyright &copyright 。文档资料库内容来自网络,如有侵犯请联系客服。PIC16F1936可以通过配置做到互补输出四路PWM_百度知道
PIC16F1936可以通过配置做到互补输出四路PWM
仅通过内部配置,谢谢
路PWM波绝不可能独立控制六足机器人的18个舵机,我见过比较高档的ATMEGA128也才8路PWM,不一定非得依赖单片机内部的PWM模块! 18个舵机必须由18路PWM波控制;不过18路的协调是一个难题。 PWM波。用普通的I/O口配合定时器就应该能做到
其他类似问题
为您推荐:
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁PWM 在Keil环境使用stm32F407写的带死区控制的互补PWM驱动,很适合做双路 ,这是一 SCM 单片机开发 238万源代码下载-
&文件名称: PWM
& & & & &&]
&&所属分类:
&&开发工具: Others
&&文件大小: 2800 KB
&&上传时间:
&&下载次数: 1
&&提 供 者:
&详细说明:在Keil环境使用stm32F407写的带死区控制的互补PWM驱动,很适合做双路电机控制,这是一个完整的工程,可以直接编译使用-In complementary PWM Keil environment stm32F407 write with dead-time control of the drive, it is suitable for dual motor control, which is a complete project, can be directly compiled using
文件列表(点击判断是否您需要的文件,如果是垃圾请在下面评价投诉):
&&死区互补PWM&&...........\CORE&&...........\....\core_cm4.h&&...........\....\core_cm4_simd.h&&...........\....\startup_stm32f40_41xxx.s&&...........\FWLib&&...........\.....\inc&&...........\.....\...\misc.h&&...........\.....\...\stm32f4xx_adc.h&&...........\.....\...\stm32f4xx_can.h&&...........\.....\...\stm32f4xx_crc.h&&...........\.....\...\stm32f4xx_cryp.h&&...........\.....\...\stm32f4xx_dac.h&&...........\.....\...\stm32f4xx_dbgmcu.h&&...........\.....\...\stm32f4xx_dcmi.h&&...........\.....\...\stm32f4xx_dma.h&&...........\.....\...\stm32f4xx_dma2d.h&&...........\.....\...\stm32f4xx_exti.h&&...........\.....\...\stm32f4xx_flash.h&&...........\.....\...\stm32f4xx_flash_ramfunc.h&&...........\.....\...\stm32f4xx_fsmc.h&&...........\.....\...\stm32f4xx_gpio.h&&...........\.....\...\stm32f4xx_hash.h&&...........\.....\...\stm32f4xx_i2c.h&&...........\.....\...\stm32f4xx_iwdg.h&&...........\.....\...\stm32f4xx_ltdc.h&&...........\.....\...\stm32f4xx_pwr.h&&...........\.....\...\stm32f4xx_rcc.h&&...........\.....\...\stm32f4xx_rng.h&&...........\.....\...\stm32f4xx_rtc.h&&...........\.....\...\stm32f4xx_sai.h&&...........\.....\...\stm32f4xx_sdio.h&&...........\.....\...\stm32f4xx_spi.h&&...........\.....\...\stm32f4xx_syscfg.h&&...........\.....\...\stm32f4xx_tim.h&&...........\.....\...\stm32f4xx_usart.h&&...........\.....\...\stm32f4xx_wwdg.h&&...........\.....\src&&...........\.....\...\misc.c&&...........\.....\...\stm32f4xx_adc.c&&...........\.....\...\stm32f4xx_can.c&&...........\.....\...\stm32f4xx_crc.c&&...........\.....\...\stm32f4xx_cryp.c&&...........\.....\...\stm32f4xx_cryp_aes.c&&...........\.....\...\stm32f4xx_cryp_des.c&&...........\.....\...\stm32f4xx_cryp_tdes.c&&...........\.....\...\stm32f4xx_dac.c&&...........\.....\...\stm32f4xx_dbgmcu.c&&...........\.....\...\stm32f4xx_dcmi.c&&...........\.....\...\stm32f4xx_dma.c&&...........\.....\...\stm32f4xx_dma2d.c&&...........\.....\...\stm32f4xx_exti.c&&...........\.....\...\stm32f4xx_flash.c&&...........\.....\...\stm32f4xx_flash_ramfunc.c&&...........\.....\...\stm32f4xx_fsmc.c&&...........\.....\...\stm32f4xx_gpio.c&&...........\.....\...\stm32f4xx_hash.c&&...........\.....\...\stm32f4xx_hash_md5.c&&...........\.....\...\stm32f4xx_hash_sha1.c&&...........\.....\...\stm32f4xx_i2c.c&&...........\.....\...\stm32f4xx_iwdg.c&&...........\.....\...\stm32f4xx_ltdc.c&&...........\.....\...\stm32f4xx_pwr.c&&...........\.....\...\stm32f4xx_rcc.c&&...........\.....\...\stm32f4xx_rng.c&&...........\.....\...\stm32f4xx_rtc.c&&...........\.....\...\stm32f4xx_sai.c&&...........\.....\...\stm32f4xx_sdio.c&&...........\.....\...\stm32f4xx_spi.c&&...........\.....\...\stm32f4xx_syscfg.c&&...........\.....\...\stm32f4xx_tim.c&&...........\.....\...\stm32f4xx_usart.c&&...........\.....\...\stm32f4xx_wwdg.c&&...........\My_Code&&...........\.......\inc&&...........\.......\...\PWM.h&&...........\.......\PWM.c&&...........\OBJ&&...........\...\main.crf&&...........\...\main.d&&...........\...\main.o&&...........\...\misc.crf&&...........\...\misc.d&&...........\...\misc.o&&...........\...\pwm.crf&&...........\...\pwm.d&&...........\...\pwm.o&&...........\...\startup_stm32f40_41xxx.d&&...........\...\startup_stm32f40_41xxx.o&&...........\...\stm32f4xx_gpio.crf&&...........\...\stm32f4xx_gpio.d&&...........\...\stm32f4xx_gpio.o&&...........\...\stm32f4xx_it.crf&&...........\...\stm32f4xx_it.d&&...........\...\stm32f4xx_it.o&&...........\...\stm32f4xx_rcc.crf&&...........\...\stm32f4xx_rcc.d&&...........\...\stm32f4xx_rcc.o&&...........\...\stm32f4xx_syscfg.crf&&...........\...\stm32f4xx_syscfg.d
&输入关键字,在本站238万海量源码库中尽情搜索:
&[] - 基于LD3320语音识别模块的语音识别程序源代码
&[] - KS103基于stm32高精度超声波程序.内含datasheet模块详细说明。求51单片机硬件控制PWM的原理图_百度知道
求51单片机硬件控制PWM的原理图
芯片主要是想做实现多路舵机控制,51单片机总是需要定时器来控制舵机的PWM 占空比如果同时控制多路舵机,研究了很久,我技术不到家....,控制舵机比较容易的又或者DSP.只怕学不会,控制PWM比较容易的,2路.,像ARM什么的.,暂时研究不来所以想知道有没有什么可以芯片,可以通过单片机引脚来控制他输出PWM信号、又或者说?或者谁介绍个基于51核的,还是2个IO口啊,就显得特别麻烦,是指2组IO口,我还是想51核的?STC12C5A60S2 说是带2路PWM输出,先把51学强再说STC15F2K60S2 跟 STC12C5A60S2 哪个好,现在还没那个本事去学,又比较简单的-----------我是STC89C52的如果换单片机的话求51单片机硬件输出PWM的原理图.
我有更好的答案
配置一下寄存器就ok:软件模拟pwm是最不实用的!我认为毫无意义你说的STC15或者STC12就可以了。PS,不需要再STC89上那样的软件模拟,用PCA部件产生PWM
PCA部件怎么产生PWM呢? 可以用STC12 或是 STC15控制吗?12好 还是15好呢
PCA的结构特殊,配置寄存器就可以的,你仔细看看资料吧!STC12好些,引脚排列和主流单片机的相同,可以直接替换STC89.
PCA我完全没接触过,看资料也不懂呀!!!
那我没办法了,花几千上万的去买现成的技术吧!!
你比我还坑
正是因为不懂才要学,如果以“不懂”为借口偷懒什么都不做,那为什么当初要学单片机要控制舵机呢?再说了,STC的文档是给出例程了的,要是连代码都没看到……呵呵……
两个定时器可以模拟出来,我觉得做过实验可以了,当然现实中很少有人这么用430
16位的mcu就可以输出PWM要学就学点高级的,你换了51还是51,没意思。只有上了一个平台,你才会觉得对以前低端的东西很有意思。
不是不学,只是怕太复杂了,学不会16位的mcu 有几个PWM?
2路,就是两个IO口,不是两组IO。我记得STC的不是两路吧。
其他类似问题
为您推荐:
51单片机的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁

我要回帖

更多关于 单片机 pwm 死区 的文章

 

随机推荐