{"id":431,"date":"2009-11-04T07:53:21","date_gmt":"2009-11-04T11:53:21","guid":{"rendered":"http:\/\/www.etotheipiplusone.net\/?p=431"},"modified":"2009-11-04T07:53:21","modified_gmt":"2009-11-04T11:53:21","slug":"ubercl%c3%b8cker-r%d1%8dmi%cf%87-r%d1%8dvived-and-segfault-update-2","status":"publish","type":"post","link":"https:\/\/www.etotheipiplusone.net\/?p=431","title":{"rendered":"\u00dcbercl\u00f8cker R\u042dmi\u03c7 R\u042dvived, and SEGFAULT Update 2"},"content":{"rendered":"<p>In the last \u00dcberclocker-related post, I said<\/p>\n<blockquote><p>this conversion ought to go quickly since I\u2019ve already drilled the new mounting holes to accommodate them.<\/p><\/blockquote>\n<p>By this I meant &#8221;<\/p>\n<blockquote><p>this conversion ought to go quickly since I&#8217;ve already drilled the new mounting holes but am swamped with classes, other duties, and a lack of motivation to do anything robot-related so \u00dcberclocker has been sitting on a table at <a href=\"http:\/\/miters.mit.edu\" target=\"_blank\">MITERS<\/a> taking up work space for two months<\/p><\/blockquote>\n<p>But that&#8217;s over now. I charged the Mental Capacitor of Project Motivating (+1) enough to go take apart the drivetrain to stuff the DeWalt motors in. The whole operation actually took about 30 minutes total, by the way, it&#8217;s just that the time constant of the MCPM is a semester or so.<\/p>\n<p>Here&#8217;s a picture of the robot.<\/p>\n<p><a href=\"\/pics\/cb2\/cb2_138.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"\/pics\/cb2\/cb2_138-mid.jpg\" alt=\"\" width=\"512\" height=\"384\" \/><\/a><\/p>\n<p>I excavated the carcass of Test Bot SP1 to use as a chew toy for testing &#8216;clocker. There&#8217;s no test video, unfortunately.<\/p>\n<p>I can&#8217;t exactly describe the new drivetrain as &#8220;Fast&#8221;. In fact, I think the HTI motors resulted in an overall higher speed, but not by much. Calculations put the anticipated top speed around 8 to 9 miles per hour. The bot isn&#8217;t slow by any means, but it was almost <em>too controllable<\/em>. I like a bit of unpredictability in robot handling.<\/p>\n<p>For future events, I might consider recutting the <a href=\"https:\/\/www.etotheipiplusone.net\/pics\/cb2\/cb2_94.jpg\" target=\"_self\">intermediate drive gears<\/a> to act as a speed increaser. 8MPH is nice for small arenas and stages like Dragon*Con, but in a larger arena it is a handicap.<\/p>\n<p>Here&#8217;s an overall picture of the robot internals, now featuring DeWalt drill motors mated to undoubtedly overdriven Harbor Freight drill gearbox parts.<\/p>\n<p style=\"text-align: center;\"><a href=\"\/pics\/cb2\/cb2_139.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"\/pics\/cb2\/cb2_139-mid.jpg\" alt=\"\" width=\"512\" height=\"384\" \/><\/a><\/p>\n<h3>Segfault<\/h3>\n<p>Alright, so I&#8217;m pretty damn sure the project is moving forward now, considering I just dropped big Benjamins on aluminum plates. The project has actually been limbo for a while because I&#8217;ve been slammed with everything else that does not pertain to building. As the assignments-and-papers season winds down and OH-GOD-EXAMS-AND-FINAL-PROJECTS season begins, there&#8217;s an occasional moment where I can&#8230; you know, do other stuff.<\/p>\n<p>I&#8217;m also in luck because I have no classes this term which have final exams.<\/p>\n<p>In the last SEGFAULT episode, we left off with a picture of two wheels.<\/p>\n<p><a href=\"\/pics\/seg\/seg_1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"\/pics\/seg\/seg_1-mid.jpg\" alt=\"\" width=\"512\" height=\"384\" \/><\/a><\/p>\n<p>Like before, not exciting at all. Through some more excavation of the archaeological site that is MITERS, I sequestered these 180 watt DC scooter motors, which seemed to have been paired with the wheels at one point in time. They have matching pulley pitches.<\/p>\n<p style=\"text-align: center;\"><a href=\"\/pics\/seg\/seg_2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"\/pics\/seg\/seg_2-mid.jpg\" alt=\"\" width=\"512\" height=\"384\" \/><\/a><\/p>\n<p>The pulleys gave a speed reduction of roughly 6 to 1. Through some crafty mathematics, I backsolved the specs of the motors so I can actually play some numbers games.<\/p>\n<p>The manufacturer, <a href=\"http:\/\/en.unitemotor.com\/ProductView_32.html\" target=\"_blank\">Unite Motor<\/a>, was kind enough to give some measurements of torque and current for these motors. Real measured numbers are better than theoretical ones, and leaps better than bullshit such as &#8220;TURNS&#8221; and &#8220;WINDS&#8221;.\u00a0 The rated torque (<strong>Tr<\/strong>) and rated current (<strong>Ir<\/strong>) were 0.7 N-m and 10.6 A, respectively.<\/p>\n<p>This was nice because if you have torque and amps, you can immediately get a critical constant of the DC motor, the torque constant (<strong>Kt<\/strong>). The Kt of this motor , <strong>Tr<\/strong>\/<strong>Ir<\/strong>,\u00a0 is <strong>0.66<\/strong> Nm \/ A.<\/p>\n<p>This alone doesn&#8217;t tell me much, because I don&#8217;t know what the maximum torque of the motor is if I don&#8217;t know how many amps it can ultimately pull if stalled. This is not provided by Unite Motor, shame on them.<\/p>\n<p>But fortunately, they also gave a rated <em>speed<strong> <\/strong><\/em>specification, which occurs (I hope to Robot Jesus on a stick, anyway) at the same point they rated <strong>Tr <\/strong>and <strong>Ir<\/strong>. This rotational velocity <strong>\u03c9 <\/strong>at the rated input voltage <strong>Vin <\/strong>of 24 volts is 2,600 RPM, or <strong>272.3<\/strong> radians (rad) per second.<\/p>\n<p>In an ideal motor, power in equals power out. Power is torque (<strong>T<\/strong>) * speed(<strong>\u03c9<\/strong>) AND also volts (<strong>V<\/strong>)* amps(<strong>I<\/strong>). Therefore, the crafty relation T\/I = \u03c9\/V occurs.<\/p>\n<p>Hey, this is convenient, because what it&#8217;s saying is that in SI units, <strong>torque per amp IS speed per volt<\/strong>. The motor back-EMF constant, <strong>Kv<\/strong>, is equal to <strong>Kt<\/strong>. So this motor as an ideal model gets <strong>0.66V \/ rad \/ s<\/strong>. This is to say that if you turned the motor at 1 radian per second, it would generate 0.66 volts for you. Conversely, running the motor at 0.66 volts will make it turn 1 radian per second. <strong>Kv = Kt<\/strong> only works in metricland, by the way.<\/p>\n<p>But real motors aren&#8217;t ideal transducers. They have resistance in the windings that turns input power into heat. A real motor can be modeled as a resistor in series with the ideal motor. The resistor drops some voltage across it while the motor is under load, so the ideal motor sees some value below your input voltage.<\/p>\n<p>Luckily, I know that the motor is rated for 24 volts <strong>Vin<\/strong> while turning <strong>2,600 RPM<\/strong> or <strong>272.3 rad\/s<\/strong> and having a BEMF contstant of <strong>0.66 V\/rad\/s<\/strong>. This means the voltage the motor is <em>generating<\/em> by virtue of turning, <strong>Vbemf = 272.3 rad\/s * 0.66 V\/rad\/s<\/strong> = <strong>17.97v<\/strong>.<\/p>\n<p>Even better is that this is known to happen <em>while <\/em><strong>Ir<\/strong> amps are flowing through the windings.\u00a0 When you have the differential voltage across a resistance and the current flowing through it, you know the resistance <strong>R<\/strong> through Ohm&#8217;s Law.<\/p>\n<p>So the motor resistance <strong>Rm<\/strong> is simple (<strong>Vin &#8211; Vbemf)<\/strong> \/ <strong>Ir<\/strong> = <strong>0.56<\/strong>\u03a9<strong>.<\/strong><\/p>\n<p>Now the stall characteristics of the motor can be calculated. When the motor is stalled balls to the wall, <strong>Vbemf = 0<\/strong> because there is no rotation. <strong>Rm<\/strong> dissipates all the power you put into the motor, and the only current flowing is therefore <strong>Istall<\/strong>.\u00a0 Through <strong>Istall<\/strong> = <strong>Vin\/Rm<\/strong> I know that the motor will pull a maximum of <strong>42 amps<\/strong>. Then smoke. At <strong>42 amps<\/strong>, the motor can make about <strong>2.75 N-m<\/strong> of torque.<\/p>\n<p>The no-load speed of the motor ideally occurs when the input current approaches 0. In practice this never happens because of <strong>Rm<\/strong>, but the NL speed is something that has to be measured. I can only conjecture on how fast the motor will turn with no load by <strong>\u03c9nl<\/strong> = <strong>Vin * Kv<\/strong>, and assume the motor current to be something small. This usually gets you within 10% or something. The guessed no load speed of these motors is around 345 rad\/s, or about 3300 RPM.<\/p>\n<p>Okay, enough DC motor theory.\u00a0 So now I wanted to find out what the limit is in terms of speed and tilt angle if I used these motors and their matching wheels.<\/p>\n<p><a href=\"\/pics\/seg\/notcourse8.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"\/pics\/seg\/notcourse8-mid.png\" alt=\"\" width=\"427\" height=\"512\" \/><\/a>Here&#8217;s a (really, really) rough model of me on a balancing vehicle. Segway-type vehicles are a variant of the <a href=\"http:\/\/en.wikipedia.org\/wiki\/Inverted_pendulum\" target=\"_blank\">inverted pendulum<\/a>, a classical problem in control theory and physics. The actual equations of motion for such a system are a bit convoluted, though rest assured I have been forced at chalkpoint to derive them step by step.<\/p>\n<p>I just want a ballpark number for how fast I can go, so I can gauge the type of helmet I need to prevent too much brain splatter when I fall over. This can be easily approximated in the above system, where you have a point mass approximation of me, tilted out in front of the vehicle by an angle \u03a6, and away from the center of rotation by a distance d. <strong>d<\/strong> is the distance that my center of mass is above the vehicle platform. In a typical human, the CoM \/ CoG occurs a bit above the hips. I assumed this was 1 meter for sake of argument, since I&#8217;m not that tall and this is not very scientific. The vehicle itself is assumed to have no mass yet. This is a very bad thing to assume, and strictly limits this to guessing &#8220;steady state&#8221; characteristics &#8211; i.e. no acceleration of any kind is allowed.<\/p>\n<p>In classic 8.01 fashion, the goal is to keep me-in-a-black-hole from acclerating. That means all forces and torques have to be balanced.<\/p>\n<p style=\"text-align: center;\"><a href=\"\/pics\/seg\/notcourse8_2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"\/pics\/seg\/notcourse8_2-mid.png\" alt=\"\" width=\"512\" height=\"384\" \/><\/a><\/p>\n<p>\u03a6 is referenced from the vertical, so the Condensed Matter Charles Equivalent Force Diagram\u2122 is thus. <strong>N<\/strong> is provided by the ground &#8211; we are assuming I&#8217;m on solid ground here, not flying, so the vehicle doesn&#8217;t have to generate lift. This may also be bad assumption.<\/p>\n<p>That leaves just <strong>F<\/strong> and <strong>mg sin \u03a6<\/strong> to fight it out.\u00a0 The latter is provided by me existing and also tilting the vehicle forward or backwards. <strong>F<\/strong> comes from the torque of the motor and the radius of the wheels: <strong>F<\/strong> = <strong>T<\/strong>\/<strong>r<\/strong>. Therefore, <strong>mg sin \u03a6 = T\/r. <\/strong><\/p>\n<p>The uber-ballparked approximate steady state model of the vehicle is then given by <strong>\u03a6 = arcsin ( T \/ mgr )<\/strong>. If I have a torque figure, I can estimate the maximum angle of tilt that the motors can sustain while moving at constant velocity. That means if I run over a pebble, it&#8217;s all over.<\/p>\n<p>To avoid this scenario, I want to size <strong>T<\/strong> to be under <em>half<\/em> the stall torque of the motors. The reason is that <strong>T\u03c9 = VI<\/strong> maxes out at one half of any of the input variables. This is the point which the motors make maximum power. If I&#8217;m crusing at maximum power, there is no recovery if the unstable system deviates further from the vertical because the motors can&#8217;t exert any more torque without slowing down. Which of course will only make the situation worse.<\/p>\n<p>I decided that 33% peak torque was the &#8220;safe point&#8221;. This gives me some leeway such that the motors can exert a momentary, more powerful shove to counteract my attempts at crossing the critical \u03a6. The real Segway does something like this &#8211; if you try to go too fast, it will start tilting back to save your ass (\/face).<\/p>\n<p>33% of stall torque for my <em>two<\/em> motors driving a <strong>6:1<\/strong> reduction\u00a0 on <strong>4&#8243; radius<\/strong> ( 0.1m) wheels is\u00a0 (<strong>2 * 2.75 N-m * 0.33<\/strong> * <strong>6<\/strong>) = <strong>10.89 N-m<\/strong>. So that gives <strong>\u03a6 = arcsin ( T \/ mgr ) <\/strong>of 9.6 degrees or so.<\/p>\n<p>Decently smooth. 10 degrees is pretty steep for a lean angle during travel, but I was concerned with the peak torque (\/force) limiting how quickly the platform could react to a sudden input like me jumping on it. If this is limited, then the whole vehicle will feel sloshy and risk not being able to recover from a sudden disturbance, like hitting a small child.<\/p>\n<p>Okay, so I&#8217;m not designing to target small children (honestly!), but things like bumps in the ground, terrain changes, sidewalk seams, door and hallway thresholds, etc. all represent sources of external disturbances.<\/p>\n<p>Having these numbers, I put the motors into the parts bin (i.e. LOLrioKart) and began working on vehicle design.<\/p>\n<p><a href=\"\/pics\/seg\/seg_3.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"\/pics\/seg\/seg_3-mid.jpg\" alt=\"\" width=\"512\" height=\"384\" \/><\/a><\/p>\n<p>This is a kewl motor.<\/p>\n<p>I wasn&#8217;t able to design for too long before another intrepid MITERer mentioned that he crufted some motors out of a lab cleanup.<\/p>\n<p>The deal with lab cleaups here is that the proper response as an engineering student is, as soon as you receive an email containing the words &#8220;LAB CLEANUP&#8221; or similar, drop <strong>everything<\/strong> you are doing and <strong>immediately<\/strong> report to the scene to claim cool stuff. Sadly, I don&#8217;t make it to many of them, but a surprising majority of cool Reuse stuff goes to MITERS because there are so many of us that at least one person is on guard.<\/p>\n<p>These are <a href=\"http:\/\/www.potomacelectric.com\/Downloads\/Datasheets\/Kollmorgen\/Kollmorgen%20Servodisc%20catalog.PDF\" target=\"_blank\">Kollmorgen Servodisc<\/a> motors, renowned in the industry for being flat and pancakey&#8230;as well as being extremely power-dense. They are <em>coreless <\/em>motors. That means there is no big iron thing in the rotor to accelerate, and such motors can reach extremely high angular accelerations. That means they respond to commands <strong>fast<\/strong>.<\/p>\n<p>Fast is good. Also, Kollmorgen, being a legit motor manufacturer for legit industries, completely chracterized their motors in the datasheet. Even handily providing me with <em>armature inertia<\/em> if I care to include that in the system dynamics (hint: No.)<\/p>\n<p>These type U9D-E motors are attached to 10:1 precision spur gearboxen. Convenience in motor form &#8211; so I borrowed them on good faith that they won&#8217;t be baked or damaged. I sincerely hope this will remain true, because I sure as hell can&#8217;t possibly afford these motors in real life.<\/p>\n<p>Running the numbers, I got that the vehicle could achieve almost <strong>30 degrees<\/strong> of forward tilt. This just shot the error margin into low earth orbit, so the &#8216;morgs win the motor race. When the vehicle is 30 degrees off kilter, shit has gone down anyway. Or is about to go down. Hard.<\/p>\n<p>With these, even if I was completely wrong on the physical modeling, I&#8217;d have enough torque capacity to tune the final system to taste.<\/p>\n<p>What to do with kewl moters? Digitize them!<\/p>\n<p style=\"text-align: center;\"><a href=\"\/pics\/seg\/seg_4.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"\/pics\/seg\/seg_4-mid.jpg\" alt=\"\" width=\"512\" height=\"437\" \/><\/a><\/p>\n<p>I like motors that are flat colors and prismatic.<\/p>\n<p style=\"text-align: center;\"><a href=\"\/pics\/seg\/seg_5.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"\/pics\/seg\/seg_5-mid.jpg\" alt=\"\" width=\"512\" height=\"438\" \/><\/a><\/p>\n<p>Hey, it&#8217;s a circle.<\/p>\n<p>I&#8217;ve recently taken a liking to the truncated circle profile. This is clearly visible on my <a href=\"https:\/\/www.etotheipiplusone.net\/pics\/meche\/007\/007_9.jpg\" target=\"_self\">2.007 robot<\/a>. It&#8217;s alot less <em>boring<\/em> than just plain square sides.<\/p>\n<p>SEGFAULT is built around a 24 inch diameter circle. Having an actual 2 foot circle as a baseplate is excessive, so the ends will be clipped off.<\/p>\n<p style=\"text-align: center;\"><a href=\"\/pics\/seg\/seg_6.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"\/pics\/seg\/seg_6-mid.jpg\" alt=\"\" width=\"512\" height=\"438\" \/><\/a><\/p>\n<p>Underside, showing the motor carriers.<\/p>\n<p style=\"text-align: center;\"><a href=\"\/pics\/seg\/seg_7.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"\/pics\/seg\/seg_7-mid.jpg\" alt=\"\" width=\"512\" height=\"438\" \/><\/a><\/p>\n<p>The circle is cut where the motor modules end. The overall length is now around 17 inches.<\/p>\n<p style=\"text-align: center;\"><a href=\"\/pics\/seg\/seg_8.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"\/pics\/seg\/seg_8-mid.jpg\" alt=\"\" width=\"512\" height=\"438\" \/><\/a><\/p>\n<p>&#8230;Okay, just a LITTLE LEAP OF FAITH THERE.\u00a0 What the hell is that?<\/p>\n<p>I skipped over more screenshots of the CAD work because it was essentially done in one night. That means it sucks and is riddled with flaws. I&#8217;m putting this here because it will probably represent the overall shape of the thing, even if details change.<\/p>\n<p>The frame is all 1\/4&#8243; and 3\/8&#8243; aluminum appropriately waterjetted and T-nutted together. I&#8217;m currently on a mission to reduce the sheer amount of metal used in construction. While the whole thing (including stick AND both drive motors!) only weighs 36 pounds, it needs <strong>alot<\/strong> of metal. And it&#8217;s a waste of the metal, because the plates are totally trussed out and hollow.<\/p>\n<p>What was that I said about it sucking and being done in one night?<\/p>\n<p>The difference between this frame and essentially all the other DIY balancing vehicles is that it has tiny-ass wheels. I mostly chose this route because i already had said wheels. In order to fit components, then, I had to make an &#8220;middle deck&#8221; above the motors, where most DIYers will just put parts between the motors and under the top platform. A bit convoluted, but I don&#8217;t want to go back and <em>redesign everything<\/em>. Batteries go in the middle deck, along with most controls.<\/p>\n<p>There&#8217;s nothing on the stick yet, because I haven&#8217;t gotten around to it. At most, there will be a simple panel dashboard showing battery voltage and probably speed, along with a main power switch. And handlebars.<\/p>\n<p>Steering will be performed by <em>tilting the stick<\/em> left and right, so there&#8217;s no conventional grip throttle like on the first generation Segways.<\/p>\n<p>Alright, enough is enough. Time to start on something &#8211; pay attention to this space. And I promise that SEGFAULT will get its own page soon!<\/p>\n<div id=\"_mcePaste\" style=\"overflow: hidden; position: absolute; left: -10000px; top: 2317px; width: 1px; height: 1px;\">\u03c9<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In the last \u00dcberclocker-related post, I said this conversion ought to go quickly since I\u2019ve already drilled the new mounting holes to accommodate them. By this I meant &#8221; this conversion ought to go quickly since I&#8217;ve already drilled the new mounting holes but am swamped with classes, other duties, and a lack of motivation [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,60,59],"tags":[],"class_list":["post-431","post","type-post","status-publish","format-standard","hentry","category-project-build-reports","category-segfault","category-uberclocker-remix"],"_links":{"self":[{"href":"https:\/\/www.etotheipiplusone.net\/index.php?rest_route=\/wp\/v2\/posts\/431","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=431"}],"version-history":[{"count":5,"href":"https:\/\/www.etotheipiplusone.net\/index.php?rest_route=\/wp\/v2\/posts\/431\/revisions"}],"predecessor-version":[{"id":436,"href":"https:\/\/www.etotheipiplusone.net\/index.php?rest_route=\/wp\/v2\/posts\/431\/revisions\/436"}],"wp:attachment":[{"href":"https:\/\/www.etotheipiplusone.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=431"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.etotheipiplusone.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=431"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.etotheipiplusone.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=431"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}