烽火社区

快捷导航
电源技术
收藏本版 |订阅

电源技术 今日: 0|主题: 4168|排名: 29 

发新帖
打印 上一主题 下一主题

什么是PWM 啊?哪里有资料...

[复制链接]
1277089978056 发布于: 2015-12-5 09:12 AM 2220 次浏览 20 位用户参与讨论
跳转到指定楼层
qrcode
什么是PWM   啊?哪里有资料                                                                                                                                                                       
回复

使用道具 举报

已有20人评论

沙发
lai832 发表于 2015-12-5 06:19 AM
我只知道PWM是Pulse-Width Modulation 脉宽调制, 具体的工作原理, 我也不怎么会讲. 我们的IC很多是PRC工作方式.                                                                                                                                                                       
回复 支持 反对

使用道具 举报

板凳
fleshhunter 发表于 2015-12-8 05:04 AM
如把脉冲高电平时的波形和横轴组成一个面...
该面积直接等于输出量的有效面积......

(当然要经过一系列的变换....后..得出能量相等---------理论上)
回复 支持 反对

使用道具 举报

地板
liangzhitu 发表于 2015-12-8 09:21 AM
开关电源,用百度找找.                                                                                                                                                                       
回复 支持 反对

使用道具 举报

5#
shallys 发表于 2006-1-5 02:05 AM
类似于多进制调制
PCM是一个信号对应多个传输波形,而PWM是一对一,但是要用脉冲到时钟的距离来度量。因此对时钟的要求很高
回复 支持 反对

使用道具 举报

6#
1267092528231 发表于 2006-9-4 10:28 AM

脉宽调制的基本原理及其应用实例

脉宽调制(PWM)是利用微处理器的数字输出来对模拟电路进行控制的一种非常有效的技术,广泛应用在从测量、通信到功率控制与变换的许多领域中。

模拟电路

模拟信号的值可以连续变化,其时间和幅度的分辨率都没有限制。9V电池就是一种模拟器件,因为它的输出电压并不精确地等于9V,而是随时间发生变化,并可取任何实数值。与此类似,从电池吸收的电流也不限定在一组可能的取值范围之内。模拟信号与数字信号的区别在于后者的取值通常只能属于预先确定的可能取值集合之内,例如在{0V, 5V}这一集合中取值。

模拟电压和电流可直接用来进行控制,如对汽车收音机的音量进行控制。在简单的模拟收音机中,音量旋钮被连接到一个可变电阻。拧动旋钮时,电阻值变大或变小;流经这个电阻的电流也随之增加或减少,从而改变了驱动扬声器的电流值,使音量相应变大或变小。与收音机一样,模拟电路的输出与输入成线性比例。

尽管模拟控制看起来可能直观而简单,但它并不总是非常经济或可行的。其中一点就是,模拟电路容易随时间漂移,因而难以调节。能够解决这个问题的精密模拟电路可能非常庞大、笨重(如老式的家庭立体声设备)和昂贵。模拟电路还有可能严重发热,其功耗相对于工作元件两端电压与电流的乘积成正比。模拟电路还可能对噪声很敏感,任何扰动或噪声都肯定会改变电流值的大小。

数字控制

通过以数字方式控制模拟电路,可以大幅度降低系统的成本和功耗。此外,许多微控制器和DSP已经在芯片上包含了PWM控制器,这使数字控制的实现变得更加容易了。

简而言之,PWM是一种对模拟信号电平进行数字编码的方法。通过高分辨率计数器的使用,方波的占空比被调制用来对一个具体模拟信号的电平进行编码。PWM信号仍然是数字的,因为在给定的任何时刻,满幅值的直流供电要么完全有(ON),要么完全无(OFF)。电压或电流源是以一种通(ON)或断(OFF)的重复脉冲序列被加到模拟负载上去的。通的时候即是直流供电被加到负载上的时候,断的时候即是供电被断开的时候。只要带宽足够,任何模拟值都可以使用PWM进行编码。

图1显示了三种不同的PWM信号。图1a是一个占空比为10%的PWM输出,即在信号周期中,10%的时间通,其余90%的时间断。图1b和图1c显示的分别是占空比为50%和90%的PWM输出。这三种PWM输出编码的分别是强度为满度值的10%、50%和90%的三种不同模拟信号值。例如,假设供电电源为9V,占空比为10%,则对应的是一个幅度为0.9V的模拟信号。

图2是一个可以使用PWM进行驱动的简单电路。图中使用9V电池来给一个白炽灯泡供电。如果将连接电池和灯泡的开关闭合50ms,灯泡在这段时间中将得到9V供电。如果在下一个50ms中将开关断开,灯泡得到的供电将为0V。如果在1秒钟内将此过程重复10次,灯泡将会点亮并象连接到了一个4.5V电池(9V的50%)上一样。这种情况下,占空比为50%,调制频率为10Hz。

