
{"id":505,"date":"2018-10-16T16:37:00","date_gmt":"2018-10-16T16:37:00","guid":{"rendered":"http:\/\/blogs.plymouth.ac.uk\/embedded-systems\/?page_id=505"},"modified":"2018-10-16T16:37:00","modified_gmt":"2018-10-16T16:37:00","slug":"pulse-width-modulation-pwm-glossary-entry","status":"publish","type":"page","link":"https:\/\/blogs.plymouth.ac.uk\/embedded-systems\/glossary-2\/pulse-width-modulation-pwm-glossary-entry\/","title":{"rendered":"Pulse Width Modulation (PWM) &#8211; (Glossary Entry)"},"content":{"rendered":"<p>[latexpage]<\/p>\n<p>Pulse Width Modulation is a technique of generating a digital pulse that delivers a controllable amount of power. For example, if we wish to control a DC motor, then the amount of power delivered to the motor will dictate the motor speed. Equally, if controlling an LED, the power delivered will determine the brightness.<br \/>\nConsider the digital waveform below:<\/p>\n<figure id=\"attachment_506\" aria-describedby=\"caption-attachment-506\" style=\"width: 700px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-506\" src=\"http:\/\/blogs.plymouth.ac.uk\/embedded-systems\/wp-content\/uploads\/sites\/94\/2018\/10\/PWM_Illustration.png\" alt=\"\" width=\"700\" height=\"393\" srcset=\"https:\/\/blogs.plymouth.ac.uk\/embedded-systems\/wp-content\/uploads\/sites\/94\/2018\/10\/PWM_Illustration.png 1064w, https:\/\/blogs.plymouth.ac.uk\/embedded-systems\/wp-content\/uploads\/sites\/94\/2018\/10\/PWM_Illustration-300x168.png 300w, https:\/\/blogs.plymouth.ac.uk\/embedded-systems\/wp-content\/uploads\/sites\/94\/2018\/10\/PWM_Illustration-768x431.png 768w, https:\/\/blogs.plymouth.ac.uk\/embedded-systems\/wp-content\/uploads\/sites\/94\/2018\/10\/PWM_Illustration-1024x575.png 1024w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><figcaption id=\"caption-attachment-506\" class=\"wp-caption-text\">Illustrating the output from a Pulse Width Modulation (PWM) process<\/figcaption><\/figure>\n<p>The digital pulse of \u20181\u2019 is represented by the blue regions.<\/p>\n<p>The output is a ON for $T_{mark}$ seconds and off for $T_{space}$ seconds and that $T = T_{mark}+T_{space}$. If this signal is driving a device such as an LED or a DC motor, then clearly $T$ needs to be kept small to avoid noticeable pulsing effects (although for motors, $T$ must not be too small as you will discover).<\/p>\n<p>The ratio of time spend ON, that is $\\frac{T_{mark}}{T}$ is known as the <strong>duty cycle.<\/strong> Often this is expressed as a percentage, so $duty = \\frac{T_{mark}}{T} \\cdot 100 \\%$<\/p>\n<p>Intuition would suggest the average output voltage is somehow related to the proportion of time that the output is ON. Let\u2019s look at this more formally.<\/p>\n<p>In general, for a voltage signal $v(t)$ that varies with time $t$, we can say that the mean voltage $\\overline{v(t)}$ is derived as<\/p>\n<p>$$\\overline{v(t)} = \\frac{1}{T} \\cdot \\int_{t_0}^{t_1} v(t) dt$$<\/p>\n<p>However, from the graph, $v(t)$ is a constant over fixed durations, so we can split this up and exploit this. We say that<\/p>\n<p>$$\\overline{v(t)} = \\frac{1}{T} \\cdot \\int_{t_0}^{t_0 + t_{mark}} V dt + \\frac{1}{T} \\cdot \\int_{t_0+t_{mark}}^{t_1} 0 dt$$<\/p>\n<p>where $V=3.3V$. The integral of zero is always zero, so we can write<\/p>\n<p>$$\\overline{v(t)} = \\frac{V}{T} \\cdot \\int_{t_0}^{t_0 + t_{mark}} 1 dt + 0$$<\/p>\n<p>Integrating, we get<\/p>\n<p>$$\\overline{v(t)} = \\frac{V}{T} \\cdot \\left[ t \\right]_{t_0}^{t_0 + T_{mark}}$$<\/p>\n<p>$$\\overline{V(t)} =\\frac{V}{T}\\cdot\\left[ t_0+T_{mark}-t_0 \\right]$$<\/p>\n<p>$$\\overline{V(t)} =\\frac{T_{mark}}{T} \\cdot V$$<\/p>\n<p>Intuition would also suggest the output power is somehow related to the proportion of time that the output is ON. Let\u2019s look at this more formally.<\/p>\n<p>Consider driving power into a load resistance of $R \\Omega$, the instantaneous power is calculated as $P(t)=\\frac{v(t)^2}{R}$. What is more useful is the mean power over a period of time. It is therefore the mean of $v(t)^2$ that is of interest. As $V$ and $R$ are constants, by the same reasoning<\/p>\n<p>$\\overline{P(t)} =\\frac{T_{mark}}{T} \\cdot \\frac{V^2}{R}$<\/p>\n<p>In summary, we can rewrite both these equations as follows:<\/p>\n<p>$$mean\\ voltage=\\frac{T_{mark}}{T_{mark}+T_{space}}\\cdot V$$<\/p>\n<p>$$mean\\ power=\\frac{T_{mark}}{T_{mark}+T_{space}}\\cdot \\frac{V^2}{R}$$<\/p>\n<h2>Practical Application<\/h2>\n<p>Consider a DC motor. Put simply, we are turning the motor on and off at a fixed frequency. If $T=1s$, then you would see the motor starting and stopping, causing a juddering. The fundamental frequency of the vibration is $f_{0}=1\/T \\ Hz$.<\/p>\n<ul>\n<li>If $f_{0}$ is in the audible spectrum ($&lt;20kHz$), it will make the motor noisier.<\/li>\n<li>However, if $f_{0}$ is too high, the \u201cinductive\u201d effects of the motor will significantly reduce the power delivered to the motor (the details of this is something you will study later in the course).<\/li>\n<\/ul>\n<p>As is often the case in engineering, you have to balance trade-offs between different criteria.For now, we are going to do this \u2018empirically\u2019.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[latexpage] Pulse Width Modulation is a technique of generating a digital pulse that delivers a controllable amount of power. For example, if we wish to control a DC motor, then the amount of power delivered to the motor will dictate the motor speed. Equally, if controlling an LED, the power delivered will determine the brightness.&hellip; <a class=\"more-link\" href=\"https:\/\/blogs.plymouth.ac.uk\/embedded-systems\/glossary-2\/pulse-width-modulation-pwm-glossary-entry\/\">Continue reading <span class=\"screen-reader-text\">Pulse Width Modulation (PWM) &#8211; (Glossary Entry)<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":153,"menu_order":55,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-505","page","type-page","status-publish","hentry","entry"],"_links":{"self":[{"href":"https:\/\/blogs.plymouth.ac.uk\/embedded-systems\/wp-json\/wp\/v2\/pages\/505","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.plymouth.ac.uk\/embedded-systems\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/blogs.plymouth.ac.uk\/embedded-systems\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.plymouth.ac.uk\/embedded-systems\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.plymouth.ac.uk\/embedded-systems\/wp-json\/wp\/v2\/comments?post=505"}],"version-history":[{"count":18,"href":"https:\/\/blogs.plymouth.ac.uk\/embedded-systems\/wp-json\/wp\/v2\/pages\/505\/revisions"}],"predecessor-version":[{"id":524,"href":"https:\/\/blogs.plymouth.ac.uk\/embedded-systems\/wp-json\/wp\/v2\/pages\/505\/revisions\/524"}],"up":[{"embeddable":true,"href":"https:\/\/blogs.plymouth.ac.uk\/embedded-systems\/wp-json\/wp\/v2\/pages\/153"}],"wp:attachment":[{"href":"https:\/\/blogs.plymouth.ac.uk\/embedded-systems\/wp-json\/wp\/v2\/media?parent=505"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}