{"id":1059,"date":"2010-12-04T04:23:29","date_gmt":"2010-12-04T08:23:29","guid":{"rendered":"http:\/\/www.etotheipiplusone.net\/?p=1059"},"modified":"2010-12-04T06:56:02","modified_gmt":"2010-12-04T10:56:02","slug":"segfault-rebooted-part-1-the-cyclic-tragedy-of-the-segfault","status":"publish","type":"post","link":"https:\/\/www.etotheipiplusone.net\/?p=1059","title":{"rendered":"SEGFAULT Re\/BOOTED Part 1: The Cyclic Tragedy of the SEGFAULT"},"content":{"rendered":"<p>Pop quiz: When was the last Segfault update?<\/p>\n<p>Answer: It was almost a year ago in January.<\/p>\n<p>As of a few weeks ago, Segfault looked like of like this:<\/p>\n<p style=\"text-align: center;\"><a href=\"\/pics\/seg\/seg_78.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"\/pics\/seg\/seg_78-mid.jpg\" alt=\"\" width=\"384\" height=\"512\" \/><\/a><\/p>\n<p>Poor Segfault.<\/p>\n<p>The abridged version of the story is that I stopped reporting on it shortly after the project ran into electrical demons and the gyro-accelerometer filter completely did not function as anticipated. Several more attempts, each getting increasingly desperate, were made during the Spring 2010 term and over the summer. But sadly enough, none were successful in getting it to balance or remain remotely stable, and Segfault has been sitting in a corner at<a href=\"http:\/\/miters.mit.edu\" target=\"_blank\"> MITERS<\/a> for the past semester. However, it&#8217;s slated to make a comeback&#8230;. <em>right freakin&#8217; now<\/em>&#8230;. and hopefully will be somewhat functional this time around.<\/p>\n<p>Let&#8217;s start at the beginning.<\/p>\n<h1>january<\/h1>\n<p>After putting together the final iteration of the balance controller, I started bench testing the locked-antiphase H-bridge drivers.<\/p>\n<p style=\"text-align: center;\"><a href=\"..\/pics\/seg\/seg_79.jpg\"><img decoding=\"async\" class=\"aligncenter\" src=\"..\/pics\/seg\/seg_79-mid.jpg\" alt=\"\" \/><\/a><\/p>\n<p>Yeah. That worked well. I blew out gate driver chips in rapid succession for seeming no reason at all. The FETs were also changed out a bunch of times as they seemingly latched up and shorted. It wasn&#8217;t the deadtime\/delay circuit at fault &#8211; something else was killing the drivers.<\/p>\n<p style=\"text-align: center;\"><a href=\"..\/pics\/seg\/seg_80.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"..\/pics\/seg\/seg_80-mid.jpg\" alt=\"\" width=\"512\" height=\"384\" \/><\/a><\/p>\n<p>I got so desperate that I began putting the <em>FETs themselves<\/em> in removable sockets. Damn the current processing ability &#8211; I was just going to pop them in and out as they died or became questionable, in the interest of problem solving.<\/p>\n<p>When one power-on seemingly killed the entire dead-time circuit, I gave up for the month of January and finished <a href=\"https:\/\/www.etotheipiplusone.net\/?page_id=576\" target=\"_blank\">Cold Arbor<\/a> for Motorama 2010.<\/p>\n<p>I now know that probing the ungrounded high side drivers with a grounded oscilloscope probe was the most likely cause of the latchup and destruction.<\/p>\n<h1>april<\/h1>\n<p style=\"text-align: center;\"><a href=\"..\/pics\/seg\/seg_81.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"..\/pics\/seg\/seg_81-mid.jpg\" alt=\"\" width=\"512\" height=\"384\" \/><\/a><\/p>\n<p>In April, I signed up to exhibit at the <a href=\"http:\/\/hkn.mit.edu\/expo.php\" target=\"_blank\">HKN Project Expo<\/a>. Pursuant to this, I decided to Just Rig Something to see if Segfault would remotely function. I yanked the two Dimension 25A controllers from Cold Arbor and set them to run on 0-5v analog input mode, which was compatible with the signal that the original H-bridges wanted. The Dimension boards didn&#8217;t allow any more than 24 volts input (originally slated to be 36v), however, so I pitched some NiCd packs that I had just standing around onto the thing.<\/p>\n<p>The verdict? Yeah right.<\/p>\n<p>The response was extremely poor, even with all the gains set to the highest possible. Segfault would start out balanced, but be unable to stay at that position and entered very high amplitude, low-frequency oscillations (effectively driving forward and backward). As I later found out, this isn&#8217;t just due to weak motors or weak motor drivers. Regardless, it wasn&#8217;t worth demoing&#8230;<\/p>\n<p style=\"text-align: center;\"><a href=\"..\/pics\/seg\/seg_82.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"..\/pics\/seg\/seg_82-mid.jpg\" alt=\"\" width=\"512\" height=\"384\" \/><\/a><\/p>\n<p>So I just brought it as a sculpture.<\/p>\n<h1>may<\/h1>\n<p>After not looking at Segfault for several more weeks, I decided to take the Victor HV controllers out of Arbor (which by this point was a parts-bot) and try running the whole 36 volts to see if the response would be any stiffer.<\/p>\n<p style=\"text-align: center;\"><a href=\"..\/pics\/seg\/seg_83.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"..\/pics\/seg\/seg_83-mid.jpg\" alt=\"\" width=\"512\" height=\"384\" \/><\/a><\/p>\n<p>Besides switching at only 100 Hz (and making a massive racket using Segfault&#8217;s hollow shell as a resonator), the Victors also demanded a digital input signal.<\/p>\n<p>And so I sank yet another level.<\/p>\n<p style=\"text-align: center;\"><a href=\"..\/pics\/seg\/seg_84.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"..\/pics\/seg\/seg_84-mid.jpg\" alt=\"\" width=\"512\" height=\"384\" \/><\/a><\/p>\n<p>Stop judging me.<\/p>\n<p>By this pointed, I <em>just wanted a balancing vehicle, dammit!<\/em><\/p>\n<p>This board was thrown together, and some sensor-reading code freelanced, in a few hours.<\/p>\n<p style=\"text-align: center;\"><a href=\"..\/pics\/seg\/seg_85.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"..\/pics\/seg\/seg_85-mid.jpg\" alt=\"\" width=\"512\" height=\"384\" \/><\/a><\/p>\n<p>An IRL screenshot of the Gory Details.\u00a0 The Arduino read in the user gains and steering pot angle and processed them together with the two sensored readings. A complementary filter (a real one, as I later discovered), <em>i.e. <\/em>my entire two breadboards full of parts (which really isn&#8217;t one), is <a href=\"http:\/\/web.mit.edu\/scolton\/www\/filter.pdf\" target=\"_blank\">like one line of code<\/a>.<\/p>\n<p style=\"text-align: center;\"><a href=\"..\/pics\/seg\/seg_86.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"..\/pics\/seg\/seg_86-mid.jpg\" alt=\"\" width=\"384\" height=\"512\" \/><\/a><\/p>\n<p>It was nearing the end of term, and I wanted to just get this thing out of my sight (and mind) for a while. This version of Segfault was the closest it had ever come to working &#8211; I think I managed to stay on it for 2 or 3 whole seconds. But to get there, it must have kicked me in the shins at least 10 times. It was also very angry and would occasionally completely lose all control and accelerate wildly into something, or at least until it just fell over.<\/p>\n<p>The falling over part destroyed the handlebar panel and broke several of the precision pots inside. So that was the end of Segfault for a while. Back into the corner it goes&#8230;<\/p>\n<h1>july<\/h1>\n<p>On A Midsummer Night&#8217;s Eve, when I was waiting on parts for the <a href=\"https:\/\/www.etotheipiplusone.net\/?page_id=700\" target=\"_blank\">RazErBlades<\/a>, I decided to take another crack at the thing. The Arduino controller was horribly hacked together the first time, and didn&#8217;t really incorporate the important part of the vehicle &#8211; which was the functioning Degrees gauge.<\/p>\n<p style=\"text-align: center;\"><a href=\"..\/pics\/seg\/seg_87.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"..\/pics\/seg\/seg_87-mid.jpg\" alt=\"\" width=\"512\" height=\"384\" \/><\/a><\/p>\n<p>First order of business, however, was to fix the user interface panel. I found some matching 100K 10-turn potentiometers to replace the broken ones. The wiring was made cleaner by the use of a sacrificed VGA cable instead of a billion different twisted pairs.<\/p>\n<p style=\"text-align: center;\"><a href=\"..\/pics\/seg\/seg_88.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"..\/pics\/seg\/seg_88-mid.jpg\" alt=\"\" width=\"512\" height=\"384\" \/><\/a><\/p>\n<p>I rebuilt the Arduino board with some actual forethought this time around so it incorporated all the pins and inputs I needed.<\/p>\n<p style=\"text-align: center;\"><a href=\"..\/pics\/seg\/seg_89.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"..\/pics\/seg\/seg_89-mid.jpg\" alt=\"\" width=\"512\" height=\"384\" \/><\/a><\/p>\n<p>And here it is, the degrees gauge functional for the first time!<\/p>\n<p>Too bad nothing else was. The test video <a href=\"http:\/\/techtv.mit.edu\/collections\/etotheipiplusone\/videos\/7817-taming-of-the-segfault\" target=\"_blank\">pretty much says it all<\/a>.<\/p>\n<p>No matter how the gains were tuned, Segfault was prone to <em>high frequency<\/em> oscillations this time. It was too twitchy, or perhaps the sensors coupled too much of the motion back into the control loop.<\/p>\n<p>The spark seen in the video was a portion of the battery pack heatshrink wearing through because of the vibrations, briefly contacting the metal frame at two different potentials. It was inconsequential. Unfortunately, the rapid forward-and-reverse gunning of the motors stripped out both of the precision spur gearboxes.<\/p>\n<p>With the forced termination of that test, I decided to just write off Segfault and revisit it yet another day.<\/p>\n<h1>now<\/h1>\n<p>Mechatronics.<\/p>\n<p>The synergistic combination of Mechanical engineering, Electronic engineering, Computer engineering, Control engineering, and Systems Design engineering[<a href=\"http:\/\/en.wikipedia.org\/wiki\/Mechatronics\" target=\"_blank\">1<\/a>], and also a really cool class here at MIT, designation <strong><em>2.737<\/em><\/strong>. You should take it if you get the chance.<\/p>\n<p>Basically, my assessment is that it&#8217;s everything I <em>should <\/em>have learned in my undegraduate controls courses (It&#8217;s actually a grad-level class, since MIT enjoys watching undegraduates torture themselves by taking G-level classes).<\/p>\n<p>As such, I now know what a <strong>real<\/strong> analog complementary filter is. Referencing <a href=\"http:\/\/dspace.mit.edu\/handle\/1721.1\/17007\" target=\"_blank\">this paper<\/a> by K. Byl (nee Lilienkamp), I&#8217;ve designed a new balance filter for Segfault, the <em>Adaptive Face-Forward Compensator<\/em>. I&#8217;ve also summoned the <a href=\"https:\/\/www.etotheipiplusone.net\/?p=642\" target=\"_blank\">21844 gate drivers<\/a> and my now full-blown addiction to PCB design to create a new locked-antiphase <em>Segtroller<\/em>.<\/p>\n<p>The major difference this time? I&#8217;m actually finishing SEGFAULT as a part of the grade for this class. This shit just got real\u2122.<\/p>\n<p>Here&#8217;s the sneak-peek.<\/p>\n<p style=\"text-align: center;\"><a href=\"\/pics\/seg\/segbo_4.png\"><img decoding=\"async\" class=\"aligncenter\" src=\"\/pics\/seg\/segbo_4.png\" alt=\"\" width=\"600\" \/><\/a><br \/>\n<em>The complementary filter and analog signal processing backend<\/em><\/p>\n<p style=\"text-align: center;\"><a href=\"..\/pics\/seg\/segbo_1.png\"><img decoding=\"async\" class=\"aligncenter\" src=\"..\/pics\/seg\/segbo_1.png\" alt=\"\" width=\"600\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><em>The locked-antiphase H-bridge, each driving a single side<\/em><\/p>\n<p style=\"text-align: left;\">So when&#8217;s this due? Wednesday.<\/p>\n<p style=\"text-align: left;\">By that I mean a few days from now, and between now and then I also have to make sure that 2.009 doesn&#8217;t end in utter disaster.<\/p>\n<p style=\"text-align: left;\">Onwards <em>Adaptive Face-Forward Compensator!<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Pop quiz: When was the last Segfault update? Answer: It was almost a year ago in January. As of a few weeks ago, Segfault looked like of like this: Poor Segfault. The abridged version of the story is that I stopped reporting on it shortly after the project ran into electrical demons and the gyro-accelerometer [&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,60],"tags":[],"class_list":["post-1059","post","type-post","status-publish","format-standard","hentry","category-mit-boston","category-project-build-reports","category-segfault"],"_links":{"self":[{"href":"https:\/\/www.etotheipiplusone.net\/index.php?rest_route=\/wp\/v2\/posts\/1059","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=1059"}],"version-history":[{"count":5,"href":"https:\/\/www.etotheipiplusone.net\/index.php?rest_route=\/wp\/v2\/posts\/1059\/revisions"}],"predecessor-version":[{"id":1064,"href":"https:\/\/www.etotheipiplusone.net\/index.php?rest_route=\/wp\/v2\/posts\/1059\/revisions\/1064"}],"wp:attachment":[{"href":"https:\/\/www.etotheipiplusone.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1059"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.etotheipiplusone.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1059"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.etotheipiplusone.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1059"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}