大多数负载(无论是电感性负载还是电容性负载)需要的调制频率高于10Hz。设想一下如果灯泡先接通5秒再断开5秒,然后再接通、再断开……。占空比仍然是50%,但灯泡在头5秒钟内将点亮,在下一个5秒钟内将熄灭。要让灯泡取得4.5V电压的供电效果,通断循环周期与负载对开关状态变化的响应时间相比必须足够短。要想取得调光灯(但保持点亮)的效果,必须提高调制频率。在其他PWM应用场合也有同样的要求。通常调制频率为1kHz到200kHz之间。

硬件控制器

许多微控制器内部都包含有PWM控制器。例如,Microchip公司的PIC16C67内含两个PWM控制器,每一个都可以选择接通时间和周期。占空比是接通时间与周期之比;调制频率为周期的倒数。执行PWM操作之前,这种微处理器要求在软件中完成以下工作:

* 设置提供调制方波的片上定时器/计数器的周期


* 在PWM控制寄存器中设置接通时间


* 设置PWM输出的方向,这个输出是一个通用I/O管脚


* 启动定时器


* 使能PWM控制器

虽然具体的PWM控制器在编程细节上会有所不同,但它们的基本思想通常是相同的。

通信与控制

PWM的一个优点是从处理器到被控系统信号都是数字形式的,无需进行数模转换。让信号保持为数字形式可将噪声影响降到最小。噪声只有在强到足以将逻辑1改变为逻辑0或将逻辑0改变为逻辑1时,也才能对数字信号产生影响。

对噪声抵抗能力的增强是PWM相对于模拟控制的另外一个优点,而且这也是在某些时候将PWM用于通信的主要原因。从模拟信号转向PWM可以极大地延长通信距离。在接收端,通过适当的RC或LC网络可以滤除调制高频方波并将信号还原为模拟形式。

PWM广泛应用在多种系统中。作为一个具体的例子,我们来考察一种用PWM控制的制动器。简单地说,制动器是紧夹住某种东西的一种装置。许多制动器使用模拟输入信号来控制夹紧压力(或制动功率)的大小。加在制动器上的电压或电流越大,制动器产生的压力就越大。

可以将PWM控制器的输出连接到电源与制动器之间的一个开关。要产生更大的制动功率,只需通过软件加大PWM输出的占空比就可以了。如果要产生一个特定大小的制动压力,需要通过测量来确定占空比和压力之间的数学关系(所得的公式或查找表经过变换可用于控制温度、表面磨损等等)。

例如,假设要将制动器上的压力设定为100psi,软件将作一次反向查找,以确定产生这个大小的压力的占空比应该是多少。然后再将PWM占空比设置为这个新值,制动器就可以相应地进行响应了。如果系统中有一个传感器,则可以通过闭环控制来调节占空比,直到精确产生所需的压力。

总之,PWM既经济、节约空间、抗噪性能强,是一种值得广大工程师在许多设计应用中使用的有效技术。

回复 支持 反对

使用道具 举报

7#
ddllxxrr 发表于 2015-2-28 07:24 AM

我用可编程芯片设计过8位PWM直流伺服电机驱动器,见IC设计中---用可编程芯片实现新型PLC一文。

回复 支持 反对

使用道具 举报

8#
雨龙 发表于 2015-4-13 07:53 AM
我用可编程芯片设计过8位PWM直流伺服电机变速驱动器,见IC设计中的《用可编程芯片实现新型PLC》一帖。                                                                                                                                                                       
回复 支持 反对

使用道具 举报

9#
xxmlyt 发表于 2015-12-25 10:15 AM
kuanghai 的转帖明摆着就是下面这一篇的翻译,

请问是用什么软件工具翻译的?该不是人手翻译的吧??

Pulse width modulation (PWM) is a powerful technique for controlling analog circuits with a processor's digital outputs. PWM is employed in a wide variety of applications, ranging from measurement and communications to power control and conversion.

Analog circuits
An analog signal has a continuously varying value, with infinite resolution in both time and magnitude. A nine-volt battery is an example of an analog device, in that its output voltage is not precisely 9V, changes over time, and can take any real-numbered value. Similarly, the amount of current drawn from a battery is not limited to a finite set of possible values. Analog signals are distinguishable from digital signals because the latter always take values only from a finite set of predetermined possibilities, such as the set {0V, 5V}.

Analog voltages and currents can be used to control things directly, like the volume of a car radio. In a simple analog radio, a knob is connected to a variable resistor. As you turn the knob, the resistance goes up or down. As that happens, the current flowing through the resistor increases or decreases. This changes the amount of current driving the speakers, thus increasing or decreasing the volume. An analog circuit is one, like the radio, whose output is linearly proportional to its input.

As intuitive and simple as analog control may seem, it is not always economically attractive or otherwise practical. For one thing, analog circuits tend to drift over time and can, therefore, be very difficult to tune. Precision analog circuits, which solve that problem, can be very large, heavy (just think of older home stereo equipment), and expensive. Analog circuits can also get very hot; the power dissipated is proportional to the voltage across the active elements multiplied by the current through them. Analog circuitry can also be sensitive to noise. Because of its infinite resolution, any perturbation or noise on an analog signal necessarily changes the current value.

