{"id":59,"date":"2008-12-12T21:12:45","date_gmt":"2008-12-12T20:12:45","guid":{"rendered":"http:\/\/elektroink.de\/2008\/12\/12\/modulierte-pwm-mit-ltspice-darstellen\/"},"modified":"2012-11-29T18:56:38","modified_gmt":"2012-11-29T18:56:38","slug":"modulierte-pwm-mit-ltspice-darstellen","status":"publish","type":"post","link":"https:\/\/transistorgrab.de\/en\/2008\/12\/12\/modulierte-pwm-mit-ltspice-darstellen\/","title":{"rendered":"Generate Modulated PWM with LTSpice"},"content":{"rendered":"<p>LTSpice knows different signal sources. Unfurtunately there is no modulated PWM. This article shows how to generate a voltage controlled PWM.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/transistorgrab.de\/figures\/zwei-spannungsquellen.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/transistorgrab.de\/figures\/zwei-spannungsquellen-thumb.png?resize=23%2C50\" alt=\"zwei-spannungsquellen\" width=\"23\" height=\"50\" align=\"left\" \/><\/a><\/p>\n<p>At first we need two normal voltage sources &#8220;voltage&#8221;. One voltage source generates the modulation voltage, the other generates the clock for the PWM.<\/p>\n<p>For this example we want to generate a PWM with 20 kHz clock that is modulated by a sine wave of 2000 Hz.<\/p>\n<p>As modulation source every other voltage form is usable too.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/transistorgrab.de\/figures\/sinus-spannungsquelle-2khz.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/transistorgrab.de\/figures\/sinus-spannungsquelle-2khz-thumb.png?resize=103%2C80\" alt=\"sinus-spannungsquelle-2kHz\" width=\"103\" height=\"80\" align=\"left\" \/><\/a><\/p>\n<p>The voltage source that generates the sine wave will be set acordingly to the requirements. The PWM shall be 5 V peak voltage and single ended (ground based). That&#8217;s why the sine gets an offset voltage of 2.5 V and an amplitude of 2.5 V. That causes the PWM to a middle value of 50%. The maximum modulation of the PWM depends only on the amplitude of the sine wave. At 2.5 V amplitude the modulation will be 100%.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/transistorgrab.de\/figures\/dreieck-spannungsquelle-20khz1.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/transistorgrab.de\/figures\/dreieck-spannungsquelle-20khz-thumb1.png?resize=103%2C80\" alt=\"dreieck-spannungsquelle-20kHz\" width=\"103\" height=\"80\" align=\"left\" \/><\/a><\/p>\n<p>The second voltage source generates the clock of the PWM. To achieve an actual PWM this voltage source must generate a triangular voltage. For 20 kHz the period duration is 50 \u00b5s, one ramp has a duration of 25 \u00b5s. The amplitude of this source is also set to 5 V.<\/p>\n<p>Up to now this is not a PWM yet. Now both voltages need to be connected.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/transistorgrab.de\/figures\/zwei-spannungsquellen-mit-werten.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/transistorgrab.de\/figures\/zwei-spannungsquellen-mit-werten-thumb.png?resize=99%2C80\" alt=\"zwei-spannungsquellen-mit-werten\" width=\"99\" height=\"80\" align=\"left\" \/><\/a><\/p>\n<p>For this a common ground needs to be defined and each voltage needs a unique name. The voltage sources are connected to ground with their &#8220;-&#8221; terminal. The &#8220;+&#8221; terminal is connected to a short wire. These wires are open on the other end. Each wire is given a unique name. In our example they are named &#8220;sine&#8221; and &#8220;ramp&#8221;.<\/p>\n<p>Now only the combination of both voltages to a PWM is missing.<\/p>\n<p>For that combination we use the &#8220;arbitrary behavioural voltage source&#8221;. These voltage sources generate a voltage that is defined by formulas and functions.<\/p>\n<p>For our use a simple IF-function will suffice: if the value of the sine wave is higher than the triangular voltage a voltage will be put out. If the value is lower 0 will be put out. For our example we choose 5 V for the peak value of the PWM.<\/p>\n<p>This voltage source must be connectet to ground too. That the PWM does not stand for itself the output is connected to a simple RC low pass filter.<\/p>\n<p>The last figure shows all voltages as the result.<\/p>\n<ul>\n<li>Red: the sine wave,<\/li>\n<li>Blue: the triangular voltage,<\/li>\n<li>Green: the PWM and<\/li>\n<li>Yellow: the voltage from the PWM after the low pass filter<\/li>\n<\/ul>\n<p><a href=\"https:\/\/i0.wp.com\/transistorgrab.de\/figures\/komplette-simulation1.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/transistorgrab.de\/figures\/komplette-simulation-thumb1.png?resize=400%2C135\" alt=\"komplette-simulation\" width=\"400\" height=\"135\" \/><\/a><\/p>\n<p><a href=\"https:\/\/i0.wp.com\/transistorgrab.de\/figures\/simulationskurven1.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/transistorgrab.de\/figures\/simulationskurven-thumb1.png?resize=400%2C188\" alt=\"simulationskurven\" width=\"400\" height=\"188\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>LTSpice knows different signal sources. Unfurtunately there is no modulated PWM. This article shows how to generate a voltage controlled PWM. At first we need two normal voltage sources &#8220;voltage&#8221;. One voltage source generates the modulation voltage, the other generates the clock for the PWM. For this example we want to generate a PWM with &hellip; <a href=\"https:\/\/transistorgrab.de\/en\/2008\/12\/12\/modulierte-pwm-mit-ltspice-darstellen\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Generate Modulated PWM with LTSpice<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[9],"tags":[47,16,17,19],"class_list":["post-59","post","type-post","status-publish","format-standard","hentry","category-tutorials","tag-ltspice","tag-simulation","tag-spannungsquellen","tag-switchercad"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8KIDw-X","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/transistorgrab.de\/en\/wp-json\/wp\/v2\/posts\/59","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/transistorgrab.de\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/transistorgrab.de\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/transistorgrab.de\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/transistorgrab.de\/en\/wp-json\/wp\/v2\/comments?post=59"}],"version-history":[{"count":0,"href":"https:\/\/transistorgrab.de\/en\/wp-json\/wp\/v2\/posts\/59\/revisions"}],"wp:attachment":[{"href":"https:\/\/transistorgrab.de\/en\/wp-json\/wp\/v2\/media?parent=59"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/transistorgrab.de\/en\/wp-json\/wp\/v2\/categories?post=59"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/transistorgrab.de\/en\/wp-json\/wp\/v2\/tags?post=59"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}