{"id":455,"date":"2021-05-25T02:28:43","date_gmt":"2021-05-25T00:28:43","guid":{"rendered":"https:\/\/logbooks.ifosim.org\/pykat\/?p=455"},"modified":"2021-05-25T02:28:43","modified_gmt":"2021-05-25T00:28:43","slug":"dither-locking-generating-an-error-signal","status":"publish","type":"post","link":"https:\/\/logbooks.ifosim.org\/pykat\/blog\/dither-locking-generating-an-error-signal\/","title":{"rendered":"Dither locking &#8211; generating an error signal"},"content":{"rendered":"\n<p><strong><em>NOTE: The dither command is classed as an experimental feature in Finesse v2<\/em><\/strong><\/p>\n\n\n\n<p>A quick example for generating an error signal by dithering the mirror. For this we need to use the `dither` command.<\/p>\n\n\n\n<p class=\"has-text-align-center\"><code>dither component_name f m order phase <\/code><\/p>\n\n\n\n<p>Where f and m are the dither frequency and modulation index. The first simple example shows the a laser beam reflected from a dithered mirror and observing the fundamental, with the 1st and 2nd order sidebands.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import pykat\npykat.init_pykat_plotting()\n\nkat = pykat.finesse.kat()\nkat.parse(\"\"\"\n l l1 1 0 n1\n s s2 1 1 n1 n4\n m mN 1 0 0 n4 n5\n # 2nd order 50kHz displacement dither with 1e-9 modulation index\n dither mN 50k 1n 2 0 \n ad ap0 0 n4\n ad ap10 50k n4\n ad am20 100k n4\n vary the dither amplitude\n xaxis mN dither_m lin 0 1e-6 1000\n \"\"\")\nout = kat.run()\nout.plot(<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"584\" height=\"359\" src=\"https:\/\/logbooks.ifosim.org\/pykat\/wp-content\/uploads\/sites\/4\/2021\/05\/image-1.png\" alt=\"\" class=\"wp-image-457\" srcset=\"https:\/\/logbooks.ifosim.org\/pykat\/wp-content\/uploads\/sites\/4\/2021\/05\/image-1.png 584w, https:\/\/logbooks.ifosim.org\/pykat\/wp-content\/uploads\/sites\/4\/2021\/05\/image-1-300x184.png 300w\" sizes=\"auto, (max-width: 584px) 100vw, 584px\" \/><\/figure>\n\n\n\n<p>The above plot shoes the amplitude of the first two orders generated by the mirror dither.<\/p>\n\n\n\n<p>You should note that Pykat returns a warning:<\/p>\n\n\n\n<p><br><code>Parsing `dither mN 10M 1n 2 0` into pykat object not implemented yet, added as extra line.<\/code><\/p>\n\n\n\n<p>This means that there is no interface in Pykat to interact with the dither command and change its parameters. If you want to change this line you first have to remove it, then reparse it:<\/p>\n\n\n\n<p><code>kat.removeLine(\"dither m1 100k 1n 2 0\")<\/code><\/p>\n\n\n\n<p>The line has to be <strong>exactly<\/strong> the same text as the line previously added.<\/p>\n\n\n\n<p>It&#8217;s fairly straight forward to just dither a mirror in a cavity and use a demodulating photodiode detector at the same frequency to observe the error signal (Make sure to optimise the demodulation phase)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kat = pykat.finesse.kat()\nkat.parse(\"\"\"\nl l1 1 0 n0\nm m1 0.99 0.01 0 n0 n1\ns s1 10 n1 n2\nm m2 1 0 0 n2 n3\n\ndither m2 200k 1n 2 0\npd1 REFL 200k 100 n0\nxaxis m1 phi lin -10 10 1000\n\"\"\")\nout = kat.run()\nout.plot()<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"582\" height=\"360\" src=\"https:\/\/logbooks.ifosim.org\/pykat\/wp-content\/uploads\/sites\/4\/2021\/05\/image-2.png\" alt=\"\" class=\"wp-image-458\" srcset=\"https:\/\/logbooks.ifosim.org\/pykat\/wp-content\/uploads\/sites\/4\/2021\/05\/image-2.png 582w, https:\/\/logbooks.ifosim.org\/pykat\/wp-content\/uploads\/sites\/4\/2021\/05\/image-2-300x186.png 300w\" sizes=\"auto, (max-width: 582px) 100vw, 582px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>NOTE: The dither command is classed as an experimental feature in Finesse v2 A quick example for generating an error signal by dithering the mirror. For this we need to use the `dither` command. dither component_name f m order phase Where f and m are the dither frequency and modulation index. The first simple example [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ssl_alp_hide_revisions":false,"footnotes":"","ssl_alp_hide_crossreferences_to":false},"categories":[1],"tags":[],"ssl-alp-coauthor":[18],"class_list":["post-455","post","type-post","status-publish","format-standard","hentry","category-uncategorised"],"_links":{"self":[{"href":"https:\/\/logbooks.ifosim.org\/pykat\/wp-json\/wp\/v2\/posts\/455","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/logbooks.ifosim.org\/pykat\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/logbooks.ifosim.org\/pykat\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/logbooks.ifosim.org\/pykat\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/logbooks.ifosim.org\/pykat\/wp-json\/wp\/v2\/comments?post=455"}],"version-history":[{"count":1,"href":"https:\/\/logbooks.ifosim.org\/pykat\/wp-json\/wp\/v2\/posts\/455\/revisions"}],"predecessor-version":[{"id":459,"href":"https:\/\/logbooks.ifosim.org\/pykat\/wp-json\/wp\/v2\/posts\/455\/revisions\/459"}],"wp:attachment":[{"href":"https:\/\/logbooks.ifosim.org\/pykat\/wp-json\/wp\/v2\/media?parent=455"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/logbooks.ifosim.org\/pykat\/wp-json\/wp\/v2\/categories?post=455"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/logbooks.ifosim.org\/pykat\/wp-json\/wp\/v2\/tags?post=455"},{"taxonomy":"ssl-alp-coauthor","embeddable":true,"href":"https:\/\/logbooks.ifosim.org\/pykat\/wp-json\/wp\/v2\/ssl-alp-coauthor?post=455"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}