{"id":1653,"date":"2014-12-10T03:03:04","date_gmt":"2014-12-10T03:03:04","guid":{"rendered":"http:\/\/41j.com\/blog\/?p=1653"},"modified":"2014-12-12T00:36:25","modified_gmt":"2014-12-12T00:36:25","slug":"phase-shift-oscillator","status":"publish","type":"post","link":"https:\/\/41j.com\/blog\/2014\/12\/phase-shift-oscillator\/","title":{"rendered":"Phase Shift Oscillator"},"content":{"rendered":"<p>Today I&#8217;ve been trying to understand the phase-shift oscillator. In order to understand the phase-shift oscillator, you first need to understand the phase-shift caused by a capacitor!<\/p>\n<p>The figure below shows a single capacitor causing a phase shift:<\/p>\n<p><a href=\"http:\/\/41j.com\/blog\/wp-content\/uploads\/2014\/12\/phaseshift.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/41j.com\/blog\/wp-content\/uploads\/2014\/12\/phaseshift-1024x299.png\" alt=\"phaseshift\" width=\"700\" height=\"204\" class=\"aligncenter size-large wp-image-1646\" srcset=\"https:\/\/41j.com\/blog\/wp-content\/uploads\/2014\/12\/phaseshift-1024x299.png 1024w, https:\/\/41j.com\/blog\/wp-content\/uploads\/2014\/12\/phaseshift-300x87.png 300w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/a><\/p>\n<p>It took me a little while to understand why a capacitor in this configuration causes a voltage phase shift. However, fundamentally the charging of the capacitor causes a lag, it take the capacitor a while to &#8220;catch up&#8221; with the current voltage, so it appears to lag behind the input. This means the amount shifted will depend on the capacity of the capacitor (how long it takes the capacitor to get up to full voltage). The capacitor can only lag behind the current voltage. This means that you can shift the phase by at most 90 degrees. Any more that this and the capacitor would be fighting the input voltage, rather than approaching it&#8217;s current value. The phase-shift will also always cause some attenuation, that the capacitor is trying to &#8220;catch up&#8221; with the current voltage, but never quit getting there. It&#8217;s worth note that if you overlay the original sine wave and the shifted version, the shifted wave will always cross the input at the shifted versions maximum voltage. You can therefore see the relationship between attenuation and the degree of phase-shift.<\/p>\n<p>Hopefully that helps explain phase-shift a little. For a phase-shift oscillator we use this characteristic to generate an oscillation. <\/p>\n<p>Here&#8217;s the phase-shift oscillator circuit, there are different configurations, but this is the one we&#8217;re going to talk about:<\/p>\n<p><a href=\"http:\/\/41j.com\/blog\/wp-content\/uploads\/2014\/12\/phaseshift_sch.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/41j.com\/blog\/wp-content\/uploads\/2014\/12\/phaseshift_sch.png\" alt=\"phaseshift_sch\" width=\"442\" height=\"570\" class=\"aligncenter size-full wp-image-1650\" srcset=\"https:\/\/41j.com\/blog\/wp-content\/uploads\/2014\/12\/phaseshift_sch.png 442w, https:\/\/41j.com\/blog\/wp-content\/uploads\/2014\/12\/phaseshift_sch-232x300.png 232w, https:\/\/41j.com\/blog\/wp-content\/uploads\/2014\/12\/phaseshift_sch-300x386.png 300w\" sizes=\"auto, (max-width: 442px) 100vw, 442px\" \/><\/a><\/p>\n<p>I&#8217;ve drawn the schematic so the 3 phase-shift resistor\/capacitors line up. Each set will shift the phase of the input ~60 degrees. This results in a 180 degree shift. Remember because we can only shift by less than 90 at a time we need 3 sets of capacitors. We&#8217;ll also be significantly attenuating the input with each shift.<\/p>\n<p><a href=\"http:\/\/41j.com\/blog\/wp-content\/uploads\/2014\/12\/phaseshift2.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/41j.com\/blog\/wp-content\/uploads\/2014\/12\/phaseshift2-1024x319.png\" alt=\"phaseshift2\" width=\"700\" height=\"218\" class=\"aligncenter size-large wp-image-1652\" srcset=\"https:\/\/41j.com\/blog\/wp-content\/uploads\/2014\/12\/phaseshift2-1024x319.png 1024w, https:\/\/41j.com\/blog\/wp-content\/uploads\/2014\/12\/phaseshift2-300x93.png 300w, https:\/\/41j.com\/blog\/wp-content\/uploads\/2014\/12\/phaseshift2.png 1204w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/a><\/p>\n<p>The output of the phase-shift network in this oscillators drives the input to an amplifier (in this case a transistor) in a feedback loop. But why do we want to shift by 180 degrees? Well, if we shift a sine wave by 180 degrees we&#8217;ll end up with the exact opposite of our signal. The NPN transistor we&#8217;re using is in an inverting configuration (you might want to read my <a href=\"http:\/\/41j.com\/blog\/2014\/12\/npn-bjt-common-emitter-inverting-amplifier\/\">other post about that<\/a>), this effectively gives another 180degrees of shift. The result is a resonance at a frequency determined by the phase-shift network resulting in an oscillation.<\/p>\n<p>Here&#8217;s a simulation of the phase-shift circuit shown above:<br \/>\n<a href=\"http:\/\/41j.com\/blog\/wp-content\/uploads\/2014\/12\/phaseshift_sim.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/41j.com\/blog\/wp-content\/uploads\/2014\/12\/phaseshift_sim.png\" alt=\"phaseshift_sim\" width=\"768\" height=\"1024\" class=\"aligncenter size-full wp-image-1654\" srcset=\"https:\/\/41j.com\/blog\/wp-content\/uploads\/2014\/12\/phaseshift_sim.png 768w, https:\/\/41j.com\/blog\/wp-content\/uploads\/2014\/12\/phaseshift_sim-225x300.png 225w, https:\/\/41j.com\/blog\/wp-content\/uploads\/2014\/12\/phaseshift_sim-300x400.png 300w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><br \/>\nYou can also download the file for iCircuit <a href=\"http:\/\/41j.com\/blog\/wp-content\/uploads\/2014\/12\/phaseshift.cir\">here<\/a>.<\/p>\n<p>I built the circuit up using an 2N2222 and the approximate values in the simulation above:<\/p>\n<p><a href=\"http:\/\/41j.com\/blog\/wp-content\/uploads\/2014\/12\/phaseshift_r2.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/41j.com\/blog\/wp-content\/uploads\/2014\/12\/phaseshift_r2-1024x768.jpg\" alt=\"phaseshift_r2\" width=\"700\" height=\"525\" class=\"aligncenter size-large wp-image-1657\" srcset=\"https:\/\/41j.com\/blog\/wp-content\/uploads\/2014\/12\/phaseshift_r2-1024x768.jpg 1024w, https:\/\/41j.com\/blog\/wp-content\/uploads\/2014\/12\/phaseshift_r2-300x225.jpg 300w, https:\/\/41j.com\/blog\/wp-content\/uploads\/2014\/12\/phaseshift_r2.jpg 1632w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/a><\/p>\n<p>It worked pretty well, output a 20Hz sine wave which is approximately as expected from the simulation:<br \/>\n<a href=\"http:\/\/41j.com\/blog\/wp-content\/uploads\/2014\/12\/phaseshift_r.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/41j.com\/blog\/wp-content\/uploads\/2014\/12\/phaseshift_r-1024x768.jpg\" alt=\"phaseshift_r\" width=\"700\" height=\"525\" class=\"aligncenter size-large wp-image-1656\" srcset=\"https:\/\/41j.com\/blog\/wp-content\/uploads\/2014\/12\/phaseshift_r-1024x768.jpg 1024w, https:\/\/41j.com\/blog\/wp-content\/uploads\/2014\/12\/phaseshift_r-300x225.jpg 300w, https:\/\/41j.com\/blog\/wp-content\/uploads\/2014\/12\/phaseshift_r.jpg 1632w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/a><\/p>\n<p>Here&#8217;s a clearer picture of the trace:<br \/>\n<a href=\"http:\/\/41j.com\/blog\/wp-content\/uploads\/2014\/12\/phaseshift_trace.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/41j.com\/blog\/wp-content\/uploads\/2014\/12\/phaseshift_trace.jpg\" alt=\"phaseshift_trace\" width=\"700\" height=\"478\" class=\"aligncenter size-large wp-image-1658\" srcset=\"https:\/\/41j.com\/blog\/wp-content\/uploads\/2014\/12\/phaseshift_trace.jpg 800w, https:\/\/41j.com\/blog\/wp-content\/uploads\/2014\/12\/phaseshift_trace-300x205.jpg 300w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today I&#8217;ve been trying to understand the phase-shift oscillator. In order to understand the phase-shift oscillator, you first need to understand the phase-shift caused by a capacitor! The figure below shows a single capacitor causing a phase shift: It took me a little while to understand why a capacitor in this configuration causes a voltage [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":["post-1653","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1RRoU-qF","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts\/1653","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/comments?post=1653"}],"version-history":[{"count":4,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts\/1653\/revisions"}],"predecessor-version":[{"id":1694,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts\/1653\/revisions\/1694"}],"wp:attachment":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/media?parent=1653"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/categories?post=1653"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/tags?post=1653"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}