{"id":462,"date":"2009-11-25T03:40:22","date_gmt":"2009-11-25T07:40:22","guid":{"rendered":"http:\/\/www.etotheipiplusone.net\/?p=462"},"modified":"2010-04-06T04:53:34","modified_gmt":"2010-04-06T08:53:34","slug":"face-vector-modulation-part-ii-background-and-theory","status":"publish","type":"post","link":"https:\/\/www.etotheipiplusone.net\/?p=462","title":{"rendered":"Face Vector Modulation Part II: Background and Theory"},"content":{"rendered":"<p>It all started in <a href=\"http:\/\/web.mit.edu\/6.131\/www\/\" target=\"_blank\">6.131<\/a>.<\/p>\n<p>What caught my eye in the description was &#8220;go-kart controller&#8221;. I registered for the class back when I blew up a new <a href=\"https:\/\/www.etotheipiplusone.net\/?page_id=197\" target=\"_self\">LOLrioKart<\/a> controller about once every month or so. I wanted to learn how to do it <em>right<\/em>. Lingering in the back of my mind was the little mention of 3 phase AC inverters, but I was reassured by classmates that it was just <a href=\"http:\/\/en.wikipedia.org\/wiki\/Variable-frequency_drive\" target=\"_blank\">V\/Hz<\/a> control for an induction motor, i.e. not really that exciting. A legitimate control method it may be, but it wasn&#8217;t BLDC .<\/p>\n<p>It all changed, though, when I received the assignment handout for the AC motor control. Here&#8217;s a link to a <a href=\"\/stuff\/leeb_paper.pdf\" target=\"_blank\">paper<\/a> jointly written by the course professor along with associates, which details the apparati and methods used in the class. Pay particularly close attention to Figure 15.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"\/pics\/fvm_state_machine.png\" alt=\"\" width=\"572\" height=\"399\" \/>So what does it do?<\/p>\n<h2>Space Vector Modulation<\/h2>\n<p><a href=\"http:\/\/en.wikipedia.org\/wiki\/Space_Vector_Modulation\" target=\"_blank\">SVM<\/a> is a control algorithm for generating 3 phase waveforms to drive motors. It is based off the simplest possible 3 phase AC motor, that which has 1 winding per phase and 1 pole pair (that is, 1 N and 1 S on the rotor). Such a motor has six <em>states<\/em> it can be in which are represented by 6 voltage vectors.<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/upload.wikimedia.org\/wikipedia\/commons\/5\/5a\/Space_Vector_Modulation.gif\"><img decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/upload.wikimedia.org\/wikipedia\/commons\/5\/5a\/Space_Vector_Modulation.gif\" alt=\"\" width=\"512\" \/><\/a><\/p>\n<p>There are actually 8 total states, because if the three phase legs are taken to be either on (connected to V+) or off (grounded) and treated as binary digits, there exists all combinations of 0 and 1 from 000 to 111. Both 000 and 111 themselves produce no voltage across the motor, thus no movement, and are invalid states &#8211; observing the diagram on Wikipedoia, this corresponds to all the top switches or all the bottom switches being closed.<\/p>\n<p>It is interesting to note that at no time are the top and bottom switches in a leg closed together. This would result in everything blowing up because the power supply is being shorted.<\/p>\n<p>What this distills down to is that simple motor commutation can be achieved using a <em><a href=\"http:\/\/en.wikipedia.org\/wiki\/Finite_state_machine\" target=\"_blank\">finite state machine<\/a> <\/em>model. A device with six (or 8, counting the zero vectors) states that steps through them in order will commutate an AC motor.<\/p>\n<p>The class circuit provides this FSM functionality in the 74LS138 <em>3-to-8 Multiplexer<\/em> chip. In its legitimate life, it helped select peripherals for microcontrollers. Here, it takes the <em>conveniently<\/em> three-bit input and translates that to <em>one<\/em> output.<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/www.etotheipiplusone.net\/pics\/fvm_138.png\"><img decoding=\"async\" class=\"aligncenter\" src=\"\/pics\/fvm_138.png\" alt=\"\" width=\"512\" \/><\/a><\/p>\n<p>So that means if you put in a binary number valued 0 to 7 (000 to 111), you get one output Y0 to Y7 selected.<\/p>\n<p>Now all that&#8217;s left to do is associate each output with the top and bottom switches. Observe in Figure 15 above how the OR (actually NOR, because the 74138 is an active-low chip) gates are each tied to two 74138 outputs. That means each output NOR gate is on for two sequential states, which follows the SVM rule of <em>at least two switches, <\/em>one top and one bottom,<em> always being on<\/em>.<\/p>\n<p style=\"text-align: center;\">\/<a href=\"\/pics\/fvm_3ph.png\"><img decoding=\"async\" class=\"aligncenter\" src=\"\/pics\/fvm_3ph.png\" alt=\"\" width=\"512\" \/><\/a><\/p>\n<p>So how does that correspond to the 3 phase bridge circuit? Let&#8217;s start at &#8220;state 1&#8221;. Motors are round objects, and to a degree you can fiddle with what&#8217;s called state 1. In state 1, Q1 is on. That means Q2 <em>cannot be on<\/em>, or things would smoke. So state 1 is Q1 and Q4 on, and the motor current goes <em>in-1-out-4<\/em>.<\/p>\n<p>State 2 advances the motor to <em>in-1-out-6<\/em>, state 3 now toggles q1 off and turns q3 on, and so on.<\/p>\n<ol>\n<li>in-1-out-4<\/li>\n<li>in-1-out-6<\/li>\n<li>in-3-out-6<\/li>\n<li>in-3-out-2<\/li>\n<li>in-5-out-2<\/li>\n<li>in-5-out-4<\/li>\n<li>And the beat goes on.<\/li>\n<\/ol>\n<p>The top and bottom switches are complementary and offset. The result in a motor is something trippy like this.<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/www.ibiblio.org\/kuphaldt\/socratic\/output\/animation_3phase_motor_fast.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/www.ibiblio.org\/kuphaldt\/socratic\/output\/animation_3phase_motor_fast.gif\" alt=\"\" width=\"416\" height=\"416\" \/><\/a><\/p>\n<p>In the class circuit, the state switching is provided by the 74LS163, a 4-bit counter. In the lab assignment, we input a variable frequency square wave into the 74163, which sequentially stepped through its outputs from 000 to 101, 6 total states, then automatically resetting itself to 000 on state 5.<\/p>\n<p>It is important to note that 000 and 111 here do <strong>not<\/strong> correspond to SVM states 000 through 111. The SVM 3 bit code is a <a href=\"http:\/\/en.wikipedia.org\/wiki\/Gray_Code\" target=\"_blank\"><em>Gray Code<\/em><\/a> (of sorts), while the 74163 counts in raw binary. What the count from 000 to 101 does is <em>select outputs 0 through 5<\/em><strong><em> <\/em><\/strong>sequentially on the 74138. These output pins, in turn, go to the NOR gates and become commutation commands.<\/p>\n<p>This was used as a crude VFD to turn an AC induction motor. The state machine sets up a rotating magnetic field in the motor, and it turns.<\/p>\n<p>Oooh, shiny.<\/p>\n<h2>Face Vector Modulation<\/h2>\n<p>I wanted more.<\/p>\n<p>I immediately saw how the simple SVM kernel could be used to run a brushless DC motor. Your average brushless DC motor has 3 Hall Effect magnetic sensors that pop high and low depending on the position of the magnetic rotor.<\/p>\n<p>Wait, <em>3<\/em> bits?<\/p>\n<p>This could get exciting.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It all started in 6.131. What caught my eye in the description was &#8220;go-kart controller&#8221;. I registered for the class back when I blew up a new LOLrioKart controller about once every month or so. I wanted to learn how to do it right. Lingering in the back of my mind was the little mention [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,5,62],"tags":[],"class_list":["post-462","post","type-post","status-publish","format-standard","hentry","category-mit-boston","category-project-build-reports","category-reference-posts"],"_links":{"self":[{"href":"https:\/\/www.etotheipiplusone.net\/index.php?rest_route=\/wp\/v2\/posts\/462","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.etotheipiplusone.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.etotheipiplusone.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.etotheipiplusone.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.etotheipiplusone.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=462"}],"version-history":[{"count":4,"href":"https:\/\/www.etotheipiplusone.net\/index.php?rest_route=\/wp\/v2\/posts\/462\/revisions"}],"predecessor-version":[{"id":606,"href":"https:\/\/www.etotheipiplusone.net\/index.php?rest_route=\/wp\/v2\/posts\/462\/revisions\/606"}],"wp:attachment":[{"href":"https:\/\/www.etotheipiplusone.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=462"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.etotheipiplusone.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=462"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.etotheipiplusone.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=462"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}