Digital control
By controlling analog circuits digitally, system costs and power consumption can be drastically reduced. What's more, many microcontrollers and DSPs already include on-chip PWM controllers, making implementation easy.

In a nutshell, PWM is a way of digitally encoding analog signal levels. Through the use of high-resolution counters, the duty cycle of a square wave is modulated to encode a specific analog signal level. The PWM signal is still digital because, at any given instant of time, the full DC supply is either fully on or fully off. The voltage or current source is supplied to the analog load by means of a repeating series of on and off pulses. The on-time is the time during which the DC supply is applied to the load, and the off-time is the period during which that supply is switched off. Given a sufficient bandwidth, any analog value can be encoded with PWM.

Figure 1 shows three different PWM signals. Figure 1a shows a PWM output at a 10% duty cycle. That is, the signal is on for 10% of the period and off the other 90%. Figures 1b and 1c show PWM outputs at 50% and 90% duty cycles, respectively. These three PWM outputs encode three different analog signal values, at 10%, 50%, and 90% of the full strength. If, for example, the supply is 9V and the duty cycle is 10%, a 0.9V analog signal results.





Figure 1. PWM signals of varying duty cycles

Figure 2 shows a simple circuit that could be driven using PWM. In the figure, a 9 V battery powers an incandescent lightbulb. If we closed the switch connecting the battery and lamp for 50 ms, the bulb would receive 9 V during that interval. If we then opened the switch for the next 50 ms, the bulb would receive 0 V. If we repeat this cycle 10 times a second, the bulb will be lit as though it were connected to a 4.5 V battery (50% of 9 V). We say that the duty cycle is 50% and the modulating frequency is 10 Hz.



Figure 2. A simple PWM circuit

Most loads, inductive and capacitative alike, require a much higher modulating frequency than 10 Hz. Imagine that our lamp was switched on for five seconds, then off for five seconds, then on again. The duty cycle would still be 50%, but the bulb would appear brightly lit for the first five seconds and off for the next. In order for the bulb to see a voltage of 4.5 volts, the cycle period must be short relative to the load's response time to a change in the switch state. To achieve the desired effect of a dimmer (but always lit) lamp, it is necessary to increase the modulating frequency. The same is true in other applications of PWM. Common modulating frequencies range from 1 kHz to 200 kHz.

Hardware controllers
Many microcontrollers include on-chip PWM units. For example, Microchip's PIC16C67 includes two, each of which has a selectable on-time and period. The duty cycle is the ratio of the on-time to the period; the modulating frequency is the inverse of the period. To start PWM operation, the data sheet suggests the software should:

Set the period in the on-chip timer/counter that provides the modulating square wave
Set the on-time in the PWM control register
Set the direction of the PWM output, which is one of the general-purpose I/O pins
Start the timer
Enable the PWM controller
Although specific PWM controllers do vary in their programmatic details, the basic idea is generally the same.

Communication and control
One of the advantages of PWM is that the signal remains digital all the way from the processor to the controlled system; no digital-to-analog conversion is necessary. By keeping the signal digital, noise effects are minimized. Noise can only affect a digital signal if it is strong enough to change a logic-1 to a logic-0, or vice versa.

Increased noise immunity is yet another benefit of choosing PWM over analog control, and is the principal reason PWM is sometimes used for communication. Switching from an analog signal to PWM can increase the length of a communications channel dramatically. At the receiving end, a suitable RC (resistor-capacitor) or LC (inductor-capacitor) network can remove the modulating high frequency square wave and return the signal to analog form.

PWM finds application in a variety of systems. As a concrete example, consider a PWM-controlled brake. To put it simply, a brake is a device that clamps down hard on something. In many brakes, the amount of clamping pressure (or stopping power) is controlled with an analog input signal. The more voltage or current that's applied to the brake, the more pressure the brake will exert.

The output of a PWM controller could be connected to a switch between the supply and the brake. To produce more stopping power, the software need only increase the duty cycle of the PWM output. If a specific amount of braking pressure is desired, measurements would need to be taken to determine the mathematical relationship between duty cycle and pressure. (And the resulting formulae or lookup tables would be tweaked for operating temperature, surface wear, and so on.)

To set the pressure on the brake to, say, 100 psi, the software would do a reverse lookup to determine the duty cycle that should produce that amount of force. It would then set the PWM duty cycle to the new value and the brake would respond accordingly. If a sensor is available in the system, the duty cycle can be tweaked, under closed-loop control, until the desired pressure is precisely achieved.

PWM is economical, space saving, and noise immune. And it's now in your bag of tricks. So use it.
回复 支持 反对

使用道具 举报

10#
y0927 发表于 2015-7-22 07:06 AM
回的好!                                                                                                                                                                       
回复 支持 反对

使用道具 举报

123下一页
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表