<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8200098102909041178</id><updated>2012-01-30T12:21:10.778-08:00</updated><category term='quadrotor'/><category term='pcb quadrotor'/><category term='failbot'/><category term='field-oriented control'/><category term='e-kart'/><category term='robot'/><category term='mems'/><category term='segstick'/><category term='balancer'/><category term='tinykart'/><category term='strobe'/><category term='FOC'/><category term='monaco'/><category term='high speed video'/><category term='mini4WDbot'/><category term='electric go-kart'/><category term='test'/><category term='hexrotor'/><category term='4pcb'/><category term='motor control'/><category term='motor timing'/><category term='axial motor'/><category term='edgerton center'/><category term='scooter'/><category term='video'/><category term='singapore'/><category term='mecanum'/><category term='prototype this discovery'/><category term='EVER'/><category term='pneu scooter'/><category term='servos'/><category term='melon'/><category term='flywheel'/><category term='tesla'/><category term='arduino'/><category term='SMMA'/><category term='victor'/><category term='table'/><category term='2.007'/><category term='scv'/><category term='directdrive'/><category term='twitch'/><category term='A123'/><category term='mSCR'/><category term='maker faire'/><category term='3ph'/><category term='RC'/><category term='charger'/><category term='prop balancer'/><category term='motor'/><category term='game'/><category term='flinch'/><category term='pneu'/><category term='wootstick'/><category term='BWD'/><category term='quals'/><category term='kart'/><category term='sensorless'/><category term='cap'/><category term='LEAF'/><category term='engineering design class'/><category term='wheel'/><category term='FIRST'/><category term='MIDI'/><category term='snow'/><category term='miters'/><category term='hexbridge'/><category term='prototype'/><title type='text'>Shane Colton</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://scolton.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://scolton.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default?start-index=101&amp;max-results=100'/><author><name>Shane Colton</name><uri>http://www.blogger.com/profile/10603406287033587039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>147</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8200098102909041178.post-1237742274210592961</id><published>2012-01-29T22:19:00.000-08:00</published><updated>2012-01-30T07:18:15.630-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='robot'/><category scheme='http://www.blogger.com/atom/ns#' term='flinch'/><category scheme='http://www.blogger.com/atom/ns#' term='mecanum'/><title type='text'>Did you know that Flinch still exists?</title><content type='html'>If you don't even know what a Flinch is, I don't blame you, since I last posted about it in &lt;a href="http://scolton.blogspot.com/2011/06/pan-project-update-61611.html"&gt;June 2011&lt;/a&gt;, and it's been sitting on a shelf ever since. It's a miniature Mecanum-wheel robot that was supposed to be a smaller companion to &lt;a href="http://scolton.blogspot.com/p/robots.html#twitch"&gt;Twitch&lt;/a&gt;:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-8b59NqDYPzY/Tc857j64jJI/AAAAAAAABAY/b-ZbO5o5q_8/s1600/f013.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="228" src="http://4.bp.blogspot.com/-8b59NqDYPzY/Tc857j64jJI/AAAAAAAABAY/b-ZbO5o5q_8/s400/f013.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Unfortunately, I ran into trouble with the &lt;a href="http://www.fingertechrobotics.com/proddetail.php?prod=ft-mecanum-set-cg"&gt;FingerTech 2.125" Mecanum wheels&lt;/a&gt;. The rollers are nicely-molded rubber, but the shafts are just 1/8" brass rods riding directly on the plastic hubs. Steel washers separate the rubber from the face of the plastic, but there is still &lt;i&gt;way&lt;/i&gt;&amp;nbsp;too much friction for the rollers to do what they're designed to do. (For reference, here's a &lt;a href="http://techtv.mit.edu/collections/scolton/videos/905-first-team-97-week-4-driving"&gt;smooth-driving ~40lb Mecanum wheel chassis&lt;/a&gt;. And here's the &lt;a href="http://techtv.mit.edu/collections/scolton/videos/554-first-robot-practice-match"&gt;full ~110lb robot&lt;/a&gt;.)&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;FingerTech does sell a &lt;a href="http://www.fingertechrobotics.com/proddetail.php?prod=ft-mecanum-bearing-kit"&gt;bearing upgrade kit&lt;/a&gt;, but I have my doubts. The bearings they sell are needle roller bearings, which can only handle radial force. The roller shafts can still slide sideways, allowing the metal washers to rub against the plastic face of the wheel. That, if anything, is the large-surface-area friction culprit of these wheels. So, I decided to go my own way and get &lt;i&gt;much more expensive&lt;/i&gt;&amp;nbsp;SR144ZZ ball bearings:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-Ti8BNP_BlnE/TyYqMg61jRI/AAAAAAAABb8/lEOKnmAd3cI/s1600/f024.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-Ti8BNP_BlnE/TyYqMg61jRI/AAAAAAAABb8/lEOKnmAd3cI/s400/f024.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Pictured: Lunch money for three days.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Additionally, I bought some 1/8" ID bearing shaft shims, McMaster P/N &lt;a href="http://www.mcmaster.com/#99040A316"&gt;99040A316&lt;/a&gt;. These tiny shims keep the metal washers that come with the Mecanum wheel rollers separated from the inner race of the bearings, spacing them out from the side face of the wheel. This allows the ball bearings to take up the thrust load, rather than the face of the wheel. Here's the roller, stock washer, and extra shaft shim all in place on one shaft:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-j7EFMnwOf8A/TyYry5_oeqI/AAAAAAAABcE/T_PM9mF-1xc/s1600/f025.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/-j7EFMnwOf8A/TyYry5_oeqI/AAAAAAAABcE/T_PM9mF-1xc/s400/f025.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The next step was boring out each of the 24 roller shaft holes from 1/8" to 1/4" to accept the new bearings. Since the faces on which these holes are drilled are at 45º to the rotational axis of the wheel, and spaced 60º radially from each other, and there are two different (mirror image) wheels, this was not a simple task.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-Wx1gWWnskKk/TyYtXT-bb7I/AAAAAAAABcM/HivpgqljlrM/s1600/f026.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/-Wx1gWWnskKk/TyYtXT-bb7I/AAAAAAAABcM/HivpgqljlrM/s400/f026.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Or maybe it was, and I made it way more complicated.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;In any case, I managed to increase the roller bores to 1/4" in a way that isn't &lt;a href="http://www.fingertechrobotics.com/prodimages/wheels/drillhub.jpg"&gt;idiotic&lt;/a&gt;. The next step in this already-too-long-and-expensive process was to take apart all the wheels:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-FszfwWGkZfk/TyYuSLlT7zI/AAAAAAAABcU/j1Q6mph-brU/s1600/f027.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-FszfwWGkZfk/TyYuSLlT7zI/AAAAAAAABcU/j1Q6mph-brU/s400/f027.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Sigh...&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;Then, I pressed in the bearings one by one and...realized I only ordered half as many SR144ZZ's as I needed.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;...&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;FFFFFFFUUUUUUUUUu&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;...&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;A few days and $70 later, I finally got around to reassembling all four wheels with the new bearings.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-S2fehTmKFRE/TyYvFxvtPPI/AAAAAAAABcc/wGSzfKGxhmc/s1600/f028.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/-S2fehTmKFRE/TyYvFxvtPPI/AAAAAAAABcc/wGSzfKGxhmc/s400/f028.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;And after all that work I had four wheels that look exactly the same as they did before, but cost 122% more than FingerTech pretends they do. At least they will be more functional. Except they weren't, at first. After just a minute of driving around, half the bearings had slipped sideways, allowing the metal washers to contact the sides of the wheels again. This was mostly because the new bore was exactly 1/4", so the press fits were loose. So, I took all four wheels apart again...&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-oCOuVLReR2Q/TyYwPlZpYRI/AAAAAAAABck/mSI9fM2ex2w/s1600/f029.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/-oCOuVLReR2Q/TyYwPlZpYRI/AAAAAAAABck/mSI9fM2ex2w/s400/f029.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;...cursing myself for ever thinking this was a good idea.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;And I &lt;i&gt;very carefully&lt;/i&gt;&amp;nbsp;added CA to each of the 48 bearings (two per shaft) to hold them in place:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-KGepvyye03I/TyYwpVmFCMI/AAAAAAAABcs/TnA6rFiqAZA/s1600/f030.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/-KGepvyye03I/TyYwpVmFCMI/AAAAAAAABcs/TnA6rFiqAZA/s400/f030.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;I used a sharp object to spread CA around the bearing perimeter so it would wick into the bore, hopefully without getting into the bearing itself. I managed not to ruin any bearings, but the process took half a day. And then I still had to reassemble all the rollers.&amp;nbsp;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;I wish I could say that the result of all this Mecanum wheel re-engineering was a wonderful drivetrain that will rival Twitch for its speed and maneuverability. I wish I could say it was all worth the effort and the money. But, after putting it all together and running it, it's still only barely passable as a Mecanum, drive:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;iframe allowfullscreen="" frameborder="0" height="274" src="http://www.youtube.com/embed/g7HFoxP2IrU?rel=0" width="480"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Yes, it moves sideways. But it's a jerky, bumpy, inefficient sideways. All Mecanum drives are less efficient sideways than they are forward, but this one is really fighting. It tends to rotate while moving sidways as well, which is a sign of mismatched wheel friction and bad weight distribution. That can mostly be compensated out by gyro feedback. But the gyros won't be able to stop it from bouncing around like a cockroach bot. That's mostly a function of the wheel shape and twitchy nature of small/light robots with oversized motors.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;So I'm not sure how much more time or money I'm willing to spend on it. I feel like adding weight, switching to a higher gear reduction, and adding closed-loop rotation control would help a lot. But the thought of buying new gearboxes, a gyro, and possibly stiffer chassis plates makes me cringe. I'm glad it isn't just sitting half-finished on a shelf anymore, though.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8200098102909041178-1237742274210592961?l=scolton.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scolton.blogspot.com/feeds/1237742274210592961/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scolton.blogspot.com/2012/01/did-you-know-that-flinch-still-exists.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/1237742274210592961'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/1237742274210592961'/><link rel='alternate' type='text/html' href='http://scolton.blogspot.com/2012/01/did-you-know-that-flinch-still-exists.html' title='Did you know that Flinch still exists?'/><author><name>Shane Colton</name><uri>http://www.blogger.com/profile/10603406287033587039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-8b59NqDYPzY/Tc857j64jJI/AAAAAAAABAY/b-ZbO5o5q_8/s72-c/f013.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8200098102909041178.post-4480706034433042639</id><published>2012-01-22T21:41:00.000-08:00</published><updated>2012-01-22T22:40:43.328-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='electric go-kart'/><category scheme='http://www.blogger.com/atom/ns#' term='tinykart'/><title type='text'>tinyKart: More Abuse</title><content type='html'>Poor &lt;a href="http://scolton.blogspot.com/p/cap-kart.html#tinykart"&gt;tinyKart&lt;/a&gt;. Pretty much ever since we built it and it didn't fall apart, it's been put through a series of tests it was never designed for, including &lt;a href="http://www.youtube.com/watch?v=OOLkBiJ0wKQ"&gt;off-roading&lt;/a&gt;, &lt;a href="http://www.youtube.com/watch?v=eoCMp9fdZl8"&gt;hill climbing&lt;/a&gt;, and &lt;a href="http://www.youtube.com/watch?v=9oMbGoiJO04"&gt;Radu&lt;/a&gt;. But this week, it was given its toughest trial yet: New England winter weather rallying. The thing about living on the coast is that it's not just snow - it's cold rain, mist, sleet, salt, slush, dirt, and sometimes snow. To really handle all the crap that occupies the ground here during the winter months, you would need something like a &lt;a href="http://www.etotheipiplusone.net/?p=1849"&gt;small tank&lt;/a&gt;. But to make some attempt at handling the winter season, we splash-proofed the electronics and fitted &lt;a href="http://www.monsterscooterparts.com/200x50-tire-tube-set-razor-dune-buggy.html"&gt;Razor Dune Buggy&lt;/a&gt; tires to the rear wheels:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-Le1fNVDPOpI/TxztpcouI4I/AAAAAAAABbU/FyDpVHeHf90/s1600/dn54.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-Le1fNVDPOpI/TxztpcouI4I/AAAAAAAABbU/FyDpVHeHf90/s400/dn54.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;After that, there was only one thing left to do, and that was to hand it over to our tame racing driver. Some say his urine turns snow blue, and that he doesn't believe in polar bears. All we know is...&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;iframe allowfullscreen="" frameborder="0" height="274" src="http://www.youtube.com/embed/0qAU5hbtsLM?rel=0" width="480"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-size: x-small;"&gt;...he's called The Stig.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The aftermath was a very snowy and very dirty tinyKart:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-F8FCYeJmGX8/TxzviDPxz7I/AAAAAAAABbk/re1t8jk2d_A/s1600/dn56.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-F8FCYeJmGX8/TxzviDPxz7I/AAAAAAAABbk/re1t8jk2d_A/s400/dn56.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-JKGLYI8Q5OA/Txzvb0vj1MI/AAAAAAAABbc/939PkVlknzQ/s1600/dn53.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/-JKGLYI8Q5OA/Txzvb0vj1MI/AAAAAAAABbc/939PkVlknzQ/s400/dn53.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-LL3RPxfxZQI/Txzvm5h9O4I/AAAAAAAABbs/wKMe023TrrQ/s1600/dn57.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/-LL3RPxfxZQI/Txzvm5h9O4I/AAAAAAAABbs/wKMe023TrrQ/s400/dn57.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;div style="text-align: left;"&gt;But it was worth it. The kart behaves as a RWD ultralight kart with a lot of torque should in low-traction conditions, which is to say that it either goes in a straight line, if you are trying to&amp;nbsp;decelerate, or spins in violent circles, if you are trying to accelerate. This wonderful combination of user-selectable understeer and oversteer makes it a lot of fun to drive, though not particularly practical for real rallying.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Somebody should make a 4WD version...&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8200098102909041178-4480706034433042639?l=scolton.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scolton.blogspot.com/feeds/4480706034433042639/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scolton.blogspot.com/2012/01/tinykart-more-abuse.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/4480706034433042639'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/4480706034433042639'/><link rel='alternate' type='text/html' href='http://scolton.blogspot.com/2012/01/tinykart-more-abuse.html' title='tinyKart: More Abuse'/><author><name>Shane Colton</name><uri>http://www.blogger.com/profile/10603406287033587039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-Le1fNVDPOpI/TxztpcouI4I/AAAAAAAABbU/FyDpVHeHf90/s72-c/dn54.jpg' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8200098102909041178.post-7800514642306282952</id><published>2012-01-18T23:07:00.000-08:00</published><updated>2012-01-18T23:08:17.899-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='pcb quadrotor'/><category scheme='http://www.blogger.com/atom/ns#' term='4pcb'/><category scheme='http://www.blogger.com/atom/ns#' term='quadrotor'/><category scheme='http://www.blogger.com/atom/ns#' term='prop balancer'/><title type='text'>Precision SMALL Prop Balancer</title><content type='html'>The biggest problem I've had with my &lt;a href="http://scolton.blogspot.com/p/flying-things.html#4pcb"&gt;PCB quadrotor&lt;/a&gt; has been mechanical vibration disturbing the rate gyros and causing the angle estimate to drift or be unstable. While the small and flexible frame exaggerates the vibrations, their source is imbalance of the propellers and, to a lesser extent, the motors themselves. So far, I've been balancing the propellers by spinning them on a small allen wrench and watching which way they prefer to settle, but this is obvious not ideal. The problem is, commercial prop balancers are useless for props this size:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-a7DkxYCojDA/Txe4BGRKaqI/AAAAAAAABak/1qy6KDls4HE/s1600/4p65.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/-a7DkxYCojDA/Txe4BGRKaqI/AAAAAAAABak/1qy6KDls4HE/s400/4p65.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Here's a commercial prop balancer from &lt;a href="http://www.hobbyking.com/hobbyking/store/uh_viewItem.asp?idProduct=21595"&gt;Hobby King&lt;/a&gt;, which has "very low friction bearings" on which a shaft with conical plugs rides. There are other types that use &lt;a href="http://www.hobbyking.com/hobbyking/store/__19292__Turnigy_Magnetic_Precision_Prop_Balancer_.html"&gt;magnets&lt;/a&gt; to hold the shaft. They work pretty well for large props. This one can probably be useful for 8" or larger, and the magnetic one might be able to do 5" props. Smaller props weigh less and the friction in the bearings or at the shaft/magnet contact cannot be overcome by the slight imbalance of a 4" prop. My main beef with them is pretty simple:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-X6BwnPQ28n0/Txe5r3vOoXI/AAAAAAAABas/PfDDuwn0-GE/s1600/4p64.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/-X6BwnPQ28n0/Txe5r3vOoXI/AAAAAAAABas/PfDDuwn0-GE/s400/4p64.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;For small props, they work better if you ditch the bearings altogether and use them as horizontal rails. (You could even argue that the same is true for any size prop...) Why not minimize the number of rolling contacts by using the shaft directly? There is much less friction this way. It's like somebody Google'd "prop balancer" and built something that looked like it should work without thinking about a simpler way to make the same thing. There are some commercial balancers that use &lt;a href="http://www.aquacraftmodels.com/accessories/aqub9575-lg.jpg"&gt;simple rails&lt;/a&gt;, and no surprise, they tend to be for boat props and RC car wheels. If they work for such small things, they must work better for large props.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;I know what you're thinking: How do you know the rails are level? The answer is the key to my new precision small prop balancer:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-S7mU-3uXxm4/Txe6vkmndhI/AAAAAAAABa0/sJvvEKpiB48/s1600/4p66.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/-S7mU-3uXxm4/Txe6vkmndhI/AAAAAAAABa0/sJvvEKpiB48/s400/4p66.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Those are two nice-but-cheap bubble levels from McMaster, P/N &lt;a href="http://www.mcmaster.com/#2151A65"&gt;2151A65&lt;/a&gt;. They are aluminum-and-plastic levels for $8.51 each. Add to that one precision-ground tool steel shaft, P/N &lt;a href="http://www.mcmaster.com/#2900A222"&gt;2900A222&lt;/a&gt;, and you have a precision small prop balancer for about $20. I use the prop adapters that come with these small 1.5mm-shaft motors to sandwich a prop on the shaft:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-dtJQr57SPds/Txe8LEdHn8I/AAAAAAAABa8/5MvSQSki1Yk/s1600/4p71.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-dtJQr57SPds/Txe8LEdHn8I/AAAAAAAABa8/5MvSQSki1Yk/s400/4p71.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Then after finding a level surface, I place the shaft on the flat aluminum edges of the levels and let gravity do the rest:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-iovcaQS46CQ/Txe8dMavqKI/AAAAAAAABbE/nt1OZjfCDl4/s1600/4p70.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-iovcaQS46CQ/Txe8dMavqKI/AAAAAAAABbE/nt1OZjfCDl4/s400/4p70.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Unbalanced.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-xbF4tR6ekLA/Txe8kGGADXI/AAAAAAAABbM/fB_bRQrAQ9c/s1600/4p67.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/-xbF4tR6ekLA/Txe8kGGADXI/AAAAAAAABbM/fB_bRQrAQ9c/s400/4p67.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Balanced!&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;It's almost that simple. There are a few subtleties:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;ol&gt;&lt;li&gt;Make sure the level edges are clean and free of dust/dirt.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Make sure the set screws are tightened evenly and facing perpendicular to the prop blades, so they don't contribute to the spanwise imbalance. (They will contribute to chordwise imbalance...no way around that.)&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Depending on the chordwise balance, you might get to a state where the prop seems bistable, so that it will settle on either side but never stay horizontal. If so, rotate 180º.&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;That's pretty much it. 4pcb's props were already pretty well-balanced, but after a bit of tweaking with the more precise balancer, it became even easier to fly. It takes off and hovers more smoothly and remains in one place for longer with no command inputs. Because of this, I took some time to learn a new trick: hand launching!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;iframe allowfullscreen="" frameborder="0" height="274" src="http://www.youtube.com/embed/pa5K_aQ3py4?rel=0" width="480"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8200098102909041178-7800514642306282952?l=scolton.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scolton.blogspot.com/feeds/7800514642306282952/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scolton.blogspot.com/2012/01/precision-small-prop-balancer.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/7800514642306282952'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/7800514642306282952'/><link rel='alternate' type='text/html' href='http://scolton.blogspot.com/2012/01/precision-small-prop-balancer.html' title='Precision SMALL Prop Balancer'/><author><name>Shane Colton</name><uri>http://www.blogger.com/profile/10603406287033587039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-a7DkxYCojDA/Txe4BGRKaqI/AAAAAAAABak/1qy6KDls4HE/s72-c/4p65.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8200098102909041178.post-1933695397472598143</id><published>2012-01-08T22:03:00.000-08:00</published><updated>2012-01-09T13:28:11.376-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tinykart'/><title type='text'>tinyKart: "Winter" Special</title><content type='html'>I was planning to keep &lt;a href="http://scolton.blogspot.com/p/cap-kart.html#tinykart"&gt;tinyKart&lt;/a&gt; inactive for most of the winter to upgrade the power system and move to custom controllers, figuring that it's too cold to do any test driving anyway. But for some reason &amp;nbsp;it's 50ºF in early-January in Cambridge, MA. That, combined with tinyKart co-designer &lt;a href="http://lmh-tech.blogspot.com/"&gt;Max Hill&lt;/a&gt; being in town, along with a some other &lt;a href="http://mhonickman.wordpress.com/"&gt;distinguished&lt;/a&gt; &lt;a href="http://www.geekshavefeelings.com/"&gt;visitors&lt;/a&gt;, was enough reason to put the kart back together for a brief "winter" testing season.&lt;br /&gt;&lt;br /&gt;The first things to fix up were a few loose screws in the steering assemblies. Normally, loose screws aren't a problem: take them out, add more Loctite, and re-tighten. But these screws were a little hard to access:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-OVaOHIu3xmU/TwqFyvw0WiI/AAAAAAAABZw/fJkBwLBuk48/s1600/dn45.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="295" src="http://4.bp.blogspot.com/-OVaOHIu3xmU/TwqFyvw0WiI/AAAAAAAABZw/fJkBwLBuk48/s400/dn45.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;They're the six screws that hold the uprights together, and they were not designed to be accessed without taking the entire front chassis plate of the kart off. By dislocating some of the steering linkages, though, two out of three on each side could just barely be reached with a screwdriver. To make matters worse, they were stainless steel cross-head screws, which are easy to strip. So, after careful removal, they were replaced with alloy steel Torx-head screws which will hopefully never come loose:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-ZgLudNVEKUI/TwqHjzcDRtI/AAAAAAAABZ4/GxgsNZm-g18/s1600/dn46.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/-ZgLudNVEKUI/TwqHjzcDRtI/AAAAAAAABZ4/GxgsNZm-g18/s400/dn46.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-VUmAfibjayo/TwqHqMceHdI/AAAAAAAABaA/mX9tt7t8gkI/s1600/dn47.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-VUmAfibjayo/TwqHqMceHdI/AAAAAAAABaA/mX9tt7t8gkI/s400/dn47.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Max and I also finished yet another motor swap. tinyKart started on Turnigy &lt;a href="http://www.hobbyking.com/hobbyking/store/uh_viewItem.asp?idProduct=7870"&gt;SK-6374-170&lt;/a&gt; motors, which were excellent except for the lack of can bearings, which allowed them to tear themselves apart at high speeds. I then &lt;a href="http://scolton.blogspot.com/2011/10/strobe-attack.html"&gt;installed&lt;/a&gt; but never test drove the newer &lt;a href="http://www.hobbyking.com/hobbyking/store/uh_viewItem.asp?idProduct=18181"&gt;SK3-6364-190&lt;/a&gt;s. They have can bearings and nicer windings than the old SKs, but I'm still annoyed that they're not actually 63mm motors. They're 59mm and they have a smaller shaft than the old SKs (8mm instead of 10mm). The smaller diameter messes with the timing of the external &lt;a href="http://1.bp.blogspot.com/-atGJnZLDHdc/Tqo9NLSwutI/AAAAAAAABR8/6EPeYSuTQ6E/s1600/dn34.jpg"&gt;Hall effect sensor boards&lt;/a&gt; I made, which were specifically designed for 63mm. The resistance of the SK3-6364-190 is also 60% higher than the old SK. So, we removed those and installed the third set of motors tinyKart has seen so far:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-bIEiA29OMow/TwqTPzEZlAI/AAAAAAAABaQ/y96vOkv4RE8/s1600/dn51.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-bIEiA29OMow/TwqTPzEZlAI/AAAAAAAABaQ/y96vOkv4RE8/s400/dn51.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;These are &lt;strike&gt;Turnigy&lt;/strike&gt; &lt;a href="http://www.leaderhobby.com/product.asp?ID=9394001224160"&gt;EMP C6374-200&lt;/a&gt;s from &lt;a href="http://www.leaderhobby.com/"&gt;Leaders Hobby&lt;/a&gt;. As far as I can tell, they're identical to the &lt;a href="http://www.hobbyking.com/hobbyking/store/uh_viewItem.asp?idProduct=3890"&gt;Turnigy C6374-200&lt;/a&gt; that is no longer stocked on &lt;a href="http://www.hobbyking.com/hobbyking/store/uh_viewItem.asp?idProduct=3890"&gt;Hobby King&lt;/a&gt;. It is &lt;i&gt;actually&lt;/i&gt;&amp;nbsp;63mm in diameter and it has a 10mm shaft, like the old SK. But it has a can bearing like the new SK3. The only noticeable shortfall is the messy/loose windings, characteristic of the old SK and old Turnigy motors in general. The SK3s are probably perfectly suitable motors, but right now these are a better deal, especially since Leaders Hobby ships them from the US. It's good to have a few options; I dread the day when the imported &lt;a href="http://web.mit.edu/scolton/www/aremelons.html"&gt;fruit-sized motors&lt;/a&gt; disappear and all that's left are the economically prohibitive &lt;a href="http://www.aero-model.com/Hacker-Brushless-A60-20M.aspx"&gt;purple-flavored ones&lt;/a&gt;.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-v0oaZS1CBls/TwqO3M6K6jI/AAAAAAAABaI/MI3wqpTevtA/s1600/dn48.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/-v0oaZS1CBls/TwqO3M6K6jI/AAAAAAAABaI/MI3wqpTevtA/s400/dn48.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Because the C6374-200 is actually 63mm, the sensor board fits nicely and the motors are relatively easy to time for forward and reasonable reverse, &lt;a href="http://scolton.blogspot.com/2011/10/strobe-attack.html"&gt;unlike the SK3s&lt;/a&gt;. These motors should have about the same amount of torque as the old SKs. Even though those were rated at 170rpm/V, our data showed something closer to 190rpm/V, almost the same as the new EMPs. These should be able to handle higher speeds, though, since they have a can bearing. At 190rpm/V and 40V, the no-load speed is 40mph. But we will have to solve the controller limits and find more testing space before that can happen.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The Kelly controllers have been okay, but quirky. When they don't like something, they cut power temporarily and give a useless "Frequent Reset" error code. It's dependent on load and motor timing, and seems to trip when the maximum current is set to 80A or above (on a 100A-rated controller). I think it's a hardware current limit being tripped by current spikes. I think the high speed firmware version would handle these motors a lot better, since the switching frequency is higher and the current ripple should be lower. But I'm not sure I want to spend $400 exploring that option when I could implement &lt;a href="http://scolton.blogspot.com/p/motor-controllers.html#directdrive"&gt;DirectDrive&lt;/a&gt; and, some day, have &lt;a href="http://scolton.blogspot.com/search/label/sensorless"&gt;sensorless field-oriented control&lt;/a&gt;. For now, though, we have to live with these Kelly controllers.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;We also installed new batteries to replace the 0.33kWh of LiPo high explosives that tinyKart has used up until now. This pack looks shadier, but it's LiFePO4, which is significantly less frightening to work with:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-Lyi1488k-5k/TwqXdZTnNfI/AAAAAAAABaY/_0a293RhDGA/s1600/dn49.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-Lyi1488k-5k/TwqXdZTnNfI/AAAAAAAABaY/_0a293RhDGA/s400/dn49.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;The orange straps make it safer.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;The packs are custom 12S3P A123 26650 m1-sorta-B's (39.6V, 6.9Ah, about 30mΩ). They've got a little less energy storage than the LiPos (0.27kWh), so less run time per pack. But the packs are easy to swap now and can be fast-charged in under 30 minutes with &lt;a href="http://scolton.blogspot.com/p/cap-kart.html#capkart"&gt;Cap Kart&lt;/a&gt;'s 15A charger. The also have a lower internal resistance than the LiPos or an equivalent pack of A123 M1A cells, which means higher peak power (theoretically up to 8kW).&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;With the new motors and battery installed, we took tinyKart out for some garage testing:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;iframe allowfullscreen="" frameborder="0" height="274" src="http://www.youtube.com/embed/bWo3PKJN05A?rel=0" width="480"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;It's nothing as brutal as the last couple of &lt;a href="http://www.youtube.com/watch?v=eoCMp9fdZl8"&gt;garage&lt;/a&gt; &lt;a href="http://www.youtube.com/watch?v=9oMbGoiJO04"&gt;runs&lt;/a&gt;, just making sure everything still works. The controllers seemed to be okay, although I was able to make the right side cut out a few times at full throttle. The new motors are equal in torque to the old ones, and the new battery seems fine. The handling is as wonderfully drifty as usual, and a close inspection afterwards revealed no loose parts.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;So, while I sort out the details for converting it to custom controllers, we at least have something to play with if it stays warm. If not, we also have a back-up plan involving &lt;a href="http://www.monsterscooterparts.com/200x50-tire-tube-set-razor-dune-buggy.html"&gt;snow tires&lt;/a&gt;...&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8200098102909041178-1933695397472598143?l=scolton.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scolton.blogspot.com/feeds/1933695397472598143/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scolton.blogspot.com/2012/01/tinykart-winter-special.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/1933695397472598143'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/1933695397472598143'/><link rel='alternate' type='text/html' href='http://scolton.blogspot.com/2012/01/tinykart-winter-special.html' title='tinyKart: &quot;Winter&quot; Special'/><author><name>Shane Colton</name><uri>http://www.blogger.com/profile/10603406287033587039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-OVaOHIu3xmU/TwqFyvw0WiI/AAAAAAAABZw/fJkBwLBuk48/s72-c/dn45.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8200098102909041178.post-8626917701668377690</id><published>2011-12-27T22:07:00.000-08:00</published><updated>2011-12-27T22:14:42.395-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='hexrotor'/><category scheme='http://www.blogger.com/atom/ns#' term='4pcb'/><category scheme='http://www.blogger.com/atom/ns#' term='quadrotor'/><title type='text'>4pcb: √ Control Law + Teaser...</title><content type='html'>Yes, I am making another post about quadrotors. A made a few minor tweaks to the control of &lt;a href="http://scolton.blogspot.com/p/flying-things.html#4pcb"&gt;4pcb&lt;/a&gt;. The most notable is a change to the output command for each motor, after all the P[I]D controller and motor mapping. The commands are now sent through a square root function. The force produced by the props is more related to rotational speed squared than to rotational speed. The speed is roughly proportional to the command. So, to produce a corrective a force, as the PID controller would like to do, the command generated in response to angle or rate error should follow a square root-type curve. Or so the story goes.&lt;br /&gt;&lt;br /&gt;The remap sends the command through a square root function while normalizing to 1, to preserve the command range. Something like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #9fc5e8; font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;// square root remap, command range is 0-255:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #9fc5e8; font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;command_out = 255.0*sqrt(command_in/255.0);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This keeps the maximum command at 255 and the minimum at 0, but shapes the intermediate values to be a square root function. I don't actually do it like this because square root on a microcontroller is a horrible thing. Both the input and the output are 8-bit integers, and I have plenty of memory, so I use a look-up table instead:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #9fc5e8; font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;// I'm a horrible person, generating my LUT at run-time:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #9fc5e8; font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;unsigned char SQRT_LUT[256];&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #9fc5e8; font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;for(unsigned int i = 0; i &amp;lt;= 255; i++)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #9fc5e8; font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #9fc5e8; font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; SQRT_LUT[i] = (unsigned char)(255.0*sqrt((float)i/255.0));&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #9fc5e8; font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;}&lt;/span&gt;&lt;span style="font-family: inherit;"&gt;&lt;br /&gt;&lt;br /&gt;...and later, in the loop...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #9fc5e8; font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;command_out = SQRT_LUT[command_in];&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Because it's an 8-bit integer table, there is some quantization near the extremes, but my upper and lower throttle limits (100 and 230) constrain it to a well-behaved part of the curve:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-BMc5u8SXMQs/Tvqo0ndmlTI/AAAAAAAABZc/oyW8padKhU4/s1600/4p61.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="292" src="http://2.bp.blogspot.com/-BMc5u8SXMQs/Tvqo0ndmlTI/AAAAAAAABZc/oyW8padKhU4/s400/4p61.gif" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;After implementing the remap, I noticed a significant improvement in the performance. For one, some of the high-frequency oscillation is gone. It doesn't seem to wiggle back and forth quickly when it's just hovering. It's also easier to hold it at a given altitude, probably due to the more linear stick-to-force relationship.&amp;nbsp;I don't think it's just placebo effect, but who knows?&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;I also made one other ugly hack. One motor has been consistently and annoyingly slow compared to the other three, causing the roll axis to be hard to fly, especially as the battery drops below about 7.4V. I just multiplied this motor's rate gain by 1.3. I have no justification for this value, but it helps. Maybe I will replace that motor and ESC at some point.&amp;nbsp;Here's some new video:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;iframe allowfullscreen="" frameborder="0" height="360" src="http://www.youtube.com/embed/wl5YdJojtco?rel=0" width="480"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;I can keep it in the air indefinitely in a small room, as long as the battery is above 7.4V. Below 7.4V, the roll axis still gets soft and it's hard to not crash into things. So for now I live with flying just a bit more than half the battery capacity. Even &lt;a href="http://www.etotheipiplusone.net/"&gt;Charles&lt;/a&gt; can kinda fly it now. So it must be a little more stable.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The two hardest parts about flying it are maintaining altitude and remembering which way it's pointed. While I think you can learn to deal with both of these, I would like it to be easy enough for anyone to pick up and fly. I have, waiting to be installed, a &lt;a href="http://www.pololu.com/catalog/product/726"&gt;sonar module&lt;/a&gt; that can be used for closed-loop altitude control. Then, the stick would control a climb rate or descent rate, but with no input it would hold altitude and you can focus on flying the rotational axes. I also have yet to implement the magnetometer on the &lt;a href="http://scolton.blogspot.com/2011/12/pcb-quadrotor-new-digital-imu.html"&gt;new IMU&lt;/a&gt;, which can be useful for holding heading so you don't have to deal with yaw.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;I really shouldn't be spending this much time on quadrotors, though. I'm pretty sure I had other things I was supposed to be working on. On that note...&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-PpIO9gomlUg/TvqvD-uAqoI/AAAAAAAABZo/yId05S4waE4/s1600/cs05.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-PpIO9gomlUg/TvqvD-uAqoI/AAAAAAAABZo/yId05S4waE4/s400/cs05.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;......&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8200098102909041178-8626917701668377690?l=scolton.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scolton.blogspot.com/feeds/8626917701668377690/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scolton.blogspot.com/2011/12/4pcb-control-law-teaser.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/8626917701668377690'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/8626917701668377690'/><link rel='alternate' type='text/html' href='http://scolton.blogspot.com/2011/12/4pcb-control-law-teaser.html' title='4pcb: √ Control Law + Teaser...'/><author><name>Shane Colton</name><uri>http://www.blogger.com/profile/10603406287033587039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-BMc5u8SXMQs/Tvqo0ndmlTI/AAAAAAAABZc/oyW8padKhU4/s72-c/4p61.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8200098102909041178.post-7410821948353475868</id><published>2011-12-23T19:05:00.000-08:00</published><updated>2011-12-23T19:10:37.671-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='pneu scooter'/><category scheme='http://www.blogger.com/atom/ns#' term='sensorless'/><category scheme='http://www.blogger.com/atom/ns#' term='pneu'/><category scheme='http://www.blogger.com/atom/ns#' term='FOC'/><category scheme='http://www.blogger.com/atom/ns#' term='motor control'/><title type='text'>More Sensorless</title><content type='html'>I'm still tweaking the sensorless routine for &lt;a href="http://scolton.blogspot.com/p/bwd-scooter.html#pneu"&gt;Pneu Scooter&lt;/a&gt;. The software framework for sensorless sinusoidal commutation and field-oriented current control is set, and now I am playing with the different parameters to see if they have the effects I think they should.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;First, I hypothesized in the &lt;a href="http://scolton.blogspot.com/2011/12/sensorless-pneu-scooter-part-2.html"&gt;last post&lt;/a&gt; that the positive relationship between current and flux estimator offset (with respect to the Hall effect sensors), seen &lt;a href="http://2.bp.blogspot.com/-KFjgHMHuDiQ/Tu2oqC3hUhI/AAAAAAAABX4/C-3FudUzk08/s1600/ol01_13.gif"&gt;here&lt;/a&gt;, was due to underestimated inductance. At high current, the rotor electrical angle predicted by the flux estimator would lead the angle interpolated from the Hall effect sensors, which I trust to be more accurate. Based on &lt;a href="http://1.bp.blogspot.com/-BAnrhkGFJVU/Tu2TB8WV06I/AAAAAAAABWw/2wDlZ8cnCdU/s1600/ol01_04.gif"&gt;this figure&lt;/a&gt;, if the inductance parameter is too low, the [-IL] vector will be too short and the estimated flux vector will lead the actual flux vector at high current.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To test this, I changed only the &lt;i&gt;L&lt;/i&gt;&amp;nbsp;parameter in the sensorless code definitions, from 200μH to 300μH, leaving all other settings the same. After another 15-minute outdoor test drive, I plotted the flux estimator offset as a function of current once again. Here it is with the old data for comparison:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-klBdOre2bTw/TvUxBdqKZvI/AAAAAAAABYk/K-srKzf-78E/s1600/ol01_02.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="295" src="http://4.bp.blogspot.com/-klBdOre2bTw/TvUxBdqKZvI/AAAAAAAABYk/K-srKzf-78E/s400/ol01_02.gif" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The effect is exactly what I thought it would be, flattening out the slope so that the offset is constant (near zero) though the entire range of load currents. I may have even gone a bit too far, creating a very slightly negative slope. But now I know that the inductance parameter has as predictable effect. The lead induced by using an inductance parameter that was 33% too low was about 20º electrical at maximum current. The error sensitivity is easy to predict using the vectors in &lt;a href="http://1.bp.blogspot.com/-BAnrhkGFJVU/Tu2TB8WV06I/AAAAAAAABWw/2wDlZ8cnCdU/s1600/ol01_04.gif"&gt;this figure&lt;/a&gt;, but&amp;nbsp;I will spare you the analysis in this post.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;A closed-loop flux observer, which some day in the future I will certainly try out, would seek to minimize the effect of an over- or under-estimated inductance parameter. The ultimate goal would be plug-and-play sensorless that adapts to any motor on the fly. But for now, I can live with nicely-behaved dependencies like this. Though, without the parallel-processed Hall effect sensor data, I would be lost as to how to characterize any of it.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;I also tried out the sensorless controller on a different motor:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-O-wjcSqZ5pY/TvU05Hbk9sI/AAAAAAAABYw/e-gf_AshiGU/s1600/sl13.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-O-wjcSqZ5pY/TvU05Hbk9sI/AAAAAAAABYw/e-gf_AshiGU/s400/sl13.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The thing clamped to the table is &lt;a href="http://www.etotheipiplusone.net/?p=1188"&gt;Kitmotter&lt;/a&gt;, a demonstration motor with very similar characteristics to Pneu Scooter's wheel motor. They have virtually the same measured inductance. Kitmotter has a higher resistance, which I modified in the sensorless code definitions for this test. It also has a lower torque constant, which is not an explicit parameter in this sensorless algorithm. What it does mean, though, is that the flux magnitude should be lower:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-UD5dx9SuLNg/TvU8Qk_bmMI/AAAAAAAABY8/0IKqYNQ1CIE/s1600/sl14.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="293" src="http://3.bp.blogspot.com/-UD5dx9SuLNg/TvU8Qk_bmMI/AAAAAAAABY8/0IKqYNQ1CIE/s400/sl14.gif" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;And in fact it is, by a small amount. It's also interesting to see that the general form of the flux estimates is very similar for both motors. In particular, the gap between about 200º and 210º shows up in both cases. This eliminates the possibility that the gap is caused by some asymmetry in one motor's winding. It could be current sensor asymmetry, though.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Kitmotter also accidentally allowed me to test the fast overcurrent shutdown. The dangling mess of alligator clips seen above was not the best idea, and when two of the phase outputs shorted to each other, causing a large spark, the controller shut down properly and gave an overcurrent fault. No dead FET.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The next parameter I want to tweak is the &lt;a href="http://scolton.blogspot.com/2011/12/sensorless-pneu-scooter-part-2.html"&gt;low-pass filter time constant&lt;/a&gt;, which affects the low speed performance of the sensorless control. I mentioned that the low-pass filter causes the flux estimator to lead the true angle at low speeds, and showed the &lt;a href="http://2.bp.blogspot.com/-3YVg6IEwyxY/Tu2jej-jqoI/AAAAAAAABXQ/R_x4c-0-6kE/s1600/ol01_11.gif"&gt;offset as a function of speed&lt;/a&gt;. Here it is again, but in pseudo-3D:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-Cl8sljyGW2Y/TvU-OfjlGlI/AAAAAAAABZI/TX49bd79Vb8/s1600/ol01_07.gif" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="295" src="http://2.bp.blogspot.com/-Cl8sljyGW2Y/TvU-OfjlGlI/AAAAAAAABZI/TX49bd79Vb8/s400/ol01_07.gif" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Is this nauseating?&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: center;"&gt;&lt;div style="text-align: left;"&gt;Below 200rpm, the flux estimator angle is greater than the Hall effect sensor angle (trusted to be the true electrical angle). This causes the data, which should lie on the x = y plane, to slope off to the left at low speeds. Making the low-pass filter time constant longer should flatten out the plane and improve the low-speed torque. A lower "valid data" speed for switching to sensorless control will make start-up ramping, when I get around to that, just a bit easier.&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;I'm also worried about high-speed operation, which was the problem that magically disappeared when I made several code improvements. But, I'm still working with relatively slow motors, having commutation frequencies of 200Hz or less. I'm interested to see how things change (probably for the worse) when I try to run a non-direct-drive (indirect-drive?) motor like that of &lt;a href="http://scolton.blogspot.com/p/cap-kart.html#tinykart"&gt;tinyKart&lt;/a&gt;, which can hit 750Hz or more.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;More testing to come...&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8200098102909041178-7410821948353475868?l=scolton.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scolton.blogspot.com/feeds/7410821948353475868/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scolton.blogspot.com/2011/12/more-sensorless.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/7410821948353475868'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/7410821948353475868'/><link rel='alternate' type='text/html' href='http://scolton.blogspot.com/2011/12/more-sensorless.html' title='More Sensorless'/><author><name>Shane Colton</name><uri>http://www.blogger.com/profile/10603406287033587039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-klBdOre2bTw/TvUxBdqKZvI/AAAAAAAABYk/K-srKzf-78E/s72-c/ol01_02.gif' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8200098102909041178.post-8173796935952027235</id><published>2011-12-18T01:07:00.000-08:00</published><updated>2011-12-21T09:05:54.647-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='pneu scooter'/><category scheme='http://www.blogger.com/atom/ns#' term='sensorless'/><category scheme='http://www.blogger.com/atom/ns#' term='field-oriented control'/><category scheme='http://www.blogger.com/atom/ns#' term='pneu'/><category scheme='http://www.blogger.com/atom/ns#' term='FOC'/><title type='text'>Sensorless Pneu Scooter: Part 2</title><content type='html'>&lt;a href="http://scolton.blogspot.com/p/bwd-scooter.html#pneu"&gt;Pneu Scooter&lt;/a&gt; is now Sensorless Pneu Scooter! (Which means I can ride it again.)&lt;br /&gt;&lt;br /&gt;This is the follow-up to &lt;a href="http://scolton.blogspot.com/2011/12/sensorless-pneu-scooter-part-1.html"&gt;Part 1: Where I make my code much fancier&lt;/a&gt;. Most of the work of the past two weeks went into setting up a new timing structure for the control code, which is summarized by &lt;a href="http://1.bp.blogspot.com/-ojHM4v1_QsE/Tu1Qo-_bWxI/AAAAAAAABWo/tFv0D27tblE/s1600/timing20.png"&gt;this graphic&lt;/a&gt;. The controller has a fast loop, which runs at 15.625kHz, and a slow loop, which runs at just under 1kHz. The slow loop handles the computationally-burdensome Field-Oriented Control (FOC) calculations, and hasn't changed since I first implemented it on &lt;a href="http://scolton.blogspot.com/p/bwd-scooter.html#bwd"&gt;B.W.D.&lt;/a&gt; long ago. The concept of FOC is summarized in these &lt;a href="http://scolton.blogspot.com/2010/01/3ph-duo-wrap-up-part-1-field-oriented.html"&gt;two&lt;/a&gt; &lt;a href="http://scolton.blogspot.com/2010/01/3ph-duo-wrap-up-part-2-control.html"&gt;posts&lt;/a&gt;, and is shown in this, the first of many neon graphics I color-inverted for this post:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-BAnrhkGFJVU/Tu2TB8WV06I/AAAAAAAABWw/2wDlZ8cnCdU/s1600/ol01_04.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="396" src="http://1.bp.blogspot.com/-BAnrhkGFJVU/Tu2TB8WV06I/AAAAAAAABWw/2wDlZ8cnCdU/s400/ol01_04.gif" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;FOC seeks to keep stator current, &lt;i&gt;&lt;b&gt;I&lt;/b&gt;&lt;/i&gt;, in phase with back EMF, &lt;i style="font-weight: bold;"&gt;E&lt;/i&gt;, which is equivalent to saying that it keeps stator flux 90º ahead of rotor flux. This produces the most torque per amp. To keep the current and back EMF in phase, the voltage, &lt;i style="font-weight: bold;"&gt;V&lt;/i&gt;, is phase-advanced by the controller to counteract the effect of inductance.&amp;nbsp;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;All these quantities are treated as vectors (really, the magnitude and relative phase of a set of balanced three-phase sine waves). The coordinate system is aligned with the rotor's magnetic field (hence, "field-oriented") and the axis on which the rotor flux is at a maximum is called the Direct (D) Axis. The Quadrature (Q) Axis leads the D-Axis by 90º electrical in the direction of rotation.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Because the coordinate system is locked to and spinning with the rotor, the position of the rotor must be known with good resolution for any of this to work. Previously, I used Hall effect sensors and time-based interpolation to derive the position. But, as the name would imply, Sensorless Pneu Scooter needs new tricks that do not rely on Hall effect sensors. To obtain the rotor position, the fast loop estimates flux on all three phases. The flux estimator I chose to start with is a very simple one:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-Ypa-aGgQjuI/TaJhoXwBGqI/AAAAAAAAA_Q/tTs77VGgnxw/s1600/maths.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="125" src="http://2.bp.blogspot.com/-Ypa-aGgQjuI/TaJhoXwBGqI/AAAAAAAAA_Q/tTs77VGgnxw/s320/maths.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;It's an "open-loop" flux observer that derives the rotor flux linkage from measured currents, driven voltages, and a good estimate of the motor's resistance, &lt;i&gt;R&lt;/i&gt;, and inductance, &lt;i&gt;L&lt;/i&gt;. The vector version of this flux estimator is shown in the image above. Note that the integral of a given vector is another vector which lags by 90º and is scaled by the angular frequency:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-ysURppAuYoo/Tu2Y4FBeieI/AAAAAAAABW4/EsgUFsJr8mE/s1600/ol01_06.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="63" src="http://2.bp.blogspot.com/-ysURppAuYoo/Tu2Y4FBeieI/AAAAAAAABW4/EsgUFsJr8mE/s320/ol01_06.gif" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Which brings up another good point: Unlike back EMF, flux does not vary with speed, so the flux estimator should produce a constant magnitude at any speed. As the &lt;i&gt;&lt;b&gt;V&lt;/b&gt;&lt;/i&gt; and &lt;i&gt;&lt;b&gt;E&lt;/b&gt;&lt;/i&gt; vectors increase in magnitude, the scaling by&amp;nbsp;&lt;i&gt;ω&lt;/i&gt; keeps the integral-form from growing.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The figure above is actually somewhat misleading. For one, the flux estimator doesn't run in the rotating D/Q coordinate system, but rather in the stationary frame, on each of the three phases independently. Also, the estimated flux on each phase is a scalar quantity; it's just the magnitude of the rotor flux seen by that particular motor phase at that particular instant. To derive position from this, I take an unusual approach of watching for flux zero-crossings (with hysteresis) and feeding these transitions to the same interpolation routine that my Hall effect sensors would have gone to.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;In this way, the flux estimator is always running in parallel with the Hall effect sensors and control can be given to either one at any point in time. Additionally, they can be compared to each other. So, as I've been test-driving with the sensorless position estimate in control, I've been logging data from both. Cue the rest of the neon graph sequence:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-u_T24dRslpo/Tu2gwUq0UUI/AAAAAAAABXA/DfVN31Imlh8/s1600/ol01_07.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="387" src="http://3.bp.blogspot.com/-u_T24dRslpo/Tu2gwUq0UUI/AAAAAAAABXA/DfVN31Imlh8/s400/ol01_07.gif" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;All of the the data in this post was recorded during a five-minute outdoor test drive with the sensorless position estimate running the field-oriented control. The top plot above shows effective regulation of Q-Axis current to follow the throttle command, and the D-Axis current being held close to zero. The bottom plot shows the speed estimates produced by both the Hall effect sensors and the flux estimator. (Both calculate speed by measuring the time for one full period of rotor flux.) They are nearly identical at all speeds, including below 100rpm.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Speed is not sufficient for control, though; the flux estimator needs to be able to accurately derive the rotor position. Comparing the rotor position derived by the flux estimator to that of the Hall effect sensors reveals the following:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-xGyiRs_Adk0/Tu2iZ9yhKSI/AAAAAAAABXI/5qYcp8Sge_4/s1600/ol01_10.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="331" src="http://2.bp.blogspot.com/-xGyiRs_Adk0/Tu2iZ9yhKSI/AAAAAAAABXI/5qYcp8Sge_4/s400/ol01_10.gif" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The ideal case would be a straight line with a slope of one, indicating perfect agreement between the flux estimator and the Hall effect sensors. There is a good deal of noise in the position estimate, but the general 1:1 correlation is there. The flux estimator angle leads the Hall effect sensor angle slightly, shifting the entire line upwards by about 15º. This is not necessarily the fault of the flux estimator; it could be interpreted as the Hall effect sensors being about 15º behind neutral timing.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;To get more of a feel for the source of the noise around the 1:1 line, I plotted the relative phase offset between the flux estimator's angle and the Hall effect sensor angle as a function of a few other quantities. First, speed:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-3YVg6IEwyxY/Tu2jej-jqoI/AAAAAAAABXQ/R_x4c-0-6kE/s1600/ol01_11.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="331" src="http://2.bp.blogspot.com/-3YVg6IEwyxY/Tu2jej-jqoI/AAAAAAAABXQ/R_x4c-0-6kE/s400/ol01_11.gif" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;There are several interesting bits of information in this plot:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;/div&gt;&lt;ol&gt;&lt;li&gt;At any speed, the band of uncertainty in the position estimate is still about 30º. Therefore, there must be factors other than speed which cause offset in the position estimate.&lt;/li&gt;&lt;li&gt;The bulk shift of 15º (flux estimator leading Hall effect sensors) is clear in this plot too.&lt;/li&gt;&lt;li&gt;At low speeds, the flux estimator leads the Hall effect sensors even more. This one is easy to explain. Instead of a pure integrator, I implemented a low-pass filter on (V-IR) as part of the flux esimator:&lt;/li&gt;&lt;/ol&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-mymEuv_mCDA/Tu2kqKEVGJI/AAAAAAAABXY/i4squ6egkxo/s1600/ol01_19.gif" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="181" src="http://4.bp.blogspot.com/-mymEuv_mCDA/Tu2kqKEVGJI/AAAAAAAABXY/i4squ6egkxo/s400/ol01_19.gif" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Pure integrator.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-MYg-x7d99rM/Tu2lCtTJulI/AAAAAAAABXo/pSz2CrV43Dw/s1600/ol01_20.gif" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="178" src="http://2.bp.blogspot.com/-MYg-x7d99rM/Tu2lCtTJulI/AAAAAAAABXo/pSz2CrV43Dw/s400/ol01_20.gif" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Low-pass filter.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;The low-pass filter is used to keep the integral from drifting away. It's combined with a gain of&amp;nbsp;&lt;i&gt;τ&lt;/i&gt;, the filter time constant, so that at high frequencies it looks like a pure integrator. But at low frequencies, it has less than the -90º of phase a pure integrator would give:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-VaS8BAB8fsQ/Tu2l2iEVUII/AAAAAAAABXw/JaXfM7Xk9_A/s1600/ol01_17.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="348" src="http://4.bp.blogspot.com/-VaS8BAB8fsQ/Tu2l2iEVUII/AAAAAAAABXw/JaXfM7Xk9_A/s400/ol01_17.gif" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;At the corner frequency I chose for the low-pass filter, 0.053s, the low-pass filter causes the flux estimator to lead significantly at low speeds. The blue line in the offset vs. speed plot above is the theoretical lead induced by the low-pass filter. Setting the filter time constant to be longer would push the speed at which lead becomes significant down lower. Since the data seems to clearly show this effect, I would like to run some tests where all I change is the low-pass filter time constant. Obviously a longer time constant would be better for low speed operation. Integral drift might hurt the performance overall, though.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;I also plotted the offset between the flux estimator angle and the Hall effect sensor angle as a function of load (Q-Axis current):&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-KFjgHMHuDiQ/Tu2oqC3hUhI/AAAAAAAABX4/C-3FudUzk08/s1600/ol01_13.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="331" src="http://2.bp.blogspot.com/-KFjgHMHuDiQ/Tu2oqC3hUhI/AAAAAAAABX4/C-3FudUzk08/s400/ol01_13.gif" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Here, another clear trend was revealed: the flux estimator lead increases with current. My hypothesis on this one is that the inductance estimate is low. In the first &lt;a href="http://1.bp.blogspot.com/-BAnrhkGFJVU/Tu2TB8WV06I/AAAAAAAABWw/2wDlZ8cnCdU/s400/ol01_04.gif"&gt;graphic&lt;/a&gt; of this post, the -IL vector would be too short if &lt;i&gt;L&lt;/i&gt; were underestimated. This would cause the estimated flux to be somewhere in the upper-right quadrant, leading the true flux, which is on the D-Axis. Again, since the data shows a very clear trend, I would like to run some test where I vary only the inductance parameter to see if I can flatten out this line.&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;This particular dependency (position error as a function of load) is one that I think can be avoided as I pursue more advanced sensorless algorithms. A "closed-loop" flux observer would be able to more readily handle misidentified motor parameters by using feedback to adapt the motor model or negate some of the effects of the misidentified parameter. Another valid option is to have the motor parameters self-calibrate, either at power-on or dynamically as it runs.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Lastly, my favorite graph of all:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-fXGQ5ObFz9U/Tu2qoMjhCXI/AAAAAAAABYA/KXoqMXa_Eq8/s1600/ol01_15.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="258" src="http://3.bp.blogspot.com/-fXGQ5ObFz9U/Tu2qoMjhCXI/AAAAAAAABYA/KXoqMXa_Eq8/s400/ol01_15.gif" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;I had the data spit back the actual flux estimate on Phase A along with all the phase currents. Plotting the Phase A flux as a function of the flux estimator's angle reveals a very nice sinusoidal flux that peaks at 180º and has an amplitude of about 15-17mWb. Not coincidentally, this is close to 1/7th of the motor's per-phase back EMF constant of 0.105V/(rad/s) = 0.105Wb. (The motor has seven pole pairs.)&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;The three phase currents are also plotted and are bounded by nice 40A sine waves, representing maximum positive throttle. Phase A's current (yellow) leads Phase A's flux (white) by about 90º, as it should if the field-oriented control is doing its job.There's a very interesting gap in the flux estimate angle just before 210º, which is also seen as a "staircase" effect in the flux estimator angle vs. Hall effect sensor angle plot. I still haven't tracked this one down or formed a theory about it yet, but this convinces me that it's an issue inherent to the flux estimate, since this plot has nothing to do with the Hall effect sensors.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Altogether, this "simple" sensorless routine has been working very well since I modified the controller timing. I can't say I understand exactly why (or even if) the changes I made to the loop timing caused it to start working, but I'm happy that it's now producing useful data and that I have new tests to try out.&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;I'm even more happy that my Pneu Scooter riding ban can be lifted since it's now capable of propelling itself in 100% sensorless mode.&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8200098102909041178-8173796935952027235?l=scolton.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scolton.blogspot.com/feeds/8173796935952027235/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scolton.blogspot.com/2011/12/sensorless-pneu-scooter-part-2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/8173796935952027235'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/8173796935952027235'/><link rel='alternate' type='text/html' href='http://scolton.blogspot.com/2011/12/sensorless-pneu-scooter-part-2.html' title='Sensorless Pneu Scooter: Part 2'/><author><name>Shane Colton</name><uri>http://www.blogger.com/profile/10603406287033587039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-BAnrhkGFJVU/Tu2TB8WV06I/AAAAAAAABWw/2wDlZ8cnCdU/s72-c/ol01_04.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8200098102909041178.post-325023912405236174</id><published>2011-12-17T08:53:00.000-08:00</published><updated>2011-12-17T18:54:06.885-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='pneu scooter'/><category scheme='http://www.blogger.com/atom/ns#' term='sensorless'/><category scheme='http://www.blogger.com/atom/ns#' term='field-oriented control'/><category scheme='http://www.blogger.com/atom/ns#' term='pneu'/><category scheme='http://www.blogger.com/atom/ns#' term='FOC'/><title type='text'>Sensorless Pneu Scooter: Part 1</title><content type='html'>After just about one month, my &lt;a href="http://scolton.blogspot.com/2011/11/ah-software-optimization-my-old-friend.html"&gt;voluntary moratorium on Pneu Scooter riding&lt;/a&gt; is officially over. Yes, that means it is now Sensorless Pneu Scooter. Even though I was distracted by &lt;a href="http://scolton.blogspot.com/2011/12/slightly-more-quadrotor.html"&gt;flying things&lt;/a&gt; for a short period of time, I have made steady progress on working out the &lt;a href="http://scolton.blogspot.com/2011/11/first-instance-of-sensorless-sine.html"&gt;software&lt;/a&gt; &lt;a href="http://scolton.blogspot.com/2011/12/first-sensorless-test-drive.html"&gt;kinks&lt;/a&gt; to get my first attempt at a sensorless field-oriented control strategy up and running. This is a two-week update, so I think I'll have to split it into two parts. The first part here explains most of the code tweaking I did. The second part, to come shortly, is when the sensorless control finally begins to work the way it should. How the two parts are related to each other, I don't exactly know.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Part 1: Where I make my code much fancier.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In the &lt;a href="http://scolton.blogspot.com/2011/12/first-sensorless-test-drive.html"&gt;last update&lt;/a&gt;, I had been able to get &lt;a href="http://scolton.blogspot.com/p/bwd-scooter.html#pneu"&gt;Pneu Scooter&lt;/a&gt; running for a short indoor test drive on sensorless control. While it worked at low speed and low load, it was glitchy at anything above 20A and seemed to completely fail at 800rpm. These may have been related or unrelated problems, and I never got far enough into troubleshooting it to find out. Instead, while test-driving, one of the glitches took out the power stage, killing the FET, at least two gate drivers, and leaving a small crater where my DC current sensor used to be:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-fVM9fzXzVXs/Tuy2NMiVvJI/AAAAAAAABWI/0FmFbSIRppg/s1600/tp15.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-fVM9fzXzVXs/Tuy2NMiVvJI/AAAAAAAABWI/0FmFbSIRppg/s400/tp15.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;In a previous FET failure, the trace leading into the DC bus had blown, so I reinforced it with some copper braid. This moved the weakest link to the current sensor, I guess. It's worth noting that there is a 40A slow fuse in the system but it seems never to actually do anything during failures. Maybe time to go back to the magnetically-tripped circuit breaker switch. In any case, this board is toast. Even after I repair the power stage, it will only work with the DC current sensor bypassed completely. Possible motivation to design 3ph v4.0.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;I switched to my back-up &lt;a href="http://scolton.blogspot.com/p/motor-controllers.html#hd"&gt;3ph v3.1&lt;/a&gt; controller and took some time to implement a few software improvements, including fast over-current shutdown designed to (possibly) save the FETs if (when) the sensorless control commutation glitches. I also implemented a better ADC sampling strategy to try to clean up the current measurements as much as possible. The goal was to &lt;a href="http://2.bp.blogspot.com/-dIRg_MpkL2o/TtvRDfYJd5I/AAAAAAAABVE/I6WeCLdKgt4/s1600/sl08.gif"&gt;sample phase currents at a time where no power switching is happening&lt;/a&gt;, since the switching transients can couple noise onto the current sensor signals.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;First, the three PWM timers are synchronized (no easy task) and set to center-aligned mode, producing nested and symmetric voltage ouputs. In addition to reducing ripple on the DC bus capacitors, this has the benefit of creating a guaranteed point in time where all three PWMs are off. This is where I wanted to trigger the ADC to sample phase current. The &lt;a href="http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/DATASHEET/CD00210843.pdf"&gt;STM32F103&lt;/a&gt; has all sorts of interesting timer and ADC setup nuances that I discovered. After several days of messing around with timer and ADC configuration registers, I got to this:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-1QmKdcx8k7k/Tuy7HakDhSI/AAAAAAAABWQ/vNnLnhqf_g8/s1600/sl10.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/-1QmKdcx8k7k/Tuy7HakDhSI/AAAAAAAABWQ/vNnLnhqf_g8/s400/sl10.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;&lt;a href="http://eeanonymous.blogspot.com/2011/12/scopemas-tree.html"&gt;Scopemas Tree&lt;/a&gt;.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;I had to overlap the three voltage outputs to get all the traces to fit on the scope. Here, they are running with duty cycles of 25%, 50%, and 75%, just to illustrate what center-timed PWM looks like. Timer 1 is the master and the other two are synchronized to it. I set up an unused Timer 1 compare output as the trigger for the ADC, and I configured the dual ADC so I can convert two measurements simultaneously. I group and order the measurements as follows:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;/div&gt;&lt;ol&gt;&lt;li&gt;Phase A Current &amp;amp; Phase C Current&lt;/li&gt;&lt;li&gt;DC Current &amp;amp; DC Voltage&lt;/li&gt;&lt;li&gt;Throttle &amp;amp; Nothing&lt;/li&gt;&lt;/ol&gt;&lt;div style="text-align: left;"&gt;The phase current measurements are most important, so they go first, triggered just before the center of the "off" portion of all three PWMs. The other measurements are more heavily filtered in hardware and software, so I don't care about protecting them from the switching transients. With my ADC configuration, it takes about 1.7μs to sample the two phase current analog signals. So, I set the ADC trigger to occur about 0.85μs before dead-center and expect it to finish 0.85μs after dead-center. After that, there is about another 2μs of conversion time, when the ADC translates the sampled voltage into a digital value. Then, an interrupt is triggered which stores the result in a variable. Zooming in on the center of the PWM, the timing of the first two sample-and-converts is something like this:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-d6uji8SsvhI/TuzBFoW1OYI/AAAAAAAABWY/u9-oAfQN814/s1600/sl12.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="318" src="http://3.bp.blogspot.com/-d6uji8SsvhI/TuzBFoW1OYI/AAAAAAAABWY/u9-oAfQN814/s400/sl12.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;This scope plot also shows the motivation for sampling the phase currents away from the transitions. The tiny bits of ringing at each switching event show up everywhere: on other voltage outputs and on the digital line being used to illustrate processor timing. So, by leaving a window where all three PWMs are off and sampling the phase currents exactly in that window, the noise is hopefully reduced. The width of this "all-off" window has to be just a bit wider than the ADC sample time of 1.7μs, so perhaps 2μs. That limits the maximum duty cycle at 15.625kHz to 2μs/64μs, about 96.8%. Since the gate drivers are bootstrapped anyway and need some off-time to work at all, this seems like a reasonable limit.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;After the three sets of ADC conversions, the fast loop is triggered and runs the sensorless field-oriented control routine using the freshly-converted current measurements. I also added some fast over-current shutdown code to kill the gate drive if any of the phase currents or the DC current exceed a maximum limit, positive or negative. Hopefully the combination of cleaner current measurments and shutdown within 64μs&amp;nbsp;of an overcurrent fault will have some chance of saving the FETs if there is a controller glitch.&lt;br /&gt;&lt;br /&gt;In case the last 1,000 words weren't very clear, here's a graphic showing the controller timing in its entirety:&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-ojHM4v1_QsE/Tu1Qo-_bWxI/AAAAAAAABWo/tFv0D27tblE/s1600/timing20.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="251" src="http://1.bp.blogspot.com/-ojHM4v1_QsE/Tu1Qo-_bWxI/AAAAAAAABWo/tFv0D27tblE/s400/timing20.png" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;(Click to enlarge.)&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;There are still some minor tweaks I want to make to the code. One way to save a ton of time is to use the Direct Memory Access (DMA) peripheral to automatically store ADC results in memory. Theoretically, this would cut the entire ADC block down to about 10μs. I'm also still running at only 32MHz. I don't need it yet, but the processor is capable of 72MHz in case I want to add more fanciness to my fast loop.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;But for now, this setup seems fine. After loading the new version of the controller, Sensorless Pneu Scooter magically started working the way it should. I didn't think I had changed anything fundamental, but the performance is much better than it was before, almost indistinguishable from the previously-sensored Pneu Scooter. I've been riding it around for a few days now with no problems.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;In Part 2, I'll get to the sensorless scheme itself and the data I've collected during my few days of test driving...&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8200098102909041178-325023912405236174?l=scolton.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scolton.blogspot.com/feeds/325023912405236174/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scolton.blogspot.com/2011/12/sensorless-pneu-scooter-part-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/325023912405236174'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/325023912405236174'/><link rel='alternate' type='text/html' href='http://scolton.blogspot.com/2011/12/sensorless-pneu-scooter-part-1.html' title='Sensorless Pneu Scooter: Part 1'/><author><name>Shane Colton</name><uri>http://www.blogger.com/profile/10603406287033587039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-fVM9fzXzVXs/Tuy2NMiVvJI/AAAAAAAABWI/0FmFbSIRppg/s72-c/tp15.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8200098102909041178.post-4492459488077933794</id><published>2011-12-10T08:59:00.001-08:00</published><updated>2011-12-10T09:55:24.619-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='4pcb'/><category scheme='http://www.blogger.com/atom/ns#' term='quadrotor'/><title type='text'>Slightly More Quadrotor</title><content type='html'>&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-k5NEhPfgnHY/TuOP-8t8kAI/AAAAAAAABVk/ke7OawFvbVo/s1600/5pcb.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/-k5NEhPfgnHY/TuOP-8t8kAI/AAAAAAAABVk/ke7OawFvbVo/s400/5pcb.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;I promise I will put it away soon...&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;After some &lt;a href="http://scolton.blogspot.com/2011/12/pcb-quadrotor-new-digital-imu.html"&gt;reasonable success with the new digital IMU&lt;/a&gt;, I decided to play around with the digital filters built into the &lt;a href="http://www.pololu.com/file/download/L3G4200D.pdf?file_id=0J491"&gt;L3G4200D&lt;/a&gt; 3-axis gyro to see if I could improve the performance a little more. (The accelerometer is already heavily-filtered by the &lt;a href="http://web.mit.edu/scolton/www/filter.pdf"&gt;complementary filter&lt;/a&gt;, so no need to focus much attention on that.)&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;In &lt;a href="http://scolton.blogspot.com/2011/09/i-should-put-pcb-quadrotor-away.html"&gt;previous testing&lt;/a&gt;, I had determined that the gyro rate signals were incredibly noisy and that the source of the noise was not electrical but rather mechanical frame vibrations. This is a common problem and, according to many people, it can most often be solved by mounting the sensors with foam tape. For some reason, foam tape alone is not enough on this frame, so I have to resort to heavier filtering:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-bD4C8aruvqU/TuOTW0UlXyI/AAAAAAAABVs/vaZHdkZpba0/s1600/filters.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://3.bp.blogspot.com/-bD4C8aruvqU/TuOTW0UlXyI/AAAAAAAABVs/vaZHdkZpba0/s400/filters.gif" width="373" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;From top to bottom, the graphs represent digital low-pass filters (built into the gyro) with cutoff frequencies of 50Hz, 25Hz, and 12.5Hz. The left plots are the rate signals when the quadrotor is held level and the motors are run at full throttle. The right plots are the angle computed by the complementary filter.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Noise in the rate signal can cause trouble in two ways: (1) directly, by being amplified through the derivative (D) term in the control loop, and (2) indirectly, by causing random drift in the angle calculated by the complementary filter. I actually think the second problem is the bigger one, since the angle drift occurs on a long enough time scale that it doesn't get averaged out by the mechanical system. I noticed while flying that the quadrotor would drift a lot and sometimes quickly dart off in one direction, something that could be caused by the sharp jump in angle seen in the right-middle graph.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;With heavier digital low-pass filtering, the rate signal noise is significantly reduced. The angle estimate is also more stable. The trade-off is dynamic performance. With a 12.5Hz low-pass filter, command inputs faster than that cannot be tracked. A 12.5Hz low-pass filter has a rise time of about 20ms. I tried flying with this filter and the improvement in static hovering ability greatly outweighs any decrease in response time. Here's some new video:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;iframe allowfullscreen="" frameborder="0" height="360" src="http://www.youtube.com/embed/7rK0UslPKtA?rel=0" width="480"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;It doesn't drift as much and the random darting is significantly reduced, at least to the point where it can be controlled. It still lacks altitude control, so maintaining height is difficult. But the improvement just by tweaking the filters is pretty neat.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;I also finally compiled the documentation for this project. It's certainly not a fully-tested and user-friendly kit, but if you want to make your own, here is the documentation folder:&amp;nbsp;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;a href="http://web.mit.edu/scolton/www/4pcb_DOC.zip"&gt;4pcb_DOC.zip&lt;/a&gt; (1.38MB)&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;It's also on the &lt;a href="http://scolton.blogspot.com/p/flying-things.html#4pcb"&gt;project page&lt;/a&gt;. It contains:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;/div&gt;&lt;ul&gt;&lt;li style="text-align: left;"&gt;Full bill of materials&lt;/li&gt;&lt;li style="text-align: left;"&gt;EAGLE files&lt;/li&gt;&lt;li style="text-align: left;"&gt;Gerber board files&lt;/li&gt;&lt;li style="text-align: left;"&gt;Schematic&lt;/li&gt;&lt;li style="text-align: left;"&gt;Arduino project&lt;/li&gt;&lt;li style="text-align: left;"&gt;Executable control station GUI&lt;/li&gt;&lt;li style="text-align: left;"&gt;Control station GUI source (VB .NET)&lt;/li&gt;&lt;li style="text-align: left;"&gt;Picture showing mounting of IMU&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;div style="text-align: left;"&gt;The most important change from the original schematic is that the Sparkfun IMU, which has been discontinued, is not used. Instead, the Pololu minIMU-9 is &lt;i&gt;externally&lt;/i&gt; wired into SDA, SCL, +5V and GND. Since the IMU needs to be creatively mounted on a ball of foam tape anyway, I did not include it in the board schematic.&amp;nbsp;The power wiring to the motor control chips is also done externally, connecting to the pads near each chip. In a future version of the board I may clean all this up.&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8200098102909041178-4492459488077933794?l=scolton.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scolton.blogspot.com/feeds/4492459488077933794/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scolton.blogspot.com/2011/12/slightly-more-quadrotor.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/4492459488077933794'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/4492459488077933794'/><link rel='alternate' type='text/html' href='http://scolton.blogspot.com/2011/12/slightly-more-quadrotor.html' title='Slightly More Quadrotor'/><author><name>Shane Colton</name><uri>http://www.blogger.com/profile/10603406287033587039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-k5NEhPfgnHY/TuOP-8t8kAI/AAAAAAAABVk/ke7OawFvbVo/s72-c/5pcb.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8200098102909041178.post-6282048701259567117</id><published>2011-12-05T13:07:00.001-08:00</published><updated>2011-12-05T14:18:40.927-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='4pcb'/><category scheme='http://www.blogger.com/atom/ns#' term='quadrotor'/><title type='text'>PCB Quadrotor: New Digital IMU</title><content type='html'>Over the weekend I took a break from my &lt;a href="http://scolton.blogspot.com/2011/12/first-sensorless-test-drive.html"&gt;sensorless FOC&lt;/a&gt; work to upgrade &lt;a href="http://scolton.blogspot.com/p/flying-things.html"&gt;4pcb&lt;/a&gt; with a new digital IMU:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-flnz9iOJyVU/Tt0yzSWE73I/AAAAAAAABVM/rIODob3Pgw8/s1600/4p59.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-flnz9iOJyVU/Tt0yzSWE73I/AAAAAAAABVM/rIODob3Pgw8/s400/4p59.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;It's a &lt;a href="http://www.pololu.com/catalog/product/1265"&gt;Pololu MinIMU-9&lt;/a&gt;, featuring an ST&amp;nbsp;&lt;a href="http://www.pololu.com/file/download/L3G4200D.pdf?file_id=0J491"&gt;L3G4200D&lt;/a&gt; 3-axis gyro and&amp;nbsp;&lt;a href="http://www.pololu.com/file/download/LSM303DLM.pdf?file_id=0J514"&gt;LSM303DLM&lt;/a&gt; 3-axis accelerometer and magnetometer. This replaces the now-discontinued Sparkfun &lt;a href="http://www.sparkfun.com/products/9431"&gt;6DOF Razor IMU&lt;/a&gt;, which had six analog channels (3-axis gyro and 3-axis accelerometer). So, instead of reading each axis into the Arduino Mini's 10-bit ADC, the digital IMU streams 12-bit readings over a 2-wire serial interface (I2C).&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The digital IMU has other nice features as well, such as programmable gains, sampling rates, and low-pass filters. No more fidgeting with RC filters on the board. It's compatible with the &lt;a href="http://arduino.cc/en/Reference/Wire"&gt;Arduino Two-Wire Interface (TWI/I2C) library&lt;/a&gt; and the &lt;a href="http://www.pololu.com/catalog/product/1265/resources"&gt;sample code&lt;/a&gt; on the Pololu page is easy to work with. For once, I must admit that the Arduino I2C stuff does in fact make life easier.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Even with the nice new IMU, 4pcb still seems to suffer from the same &lt;a href="http://scolton.blogspot.com/2011/09/i-should-put-pcb-quadrotor-away.html"&gt;vibration problems&lt;/a&gt;. I'm not sure why most people are able to get away with just mounting the sensors on some foam but that doesn't seem to be enough for this frame. In order for it to be even flyable, I need to add mass (aluminum) to the back of the IMU board and stick it to a very loose loop of foam tape:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-sbid_cgtFH8/Tt07aBTJzTI/AAAAAAAABVc/B6WngyHJFao/s1600/4p60.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-sbid_cgtFH8/Tt07aBTJzTI/AAAAAAAABVc/B6WngyHJFao/s400/4p60.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-5FAfD7SIH2s/Tt07X58HEnI/AAAAAAAABVU/k1kHkbg17Vo/s1600/4p58.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="298" src="http://4.bp.blogspot.com/-5FAfD7SIH2s/Tt07X58HEnI/AAAAAAAABVU/k1kHkbg17Vo/s400/4p58.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Even the wires connecting the IMU to the main board need to be very flexible high-strand-count wire so as not to transmit vibrations. I should really film it in high speed and be horrified at the amount of high-frequency flexing happening in the frame. It would also be very easy to add stiffeners, though I would have to think about how much I want to compromise on the "entirely made out of a single PCB" goal.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;In any case, with the foam loop mounting and carefully-chosen filters, it works:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;iframe allowfullscreen="" frameborder="0" height="274" src="http://www.youtube.com/embed/HP4ePlCZ44g?rel=0" width="480"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;It's certainly flyable with not much skill and it can stay aloft much longer than in previous testing. The roll axis seems to be more prone to oscillation than the pitch axis, which is something I'll have to look into. I'm not sure it will ever be the type of quadrotor that can sit and hover in one place for an extended period of time with little input from the user. Given its size and minimal sensor set (no GPS, no altimeter), it might always be a little twitchy. But at least it's robust; it's almost never damaged in a crash and even if it is, I have enough spare parts to last forever. And &lt;a href="http://www.etotheipiplusone.net/?p=1761"&gt;it poses no risk to human life&lt;/a&gt;...&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8200098102909041178-6282048701259567117?l=scolton.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scolton.blogspot.com/feeds/6282048701259567117/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scolton.blogspot.com/2011/12/pcb-quadrotor-new-digital-imu.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/6282048701259567117'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/6282048701259567117'/><link rel='alternate' type='text/html' href='http://scolton.blogspot.com/2011/12/pcb-quadrotor-new-digital-imu.html' title='PCB Quadrotor: New Digital IMU'/><author><name>Shane Colton</name><uri>http://www.blogger.com/profile/10603406287033587039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-flnz9iOJyVU/Tt0yzSWE73I/AAAAAAAABVM/rIODob3Pgw8/s72-c/4p59.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8200098102909041178.post-7329384152577090583</id><published>2011-12-04T10:58:00.001-08:00</published><updated>2011-12-04T12:34:22.336-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sensorless'/><category scheme='http://www.blogger.com/atom/ns#' term='motor control'/><title type='text'>First Sensorless FOC Test Drive</title><content type='html'>Having done enough &lt;a href="http://scolton.blogspot.com/2011/11/ah-software-optimization-my-old-friend.html"&gt;computational optimization of the flux observer math&lt;/a&gt; and &lt;a href="http://scolton.blogspot.com/2011/11/first-instance-of-sensorless-sine.html"&gt;tested the sensorless sine commutation with no load&lt;/a&gt;, the next obvious step was to test drive it on &lt;a href="http://scolton.blogspot.com/p/bwd-scooter.html#pneu"&gt;Pneu Scooter&lt;/a&gt;:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;iframe allowfullscreen="" frameborder="0" height="360" src="http://www.youtube.com/embed/u_ZRzbt-CCw?rel=0" width="480"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;br /&gt;Well, no, the next obvious step would have been to run it under load with the Hall effect sensors but collect data from the flux observer in parallel to ensure that it is working. But I guess I skipped over that step.&lt;br /&gt;&lt;br /&gt;As you can see in the video, the &lt;a href="http://2.bp.blogspot.com/-Ypa-aGgQjuI/TaJhoXwBGqI/AAAAAAAAA_Q/tTs77VGgnxw/s320/maths.jpg"&gt;open-loop flux observer&lt;/a&gt;&amp;nbsp;appears to work very well at low speeds. There is no start-up ramp in the code right now; I just nudge the scooter very slightly forward and it picks up commutation right away. It's able to find the position of the rotor at speeds down to 50rpm, which is less than 5% of the maximum speed. Here's a slice of data from one of these low-speed runs, showing the flux observer speed estimate matching up with the Hall effect sensor speed in the range of 50-400rpm:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-aoR7nxLmPdc/TtvJzJmijrI/AAAAAAAABU0/kpW4GE-p5Dc/s1600/sl06.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="265" src="http://4.bp.blogspot.com/-aoR7nxLmPdc/TtvJzJmijrI/AAAAAAAABU0/kpW4GE-p5Dc/s400/sl06.gif" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Here's the comparison of estimated rotor electrical angles for the same data range:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-ozcG3nd7UR0/TtvK2lqQWlI/AAAAAAAABU8/1ty8nW_VgEQ/s1600/sl07.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="265" src="http://4.bp.blogspot.com/-ozcG3nd7UR0/TtvK2lqQWlI/AAAAAAAABU8/1ty8nW_VgEQ/s400/sl07.gif" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The 1:1 correlation is not as tight as &lt;a href="http://2.bp.blogspot.com/-WkCt61TI_Vk/TtU1R7v9r3I/AAAAAAAABUs/WW39N-EIoXw/s1600/sl04.gif"&gt;that of the no-load test&lt;/a&gt;. The additional noise is most likely caused by the current sensors, and is a target for improvement. The current sensors on this particular controller have always been noisy. When I was in Singapore last year, &lt;a href="http://scolton.blogspot.com/2010/11/singapore-wrap-up-pneu-scooter-v1-1.html"&gt;I confirmed that the source of noise was the PWM&lt;/a&gt;. I later &lt;a href="http://scolton.blogspot.com/2005/11/pneu-scooter-v10-stealth-mode.html"&gt;added better filtering&lt;/a&gt; and that made the sensors much more usable. &amp;nbsp;But one thing I've wanted to try for a while is more intelligent ADC sampling, where the ADC is triggered in the middle of a PWM pulse, away from the noisy transitions:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-dIRg_MpkL2o/TtvRDfYJd5I/AAAAAAAABVE/I6WeCLdKgt4/s1600/sl08.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="146" src="http://2.bp.blogspot.com/-dIRg_MpkL2o/TtvRDfYJd5I/AAAAAAAABVE/I6WeCLdKgt4/s320/sl08.gif" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;In order to do this on &lt;a href="http://scolton.blogspot.com/p/motor-controllers.html#hd"&gt;3ph v3.1&lt;/a&gt;, I will need to mess with the timers a bit. Each of the three phases of PWM are controlled by different timers (for &lt;a href="http://scolton.blogspot.com/2010/12/midi-scooter.html"&gt;very good reasons&lt;/a&gt;, I assure you). So before I can have them trigger the ADC, I will need to synchronize them and change the PWMs to be center-timed, all things the &lt;a href="http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/REFERENCE_MANUAL/CD00171190.pdf"&gt;1072-page STM32F103 reference manual&lt;/a&gt; ensures me are possible.&lt;br /&gt;&lt;br /&gt;Current sensor noise isn't the only problem left to solve, though. Somehow, the flux observer works very well at low speed, where sensorless routines are supposed to struggle, but it fails at high speeds, where they should do well thanks to the large back EMF. The speed at which this happens, under no-load operation, is strongly dependent on the low-pass filter time constant I use for integrating V-IR. (I swear this low-pass filter is evil.)&lt;br /&gt;&lt;br /&gt;During the process of tweaking the low-pass filter time constant, I was able to bump up the speed of the flux estimator. But this time when it failed at the higher speed, it took out one phase worth of MOSFETs with it. So I'll have to replace the whole&amp;nbsp;&lt;a href="http://ixapps.ixys.com/DataSheet/GWM100-01X1.pdf"&gt;IXYS GWM100-01X1&lt;/a&gt; module and/or switch to the spare controller. That gives me an opportunity to implement a few other improvements:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Center-timed PWM with clean ADC triggering, as discussed above. I may even try to use the Direct &lt;br /&gt;Memory Access (DMA) to fully automate the ADC and save processor time.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Faster fast loop. I don't want the fast loop and the ADC sampling to run into each other, so I will put the entire fast loop at PWM frequency, as it was on &lt;a href="http://web.mit.edu/scolton/www/3phduo.pdf"&gt;3ph v2.1&lt;/a&gt;. The timer interrupt will trigger the ADC, then the End-of-Conversion interrupt will trigger the fast loop.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Fast-loop current fault protection. If any phase current measurement exceeds some threshold, it will trigger gate driver shutdown in the fast loop, within 64μs. This might help protect the MOSFETs from destruction in the (likely/certain) event of commutation failure.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;More data. I would like to transmit some of the intermediate variables in the flux estimator so I can maybe see more clearly why it fails at high speed.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Hopefully with all these changes, testing will go more smoothly this week.&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8200098102909041178-7329384152577090583?l=scolton.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scolton.blogspot.com/feeds/7329384152577090583/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scolton.blogspot.com/2011/12/first-sensorless-test-drive.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/7329384152577090583'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/7329384152577090583'/><link rel='alternate' type='text/html' href='http://scolton.blogspot.com/2011/12/first-sensorless-test-drive.html' title='First Sensorless FOC Test Drive'/><author><name>Shane Colton</name><uri>http://www.blogger.com/profile/10603406287033587039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://img.youtube.com/vi/u_ZRzbt-CCw/default.jpg' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8200098102909041178.post-7887128386016214052</id><published>2011-11-29T09:38:00.001-08:00</published><updated>2011-11-29T12:01:32.536-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sensorless'/><category scheme='http://www.blogger.com/atom/ns#' term='motor control'/><title type='text'>First instance of sensorless sine commutation!</title><content type='html'>I won't quite call it sensorless field-oriented control yet, because it's still running open-loop sinusoidal commutation, but I've finally been able to yank the sensor cable:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;iframe allowfullscreen="" frameborder="0" height="355" src="http://www.youtube.com/embed/7Dhn1HDYR_Y?rel=0" width="480"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;br /&gt;Here's the proof in data:&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-EJeA8XRgfJQ/TtUZGX2of6I/AAAAAAAABUk/YIf8U7ntK_E/s1600/sl03.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/-EJeA8XRgfJQ/TtUZGX2of6I/AAAAAAAABUk/YIf8U7ntK_E/s400/sl03.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;(&lt;a href="http://scolton.blogspot.com/p/cap-kart.html#capkart"&gt;Cap Kart&lt;/a&gt;'s &lt;a href="http://scolton.blogspot.com/2010/07/cap-kart-summer-rebuild-3.html"&gt;fancy data logger&lt;/a&gt; has certainly come in handy.)&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;What you see there is a plot (in time) of the motor RPM as measured directly by the Hall effect sensors (yellow) and indirectly by the &lt;a href="http://2.bp.blogspot.com/-Ypa-aGgQjuI/TaJhoXwBGqI/AAAAAAAAA_Q/tTs77VGgnxw/s320/maths.jpg"&gt;open-loop flux estimator&lt;/a&gt;&amp;nbsp;(blue). At first, both RPM measurements are running simultaneously and they overlap. At the point where the sensor cable is yanked, the RPM measurement from the sensors freezes and then times out to zero, but the flux estimator RPM continues to read properly. The commutation is being controlled by the flux estimator only and the motor continues to run, even under load.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;For this test, the motor is being driven by a 12.5% command, which means the peak-to-peak value of the sine waves is 12.5% of the DC voltage. The no-load speed is therefore about 12.5% of maximum. The loaded speed dips to as low as about 6% during the test. This is a good sign that the flux estimator is capable of working at low speeds where the back EMF is small. I haven't written the start-up ramp yet, but this test tells me that I should be able to exit the start-up mode at less than 10% speed.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;The properly-functioning flux estimator did not come easy. As I mentioned &lt;a href="http://scolton.blogspot.com/2011/11/ah-software-optimization-my-old-friend.html"&gt;last time&lt;/a&gt;, I converted all the floating-point math to fixed-point 32-bit integer math to get the estimator to run at 10kHz. This led to several instances of both loss-of-precision and overflow problems. The biggest culprit was a low-pass filter being used as a pseudo-integrator on (V-IR). Here's how it looks in floating-point:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;vir_a = 0.9996 * vir_a + 0.0004 * vir_a_temp;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Every 100μs, the variable &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;vir_a&lt;/span&gt; is decreased by 0.04% and the same percentage of a new value, &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;vir_a_temp&lt;/span&gt;, is added in. Since this happens 10,000 times per second, the overall effect is that of a low-pass filter with a time constant of 0.25s. The simple conversion to fixed-point math would be:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;vir_a = vir_a * 9996 / 10000 + vir_a_temp * 4 / 10000;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;The constants are moved to the opposite side of the variables so that left-to-right order of operations doesn't yield zero all the time. (9996 / 10000 = 0 in integer math.) But that's not the only issue:&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;b&gt;[Start of horrible multi-day debugging sequence:]&lt;/b&gt;&lt;/div&gt;&lt;hr /&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;If &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; text-align: -webkit-auto;"&gt;vir_a_temp&lt;/span&gt;&lt;span class="Apple-style-span" style="text-align: -webkit-auto;"&gt; is less than about 10^6, the minimum tolerable precision (~1%) of the second term is lost. Since the physical unit of &lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; text-align: -webkit-auto;"&gt;vir_a&lt;/span&gt;&lt;span class="Apple-style-span" style="text-align: -webkit-auto;"&gt; and &lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; text-align: -webkit-auto;"&gt;vir_a_temp&lt;/span&gt;&lt;span class="Apple-style-span" style="text-align: -webkit-auto;"&gt; is Webers, this means working in&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="text-align: -webkit-auto;"&gt;μ&lt;/span&gt;&lt;span class="Apple-style-span" style="text-align: -webkit-auto;"&gt;Wb or even nWb depending on the expected flux.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;But, if &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;vir_a&lt;/span&gt; is greater than 10^6, then the first multiplication of the first term, &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;vir_a * 9996&lt;/span&gt;, overflows a 32-bit signed integer.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Okay, no problem, let's just change the order of operations in the first term:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;vir_a = vir_a / 10000 * 9996 + ...&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;div style="text-align: left;"&gt;Problem solved? Actually, no. Think about what happens on the first two iterations with &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;vir_a_temp&lt;/span&gt;&amp;nbsp;set to 10^6 and &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;vir_a&lt;/span&gt; intially at zero.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;(1)&amp;nbsp;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;vir_a = 0 / 10000 * 9996 + 1000000 * 4 / 10000;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;The result is 400.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;(2)&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;vir_a = 400 / 10000 * 9996 + 1000000 * 4 / 10000;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;The results is...400 again. The first term is zero.You can probably see the problem. &lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;vir_a&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt; will never increase because the divide by 10000 kills off the small initial values completely. So, you can't divide by 10000 first because it kills the small initial values, and you can't multiply by 9996 first because it overflows the large steady-state values. My solution is so horrible that I'm actually ashamed to post it:&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;if((vir_a &amp;lt;= 214748) &amp;amp;&amp;amp; (vir_a &amp;gt;= -214748))&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;{ vir_a = vir_a * 9996 / 10000; }&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;else&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;{ vir_a = vir_a / 10000 * 9996; }&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;(Note: 214748 is 2^31 / 10000)&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;There &lt;i&gt;must&lt;/i&gt;&amp;nbsp;be a more elegant way to do this...&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;hr /&gt;&lt;b&gt;[End of horrible multi-day debugging sequence.]&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;After sorting out that mess, I could finally get to the interesting part, which was actually testing the flux estimator to see if it works. Because I opted to paste the flux estimator directly in parallel with my existing sensor-based control code, the testing was greatly simplified:&lt;br /&gt;&lt;br /&gt;At all times, the Hall effect sensors are being read and a rotor electrical angle is interpolated from them. Separately, the flux estimator is running on all three phases. At flux zero-crossings, a "virtual Hall effect sensor" transition is generated. The rotor electrical angle based on flux is interpolated from these virtual Hall effect sensor transitions, using the same method as the real sensors. This is where the two methods intersect, and either electrical angle can be fed into the field-oriented control algorithm (or, in this case, directly into the sine wave generator).&lt;br /&gt;&lt;br /&gt;Both electrical angles (from flux and from sensors) are recorded and periodically transmitted to the data logger. Because the commutation frequency is much greater than the transmit frequency, plotting either angle against time would not be very informative. But, plotting them against each other tells the whole story:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-WkCt61TI_Vk/TtU1R7v9r3I/AAAAAAAABUs/WW39N-EIoXw/s1600/sl04.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="265" src="http://2.bp.blogspot.com/-WkCt61TI_Vk/TtU1R7v9r3I/AAAAAAAABUs/WW39N-EIoXw/s400/sl04.gif" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The rotor electrical angle derived from Hall effect sensors, which were properly sequenced and timed, is nicely correlated to the rotor angle derived from the flux estimator. The "virtual Hall effect sensors" from the flux estimator do not require sequencing or timing, since they are linked to the correct phase variables already. (No more guessing wire combinations!)&amp;nbsp;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;There is a bit of a staircase effect which I have yet to determine a cause for. There are also still a few bugs to track down, including something that is causing the field-oriented control to freak out. And I haven't even begun to write in the start-up and fault detection, but at least progress has finally been made.&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8200098102909041178-7887128386016214052?l=scolton.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scolton.blogspot.com/feeds/7887128386016214052/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scolton.blogspot.com/2011/11/first-instance-of-sensorless-sine.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/7887128386016214052'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/7887128386016214052'/><link rel='alternate' type='text/html' href='http://scolton.blogspot.com/2011/11/first-instance-of-sensorless-sine.html' title='First instance of sensorless sine commutation!'/><author><name>Shane Colton</name><uri>http://www.blogger.com/profile/10603406287033587039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://img.youtube.com/vi/7Dhn1HDYR_Y/default.jpg' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8200098102909041178.post-7667483004714676500</id><published>2011-11-19T14:41:00.001-08:00</published><updated>2011-11-29T12:00:10.138-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sensorless'/><category scheme='http://www.blogger.com/atom/ns#' term='motor control'/><title type='text'>Ah, software optimization, my old friend. It's been a while.</title><content type='html'>In a somewhat drastic attempt to force myself to get work done, I have decided not to ride &lt;a href="http://scolton.blogspot.com/p/bwd-scooter.html#pneu"&gt;Pneu Scooter&lt;/a&gt; until I implement sensorless field-oriented control on its controller, a &lt;a href="http://scolton.blogspot.com/p/motor-controllers.html#hd"&gt;3ph 3.1&lt;/a&gt;&amp;nbsp;board that's been happily commutating the motor off Hall effect sensors for something like 2-3 million electrical cycles. It's pretty much an ideal test platform since the motor is well-characterized (I built it.) and the controller is known to be reliable. It's also a relatively low-frequency system (175Hz at top speed), so the sensorless algorithm need not be absurdly fast to keep up with the commutation frequency. But, I do plan to use this algorithm on faster motors, so I'm designing for higher frequencies anyway.&lt;br /&gt;&lt;br /&gt;The highest frequency the controller could run at is the PWM frequency, in this case 15.6kHz. Above this speed, it's not possible to update the commanded voltage to the motor fast enough, since the PWM duty cycle is not latched into a timer until the next PWM cycle. So, even if you could run a sensorless algorithm faster, there would be almost no point.&lt;br /&gt;&lt;br /&gt;Back when I was using the &lt;a href="http://www.ti.com/product/msp430f2274"&gt;MSP430F2274&lt;/a&gt;, I ran a "fast loop" at 14.4kHz (PWM frequency) to handle sensor polling, speed estimation, position interpolation, and updating the three phase motor PWMs from a sine look-up table. The "slow loop" ran at 122Hz and handled current sampling, coordinate transformation into the rotating reference frame, and feedback control of the q-axis and d-axis currents.&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-uhiHx1aFOl0/S09LKMuS0_I/AAAAAAAAAV8/si_iReF4fgQ/s1600/feedback4.gif" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="260" src="http://3.bp.blogspot.com/-uhiHx1aFOl0/S09LKMuS0_I/AAAAAAAAAV8/si_iReF4fgQ/s400/feedback4.gif" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;This.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;On that processor, which doesn't have a hardware multiplier, getting the fast loop to run at 14.4kHz was a major challenge. I spent a large portion of the development time just optimizing the software using &lt;a href="http://scolton.blogspot.com/2010/01/3ph-duo-wrap-up-part-1-field-oriented.html"&gt;a number of tricks&lt;/a&gt; to get the processing time down to 53μs (for two motors). The largest single processor burden, accounting for 10μs, was the integer division required to get the speed of the motor, 1/(time per cycle). This was large enough that I couldn't compute both motor speeds in the same fast loop cycle; one always got priority.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-1tiXAsCWFl0/S0d9SJxrFhI/AAAAAAAAAUc/VGUieXuturI/s1600/fastloop.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-1tiXAsCWFl0/S0d9SJxrFhI/AAAAAAAAAUc/VGUieXuturI/s400/fastloop.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;High = processor in use. Low = processor free. The lighter portion of the trace is the single integer division.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;Even totally optimized with all integer math (no floating-point), the dual FOC was just barely able to fit in the fast loop at 14.4kHz. The leftover processor time went to the slow loop, which could be run arbitrarily slow thanks to the coordinate transformation to the rotating frame. So, having floating-point controller math in the slow loop has never been an issue.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;But now, I've moved on to the &lt;a href="http://www.st.com/internet/mcu/product/216825.jsp"&gt;STM32F103&lt;/a&gt; 32-bit ARM processor, which has a hardware multiplier. Though so far I haven't done anything other than &lt;a href="http://scolton.blogspot.com/search/label/MIDI"&gt;waste the extra processing power on silly things&lt;/a&gt;, one of my motivations for giving up my beloved MSP430 was to be able to implement sensorless field-oriented control. But first, for comparison, here's what single-motor FOC code looks like ported to the STM32F103:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-Cn41fODs5Zs/Tsg5mn7ftMI/AAAAAAAABT8/BycL5vM0Xos/s1600/sl_foc_16mhz.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-Cn41fODs5Zs/Tsg5mn7ftMI/AAAAAAAABT8/BycL5vM0Xos/s400/sl_foc_16mhz.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The fast loop on this processor runs at 10kHz. It's no longer tied to the PWM frequency, so it's easy to change. I chose 10kHz for simple math. Using the same clock speed as the MSP430, single-motor FOC takes just under 7us. The integer operations, including multiplication, happen in one clock cycle instead of the 50-60 it took on the MSP430. Integer division is also fast, though to the best of my knowledge it isn't single-cycle. And these are 32-bit operands, so they inherently have more precision than the MSP430's 16-bit integers.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;What about floating-point? I thought maybe the fast integer hardware would be leveraged somehow to make floating-point operations faster as well, even though the STM32F1-series does not have a hardware floating-point unit. So, I threw on my first attempt at a rotor flux observer, all implemented in floating-point math, to test this.&amp;nbsp;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;b&gt;Mathematical Tangent:&lt;/b&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The rotor flux observer, used to estimate the position of the rotor magnets in lieu of Hall effect sensors, is a simple one that I mentioned before:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-Ypa-aGgQjuI/TaJhoXwBGqI/AAAAAAAAA_Q/tTs77VGgnxw/s1600/maths.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="125" src="http://2.bp.blogspot.com/-Ypa-aGgQjuI/TaJhoXwBGqI/AAAAAAAAA_Q/tTs77VGgnxw/s320/maths.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;It's an open-loop rotor flux observer, meaning there is no feedback to correct the estimated flux. It relies on a reasonably accurate estimate of R and L (the motor resistance and inductance, respectively) to produce the flux estimate. I did a little more thinking and decided that this is a good place to start, instead of jumping right into closed-loop flux observers. The nice things about the open-loop rotor flux estimator, in my view, are:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;It's very obvious what it's doing, in the context of the motor electrical model. In my experience, simple things tend to work more reliably.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;It estimates flux, instead of back EMF. The value of flux is speed-independent, so the amplitude of the flux estimate should remain constant. The integrator also filters out noise in the current measurement. No derivative of current is required.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;The effect of parameter offset is easy to analyze. More on this in a later post, but it's easy to show with simple geometrical arguments what the effect of an improperly-set R or L is.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;I think in time I will move back toward the closed-loop observer, which can compensate for the parameter offset automatically, but for now this is what I'm starting with. So, the fast-loop code must sample the phase current sensors and the DC voltage. Phase voltage is computed as a duty cycle fraction of the DC voltage, based on the sine look-up table. The integration is implemented as a low-pass filter, to kill off DC offset.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;All three phase fluxes are estimated, and used to establish the motor position through what I will call "virtual Hall effect sensors" that detect flux zero-crossings. This method, though completely non-traditional and probably stupid, allows me to tape the flux observers to the back of my existing sensor-based FOC code and get up and running quickly.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Okay back to software:&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Implementing the above open-loop flux estimator in all floating-point math was a terrible idea:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-NQQteLEJ18I/TshAMqCEA3I/AAAAAAAABUE/IbtLx-iHpZQ/s1600/sl_float_16mhz.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/-NQQteLEJ18I/TshAMqCEA3I/AAAAAAAABUE/IbtLx-iHpZQ/s400/sl_float_16mhz.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;It looks like the processor utilization is 99%, but it's actually more like 120%. The 10kHz loop took so long that it actually took 120μs to finish each cycle...so I'm not even sure if it really finished or if the interrupt controller just gave up. The flux observer alone took about 80μs to run. I determined that each floating point multiply was taking about 7.44μs, or close to 120 clock cycles at 16MHz. So clearly the floating point math is still being done in software, and it's not really leveraging the hardware multiplier at all to speed things up.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;So began a day or two of modifying the code to run faster without actually changing what it does. Software optimization is probably one of the most thankless tasks ever, since you make something work the same way it did before and nobody can see the difference. But I still find it somewhat fun to try to squeeze every bit of time out of a control loop.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;First, I now have the ability to stick all my state variables into 32-bit integers and use the extra precision to make up for the lack of floating point capability. For example, instead of Phase A's current being represented in software as 38.7541723[A], it can be 38754[mA]. I don't care about sub-mA precision, and that still leaves me plenty of multiplication overhead. By that I mean I can still multiply the current, which fits in 17-bits of signed int, by up to 15 bits of precision without overflowing the 32-bit signed int.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;For example, the floating-point current scaling would have been:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;float raw_current, scaled_current;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;raw_current = adc_read(CH) - offset;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;scaled current = raw_current * 0.0561;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;This scaled the raw ADC value to physical units of Amps. But it has more final precision than is really necessary and can be replaced with all integer math:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;signed int raw_current, scaled_current;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;raw_current = adc_read(CH) - offset;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;scaled_current = raw_current * 561 / 10;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Now the scaled current is an integer value in mA. The intermediate precision required is about 22 bits. (12 bits for the raw ADC value plus 10 bits for the scaling operand 561.) The integer division by 10 is fast, and the precision is high enough that the truncated result is still perfectly fine.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;After thus converting all the floating-point operations to integer math, the fast-loop consisting of FOC, ADC sampling, and flux observer was down to 50.5μs&lt;span class="Apple-style-span" style="text-align: -webkit-auto;"&gt;&amp;nbsp;at 16Mhz:&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="text-align: -webkit-auto;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-jxm-Yfvkq7g/TshGJ-pX9MI/AAAAAAAABUM/xbFXRVg7F3Q/s1600/sl_int_16mhz.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/-jxm-Yfvkq7g/TshGJ-pX9MI/AAAAAAAABUM/xbFXRVg7F3Q/s400/sl_int_16mhz.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: -webkit-auto;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: -webkit-auto;"&gt;This would already be good enough to run, but there are several other processing efficiency tricks I had ready to deploy. One obvious target for efficiency improvement is the ADC sampling. The STM32F103, like many other microcontrollers, uses a &lt;a href="http://en.wikipedia.org/wiki/Successive_approximation_ADC"&gt;Successive Approximation Register (SAR) ADC&lt;/a&gt;, which is sort-of like a guess-and-check process for converting an analog value to digital representation. Each guess takes time, so many cycles are spent waiting for the conversion to complete. As implemented above, the processor would just sit there waiting for the sample to finish.&amp;nbsp;&lt;/div&gt;&lt;div style="text-align: -webkit-auto;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: -webkit-auto;"&gt;With the ADC settings I have been using, each sample takes 4.55μs. The fast loop samples four analog channels, taking a total of 18.2μs. For most of that time, the processor is waiting for the ADC to finish. It doesn't need to be, though, since the ADC can run on its own and trigger an interrupt when it's done converting. Implementing this was straightforward: I have the fast loop code start the ADC and then have it cycle through five samples on its own. After each sample, the ADC interrupt retrieves the data and moves on to the next sample. While waiting for the ADC, the processor returns to the main loop.&lt;/div&gt;&lt;div style="text-align: -webkit-auto;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-2-0hWas8gjo/TshIsDEdktI/AAAAAAAABUU/3NOE_9_-5x0/s1600/sl_int_adc_16mhz.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/-2-0hWas8gjo/TshIsDEdktI/AAAAAAAABUU/3NOE_9_-5x0/s400/sl_int_adc_16mhz.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;This showed only marginal improvement. The total processor utilization is still about 50%, because the idle time saved by not waiting for the ADC is offset by extra processing time to decide what to do with the data. The result is that each sample now takes about 8μs, four of which is spent converting and four of which is spent decided what the data is and where to put it. The data manipulating part can be completely eliminated by using &lt;i&gt;yet another&lt;/i&gt;&amp;nbsp;hardware feature of this processor, the Direct Memory Access (DMA) peripheral. The ADC can tell the DMA to automatically transfer data to a specified memory location, with no processor involvement. This would completely automate the sampling, and bring the total processing time for the fast loop down to about 28μs.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;But, there's also another way to squeeze even more horsepower out of the STM32F103. The clock speed can be multiplied by an on-board &lt;a href="http://en.wikipedia.org/wiki/Phase-locked_loop"&gt;Phase-Locked Loop&lt;/a&gt; (PLL) to up to 72MHz. (Right now, the 16MHz oscillator sets the clock speed directly.) I've never even bothered to try turning on the PLL, but now seemed like a good time to see what it would do. For some yet-unknown reason, I was only able to multiply my 16MHz oscillator by as much as 3.5 (or rather, divide it by two and then multiply it by seven...don't ask). That gives me 56MHz. I'm not sure why it won't go higher than that, but I suspect some hidden clock speed limit on a peripheral. But I tracked down all the obvious ones, and none were overclocked. Anyway, here's what the fast loop processor utilization looks like at 56MHz:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-bVCpfuXEibk/TshKgle0WzI/AAAAAAAABUc/tzNr634jNy0/s1600/sl_int_adc_56mhz.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/-bVCpfuXEibk/TshKgle0WzI/AAAAAAAABUc/tzNr634jNy0/s400/sl_int_adc_56mhz.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The entire FOC and flux estimator now take only 8μs. The ADC samples still take about 4μs, but the amount of that time spent processing data is greatly reduced. (The sampling time itself is limited by the ADC's peripheral clock speed limit of 14MHz, but the data manipulating time is based on the system clock.) The total processor utilization is now about 20%, leaving room for increasing the fast-loop rate or doing more processing for a closed-loop observer.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;For now, though, I'm satisfied that the flux observer will run happily at 10kHz and I'm merging it with the FOC code I already have. Hopefully I will get to test it before Thanksgiving.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8200098102909041178-7667483004714676500?l=scolton.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scolton.blogspot.com/feeds/7667483004714676500/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scolton.blogspot.com/2011/11/ah-software-optimization-my-old-friend.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/7667483004714676500'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/7667483004714676500'/><link rel='alternate' type='text/html' href='http://scolton.blogspot.com/2011/11/ah-software-optimization-my-old-friend.html' title='Ah, software optimization, my old friend. It&apos;s been a while.'/><author><name>Shane Colton</name><uri>http://www.blogger.com/profile/10603406287033587039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-uhiHx1aFOl0/S09LKMuS0_I/AAAAAAAAAV8/si_iReF4fgQ/s72-c/feedback4.gif' height='72' width='72'/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8200098102909041178.post-7610321923066848029</id><published>2011-11-04T18:12:00.000-07:00</published><updated>2011-11-29T11:59:58.907-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='directdrive'/><category scheme='http://www.blogger.com/atom/ns#' term='sensorless'/><category scheme='http://www.blogger.com/atom/ns#' term='motor control'/><title type='text'>Hey Shane, why haven't you been working on your motor controllers?</title><content type='html'>I haven't done much on any of my motor controller projects in a while. For example, DirectDrive hasn't been touched since the &lt;a href="http://scolton.blogspot.com/2011/07/directdrive-v10-24kva-test.html"&gt;July&lt;/a&gt; update where it passed a 2.4kVA bench test. And I have yet to do anything other than &lt;a href="http://scolton.blogspot.com/2011/07/sensorless-foc-more-analysis.html"&gt;theorize&lt;/a&gt; about sensorless FOC code. And that was so long ago that I would have to reread the post to remember what I was talking about. But now that the season of &lt;a href="http://scolton.blogspot.com/search/label/tinykart"&gt;building and testing vehicles&lt;/a&gt; is winding down, and I have sworn off doing any demos, faires, expos, exhibitions, presentations, or showcases until the spring, I can actually have time to get back to motor controllers. For real this time.&lt;br /&gt;&lt;br /&gt;First of all, even though I've been relatively pleased with the Kelly &lt;a href="http://kellycontroller.com/kbs3610140a24-36v-mini-brushless-dc-controller-p-502.html"&gt;KBS36101&lt;/a&gt; controllers on tinyKart, they are frustrating to work with. With the external Hall effect sensors &lt;a href="http://scolton.blogspot.com/2011/10/strobe-attack.html"&gt;perfectly positioned&lt;/a&gt;, the performance at 80A per motor is &lt;a href="http://scolton.blogspot.com/2011/10/okay-tinykart-frightens-me-now.html"&gt;spectacular&lt;/a&gt;. But, if the sensors go out of timing even by just a little bit, the controllers cut out and you lose power to one or both sides. Also, they won't work at all at full current (100A) and they have issues at full speed. (The baseline KBS is only rated to 40,000erpm, which is about 75% of this motor's top speed.) Recently, with the &lt;a href="http://scolton.blogspot.com/2011/10/strobe-attack.html"&gt;changeover to SK3 motors&lt;/a&gt;, the controller bugs have just gotten buggier. So...&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-4VWYHxNfIqs/TrSDC0Fi6WI/AAAAAAAABTE/mu0CMTAD3xU/s1600/dn39.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/-4VWYHxNfIqs/TrSDC0Fi6WI/AAAAAAAABTE/mu0CMTAD3xU/s400/dn39.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;I pulled out its heart...&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-26LBkN8AY0U/TrSDDAvQanI/AAAAAAAABTM/uw_-dN8CKPI/s1600/dn40.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/-26LBkN8AY0U/TrSDDAvQanI/AAAAAAAABTM/uw_-dN8CKPI/s400/dn40.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;...and put it in a box.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;If I'm gonna deal with buggy controllers, they might as well be &lt;i&gt;my&lt;/i&gt;&amp;nbsp;buggy controllers. &lt;a href="http://scolton.blogspot.com/p/motor-controllers.html#directdrive"&gt;DirectDrive&lt;/a&gt; was pretty much designed for tinyKart. If I were as hardcore as I was back in 2008 when we built &lt;a href="http://scolton.blogspot.com/p/cap-kart.html"&gt;Cap Kart&lt;/a&gt;, I would have put it on from the start. But I guess building the entire chassis was enough of a challenge and we did get quite a lot of use out of the Kelly controllers. Still, screw it, time for the complete power system overhaul.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-TAo8oUyPCq4/TrSEXEnD2-I/AAAAAAAABTU/r1GbeZhoqV8/s1600/dn36.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="280" src="http://3.bp.blogspot.com/-TAo8oUyPCq4/TrSEXEnD2-I/AAAAAAAABTU/r1GbeZhoqV8/s400/dn36.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-F_hpXxFZ0u4/TrSEbYWUI5I/AAAAAAAABTc/ZGEm9-D1WSM/s1600/dn37.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="241" src="http://2.bp.blogspot.com/-F_hpXxFZ0u4/TrSEbYWUI5I/AAAAAAAABTc/ZGEm9-D1WSM/s400/dn37.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;DirectDrive has yet to be tested under any real load, so by committing it to a vehicle, I am forced to solve any to-be-revealed bugs. I guess that means I should also buy more DirectFETs and solder paste, since things rarely go well on the first version of a motor controller. I've only built one so far, but I have enough parts for a second. The payoff will be:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;More power. DirectDrive is sized for 200A peak at 48V. In this application, assuming it doesn't just outright blow up (it will), it should have no trouble pushing 100A peak at 40V.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Sinusoidal field-oriented control. I'm not sure this is directly advantageous on such high-speed, low-inductance motors. But the side effect of having complete control of motor timing in software is worth it. No more screwing around with sensor positioning.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Wireless data. I can get vehicle performance data off these controllers, and use the data to help debug failures. (As opposed to the Kelly controllers, where *** &amp;nbsp;** is the universal indicator for every possible failure...)&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Wireless throttle? It worked for Cap Kart.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Shedding weight. DirectDrive is a tiny bit lighter than the KBS.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;For all that, the only cost is probably dozens of hours of troubleshooting...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You might also notice the new battery pack. I'm tired of worrying about LiPos and am willing to take a ~20% energy capacity cut for the peace-of-mind that comes with A123 LiFePO4 cells. But in order to match the power density of the LiPos, they will have to be &lt;a href="http://www.a123systems.com/Collateral/Documents/English-US/A123%20Systems%20ANR26650%20Data%20Sheet.pdf"&gt;m1-B&lt;/a&gt; cells. (The green ones, not the paper ones from that DeWalt Drill tree I found.) These have a lower internal resistance, such that a 6lb, 12S3P pack can put out bursts of 6-8kW.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;But yeah, messing with tinyKart's Hall effect sensors has reminded me just how much of a pain in the ass it is. It would be really, really nice to never have to play the phase-and-sensor-musical-chairs-wiring-game ever again. I am still very convinced that vehicle-grade sensorless control is a possibility. In fact, we recently found proof:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-aX9yOgNXvnc/TrSIdyg-ZNI/AAAAAAAABTk/thNktl4I2fg/s1600/nt34.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/-aX9yOgNXvnc/TrSIdyg-ZNI/AAAAAAAABTk/thNktl4I2fg/s400/nt34.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;That is a &lt;a href="http://www.ebay.com/itm/36V-350W-Brushless-E-bike-Controller-Without-Hall-/160443552607?pt=LH_DefaultDomain_0&amp;amp;hash=item255b2e535f#ht_2639wt_1020"&gt;$28 shady eBay eBike controller,&lt;/a&gt; similar to the ones that &lt;a href="http://scolton.blogspot.com/2011/10/singapore-post.html"&gt;bailed me out in Singapore&lt;/a&gt;. Except, it's sensorless. And the start-up doesn't suck. Unlike RC plane controllers, it ramps the output frequency and voltage gradually at start-up so that you get a smooth acceleration. It also does current (torque) control in both start-up and running modes. It's quite nice on &lt;a href="http://scolton.blogspot.com/p/bwd-scooter.html#pneu"&gt;Pneu Scooter&lt;/a&gt; and &lt;a href="http://www.etotheipiplusone.net/?page_id=978"&gt;RazEr Revolution&lt;/a&gt;. But it's still dumb square wave drive, and it simply refuses to start ultra-low-resistance outrunners. However, it's proof that a smooth ramping start-up is achievable.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;So, that will be my first task on the way to full sensorless field-oriented control. Start-up is regarded as the hard part of sensorless control, but for some reason I think it's easy. I will be aiming for a sinusoidal drive current with a ramping amplitude and frequency determined by some estimate of the system inertia. It may need locked-rotor detection or a way to reset and try again if it fails to achieve commutation. But I think it will be pretty easy, actually, compared to the rest of the project:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Once the speed is high enough (10%?), the fun begins. Unlike the $28 version, I will be going for full sinusoidal field-oriented control, with no direct measurement of back EMF. I'm sure this will keep me occupied in software for quite a while. It is my first big software project in a long time...and sadly I'm kind-of excited for it. So much so that I violated one of my long-standing software principles:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-ACSjL1Bzb3o/TrSLBgs83jI/AAAAAAAABTs/0kyZCSzRXls/s1600/files.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-ACSjL1Bzb3o/TrSLBgs83jI/AAAAAAAABTs/0kyZCSzRXls/s1600/files.jpg" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;I split my build into multiple files. :/&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;I'll be implementing sensorless field-oriented control first on the &lt;a href="http://scolton.blogspot.com/p/motor-controllers.html#hd"&gt;3ph 3.1&lt;/a&gt;, Pneu Scooter's controller. It's been totally fine ever since I replaced the FETs that died in Singapore. I'm still not 100% sure what the cause of that failure was, but since I've never seen it before or since, I will assume it was something specific (like bad sensor timing....) or just high ambient temperature and humidity. Once sensorless Pneu Scooter is up and running, I can think about porting it over to DirectDrive.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Let the season of motor controllers begin...&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8200098102909041178-7610321923066848029?l=scolton.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scolton.blogspot.com/feeds/7610321923066848029/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scolton.blogspot.com/2011/11/hey-shane-why-havent-you-been-working.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/7610321923066848029'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/7610321923066848029'/><link rel='alternate' type='text/html' href='http://scolton.blogspot.com/2011/11/hey-shane-why-havent-you-been-working.html' title='Hey Shane, why haven&apos;t you been working on your motor controllers?'/><author><name>Shane Colton</name><uri>http://www.blogger.com/profile/10603406287033587039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-4VWYHxNfIqs/TrSDC0Fi6WI/AAAAAAAABTE/mu0CMTAD3xU/s72-c/dn39.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8200098102909041178.post-3285614391194206446</id><published>2011-10-27T22:37:00.000-07:00</published><updated>2011-10-27T22:40:35.670-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='strobe'/><category scheme='http://www.blogger.com/atom/ns#' term='tinykart'/><category scheme='http://www.blogger.com/atom/ns#' term='motor timing'/><title type='text'>Strobe Attack</title><content type='html'>The bad thing about having tinyKart around is that we will just keep driving it until something breaks.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;iframe allowfullscreen="" frameborder="0" height="274" src="http://www.youtube.com/embed/9oMbGoiJO04?rel=0" width="480"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;br /&gt;Besides drifting the tires off, the only reliability problem I've seen so far with tinyKart is the motors. Electromagnetically, the Turnigy &lt;a href="http://www.hobbyking.com/hobbyking/store/uh_viewItem.asp?idProduct=7870"&gt;SK-6374-170&lt;/a&gt;'s are very good. But mechanically, they suck. We already had to replace the left motor at &lt;a href="http://scolton.blogspot.com/2011/09/maker-faire-ny-2011.html"&gt;Maker Faire&lt;/a&gt; because the entire rotor was loose and would shift axially until the motor locked up. Last week, the right motor suffered the same fate.&lt;br /&gt;&lt;br /&gt;Additionally, the outside rotors are out of balance and the sound like they are going to detonate at full speed (7,500rpm). The vibrations are so bad that the entire kart needs to be clamped to a table to do a no-load test, lest it resonate like the giant aluminum flexure it is. And I'm sure all that vibration would eventually lead to more problems.&lt;br /&gt;&lt;br /&gt;tinyKart was originally designed with the larger "&lt;a href="http://scolton.blogspot.com/2011/10/melon-checker-now-with-more-fruits.html"&gt;melon-class&lt;/a&gt;" 80mm motors in mind, but the 63mm "grapefruit-class" with &lt;a href="http://www.kellycontroller.com/kbs3610140a24-36v-mini-brushless-dc-controller-p-502.html"&gt;KBS36101&lt;/a&gt; controllers is a better match for its size, weight, and performance. When we built it over the summer, the SK-6374-170 was &lt;i&gt;the only&lt;/i&gt;&amp;nbsp;63mm or 80mm motor in stock, so we didn't have much choice. (Well, okay, we could have dropped $360 on &lt;a href="http://www.aero-model.com/Hacker-Brushless-A60-20M.aspx"&gt;Hacker A60&lt;/a&gt;'s...) But now there is a new line of inexpensive Hobby King motors called SK3, and there are quite a few 63mm ones:&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-bKrufIcZzoI/TqmD5_xkjEI/AAAAAAAABQ4/0e090UlujcQ/s1600/dn26.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/-bKrufIcZzoI/TqmD5_xkjEI/AAAAAAAABQ4/0e090UlujcQ/s400/dn26.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;SK-6374-170 (left) and SK3-6364-190 (right).&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;They &lt;i&gt;look&lt;/i&gt;&amp;nbsp;very nice, and the construction quality is definitely improved. The SK3 has a large radial bearing on the shaft side of the rotor, making it far less prone to shaking itself apart violently at high speeds. It should also help better-constrain the rotor axially.&amp;nbsp;My only real problem with the SK3 63mm motors is that they are &lt;i&gt;not actually 63mm&lt;/i&gt;:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-UAwZcoYbHD4/TqmFLFH_hfI/AAAAAAAABRA/NvtdNfgVXZw/s1600/dn27.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-UAwZcoYbHD4/TqmFLFH_hfI/AAAAAAAABRA/NvtdNfgVXZw/s400/dn27.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The outer diameter is 59mm. The stator is proportionally smaller. And because of the can bearing, the active length is reduced as well. The shaft is also smaller: 8mm instead of 10mm. They don't look much different in the pictures but if you held one in each hand you'd clearly be able to tell that the SK3 is a shrunk-down model, probably to cut materials costs while still passing it off as a 63mm motor.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;All of this I would be fine with if it was as good, electromagnetically, as the old SK. But the first indication that it is not is the line-to-line resistance: 37mΩ for the SK3-6364-190 as opposed to 23mΩ for the old SK-6374-170. Normally, it wouldn't be fair to compare a 190rpm/V motor to a 170rpm/V motor. But in my testing, the old SK actually was closer to 190rpm/V anyway, so they have virtually the same back EMF constant. So, for a given amount of current, you get the same torque from each, but the new SK3 generates 60% more heat.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Maybe it's not a big deal. After all, the comparable Hacker A60 is 59mm and 32mΩ. Even at 37mΩ, the power lost to winding resistance at 80A is only 237W per motor, or about 10% of the peak power input. If, with more robust motors, the speed can be increased past the 75% please-don't-blow-up limit its been at so far, the peak power might even go up.&amp;nbsp;And tinyKart has never had motor overheating problems. So, it's worth a try. Swapping motors will mean changing the pulleys to 8mm bore, but that's easy. The bigger problem is the Hall effect sensors...&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-27NsEVtlhoU/TqmJUAdlfhI/AAAAAAAABRI/U6IJHr-Uzp8/s1600/dn33.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="310" src="http://2.bp.blogspot.com/-27NsEVtlhoU/TqmJUAdlfhI/AAAAAAAABRI/U6IJHr-Uzp8/s400/dn33.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Because the can diameter is 4mm smaller, the sensors are now 2mm farther from the rotor can. They're already relying on the small amount of field leaking out of the side of the can, so every millimeter counts. It turns out they have no trouble picking up the field from the larger distance and I could still time the motor in the normal way.&amp;nbsp;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;But, reverse sucks.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;When timed correctly for forward commutation, the reverse is awful. I didn't recall this being the case on the old SK's, but a further test with them confirmed that forward and reverse have always been asymmetric. The extra distance between the sensors and the rotor can, and possibly a thicker rotor can on the SK3, seem to exaggerate the problem. I wasn't 100% sure it was a sensor problem, though. So, I went to borrow a strobotach from the &lt;a href="http://web.mit.edu/edgerton/main.html"&gt;Edgerton Center:&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-GAVpGwfEJHM/TqmKeQRLZ_I/AAAAAAAABRQ/-dRVad1YE18/s1600/dn29.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-GAVpGwfEJHM/TqmKeQRLZ_I/AAAAAAAABRQ/-dRVad1YE18/s400/dn29.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Borrowing a strobotach from the &lt;a href="http://edgerton-digital-collections.org/techniques/stroboscope"&gt;Edgerton&lt;/a&gt; Center is kind-of like borrowing an airplane from the Wright Brothers Museum...&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: center;"&gt;&lt;div style="text-align: left;"&gt;This strobotach is an old-school box of vacuum tubes with a giant dial that can adjust the strobe rate. One way to use it is to point the strobe at something spinning at a constant rate and dial the knob until it appears to stop moving. Then, you can read the rpm off the dial. But, I was interested in using the external trigger, which flashes the strobe in response to an electronic signal. I tied this in to one of the Hall effect sensors. The signal bias is 54V for some reason that I'm sure has to do with the vacuum tubes, so I had to make a quick transistor trigger circuit so it would run off the 5V Hall effect signal.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-fj0ToNQTrak/Tqozm8of2fI/AAAAAAAABRc/p25dwEjedSI/s1600/dn32.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-fj0ToNQTrak/Tqozm8of2fI/AAAAAAAABRc/p25dwEjedSI/s400/dn32.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;To make a position indicator on the rotor, I passed a fixed current into all six permutations of phase wires and put a tick mark on a piece of yellow tape at whatever fixed position the most was held at by the current. I used three different color tick marks, for A, B, and C phase. There are seven ticks of each color around the motor, since there are seven pole pairs.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The strobe makes it very easy to see where the Hall effect sensor is firing, in forward and in reverse, as well as the physical effect of moving the sensor mount:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;iframe allowfullscreen="" frameborder="0" height="274" src="http://www.youtube.com/embed/H1eKF-I6m50?rel=0" width="480"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The strobe aliases with the video camera's frame rate a bit, but you can definitely see the tick marks. Here are still pictures of the forward and reverse case as well:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-ZQFHRMSCYsY/Tqo1MmtULII/AAAAAAAABRk/OwG5J0IbVoY/s1600/dn22.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-ZQFHRMSCYsY/Tqo1MmtULII/AAAAAAAABRk/OwG5J0IbVoY/s400/dn22.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Forward.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-uACMYOK_UrI/Tqo1RSxhNpI/AAAAAAAABRs/f39UbIYfvo8/s1600/dn23.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/-uACMYOK_UrI/Tqo1RSxhNpI/AAAAAAAABRs/f39UbIYfvo8/s400/dn23.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Reverse.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;div style="text-align: left;"&gt;I had already timed the motor to run properly in the forward direction. So, in forward, the Hall effect sensor (and the strobe) fire almost exactly on a fixed-current motor position (green). A long time ago I convinced myself that this should be the case. But, if it's firing on green in forward, it should be firing 180º electrical out of phase in reverse, or, somewhere about halfway between red and black. Instead, it's firing on the wrong side of black, about 70º away from where it should. The reversing problem is definitely a timing issue, then.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;I tried a similar experiment with the old SK, for which the gap between the sensors and the rotor is much smaller, and the reverse mark was still offset from where it should be. But, it was better. Probably enough so that the SK would actually run in reverse, if not happily. I also tried making a flux-concentrating extension for the sensors:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-uxWpx0yc_RE/Tqo61BkoHfI/AAAAAAAABR0/C5wqeiDciz8/s1600/dn30.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/-uxWpx0yc_RE/Tqo61BkoHfI/AAAAAAAABR0/C5wqeiDciz8/s400/dn30.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;i.e. I glued cap screw heads to the sensors.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;This also brought the reverse mark closer to the correct position, but it still was offset by about 60º. I &lt;i&gt;think&lt;/i&gt; the problem is due to the Hall effect sensor hysteresis (about 8mT for these sensors). If the field outside the can is weak enough that the total swing is only, say, +/-20mT, then the hysteresis will have a huge effect on the forward/reverse timing.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;I could try getting the sensors themselves closer to the rotor, which I think will be better than gluing cap screw heads to them existing ones. I could also try more sensitive Hall effect IC's with a small hysteresis band. Of course, I would not want to have to make bunch of acrylic ones to test all this. Luckily...&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-atGJnZLDHdc/Tqo9NLSwutI/AAAAAAAABR8/6EPeYSuTQ6E/s1600/dn34.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-atGJnZLDHdc/Tqo9NLSwutI/AAAAAAAABR8/6EPeYSuTQ6E/s400/dn34.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8200098102909041178-3285614391194206446?l=scolton.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scolton.blogspot.com/feeds/3285614391194206446/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scolton.blogspot.com/2011/10/strobe-attack.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/3285614391194206446'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/3285614391194206446'/><link rel='alternate' type='text/html' href='http://scolton.blogspot.com/2011/10/strobe-attack.html' title='Strobe Attack'/><author><name>Shane Colton</name><uri>http://www.blogger.com/profile/10603406287033587039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://img.youtube.com/vi/9oMbGoiJO04/default.jpg' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8200098102909041178.post-5284947604634998561</id><published>2011-10-24T23:31:00.000-07:00</published><updated>2011-10-24T23:41:56.806-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='motor'/><category scheme='http://www.blogger.com/atom/ns#' term='melon'/><title type='text'>Melon Checker: Now with more fruits.</title><content type='html'>I've updated my &lt;a href="http://www.hobbyking.com/"&gt;Hobby King&lt;/a&gt; large motor inventory checker:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://web.mit.edu/scolton/www/aremelons.html"&gt;http://web.mit.edu/scolton/www/aremelons.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Previously it had only the three "melon"-class motors, so-called because at 80mm OD, they are roughly the size of melons. (So called by whom? What kind of melons? Not &lt;a href="http://www.teslamotors.com/roadster/technology/motor"&gt;watermelons&lt;/a&gt;...) These motors haven't been in stock at Hobby King in quite a long time, though they are starting to pop up in &lt;a href="http://www.leaderhobby.com/product.asp?ID=9394001224162"&gt;other&lt;/a&gt; &lt;a href="http://www.ebay.com/itm/C80100-KV130-EMP-bulshless-Motor-airplane-RC-Free-Shipping-/220870040198?pt=Radio_Control_Parts_Accessories&amp;amp;hash=item336ce15a86"&gt;places&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;But there are other large motor candidates that are interesting to keep track of, including the brand new shiny SK3 line, which is the new "grapefruit"-class of 63mm motors. Somewhat dissapointingly, the SK3-63xx motors are actually 59mm in outer diameter. (The old 63xx grapefruit-class motors were truly 63mm.)&lt;br /&gt;&lt;br /&gt;That said, &lt;a href="http://scolton.blogspot.com/p/cap-kart.html#tinykart"&gt;tinyKart&lt;/a&gt;'s older-model &lt;a href="http://www.hobbyking.com/hobbyking/store/uh_viewItem.asp?idProduct=7870"&gt;SK-6374-170&lt;/a&gt; motors are falling apart due to poor construction and lack of a large radial can bearing. (And unrelenting abuse...) I will try replacing them with &lt;a href="http://www.hobbyking.com/hobbyking/store/uh_viewItem.asp?idProduct=18181"&gt;SK3-6464-190&lt;/a&gt;'s I bought for a potential tinyKart swap a while ago. They have a &amp;nbsp;can bearing and should be able to run to higher speeds without shaking themselves apart. They also weigh 1/3lb less, each. But, they have a higher resistance (37mΩ as opposed to 23mΩ), so they will generate more heat and/or less torque. Testing to come soon...&lt;br /&gt;&lt;br /&gt;In the large motor category, there is also a durian class and a guava class that are relatively new and nicely-built. If you're interested in inexpensive RC plane motors that can be re-purposed into electric vehicle traction applications, this consolidated inventory list might help you choose.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8200098102909041178-5284947604634998561?l=scolton.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scolton.blogspot.com/feeds/5284947604634998561/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scolton.blogspot.com/2011/10/melon-checker-now-with-more-fruits.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/5284947604634998561'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/5284947604634998561'/><link rel='alternate' type='text/html' href='http://scolton.blogspot.com/2011/10/melon-checker-now-with-more-fruits.html' title='Melon Checker: Now with more fruits.'/><author><name>Shane Colton</name><uri>http://www.blogger.com/profile/10603406287033587039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8200098102909041178.post-2379664950298394001</id><published>2011-10-18T21:54:00.000-07:00</published><updated>2011-10-19T06:45:52.234-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tinykart'/><title type='text'>Okay, tinyKart frightens me now.</title><content type='html'>&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;So it turns out tinyKart was hiding something...&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;iframe allowfullscreen="" frameborder="0" height="274" src="http://www.youtube.com/embed/eoCMp9fdZl8?rel=0" width="480"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;...and by something I mean about half its full power. I know I've had nothing but&amp;nbsp;&lt;a href="http://scolton.blogspot.com/2011/08/tinykart-round-5.html"&gt;good things to say&lt;/a&gt;&amp;nbsp;so far about tinyKart, but somehow I think I underestimated it. tinyKart. Kicks. Serious. Ass. We need to make more of these things right away and race them against each other.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-pNWrO9J1cTE/Tp5JNf1Y-JI/AAAAAAAABP0/itreZ6RIzUY/s1600/dn16.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/-pNWrO9J1cTE/Tp5JNf1Y-JI/AAAAAAAABP0/itreZ6RIzUY/s400/dn16.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;a href="http://scolton.blogspot.com/p/cap-kart.html#tinykart"&gt;tinyKart&lt;/a&gt;&amp;nbsp;was the Edgerton Center Summer Engineering Workshop's 2011 project. It's an ultralight electric go-kart, something I've dreamed about ever since&amp;nbsp;&lt;a href="http://scolton.blogspot.com/p/cap-kart.html#capkart"&gt;Cap Kart&lt;/a&gt;. The total weight is 55lbs, it fits in the trunk of a car, and it has a trigger throttle. We took it to&amp;nbsp;&lt;a href="http://scolton.blogspot.com/2011/09/maker-faire-ny-2011.html"&gt;Maker Faire NY&lt;/a&gt;&amp;nbsp;a few weeks ago, and it was a lot of fun.&amp;nbsp;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;But it seems this entire time it's been operating with at least one powered-back controller. The left side Kelly&amp;nbsp;&lt;a href="http://kellycontroller.com/kbs3610140a24-36v-mini-brushless-dc-controller-p-502.html"&gt;KBS36101&lt;/a&gt;&amp;nbsp;would give a "frequent reset" error and, at high sustained load, cut out entirely, leaving the kart with half power. The right side would also give errors occasionally, but rarely cut out. Then, I tried the parking garage climb and both sides cut out at full throttle. I was getting ready to ditch everything and put in my own controllers.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;I guessed that the problem was bad sensor timing. I've seen it before on KBS controllers. The timing is off enough that the drive voltage and back EMF don't match up, leading to current spikes that trigger the controller's protective features. It's exaggerated by the low inductance of the brushless airplane motors. So, I went to carefully re-position the external Hall-effect sensors...&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-BnJ_d_hxAuo/Tp5MjJY1eCI/AAAAAAAABP8/7sKrtodGVpk/s1600/dn18.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-BnJ_d_hxAuo/Tp5MjJY1eCI/AAAAAAAABP8/7sKrtodGVpk/s400/dn18.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;...or actually the entire sensor mount just disintegrated because I&amp;nbsp;&lt;a href="http://mitrocketscience.blogspot.com/2010/08/done-for-summer.html"&gt;failed to remember&lt;/a&gt;&amp;nbsp;that Loctite and plastic parts do not play nicely together. For now, I had no choice but to make a new one and forgo the Loctite, but for the future I am switching over to PCB-mounted sensors:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-WTLDfj2ApZ4/Tp5Owt1ndfI/AAAAAAAABQE/0udXmTHn39w/s1600/dn15.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="278" src="http://4.bp.blogspot.com/-WTLDfj2ApZ4/Tp5Owt1ndfI/AAAAAAAABQE/0udXmTHn39w/s400/dn15.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;In addition to fixing the sensors in the&amp;nbsp;&lt;a href="http://mitrocketscience.blogspot.com/2011/08/hall-effect-sensor-placement-for.html"&gt;correct positions&lt;/a&gt;&amp;nbsp;and providing for up to 60º (electrical) of adjustment, the board also has a pair of jumpers which can be used to swap two sensor leads, for easy reversing. Much better than having to dig through the software, anyway. These are the first PCBs I've attempted with internal routing, in addition to the curved outside shape. It was a good opportunity to try out&amp;nbsp;&lt;a href="http://www.myropcb.com/"&gt;MyRO PCB&lt;/a&gt;, since&amp;nbsp;&lt;a href="http://www.4pcb.com/"&gt;Advanced Circuits&lt;/a&gt;&amp;nbsp;does not allow internal routing on their $33 Each or Bare Bones deal. (Advanced Circuits' $33 Each deal&amp;nbsp;&lt;i&gt;does&lt;/i&gt;&amp;nbsp;handle complex outside dimensions, though, as evidenced by the so-named&amp;nbsp;&lt;a href="http://scolton.blogspot.com/2011/09/i-should-put-pcb-quadrotor-away.html"&gt;4pcb quadrotor&lt;/a&gt;.) I've dealt with MyRO before, and it seems okay. So I ordered six of these boards in a tab-routed panel...&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-yKGKZSnxsAU/Tp5QNtPuSkI/AAAAAAAABQM/F4x_VeF77UA/s1600/dn17.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="128" src="http://3.bp.blogspot.com/-yKGKZSnxsAU/Tp5QNtPuSkI/AAAAAAAABQM/F4x_VeF77UA/s320/dn17.jpg" width="320" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="font-size: 13px; text-align: center;"&gt;...at least, I think I did.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;The process I use for "timing" the motors is pretty simple. I set the throttle limit on the Kelly controllers to 30%, so that I can tune the sensors at a reasonable wheels-up speed without much frame vibration. Then, at max (30%) throttle, I move the sensor mount by hand within its 60º (electrical) of adjustable range until the current going into the controller is at a minimum. If the minimum is at an extreme of the adjustable range, I swap motor leads and/or reverse the direction of commutation and try again.&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Minimum current means the back EMF and drive voltage are as close to in-phase as possible. (At no load / assuming zero inductance,&amp;nbsp;&lt;a href="http://scolton.blogspot.com/2010/01/3ph-duo-wrap-up-part-1-field-oriented.html"&gt;blah blah blah&lt;/a&gt;.)&amp;nbsp;With the new acrylic sensor mounts, I did this quickly with my clamp meter, then reset the max throttle to 75% (because the controllers and motors may or may not explode above 40,000 electrical rpm.).&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;And...well, a new tinyKart was born, apparently. One that is much more evil than the original one. It will happily give full power on both motors now, right up to the motor current limit (80A per side) or the battery input current limit (60A per side), or the maximum throttle (75%), whichever is lower. It accelerates as fast as Cap Kart and might even hit the same top speed if not for the throttle limit. No more play toy...it recorded a peak input power of 4.1kW on the hill climb. And the motors only eat about 200W each to heating at that power, so it's probably putting out very nearly 5hp now.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;With the new, scarier tinyKart, I also took the opportunity to re-balance the two front disk brakes and change the steering ratio to give more travel on the steering wheel, and hence more mechanical advantage over the wheels. As if we had actually planned ahead, this only involved moving some pin joints to pre-drilled adjustment holes:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-sc0D23ElGnI/Tp5Ua9TUMAI/AAAAAAAABQU/pP8cdPu0A6g/s1600/dn19.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/-sc0D23ElGnI/Tp5Ua9TUMAI/AAAAAAAABQU/pP8cdPu0A6g/s400/dn19.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="font-size: 13px; text-align: center;"&gt;Drive link gets shorter by moving the ball joints closer to the steering column...&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-2H1ro9p2HcA/Tp5UdF90YPI/AAAAAAAABQc/F4cRMY6Vncc/s1600/dn20.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-2H1ro9p2HcA/Tp5UdF90YPI/AAAAAAAABQc/F4cRMY6Vncc/s400/dn20.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;...and follower link gets longer by moving the pin joint away from the kingpin.&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;The length of the tie rods also changes, but that is adjustable by nuts on a threaded rod. I don't think it could have been any easier.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;After that, we took it back to the parking garage (along with some&amp;nbsp;&lt;a href="http://www.etotheipiplusone.net/?page_id=1216"&gt;other things&lt;/a&gt;) and the video above is the result. With 5hp available, narrow drive wheels, and low-traction parking garage concrete, it would happily lose grip coming out of turns, even while hitting the uphill slopes. That was a little surprising. But what I find amazing is that it actually happily re-finds grip as well. It does what I would expect a go-kart to do when I steer against a drift and adjust the power. This thing that we built with 80/20 and McMaster parts behaves the way I think it should, presumably from some experience driving real go-karts... I like it.&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;span id="goog_31674878"&gt;&lt;/span&gt;&lt;span id="goog_31674879"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8200098102909041178-2379664950298394001?l=scolton.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scolton.blogspot.com/feeds/2379664950298394001/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scolton.blogspot.com/2011/10/okay-tinykart-frightens-me-now.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/2379664950298394001'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/2379664950298394001'/><link rel='alternate' type='text/html' href='http://scolton.blogspot.com/2011/10/okay-tinykart-frightens-me-now.html' title='Okay, tinyKart frightens me now.'/><author><name>Shane Colton</name><uri>http://www.blogger.com/profile/10603406287033587039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://img.youtube.com/vi/eoCMp9fdZl8/default.jpg' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8200098102909041178.post-6041586056248486456</id><published>2011-10-08T23:24:00.000-07:00</published><updated>2011-10-19T06:45:34.457-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='singapore'/><category scheme='http://www.blogger.com/atom/ns#' term='pneu'/><title type='text'>Singapore Post</title><content type='html'>I was in Singapore again last week for the&amp;nbsp;&lt;a href="http://www.sutd.edu.sg/"&gt;Singapore University of Technology and Design&lt;/a&gt;'s first ever Open House.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-acXtIKVUyn4/TpEjrrta4vI/AAAAAAAABPY/AokmrZ0zk18/s1600/oh03.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-acXtIKVUyn4/TpEjrrta4vI/AAAAAAAABPY/AokmrZ0zk18/s400/oh03.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;When I went to Singapore &lt;a href="http://scolton.blogspot.com/2010/11/gecko-works-stuffsg-pneu-scooter-meche.html"&gt;last year&lt;/a&gt;, SUTD had just the two upper floors of a Chinese language school, mostly for administrative offices. Now, it has fully moved in to the interim campus, part of the &lt;a href="http://maps.google.com/maps?q=20+Dover+Drive+Singapore+138682&amp;amp;hnear=20+Dover+Dr,+Singapore+138682&amp;amp;gl=us&amp;amp;t=m&amp;amp;z=16&amp;amp;vpsrc=0"&gt;ITE Dover Campus&lt;/a&gt;. We built up a small workshop ("&lt;a href="http://2.bp.blogspot.com/_bcej-id-XqQ/TM6-RS5B92I/AAAAAAAAA2U/Zt7W_8R3o3c/s1600/sg56.jpg"&gt;the shed&lt;/a&gt;" or &lt;a href="http://2.bp.blogspot.com/_bcej-id-XqQ/TN0x3yIUcYI/AAAAAAAAA3c/7jQ3AM_D3lw/s1600/IMG_4000.jpg"&gt;Gecko Works&lt;/a&gt;) at the &lt;i&gt;interim&lt;/i&gt; interim campus, which has now been transplanted to a room at the interim campus:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-sMACOdslv3I/TpElqKJs8pI/AAAAAAAABPc/kW0Lv-G_nME/s1600/oh12.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/-sMACOdslv3I/TpElqKJs8pI/AAAAAAAABPc/kW0Lv-G_nME/s400/oh12.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;It was cool to see the shop space I helped put together actually being used by future SUTD students and faculty to work on projects. I was expecting the interim campus to have a full shop, since it was formerly part of a technical institute, but it seems Gecko Works is still the primary fabrication space for SUTD. That makes our trip last year seem like a pretty good investment of time, actually.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;As you can see in the above picture, &lt;a href="http://www.etotheipiplusone.net/?p=1580"&gt;Charles&lt;/a&gt; and I significantly increased the number of moving vehicles on campus, as usual. But in fact, some of the future SUTD students have been forming an Electric Vehicle Team of their own, using an electric bike we got from &lt;a href="http://www.mkp.com.sg/"&gt;MKP Bikes&lt;/a&gt; last year as their first vehicle. It's been converted to a chopper bike, and now runs on a frightening amount of lithium polymer battery. You can see it towing half of the SUTD student population here:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;iframe allowfullscreen="" frameborder="0" height="274" src="http://www.youtube.com/embed/VVEEyM1FacM?rel=0" width="480"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;Also featured in the video above are a fire ant-motivated top speed test of &lt;a href="http://scolton.blogspot.com/p/bwd-scooter.html#pneu"&gt;Pneu Scooter&lt;/a&gt; and Charles taking&amp;nbsp;&lt;a href="http://www.etotheipiplusone.net/?page_id=978"&gt;RazEr Revolution&lt;/a&gt;'s name literally.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-HL39LtCzbNU/TpExolzbUII/AAAAAAAABPg/xulApWc7NS4/s1600/speedrun1.gif" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="265" src="http://1.bp.blogspot.com/-HL39LtCzbNU/TpExolzbUII/AAAAAAAABPg/xulApWc7NS4/s400/speedrun1.gif" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Pneu Scooter's officially-measured fire ant-induced top speed: 21mph.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;Pneu Scooter actually took its very first test drive in Singapore last year. I &lt;a href="http://scolton.blogspot.com/2010/11/pneu-scooter-singapore-edition.html"&gt;finished building the frame and began testing on my 3ph v3.x line of controllers&lt;/a&gt; during my last trip. Unfortunately, the v3.0 controller had serious electrical noise issues, so I redesigned it when I got back and wound up with the &lt;a href="http://scolton.blogspot.com/p/motor-controllers.html#hd"&gt;v3.1&lt;/a&gt;, which has been ultra-reliable for almost a year now...&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;...and then two of them broke on this trip. I don't really know what happened since both times it was being ridden by someone other than myself. (Not that I would know what exactly caused the failure if I was riding it, but I could at least eliminate some possible causes.) My theories are:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;/div&gt;&lt;ol&gt;&lt;li style="text-align: left;"&gt;The ambient temperature in Singapore is just that much higher than it is in Boston, and the FETs failed due to thermal overload after basically racing it around all day.&lt;/li&gt;&lt;li style="text-align: left;"&gt;Since &lt;a href="http://scolton.blogspot.com/2011/09/maker-faire-ny-2011.html"&gt;replacing the rear wheel&lt;/a&gt; a few weeks ago, the motor timing had shifted enough to cause commutation failure, leading to a destructive current spike.&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&lt;div style="text-align: left;"&gt;I would weight theory #2 a bit more heavily since both controllers (the original and the spare) had the same phase fail. In any case, having burned through even my spare controller and having neglected to pack an extra &lt;a href="http://ixdev.ixys.com/DataSheet/GWM100-01X1.pdf"&gt;IXYS module&lt;/a&gt;, I went back to MKP Bikes for Plan B: an off-the-shelf e-bike controller similar to &lt;a href="http://4.bp.blogspot.com/_bcej-id-XqQ/TN03kh5tVtI/AAAAAAAAA3o/Icc0TWLSt_c/s1600/ns94.jpg"&gt;the one I used in Singapore last time when my controller also failed&lt;/a&gt;. With that, I was able to get through the Open House. When I got back to Cambridge, I promptly changed the FETs on my controller:&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-F5k9tCxP6yw/TpE1rbEj2JI/AAAAAAAABPk/HrFLfXV2bJk/s1600/tp08.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/-F5k9tCxP6yw/TpE1rbEj2JI/AAAAAAAABPk/HrFLfXV2bJk/s400/tp08.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Precision MOSFET removal tool.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;All the gate drive was in working order, which is unusual after a FET failure. I re-timed the motor and have been riding it around with no issues, so I still have no idea what the problem was. I am going to pretend that nothing ever happened. But I did buy all the GWM100 IXYS modules remaining on the internet.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Scootering around at the Open House was not the only thing I did in Singapore for a week. Earlier, we visited a place called &lt;a href="http://www.evhub.co/"&gt;evHUB&lt;/a&gt;, which is a Singapore-based electric vehicle conversion and R&amp;amp;D house. They &amp;nbsp;have a somewhat hidden EV showroom/dealership with the name FSG Mobility Concepts, where I continued my trend of finding Tesla Roadsters scattered around outside the US.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-TLgz_iMtlww/TpE27ymvgmI/AAAAAAAABPo/5Z-Lgzznl5k/s1600/oh53.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/-TLgz_iMtlww/TpE27ymvgmI/AAAAAAAABPo/5Z-Lgzznl5k/s400/oh53.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;In addition to the Tesla, FSG also carries the &lt;a href="http://www.yikebike.com/"&gt;YikeBike&lt;/a&gt;. Rather than dedicate a paragraph of this post to describing the YikeBike, I'll just put in a video of us attempting to ride it:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;iframe allowfullscreen="" frameborder="0" height="274" src="http://www.youtube.com/embed/iltAkAUi8eY?rel=0" width="480"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="text-align: left;"&gt;I think the evHUB crew had an easier time learning how to handle Pneu Scooter than I had learning how to ride the YikeBike. Also the YikeBike is more expensive than Pneu Scooter by about the same ratio as the Tesla Roadster is to the YikeBike. So I'll stick with the kick scooters for now.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;I also brought over 4pcb, my mini PCB quadrotor. It still doesn't fly spectacularly, but I wanted to bring it because I was meeting up with Ali S. to see his somewhat larger quadrotor in action...&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-zJd_WdVX6qI/TpE5bdZrfWI/AAAAAAAABPs/J90JxDL__eY/s1600/oh51.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-zJd_WdVX6qI/TpE5bdZrfWI/AAAAAAAABPs/J90JxDL__eY/s400/oh51.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Recursive quadrotors...&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;The exhibition hall actually turned out to be a perfectly reasonable place to fly a mini quadrotor and a perfectly suicidal place to test the one with 10" blades. For that reason, the mini one got a bit more air time. Here it is taking a few short hops:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;iframe allowfullscreen="" frameborder="0" height="315" src="http://www.youtube.com/embed/08e7ei7wYcg?rel=0" width="560"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;It still needs work. After returning, I replaced the one weak motor and it at least hovers level now. But at some point in the near future I will replace the IMU with a different board. Not because I think it will necessarily handle the vibrations better, but because I am just sick of dealing with this one. And because Sparkfun doesn't make this one anymore.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;I also got to visit most of my favorite Singaporean hobby shops and industrial centers. (I am such a bad tourist...) So overall, another successful trip to Singapore. I don't know how frequently I'll be going back, but I'm sort-of used to the climate and I seem to have a system for dealing with jet-lag. (I just sleep for the entire 25-hour set of flights.) Soon, there will be actual students and classes at SUTD, so maybe I'll go for an entire semester next year.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-YDZ6EN3I44w/TpE7KbAbvoI/AAAAAAAABPw/2Ort50bAO9Q/s1600/oh26.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="400" src="http://1.bp.blogspot.com/-YDZ6EN3I44w/TpE7KbAbvoI/AAAAAAAABPw/2Ort50bAO9Q/s400/oh26.jpg" width="300" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Because clearly this is my type of university.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;For now, though, I have resolved to stop doing anything resembling a demo/expo/faire/whathaveyou for at least a few months. For one, I'm tired of answering misinformed technical questions from the slightly-more-tech-savvy-than-general public. I might just sound cranky but there's only so many times you can explain that MEMS rate sensors are not the same as flywheel gyroscopes without going crazy. Secondly, I am tired of having my vehicles turned into amusement park rides and then having to repair them after every event. And most importantly, I don't actually get any work done on new projects when I'm constantly exhibiting old ones. It's fun, but I need a break, so no more demos until at least IAP.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Now, what was I working on?...&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8200098102909041178-6041586056248486456?l=scolton.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scolton.blogspot.com/feeds/6041586056248486456/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scolton.blogspot.com/2011/10/singapore-post.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/6041586056248486456'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/6041586056248486456'/><link rel='alternate' type='text/html' href='http://scolton.blogspot.com/2011/10/singapore-post.html' title='Singapore Post'/><author><name>Shane Colton</name><uri>http://www.blogger.com/profile/10603406287033587039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-acXtIKVUyn4/TpEjrrta4vI/AAAAAAAABPY/AokmrZ0zk18/s72-c/oh03.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8200098102909041178.post-8507238522344412486</id><published>2011-09-20T17:00:00.000-07:00</published><updated>2011-10-19T06:45:19.332-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='twitch'/><category scheme='http://www.blogger.com/atom/ns#' term='maker faire'/><category scheme='http://www.blogger.com/atom/ns#' term='tinykart'/><category scheme='http://www.blogger.com/atom/ns#' term='pneu'/><title type='text'>Maker Faire NY 2011</title><content type='html'>Last weekend I went down to the World &lt;a href="http://makerfaire.com/"&gt;Maker Faire&lt;/a&gt; in New York, along with some of the other builder-types from MIT and the Summer Engineering Workshop crew. Needless to say, we were responsible for most of the rideable objects on our side of the Faire:&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;iframe allowfullscreen="" frameborder="0" height="301" src="http://www.youtube.com/embed/OOLkBiJ0wKQ?rel=0" width="400"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I've been to the &lt;a href="http://www.youtube.com/watch?v=ppmR-RP5GWY"&gt;Cambridge Mini Maker Faire&lt;/a&gt; twice, but this was my first experience with one of the three World Maker Faire events. While the Mini Maker Faire probably attracts a crowd of a few thousand, the World Maker Faire numbers must be in the several tens of thousands. First off, I was amazed that a handful of people actually knew me from my blog, so here's a shout-out to the people who came by my table to say hi. I'm not as famous as &lt;a href="http://blog.makezine.com/archive/2011/09/tear-it-up-off-road-with-this-motorized-tread-skateboard.html"&gt;certain people&lt;/a&gt;,&amp;nbsp;but it's cool to meet my blog readers in person.&lt;br /&gt;&lt;br /&gt;Also present was &lt;a href="http://lmh-tech.blogspot.com/"&gt;Max H.&lt;/a&gt;, who brought &lt;a href="http://lmh-tech.blogspot.com/search/label/TOBL"&gt;TOBL&lt;/a&gt; to show off, and most of the &lt;a href="http://scolton.blogspot.com/p/cap-kart.html#tinykart"&gt;tinyKart&lt;/a&gt; crew. A large sampling of the &lt;a href="http://miters.mit.edu/"&gt;MITERS&lt;/a&gt; builders came down from Cambridge as well to show off a &lt;a href="http://t3chnolochic.blogspot.com/2011/09/make-magazine-thinks-im-shiny-d.html"&gt;pair of sound-reactive EL shutter shades&lt;/a&gt;, &lt;a href="http://tcengineering.wordpress.com/archive-of-projects/deathla-coil-v1-drsstc/"&gt;giant Tesla coil driver&lt;/a&gt;, &lt;a href="http://www.etotheipiplusone.net/?page_id=1114"&gt;3D printer&lt;/a&gt;, &lt;a href="http://www.etotheipiplusone.net/?page_id=576"&gt;battlebot&lt;/a&gt;, &lt;a href="http://www.etotheipiplusone.net/?p=1570"&gt;tankboard&lt;/a&gt;, &lt;a href="http://www.etotheipiplusone.net/?page_id=978"&gt;hub motor kick scooter&lt;/a&gt;, eddy current clock, and &lt;a href="http://orangenarwhals.blogspot.com/2011/09/summer-rideable-hexapod-check.html"&gt;rideable freakin' hexapod&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;For my part, I decided that I would attempt to bring &lt;i&gt;five&lt;/i&gt;&amp;nbsp;projects. First, my three Maker Faire veterans, &lt;a href="http://scolton.blogspot.com/p/bwd-scooter.html#pneu"&gt;Pneu Scooter&lt;/a&gt;, &lt;a href="http://scolton.blogspot.com/p/robots.html#twitch"&gt;Twitch&lt;/a&gt;, and &lt;a href="http://scolton.blogspot.com/p/self-balancing-things.html#segstick"&gt;SegStick&lt;/a&gt;. Additionally, I brought &lt;a href="http://scolton.blogspot.com/2011/09/i-should-put-pcb-quadrotor-away.html"&gt;4pcb&lt;/a&gt;, which turned out to be an attention-getter even though I did not even attempt to fly it. I would say that quadrotors are the new Segways - the current obsession of every random tech-savvy person. But in fact, Segways are still the new Segways. For some reason, no matter what else I bring, I can't escape the Segway people.&amp;nbsp;Then again, I've said a few times that the quadrotor is just two Segways and a FIRST robot, so maybe it's all inherited from one parent class of silly self-stabilizing objects.&lt;br /&gt;&lt;br /&gt;So before I get angry, &lt;i&gt;Yes, it does have an angular rate sensor, commonly known as a "gyro" for historical reasons. No, there is no mechanical flywheel keeping it balanced. No, it does not use a Kalman filter. And yes, it runs just fine on an Arduino, and it doesn't even use that much of its processing power because the code is very, very simple...much simpler than you want to think.&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;And that's all I want to say about quadrotors and self-balancing platforms. But here are the Maker Faire recaps for the more interesting projects:&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;tinyKart:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-hv4CGfmjrf0/Tnjx1ta3pJI/AAAAAAAABOU/7nazvthLOPs/s1600/mf02.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/-hv4CGfmjrf0/Tnjx1ta3pJI/AAAAAAAABOU/7nazvthLOPs/s400/mf02.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;That's tinyKart in the trunk of a Ford Fusion. I loaded it into the trunk myself in about 10 minutes. It involved taking out 12 cap screws and sliding the two halves apart, then flipping the front half over so that the steering wheel rested in the seat. The back half weighs less than 40lbs and the front half weighs less than 20lbs. There was even enough extra room in the trunk for &lt;a href="http://tcengineering.wordpress.com/"&gt;Tyler&lt;/a&gt;'s monster Tesla coil driver.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-mVC9x3Cr9N0/Tnjytrblu3I/AAAAAAAABOY/rT_UyBcSsbg/s1600/mf06.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/-mVC9x3Cr9N0/Tnjytrblu3I/AAAAAAAABOY/rT_UyBcSsbg/s400/mf06.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;In terms of making an ultralight, ultra portable go-kart, I consider this trip a huge success. We like to make things that don't exist, and an ultralight electric go-kart is something new. There is the &lt;a href="http://www.razor.com/us/products/electricrideons/specs.html?name=Ground+Force"&gt;Razor Ground Force&lt;/a&gt;, which is the same weight (55lbs) as tinyKart but there really is no comparison. Which brings me to my next point:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;tinyKart is absolutely freaking awesome as a go-kart.&amp;nbsp;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-UqFdXuM1Ycw/Tnj7lzIXI6I/AAAAAAAABOg/TLtLyhmsX0U/s1600/mf32.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/-UqFdXuM1Ycw/Tnj7lzIXI6I/AAAAAAAABOg/TLtLyhmsX0U/s400/mf32.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Just look what reverse did to this dude's hair...&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;We drove it all weekend and it is actually amazing to me that we built such a thing from scratch. It's a totally different experience from &lt;a href="http://scolton.blogspot.com/p/cap-kart.html#capkart"&gt;Cap Kart&lt;/a&gt; and most other go-karts I've driven, and it's more fun than any of them.&amp;nbsp;"Sprightly" might be a good word. I really don't know. It darts around in ways that defy its narrow tires and flex-y frame.&amp;nbsp;The acceleration is good too, despite the lack of &lt;a href="http://web.mit.edu/scolton/www/aremelons.html"&gt;more formidable&lt;/a&gt; brushless motors. The trigger throttle just makes it even more of a unique experience. And the brakes are so good that I worry about bending the steering wheel from the deceleration force. I really would not change a single thing about the mechanical design...it's pure win.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-COOBdz6Pvxc/Tnj7g8nVCDI/AAAAAAAABOc/6VWqdXI-Lxw/s1600/mf34.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-COOBdz6Pvxc/Tnj7g8nVCDI/AAAAAAAABOc/6VWqdXI-Lxw/s400/mf34.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;"If it's going to break, it's going to break now." -Max&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;It even does things it shouldn't, like off-roading. We took it on slippery grass and dirt, and it was even more fun than on asphalt. The flex-y frame doesn't mind at all and the 17mm aluminum wheel axles, which are probably the weakest link in the structural loop, survived both the shock load from bumps and side load from drifting.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Pretty much the only things that isn't 100% perfect are the controllers. Maybe I just have a high standard for motor control...well okay, I definitely do...but the Kelly controllers just aren't quite up to the task of driving full load into these motors. They cut out&amp;nbsp;occasionally, leaving you with half power for a second or two. I'm learning the acceleration threshold that works, but the motors can handle more power so I feel the urge now to give tinyKart a set of controllers that can, too.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Pneu Scooter:&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;A few days before Maker Faire, Pneu Scooter got a flat rear tire. I knew it would happen eventually because the front tire got a flat about a month ago. Unfortunately, the 6" pneumatic casters are not conducive to easy tire/tube changes. I thought they would be, which was one of the motivators for using pneumatic tires in the first place, but as it turns out, barring special tooling, it's easier to change the entire wheel. So changing the rear wheel means taking apart the hub motor. But, really, Pneu Scooter has been ultra-reliable, so this is more like scheduled maintenance than a design flaw.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-xoN5s3WV4LU/TnkaQddWjOI/AAAAAAAABOk/JyxrBFpsizo/s1600/nt23.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-xoN5s3WV4LU/TnkaQddWjOI/AAAAAAAABOk/JyxrBFpsizo/s400/nt23.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Could use a cleaning while I'm at it...&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;So I opened the motor for the first time since it was built. The process is pretty simple. The only tricky part is getting the three phase wires out, since they are soldered to connectors. To fit back through the bearing, they needed to be de-soldered and shoved back into the axle slot. Here are some pictures from the teardown, with everything dirty but intact:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/--wkMYGv_DXQ/Tnkax6IpI-I/AAAAAAAABOo/_OMvDoVPCFY/s1600/nt26.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/--wkMYGv_DXQ/Tnkax6IpI-I/AAAAAAAABOo/_OMvDoVPCFY/s400/nt26.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Windings.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-m9I1jT7hAP8/TnkbBggRZaI/AAAAAAAABOs/viJe4OAHCu4/s1600/nt28.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-m9I1jT7hAP8/TnkbBggRZaI/AAAAAAAABOs/viJe4OAHCu4/s400/nt28.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Outer spacer.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-_N7uaPMaLFY/TnkbEsb0b8I/AAAAAAAABOw/kUnZ3eBBNrE/s1600/nt29.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-_N7uaPMaLFY/TnkbEsb0b8I/AAAAAAAABOw/kUnZ3eBBNrE/s400/nt29.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Dirty rotor.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-Z9UypqVYAVI/TnkbHGWDzII/AAAAAAAABO0/gG6fKPAJznc/s1600/nt30.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-Z9UypqVYAVI/TnkbHGWDzII/AAAAAAAABO0/gG6fKPAJznc/s400/nt30.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Awesome adapter ring.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;After taking off the adapter ring, I could get a good look at the rim and tire to see where the damage occurred. I suspected that the tire and tube had been punctured by screws that hold the ring onto the plastic rim. (The front tire suffered a similar failure.) Sure enough, I found a bunch of slashes like this:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-3i_CBJu9vYs/TnkbtxAAIhI/AAAAAAAABO4/NW0YzU1Fj_g/s1600/nt31.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/-3i_CBJu9vYs/TnkbtxAAIhI/AAAAAAAABO4/NW0YzU1Fj_g/s400/nt31.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;I guess the screws were wearing through the tire and eventually the tube over time. The solution is so simple that I have no idea why I didn't do it in the first place.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-Dr7_NfRw08k/Tnkb89lCNRI/AAAAAAAABO8/Qo7uvO3_HTU/s1600/nt32.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-Dr7_NfRw08k/Tnkb89lCNRI/AAAAAAAABO8/Qo7uvO3_HTU/s400/nt32.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Duhhhh...&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;So I put the motor back together with the shorter screws and Pneu Scooter was back up an running in less than three hours...&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-1HfeaZIXXwU/TnkcKjz1iaI/AAAAAAAABPA/pNU2LcxXS14/s1600/nt33.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/-1HfeaZIXXwU/TnkcKjz1iaI/AAAAAAAABPA/pNU2LcxXS14/s400/nt33.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;...which is great, because it actually came in really handy during Maker Faire. Not only was it the only one of my vehicles that I actually felt reasonably safe letting the annoying little kids ride, but it turned out to be the best way to get from the Citi Field parking lot to the Maker Faire itself. There were shuttle buses, but they were crowded and only took you about 60% of the distance anyway. So, I just took the scooter instead.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Twitch&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Twitch also had some lingering wheel problems before Maker Faire. Specifically, the press fit holding the custom aluminum hubs to the plastic &lt;a href="http://www.vexrobotics.com/products/accessories/motion/276-2185.html"&gt;Vex omniwheels&lt;/a&gt; had failed on one wheel, making it hard to drive. It's happened before and I've resorted to epoxy for a quick fix, but I wanted to make a more permanent solution before the Faire. So, I manned up and got on the lathe...&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-dktCOc1uZKU/TnkdW5gt7jI/AAAAAAAABPE/Lb8JZvLsbBQ/s1600/twitch27.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/-dktCOc1uZKU/TnkdW5gt7jI/AAAAAAAABPE/Lb8JZvLsbBQ/s400/twitch27.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;...and then the mill...&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-ArN0NkLKfvw/Tnkdg-Ry52I/AAAAAAAABPI/h3RTOJXkIaE/s1600/twitch28.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/-ArN0NkLKfvw/Tnkdg-Ry52I/AAAAAAAABPI/h3RTOJXkIaE/s400/twitch28.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;... to turn out some new hubs that will actually bolt onto the wheel instead of relying on a press fit into flimsy plastic. The six-bolt pattern lines up with the spokes such that 1/4-20 screws rest against the inside surfaces to positively transmit torque to the wheel. I only put on one new hub for now, but I have the full set for when the remaining press fits fail.&amp;nbsp;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;As I was doing this, though, some other problems revealed themselves. One of the linkages had a stripped-out hole, and one of the servos that drive the linkages was also damaged. I suspect both were symptoms of the wheels running into hard stops while the servo continues to drive the linkage. So far, I've only been calibrating the servos by hard-coding in soft-stop values, but they change every time I take the robot apart and put it back together.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-QFmCOjDkLCA/TnkeXiwNKbI/AAAAAAAABPM/TCdcJ22h9OM/s1600/twitch29.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-QFmCOjDkLCA/TnkeXiwNKbI/AAAAAAAABPM/TCdcJ22h9OM/s400/twitch29.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Twitchguts, if you don't remember.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;I decided that after replacing the servo and fixing the linkage, the best way to prevent this problem from happening again would be to just write the damn trim software the way it should be written.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-Hs4_kvWeWMw/Tnke9aoPdSI/AAAAAAAABPQ/0d-FJqmP8_A/s1600/twitch30.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-Hs4_kvWeWMw/Tnke9aoPdSI/AAAAAAAABPQ/0d-FJqmP8_A/s400/twitch30.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Now the servos each have a software-settable minimum and maximum value. Through some coding trickery I was able to "or" the calibrate state with the normal drive states (forward, sideways, omnidirectional) so that you can trim the servo end positions while in any one of the states. This is useful since the servo maxima occur in the forward state and the minima occur in the sideways state. And just for extra software hacker cred, I save all the trims to a text file that automatically loads when the program starts up.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Twitch was, as usual, a constant source of entertainment that filled in the gaps well while the vehicles were charging. Part of the fun of Twitch is that nobody (or very few people) have ever seen a robot move the way it does. I am finally able to drive it in the way that it deserves, making smooth state changes and combining rotation and translation in ways that just look cool. It took a lot of practice, but I feel like Twitch is finally living up to its potential. And on that note I'll just leave this here...&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-aIpn9yL2ATE/TnkgxgO9D4I/AAAAAAAABPU/tkXs_hjSmPM/s1600/twitch26.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="333" src="http://3.bp.blogspot.com/-aIpn9yL2ATE/TnkgxgO9D4I/AAAAAAAABPU/tkXs_hjSmPM/s400/twitch26.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8200098102909041178-8507238522344412486?l=scolton.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scolton.blogspot.com/feeds/8507238522344412486/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scolton.blogspot.com/2011/09/maker-faire-ny-2011.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/8507238522344412486'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/8507238522344412486'/><link rel='alternate' type='text/html' href='http://scolton.blogspot.com/2011/09/maker-faire-ny-2011.html' title='Maker Faire NY 2011'/><author><name>Shane Colton</name><uri>http://www.blogger.com/profile/10603406287033587039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://img.youtube.com/vi/OOLkBiJ0wKQ/default.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8200098102909041178.post-818854664437953698</id><published>2011-09-13T12:51:00.000-07:00</published><updated>2011-09-13T13:16:56.132-07:00</updated><title type='text'>The great XBee 57.6kbps mystery finally solved.</title><content type='html'>Ever since I started using the &lt;a href="http://www.st.com/internet/mcu/product/216825.jsp"&gt;STM32F103&lt;/a&gt; microcontroller, I've been hindered by the inability to wirelessly program the way I could with my old &lt;a href="http://www.ti.com/product/msp430f2274?qgpn=msp430f2274"&gt;MSP430F2274&lt;/a&gt; setup. Which sucks because that's the entire point of the wootstick (Wireless bOOTloading). The wootstick is the MCU board I've used on all my motor controllers:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-B-2r7nWltyo/THyTVrasRWI/AAAAAAAAAv4/W90XBVFGj0g/s1600/hd09.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-B-2r7nWltyo/THyTVrasRWI/AAAAAAAAAv4/W90XBVFGj0g/s400/hd09.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The latest one, v2.0, has the STM32F103, an &lt;a href="http://www.ftdichip.com/Products/ICs/FT232R.htm"&gt;FTDI USB-to-UART converter&lt;/a&gt;, and an &lt;a href="http://www.digi.com/products/wireless-wired-embedded-solutions/zigbee-rf-modules/point-multipoint-rfmodules/xbee-series1-module#overview"&gt;XBee Series 1&lt;/a&gt; digital radio built on to a 3"x1" board with 2mm breakout headers. Ideally, it should:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Send and receive data over USB or over the XBee&amp;nbsp;as a virtual COM port&amp;nbsp;to a PC. Switching from USB to XBee wireless is seemless - no software modifications required on either side.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Be bootloader programmable through either the USB port or (with some configuration) the XBee radio. The latter option is the most useful to me, since it means the controller can be embedded in an enclosed system and still be programmed.&lt;/li&gt;&lt;/ul&gt;The USB interface works fine, but up to now, I've been able to get only half of the wireless functionality working. I can &lt;i&gt;either&lt;/i&gt;&amp;nbsp;wirelessly bootload &lt;i&gt;or&lt;/i&gt;&amp;nbsp;send and receive data over XBee, but not both.&amp;nbsp;Changing from one state to the other requires reconfiguring the XBee, which is impossible if the controller is embedded in, idk, say, a scooter.&lt;br /&gt;&lt;br /&gt;I decided I would solve this problem before moving forward on &lt;a href="http://scolton.blogspot.com/2011/07/sensorless-foc-more-analysis.html"&gt;sensorless field-oriented control&lt;/a&gt;, or rather, that I would use it as an excuse for not making any progress for so long... I figured it would only take a day of messing around to figure out why exactly this was happening, I just hadn't actually sat down and done it up to now.&lt;br /&gt;&lt;br /&gt;Then, as I was spending the last two weeks playing with the &lt;a href="http://scolton.blogspot.com/2011/09/i-should-put-pcb-quadrotor-away.html"&gt;PCB quadrotor&lt;/a&gt;, I ran into almost exactly the same problem. I tried to set up the Arduino Mini on the quadrotor to be wirelessly programmable, so that I would not have to tether it to my computer every time I want to change the controller. But I found that if I set the radio to the baud rate required for the bootloader (57.6kbps, same as the STM32F103), I would get intermittent communication under radio control. Furthermore, the problem went away under USB control with the same baud rate, which suggested a problem specific to the XBee radios. And I've seen &lt;a href="http://forums.digi.com/support/forum/printthread_thread,7092"&gt;other online sources&lt;/a&gt; that suggest XBee trouble at 57.6kbps. So I decided to dig a little deeper.&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-rRW1_mQumbI/Tm-IntlktII/AAAAAAAABN8/g5pOYa_E2U8/s1600/4p54.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-rRW1_mQumbI/Tm-IntlktII/AAAAAAAABN8/g5pOYa_E2U8/s400/4p54.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Step one was to round up all my XBees, minus the two high-power transceivers that &lt;a href="http://www.youtube.com/watch?v=Zf8_lP8MrkU"&gt;I have yet to get back from certain unscrupulous borrowers&lt;/a&gt;.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-b56Rgxrzw6E/Tm-KPJ8XdWI/AAAAAAAABOA/jxAfseKqeso/s1600/4p55.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="400" src="http://2.bp.blogspot.com/-b56Rgxrzw6E/Tm-KPJ8XdWI/AAAAAAAABOA/jxAfseKqeso/s400/4p55.jpg" width="300" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Step two was to find a &lt;i&gt;real&lt;/i&gt;&amp;nbsp;scope.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;As much as I love the &lt;a href="http://3.bp.blogspot.com/-4i7ZHgAS80U/TgFGKNr1k-I/AAAAAAAABDI/uNnCrSpx9-s/s1600/dd44.jpg"&gt;Tek 2445 analog scopes&lt;/a&gt; in &lt;a href="http://miters.mit.edu/"&gt;MITERS&lt;/a&gt; and the &lt;a href="http://web.mit.edu/Edgerton/"&gt;Edgerton Center&lt;/a&gt;, I absolutely needed a digital scope to see what was going on at the bit level of the PC-to-XBee-to-microcontroller serial communication. So I went down to the mechatronics lab, which I now have access to since I am apparently the TA for a &lt;a href="http://stellar.mit.edu/S/course/2/fa11/2.S994/index.html"&gt;new course&lt;/a&gt;. (Have you heard?!) And there are 12 brand-new four-channel Agilent digital storage oscilloscopes with all kinds of fancy features. They can even save waveforms as .png images to a flash drive. (Something I did not find out in time for this post, as you'll soon see.)&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Anyway, based on internet rumors, I suspected a problem with baud rate timing mismatch between the computer, XBee, and microcontroller. All are nominally set to 57.6kbps, but due to the limited clock frequency dividers on the XBee and the microcontroller, there is some error. First, the PC:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-gDejbq9jxXE/Tm-NJvCWZSI/AAAAAAAABOE/0gfQFY0N3ic/s1600/4p56.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-gDejbq9jxXE/Tm-NJvCWZSI/AAAAAAAABOE/0gfQFY0N3ic/s400/4p56.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;I zoomed way in on the first (start) bit of the transmission, something only possible with a nice set of working trigger and holdoff settings on the new scopes. The bit width is 17.34μs/b, the inverse of which is 57.67kbps. Within the error tolerance of the measurement, that's exactly correct. Next, the XBee:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-4IUU9ILwGc8/Tm-N5EiscVI/AAAAAAAABOI/KA0Bnzbqsys/s1600/4p57.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-4IUU9ILwGc8/Tm-N5EiscVI/AAAAAAAABOI/KA0Bnzbqsys/s400/4p57.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;A single bit on the XBee Tx pin was 17.00μs wide. This is 58.824kbps, which is what the internet suggests a XBee set to 57.6kbps actually is. The reason for this is because the XBee has a 16MHz crystal and an integer divider the produces the buad rate. If the integer divider is of the form 16MHz/(16*N), and N=17, then the exact baud rate is 58.824kbps. The next integer up, N=18, would yield 55.556kbps, which has a higher error than N=17. So the XBee uses N=17 assumes the PC can deal with the 2.1% error in baud rate, which it can.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Now here is where it gets interesting. The Arduino, when configured with Serial.begin(57600), showed up with a bit rate of 17.50μs. (Sorry, forget to take a picture of the scope...) This is 57.140kbps. It's consistent with an integer divider of the form 16MHz/(8*N) with N=35, and digging into the Arduino serial library source code suggests that this is in fact what happens. With an error of less than 1%, it's preferred over N=34, which would make it exactly equal to the XBee rate.&amp;nbsp;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;But, the error on the XBee is in the opposite direction as the error on the Arduino. So the total error of an XBee talking to an Arduino at 57.600kbps nominal is close to 3%. This is flirting with the maximum error tolerance of the USART, according to the &lt;a href="http://www.atmel.com/dyn/resources/prod_documents/doc8161.pdf"&gt;ATmega328 reference manual&lt;/a&gt;, page 193. (Seriously, RTFM, you will not find this information on www.arduino.cc.) When you factor in the +/-1% error tolerance of the ceramic resonator used to generate the Arduino's 16MHz clock, the chance for framing errors increases even more.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Why exactly it works in the bootloader but not during normal data transmission, I don't know. Maybe it has trouble picking up bytes that are adjacent to each other, or maybe the bootloader just has better software error checking to verify the program data is correct. In any case, I took the safe route and forced the Arduino baud rate to match the XBee baud rate exactly:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; Serial.begin(57600);&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; UCSR0A |= (1 &amp;lt;&amp;lt; U2X0);&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; UBRR0L = 33;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Which, now that I look at it, should be the same as:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; Serial.begin(57600);&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; UCSR0A &amp;amp;= ~(1 &amp;lt;&amp;lt; U2X0);&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; UBRR0L = 16;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;It's 16MHz / [16 * (16 + 1)] instead of 16MHz / [8 * (33 + 1)]. (&lt;/span&gt;&lt;a href="http://www.atmel.com/dyn/resources/prod_documents/doc8161.pdf"&gt;RTFM on page 179&lt;/a&gt;.)&amp;nbsp;The latter is preferable because slow mode has a wider error band. Either way, it forces the Arduino to have a bit rate of 58.824kHz, matching the XBee. This made the RC control much happier, and the bootloader still works. (It should be independent of the user code.)&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;But that was all for the Arduino. To test the clock speed deviation theory on the STM32F103, I took out DirectDrive and brushed the dust off of it:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/--I0dEyQeEbI/Tm-tkaA9GUI/AAAAAAAABOM/sUl6TD_Dwo8/s1600/dd71.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/--I0dEyQeEbI/Tm-tkaA9GUI/AAAAAAAABOM/sUl6TD_Dwo8/s400/dd71.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Wasn't I going to do something with this?&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;I checked the USART documentation for the STM32F103 against my code only to find that the USART clock divider has significantly more resolution. Instead of an integer clock speed divider of the form 16MHz/(16*N) it is essentially 16MHz/N, and I have N=278. (For some reason, it's not quite that simple, &lt;a href="http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/REFERENCE_MANUAL/CD00171190.pdf"&gt;RTFM page 768&lt;/a&gt;.) But the result is that it should be (and is) running at 57.55kbps. The error between this and the XBee baud rate should be within tolerance of the USART.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Additionally, sending and receiving data works just fine on the STM32F103 at 57.6kbps with 8-N-1 configuration. Only when set to 8-E-1 (even parity bit, required by the bootloader) would the wireless data transmission stop working. But the bootloader worked fine on 8-E-1, with the XBees properly configured for even parity. So now I had at least narrowed it down to a problem involving the parity bit configuration.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Interestingly, I had unknowingly managed to avoid the problem over USB, set at 57.6kbps 8-N-1, because the FTDI chip would automatically reconfigure to 8-E-1 when using the bootloader, then switch back to 8-N-1 when running user code. Only because the XBee radios are have a fixed parity setting did the problem seem to be a wireless-only issue.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;I think the theme of this post is &lt;i&gt;Read The Fucking Manual&lt;/i&gt;&amp;nbsp;because after only about 10 minutes of doing just that, I found the answer:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-815UgEeZMGo/Tm-vdqfq_RI/AAAAAAAABOQ/cX0-bHxUVLQ/s1600/dd72.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="202" src="http://4.bp.blogspot.com/-815UgEeZMGo/Tm-vdqfq_RI/AAAAAAAABOQ/cX0-bHxUVLQ/s400/dd72.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;It's right there on &lt;a href="http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/REFERENCE_MANUAL/CD00171190.pdf"&gt;page 791&lt;/a&gt;.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;Essentially, by setting the PCE bit, I thought I was appending a single, even parity bit to the end of the data frame, making it 8-E-1. Instead, it was replacing the last data bit with the parity bit, making it 7-E-1, and screwing up the entire data protocol. Only by changing the word length to 9-bit by setting the M bit could I get 8-E-1. I should point out that &lt;i&gt;no other microcontroller&lt;/i&gt;&amp;nbsp;that I've used does it this way. Setting the parity enable bit appends a parity bit to the data frame on the ATmega328 and the MSP430F2274.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Well, with that sorted out, everything works properly now. The flash bootloader works over XBee and I can send and receive data at 57.6kbps, 8-E-1. Clearly the next thing to do is &lt;strike&gt;go back to working on sensorless control&lt;/strike&gt; make MIDI scooter play &lt;i&gt;Railgun&lt;/i&gt;.&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;iframe allowfullscreen="" frameborder="0" height="330" src="http://www.youtube.com/embed/_VabIOYxgM0?rel=0" width="400"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8200098102909041178-818854664437953698?l=scolton.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scolton.blogspot.com/feeds/818854664437953698/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scolton.blogspot.com/2011/09/great-xbee-576kbps-mystery-finally.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/818854664437953698'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/818854664437953698'/><link rel='alternate' type='text/html' href='http://scolton.blogspot.com/2011/09/great-xbee-576kbps-mystery-finally.html' title='The great XBee 57.6kbps mystery finally solved.'/><author><name>Shane Colton</name><uri>http://www.blogger.com/profile/10603406287033587039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-B-2r7nWltyo/THyTVrasRWI/AAAAAAAAAv4/W90XBVFGj0g/s72-c/hd09.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8200098102909041178.post-5228963174944918286</id><published>2011-09-05T12:48:00.000-07:00</published><updated>2011-10-02T07:05:32.744-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='4pcb'/><title type='text'>I should put the PCB quadrotor away...</title><content type='html'>...but it's just so addicting. I implemented a few simple improvements:&lt;br /&gt;&lt;br /&gt;On the suggestion of &lt;a href="http://lmh-tech.blogspot.com/"&gt;Max H.&lt;/a&gt;, I added 1" nylon standoffs to each of the four corners as landing gear:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-wO11gsb22O4/TmUA4_giPHI/AAAAAAAABNI/4xxVs3rGyzI/s1600/4p48.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/-wO11gsb22O4/TmUA4_giPHI/AAAAAAAABNI/4xxVs3rGyzI/s400/4p48.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;You might also notice that the motor looks a little different. Although the landing gear does the job of keeping the quadrotor level during takeoff, it also transmits much more of the impact of landing into the motor. (Previously, it was being absorbed by the LiPo battery...) Now, except in the rare soft landing, the impact would &lt;a href="http://4.bp.blogspot.com/-p1Ervt59foM/TlrAXX51rhI/AAAAAAAABMs/hIhj1SWg_NU/s1600/4p40.jpg"&gt;dislodge the motor can&lt;/a&gt; almost every time. I tried a few different types of adhesive, but they were too brittle and the surface area was too small for them to withstand the shock. In a moment rage-induced inspiration, I found a piece of heat shrink that fit over the motor and cut it so it would just overhang the can when it shrank, which is what you see above. This turned out to be the best idea of the week: after heat shrinking, there have been no further motor can failures.&lt;br /&gt;&lt;br /&gt;With the &lt;strike&gt;risk&lt;/strike&gt; certainty of crash landing directly on the LiPo eliminated, I also upgraded to the more potent chemistry of the&amp;nbsp;&lt;a href="http://www.hobbyking.com/hobbyking/store/__378__85__LiPo_LiFe_NiMH_Battery-Turnigy_nano_2Dtech.html"&gt;Turnigy nano-tech&lt;/a&gt; line, specifically the &lt;a href="http://www.hobbyking.com/hobbyking/store/__11896__Turnigy_nano_tech_460mah_2S_25_40C_Lipo_Pack.html"&gt;2S, 460mAh, 25-40C&lt;/a&gt; pack:&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-WG1d9q7G93g/TmUD7y1Jc_I/AAAAAAAABNM/uBgnZrC_f3c/s1600/4p49.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/-WG1d9q7G93g/TmUD7y1Jc_I/AAAAAAAABNM/uBgnZrC_f3c/s400/4p49.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Can it &lt;a href="http://www.faa.gov/news/press_releases/news_story.cfm?newsId=13083"&gt;explode&lt;/a&gt; just from looking at it?&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;It's roughly the same size, weight, voltage, and price as the lower-power LiPo I've been testing with, but it has a much lower internal resistance, which means less voltage sag under load. The difference is noticeable, with lower throttle for takeoff and also similar flight time despite the slightly lower capacity, since the motor controllers stay above their low-voltage cutoff longer.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;I made one more change which has nothing to do with the quadrotor itself: I decided to take Ryan A.'s advice and fly with a PS2-style gamepad instead of a joystick:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-D8I293feeME/TmUFOyh5KHI/AAAAAAAABNQ/zb2yY5gXWg8/s1600/4p53.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-D8I293feeME/TmUFOyh5KHI/AAAAAAAABNQ/zb2yY5gXWg8/s400/4p53.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;I haven't tried flying with a Weller power supply yet...&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;It's generally better for controlling robots, so I'm not sure why I expected the joystick to be more appropriate for a quadrotor. The only &lt;a href="http://www.instructables.com/id/Quadrotor/"&gt;other quadrotor&lt;/a&gt; I've flown used a standard RC flight transmitter, which is closer to a gamepad than a joystick. Thumbs are more precise and faster than entire arms, or even if you're doing it right, wrists. The gamepad has a spring-loaded throttle, which I thought would be problematic. But, with no altitude control anyway, I am always going to be adjusting the throttle even to hover, so it doesn't matter if I have to keep pressure on it.&amp;nbsp;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Up to now, &lt;a href="http://scolton.blogspot.com/2011/08/something-like-flight.html"&gt;it sort-of flew&lt;/a&gt;, but it would tend to drift around a lot. The series of small changes helped, but I still wasn't really satisfied with stationary hovering. I had speculated that the control loop itself was working and stable, but that the zero angles in pitch and roll were wandering, causing it to sporadically dart off in some direction. With enough space, I could still catch it and bring it back to center, but the immediate goal was to be able to fly it in a small room. For that, a more consistent zero would be necessary.&amp;nbsp;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;To troubleshoot any further, I had to spend some time getting the data acquisition up and running. This should be easy since I've been doing it &lt;a href="http://scolton.blogspot.com/p/pirate-radio-control.html"&gt;the same way&lt;/a&gt; forever, but for some reason it took me half a day to get the XBee radios to cooperate. And I had to settle for 19200bps transmission because 57600bps seems to be very tricky with XBees, particularly when wireless bootloading is involved. I've had the same problem with the STM32 chip, and I swear I will sit down and actually solve this soon. Anyway, once I had the data running, I did a test run at full throttle with the quadrotor held down on the bench.&amp;nbsp;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;My theory that the power supply was sagging, causing the ADC readings to be offset under load, was quickly&amp;nbsp;disproved and replaced by a new theory:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-pmXa_GanrHo/TmUK6SR1leI/AAAAAAAABNU/mK0oid5OYdw/s1600/no_iso.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="277" src="http://1.bp.blogspot.com/-pmXa_GanrHo/TmUK6SR1leI/AAAAAAAABNU/mK0oid5OYdw/s400/no_iso.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;Specifically, that the sensor signals are total garbage. What you're looking at is a plot of the angular rate signal coming from the +/-300deg/s pitch gyro...&lt;i&gt;while the quadrotor is stationary&lt;/i&gt;. So, the noise amplitude is half the full range of the sensor. The &lt;a href="http://web.mit.edu/scolton/www/filter.pdf"&gt;complementary filter&lt;/a&gt;, which relies heavily on the gyro for computing the angle, is understandably confused, reporting an angle that wanders from -5deg to 11deg, again &lt;i&gt;while the quadrotor is stationary&lt;/i&gt;.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;And here is where I possibly violate the golden rule of troubleshooting. ("If you can hear it, it's a mechanical problem. If you can smell it, it's an electrical problem. Everything else is a software problem.") I have implemented both hardware and software filters to take out high frequency noise from the inertial sensor signals. But somehow, a massive amount of noise was still making it through. Probing with an oscilloscope revealed it to be broad-spectrum noise, including some low enough to make it through all my filters, with a little bit of an 800Hz sine wave on top of everything. The cause seems obvious now, but I'm so used to electrical noise in high-current motor controllers that I at first neglected to even think about mechanical noise. The test to separate the two was simple:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-v9xEERjx23w/TmUNkqYJESI/AAAAAAAABNY/twnrTahDMr4/s1600/4p51.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/-v9xEERjx23w/TmUNkqYJESI/AAAAAAAABNY/twnrTahDMr4/s400/4p51.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Running at full throttle with the inertial sensors off-board, the data tell the story:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-_yvsBgsUQcg/TmUOt16p1NI/AAAAAAAABNc/X-h7oe09BL8/s1600/offboard.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="276" src="http://2.bp.blogspot.com/-_yvsBgsUQcg/TmUOt16p1NI/AAAAAAAABNc/X-h7oe09BL8/s400/offboard.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The rate sensor noise is completely gone, and the angle stays much closer to zero, where it should be. This very clearly points to mechanical vibration as the source of the noise, and more so it suggests that only a mechanical solution will work; the noise is so destructive to the gyro that no amount of hardware or software filtering will take it out. So, having the inertial sensor sitting on headers is no longer an option, and it's time to break out the foam tape:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-VN23SugZlfM/TmUPsojNRBI/AAAAAAAABNg/nZ4mMa-JIR4/s1600/4p52.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/-VN23SugZlfM/TmUPsojNRBI/AAAAAAAABNg/nZ4mMa-JIR4/s400/4p52.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Attempt #1 used foam-tape only and replaced the headers with a long loop of flexible wire, so as not to transmit vibration through the connections.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-JnNzDnX-7vA/TmUZJE_DFiI/AAAAAAAABNk/JMIOlW4GEOU/s1600/foamtape_1.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="276" src="http://4.bp.blogspot.com/-JnNzDnX-7vA/TmUZJE_DFiI/AAAAAAAABNk/JMIOlW4GEOU/s400/foamtape_1.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Well now that didn't really work at all.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;After this failure, I decided to switch over to the C part of the mechanical RC filter by adding some mass to the sensor board:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-Yh4_iWoFB9s/TmUbM1sqruI/AAAAAAAABNo/Fsrf3AB1Gxo/s1600/4p50.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/-Yh4_iWoFB9s/TmUbM1sqruI/AAAAAAAABNo/Fsrf3AB1Gxo/s400/4p50.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Sorry, Ryan.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-fZ37XIk3nSA/TmUbTqM50cI/AAAAAAAABNs/7Dbm5DHddqk/s1600/4p47.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/-fZ37XIk3nSA/TmUbTqM50cI/AAAAAAAABNs/7Dbm5DHddqk/s400/4p47.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;I also made the tape thicker and looser.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;The extra mass of the small aluminum plate helps the sensor board establish its own frame of reference that rejects high frequency vibrations that do make it through the tape. And the data:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-vhw9eznhZhA/TmUchsU3_6I/AAAAAAAABNw/8EgTJO1wPSs/s1600/foamplusmass_2.txt.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="276" src="http://3.bp.blogspot.com/-vhw9eznhZhA/TmUchsU3_6I/AAAAAAAABNw/8EgTJO1wPSs/s400/foamplusmass_2.txt.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Hrmmm.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Well, it doesn't look much better, visually. But the noise amplitude is a tiny bit lower and, more importantly, the angle doesn't wander around as much. (The times it does are when I was picking it up and moving it. You can tell because the rate is very clean there.) At least it gives me a little bit of hope that the vibrations can be damped enough to make the signals usable. I decided to give this configuration a chance in flight, using the best controller gains I'd established thus far:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;iframe allowfullscreen="" frameborder="0" height="330" src="http://www.youtube.com/embed/cVvw_mddg1M?rel=0" width="400"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Somewhat surprisingly, the small amount of noise reduction makes a huge difference in flight. (Well, combined with the other changes I made above.) You'll notice that I've changed venues and can actually fly it in this smaller classroom now. It still wanders around a little, but I at least feel much more in control of the wandering. I even manage to land smoothly a couple of times. And the data?&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-6E6ppE81zgM/TmUjwBW8laI/AAAAAAAABN0/QUCg6OW0ubY/s1600/good_flight.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="276" src="http://1.bp.blogspot.com/-6E6ppE81zgM/TmUjwBW8laI/AAAAAAAABN0/QUCg6OW0ubY/s400/good_flight.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Well, that's basically still noise. Maybe there is more useful information contained in the average rate, but it's still visually lost in the noise. I think more drastic isolation measures, maybe combined with more aggressive filtering, will be required for it to give a clean rate signal. Ideally, it should reject everything above about 100Hz. Since the sensor board mass is still very low, I suspect I will need an even more compliant mount. What the heck is more compliant than loose foam tape?&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;But anyway, I am happy that its hovering can be contained to a 10'x10' area now...&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8200098102909041178-5228963174944918286?l=scolton.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scolton.blogspot.com/feeds/5228963174944918286/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scolton.blogspot.com/2011/09/i-should-put-pcb-quadrotor-away.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/5228963174944918286'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/5228963174944918286'/><link rel='alternate' type='text/html' href='http://scolton.blogspot.com/2011/09/i-should-put-pcb-quadrotor-away.html' title='I should put the PCB quadrotor away...'/><author><name>Shane Colton</name><uri>http://www.blogger.com/profile/10603406287033587039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-wO11gsb22O4/TmUA4_giPHI/AAAAAAAABNI/4xxVs3rGyzI/s72-c/4p48.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8200098102909041178.post-254314601042537628</id><published>2011-08-31T14:18:00.000-07:00</published><updated>2011-09-01T08:05:29.073-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='4pcb'/><category scheme='http://www.blogger.com/atom/ns#' term='quadrotor'/><title type='text'>Something Like Flight</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;iframe allowfullscreen="" frameborder="0" height="255" src="http://www.youtube.com/embed/WXwzLu3PERA?rel=0" width="400"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;After a day of tweaking control loop settings, I've been able to fly 4pcb for at least several seconds at a time before crash landing or hitting a wall. I tried out two different control loop styles, PD control and nested angle/rate control. It's hard to tell from the video which one looks more promising. I want to say the PD control led to longer, more stable flights, but that was also earlier in the day and I was a bit hyper from coffee, so that may have had an effect.&lt;br /&gt;&lt;br /&gt;Proportional-Derivative (PD) control would be my first instinct for stabilizing a quadrotor, since it deals directly with the two physical quantities at hand, angle (P), and angular rate (D). Each term gets multiplied by a constant, or gain, and then the sum is sent out as a command to the relevant motors. For pitch angle, the front and rear motors are used. For roll angle, the left and right motors are used. The control structure is straightforward:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-JX0b5gE8-vQ/Tl6Lb6o_cTI/AAAAAAAABMw/P2wwbX-D1FY/s1600/4p42.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="280" src="http://1.bp.blogspot.com/-JX0b5gE8-vQ/Tl6Lb6o_cTI/AAAAAAAABMw/P2wwbX-D1FY/s400/4p42.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;The proportional term acts like a virtual spring, pulling the quadrotor back to zero angle (or whatever reference angle the joystick commands). The proportional gain (Kp) is like the spring constant, setting how stiff the virtual spring is. The derivative term acts like damper, resisting motion in either direction. The derivative gain (Kd) sets the damping constant, how viscous the virtual damper is.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-sD1pWC-7S38/Tl6Prm2JyPI/AAAAAAAABM0/k3J7LeKq-gw/s1600/4p43.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="197" src="http://4.bp.blogspot.com/-sD1pWC-7S38/Tl6Prm2JyPI/AAAAAAAABM0/k3J7LeKq-gw/s400/4p43.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;With proportional gain only, the quadrotor (which has rotational inertia) will oscillate like a mass on the end of a spring. With derivative gain only, the quadrotor won't know what angle to go to. But with both, it returns to the proper angle and settles there with minimal oscillation. Choosing the exact right gains is often a matter of tweaking. A lot of tweaking.&lt;br /&gt;&lt;br /&gt;If there is a net external torque on the quadrotor, for example due to an off-center C.G., it may also be necessary to include an integral control term that ramps up the motor command over time. With this, one motor would spin faster even when the quadrotor is level, canceling out the net external torque. Then the structure would be that of a full &lt;a href="http://en.wikipedia.org/wiki/PID_controller"&gt;PID controller&lt;/a&gt;. I've left the integral term out for now.&lt;br /&gt;&lt;br /&gt;There's another subtlety: because the motors and props have inertia, they can't instantly spin up to the commanded speed. The sensors, microcontroller, and ESCs also have built-in delay. So, if the gains are too high, the simple model breaks down and the quadrotor will just oscillate. This type of oscillation tends to be faster and twitchier than the proportional-only mass-spring oscillations. So yes, even more tweaking.&lt;br /&gt;&lt;br /&gt;After tuning the PD controller for a while, I got a tip from David B. about &lt;a href="http://www.openpilot.org/"&gt;www.openpilot.org&lt;/a&gt;. Now, I'm usually more of a do-it-myself-and-ignore-everyone-else's-version person, but the&amp;nbsp;&lt;a href="http://wiki.openpilot.org/display/Doc/Stabilization+Tuning++Multirotor"&gt;quadrotor loop tuning guide&lt;/a&gt; on openpilot is truly excellent.&amp;nbsp;The &lt;a href="http://vimeo.com/25839978"&gt;video&lt;/a&gt; especially is really, really well done. Props (lolpun) to the creator, who can also be seen &lt;a href="http://vimeo.com/25751298"&gt;here&lt;/a&gt; demonstrating my ultimate goal for 4pcb, a frisbee launch.&lt;br /&gt;&lt;br /&gt;The openpilot control loop uses a different structure, which I would call a nested or inner/outer control loop. The inner loop controls (angular) rate, and the outer loop controls angle. Both the inner and the outer loop contain a proportional (P) and an integral (I) gain, but for simplicity I will leave out the integral term.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-Icmyl5ipHwM/Tl6W--1NUoI/AAAAAAAABM4/Ayl7R50aMbY/s1600/4p44.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="161" src="http://4.bp.blogspot.com/-Icmyl5ipHwM/Tl6W--1NUoI/AAAAAAAABM4/Ayl7R50aMbY/s400/4p44.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;What happens in this case is that the angle error gets multiplied by a proportional gain, Kpo, to create a desired rate. The desired rate goes into a second proportional gain, Kpi, to create the motor command. There &amp;nbsp;integral terms would come in at each step, one in the outer loop and one in the inner loop. Though the documentation suggests using only one of the two possible integral terms. (In the video, both are explained.)&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;So, I tested this loop structure as well. In both cases, I left out the integral terms and I tweaked the gains until I was satisfied that I was getting the most stable flight I could. The values I get for PD control were Kp:1.2 and Kd:0.4. The units are a bit funky. Starting from degrees or degrees per second, these gains give you a motor command from 0 to 255. So, a 10º error would give a motor command increase of 12/255. A -20º/s error would give a motor command of -8/255.&amp;nbsp;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;For the nested loop, I settled on Kpo:4.0 and Kpi:0.5. Kpi has the same units a Kd from the PD controller. Kpo, though, is now in (deg/s)/deg. Confused? Well then now might be a good time for the plot twist.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;b&gt;They're actually the same thing.&lt;/b&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-lXoo1cOZbTI/Tl-fLC5HN7I/AAAAAAAABNA/6Cg52mQ63GA/s1600/4p45.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-lXoo1cOZbTI/Tl-fLC5HN7I/AAAAAAAABNA/6Cg52mQ63GA/s1600/4p45.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;When you ignore the integral terms, anyway, the two different control structures are actually equivalent. Kpi is Kd and the product of Kpi*Kpo is Kp. I didn't know this while I was testing, so the fact that I settled on slightly different gains (0.5 instead of 0.4 for Kpi/Kd and 4.0*0.5=2.0 instead of 1.2 for Kpi*Kpo/Kp) is probably due to the coffee. Interestingly, the gains I settled on are not far from the suggested gains on openpilot, when you convert to their &lt;a href="http://wiki.openpilot.org/display/Doc/Stabilization+Tuning++Multirotor#StabilizationTuningMultirotor-Units"&gt;unit scheme&lt;/a&gt;.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;When you add in the integral terms, though, I think two control structures do have important differences. I couldn't exactly tell you what they are, but it's an interesting thing to think about. Since the main problem I'm seeing now is drift, integral control might be an important part of making it fly better. So that will be one of the things I'll be testing next. Along with that:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;Landing gear. As suggested by &lt;a href="http://lmh-tech.blogspot.com/"&gt;Max H.&lt;/a&gt;, I'll be trying out some nylon standoffs on the four corners. If nothing else, it will help keep the quadrotor level during takeoff. It also might minimize the motor damage on slight-to-moderate crash landings.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;x-configuration. I've been using +-configuration, where forward is in line with one of the four appendages of the quadrotor. But when I think of a quadrotor, my mind sees x-configuration, where forward is halfway between two appendages. I don't know why. Also the openpilot video demonstrates x-configuration. The only possible technical advantage I can think of is that all four motors are involved in both pitch and roll, so perhaps any individual motor&amp;nbsp;anomalies&amp;nbsp;will be averaged out more. Or that might just be total BS.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Flying with a gamepad instead of a joystick, as suggested by Ryan A. Reaction time and precision may be improved with something more closely resembling a normal RC transmitter.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Supply voltage offset correction. I'm not sure if this is actually a problem or not, but the analog-to-digital converter references all signals to the supply voltage. If there is some deviation in the supply voltage under load, the zeros may drift. The gyros have a reference voltage that can be measured to correct for this offset, so I may at least test that voltage to see if its ADC value is varying under load. If it is, I can scale the other signals to compensate.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;I would eventually like to be able to fly it in a small room. Whether I get there by tweaking the control or by practice, I don't really care...&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8200098102909041178-254314601042537628?l=scolton.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scolton.blogspot.com/feeds/254314601042537628/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scolton.blogspot.com/2011/08/something-like-flight.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/254314601042537628'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/254314601042537628'/><link rel='alternate' type='text/html' href='http://scolton.blogspot.com/2011/08/something-like-flight.html' title='Something Like Flight'/><author><name>Shane Colton</name><uri>http://www.blogger.com/profile/10603406287033587039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://img.youtube.com/vi/WXwzLu3PERA/default.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8200098102909041178.post-55639076821121066</id><published>2011-08-28T15:41:00.000-07:00</published><updated>2011-08-28T15:41:22.106-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='4pcb'/><category scheme='http://www.blogger.com/atom/ns#' term='quadrotor'/><title type='text'>Hurricane Special: Navbar Updates + 4pcb's First Hops</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: left;"&gt;I'm camping inside today due to the remnants of Hurricane Irene, which came up to the Northeast this weekend.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-M4F0a9qQ5wc/Tlqs6BiGCeI/AAAAAAAABMA/g1fdn1WB6fk/s1600/4p23.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/-M4F0a9qQ5wc/Tlqs6BiGCeI/AAAAAAAABMA/g1fdn1WB6fk/s400/4p23.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Isn't this what Boston looks like &lt;i&gt;normally&lt;/i&gt;?&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;Anyway, it's a great time to make some major long-overdue navbar updates.&amp;nbsp;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Most importantly (seriously) I added a bit of dynamic content that tells me if the large brushless motors&amp;nbsp;(codename: melons)&amp;nbsp;have come back in stock at&amp;nbsp;&lt;a href="http://www.hobbyking.com/hobbyking/store/index.rc"&gt;Hobby King&lt;/a&gt;. It should be right around here --------------------------&amp;gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Turns out&amp;nbsp;Hobby King&amp;nbsp;&amp;nbsp;has a web API that you can use to do everything from check inventory to pull up tracking numbers for specific orders. I've been habitually checking the site every day to see if any new motors have been released, because they are out of stock on almost every motor larger than 55xx. I think they're working on a new line of motors that will replace things in the 63xx size range, like the ones on &lt;a href="http://scolton.blogspot.com/2011/08/tinykart-round-5.html"&gt;tinyKart&lt;/a&gt;, but I also have hope that the 80xx (melons) will return. So, rather than scrolling through the site every time, I can take a quick glance at my navbar to see if any are in stock! I made a &lt;a href="http://web.mit.edu/scolton/www/aremelons.html"&gt;static page&lt;/a&gt; with the melon checker as well.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;I've also added new links to other awesome project sites right about here ---&amp;gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;I hadn't updated my links in such a long time that I feel bad for leaving out so many awesome blogs, such as that of Transistor Man and fellow battery abuser&amp;nbsp;&lt;a href="http://transistor-man.com/Index.html"&gt;Dane Kouttron&lt;/a&gt;, combat robot and electric vehicle builder extraordinaire&amp;nbsp;&lt;a href="http://thevariableconstant.blogspot.com/"&gt;Jamison Go&lt;/a&gt;, and potentially (lolpun) the most frightening underclassman ever&amp;nbsp;&lt;a href="http://tcengineering.wordpress.com/"&gt;Tyler C. of TC-Engineering&lt;/a&gt;&amp;nbsp;(or does TC stand for Tesla Coil?).&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Lastly, the project pages have been shuffled and updated:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;Since there are now &lt;i&gt;two&lt;/i&gt;&amp;nbsp;electric go-karts, &lt;a href="http://scolton.blogspot.com/p/cap-kart.html#capkart"&gt;Cap Kart&lt;/a&gt; and &lt;a href="http://scolton.blogspot.com/p/cap-kart.html#tinykart"&gt;tinyKart&lt;/a&gt; now share a new &lt;a href="http://scolton.blogspot.com/p/cap-kart.html"&gt;high level page&lt;/a&gt;. I don't know if I'll ever build another electric go-kart, but just in case, I now have a project category for them. (Or maybe, now that I have a project category, I have to build more...)&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;I added &lt;a href="http://scolton.blogspot.com/p/motor-controllers.html#directdrive"&gt;DirectDrive&lt;/a&gt; to the &lt;a href="http://scolton.blogspot.com/p/motor-controllers.html"&gt;Motor Controllers&lt;/a&gt; page.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;I actually populated the &lt;a href="http://scolton.blogspot.com/p/self-balancing-things.html"&gt;Self-Balancing Things&lt;/a&gt; page which has been a dead link for several months now. I've determined that the internet is an infinite Segway sink, so I can keep making silly balancing robots/vehicles and people will actually want to see them. Not sure why. But anyway, now there is a page for them.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;That's it for the administrative updates, on to more interesting things:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-9HKWDOQZQU8/Tlq3--D9XII/AAAAAAAABME/4l1M59asf3o/s1600/4p24.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-9HKWDOQZQU8/Tlq3--D9XII/AAAAAAAABME/4l1M59asf3o/s400/4p24.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;PCB Quadrotor!&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;I'll admit, I rushed through this build without posting any updates, so this will be a little on the long side. I got the board from Advanced Circuits (&lt;a href="http://www.4pcb.com/"&gt;www.4pcb.com&lt;/a&gt;) early last week. It's $33 for a two-layer board with silkscreen and soldermask, routed to any shape you want (including quadrotor shape). The first thing to go on was the Toshiba &lt;a href="http://www.toshiba-components.com/motorcontrol/pdfs/TB6588FG_E_P20_080424_.pdf"&gt;TB6588FG&lt;/a&gt; sensorless driver chip:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-afw3uCGHmVo/Tlq4w57sV1I/AAAAAAAABMI/pi_aPtpv1us/s1600/4p25.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-afw3uCGHmVo/Tlq4w57sV1I/AAAAAAAABMI/pi_aPtpv1us/s400/4p25.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It's not the easiest chip to solder, but it can be done by hand. I managed not to put it in backwards. I decided to solder up just one ESC and its supporting passives so that I could test it with the tiny 5g motors to see if it would even work. I had to also put on the Arduino Mini before I could do so, but that didn't take very long.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-a8WKGN10Jlw/Tlq5gYpDRtI/AAAAAAAABMM/j7zMbzIur9c/s1600/4p27.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-a8WKGN10Jlw/Tlq5gYpDRtI/AAAAAAAABMM/j7zMbzIur9c/s400/4p27.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Very quickly I ran into one of the problems that I was expecting: the TB6588FG datasheet mentions a commutation frequency limit of &lt;i&gt;f_osc/&lt;/i&gt;(3*2^11) in the context of a protection feature that shuts down the drive if you exceed this limit. But, it doesn't mention what happens if you turn off the protection feature. I figured the possibilities were either that (1) it would work, (2) it would limit the frequency, or (3) it would explode. The actual answer was (2):&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-yj2qpYIHSZg/Tlq6RaEPUaI/AAAAAAAABMQ/t9lPJUEF0Vk/s1600/4p28.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-yj2qpYIHSZg/Tlq6RaEPUaI/AAAAAAAABMQ/t9lPJUEF0Vk/s400/4p28.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Speed limiting at about 800Hz (3 pulses per cycle).&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;The tiny 5g motors are actually very, very fast. Not only do they spin at about 14,000rpm, but they have 16 poles, so the electrical frequency in Hz is 14,000/60*8 = 1,867! Under load, I thought I might need at least 1,600Hz. So, I tried overclocking the chip by changing its oscillator resistor from 20k to 10k. This bumped &lt;i&gt;f_osc&lt;/i&gt; from 5MHz to 10MHz.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-n_icY6IeqEc/Tlq6_I1Q9SI/AAAAAAAABMU/sxunx5RSpww/s1600/4p29.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-n_icY6IeqEc/Tlq6_I1Q9SI/AAAAAAAABMU/sxunx5RSpww/s400/4p29.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;And the speed limit goes up to 1,600Hz (3 pulses per cycle).&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;This seemed to work just fine. It will also double the PWM frequency, but I chose the lower of two options, so it's no worse in terms of switching losses than the higher case with 5MHz. I'm not sure how much more you can push &lt;i&gt;f_osc&lt;/i&gt;, but it would be an interesting experiment to try.&amp;nbsp;Other than that, the ESCs work well. The start-up routine is dubious, and seems to be designed for much slower motors. But they seem to be able to find sync on these motors even starting in the run state. Once spinning, they are able to change speed quickly and smoothly.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Confident that the Toshiba chip would do the job, I filled in the remaining three and then mounted the motors:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-hqEWZQsOryM/Tlq8TU2GSLI/AAAAAAAABMY/sRjOowVXK-A/s1600/4p38.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-hqEWZQsOryM/Tlq8TU2GSLI/AAAAAAAABMY/sRjOowVXK-A/s400/4p38.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Copy-paste, copy-paste, copy paste.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-zbBBXYzlh1g/Tlq88iuixdI/AAAAAAAABMc/UFSJfXoVWbY/s1600/4p37.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-zbBBXYzlh1g/Tlq88iuixdI/AAAAAAAABMc/UFSJfXoVWbY/s400/4p37.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Motors mount with 2-56 machine screws.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-F7ib_ybfs3Q/Tlq9C2KD-1I/AAAAAAAABMg/7xkO-cD4VXc/s1600/4p22.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-F7ib_ybfs3Q/Tlq9C2KD-1I/AAAAAAAABMg/7xkO-cD4VXc/s400/4p22.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;The motor leads are &lt;i&gt;just&lt;/i&gt; long enough to reach the pads.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;And when all the parts are together:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-3TUVKit7F9o/Tlq9yHn5ABI/AAAAAAAABMo/tz7d5oGxc-o/s1600/4p39.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/-3TUVKit7F9o/Tlq9yHn5ABI/AAAAAAAABMo/tz7d5oGxc-o/s400/4p39.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The total weight, including a 7.4V, 500mAh LiPo battery, is 125g. This is just a bit over what I predicted, but then again I was using a slightly different battery for that estimate. Each 4x2.5 prop should be able to generate at least 50g of thrust, so it can still fly. The yellow electrical tape is for balancing the props, which, for $0.40, were not very good to start with. It also helps for visibility and avoiding finger contact.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;I put together some quadrotor control software (yes, in Arduino..) based heavily on the previous&amp;nbsp;&lt;a href="http://www.instructables.com/id/Quadrotor/"&gt;quadrotor project&lt;/a&gt; I was involved with. It uses a &lt;a href="http://web.mit.edu/scolton/www/filter.pdf"&gt;complementary filter&lt;/a&gt;&amp;nbsp;on each axis to calculate pitch and roll angles from accelerometer and gyroscope signals. The angle and rate then go into a Proportional-Derivative (PD) controller that attempts to keep the quadrotor level and stable. Yaw is handled by a simple proportional controller that applies a differential signal to the counter-rotating props. The input for the control is done through my &lt;a href="http://scolton.blogspot.com/p/pirate-radio-control.html"&gt;stock RC solution&lt;/a&gt;: a USB joystick and XBee radio modules.&lt;br /&gt;&lt;br /&gt;Once I had something close to flyable, I did a few test hops:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;iframe allowfullscreen="" frameborder="0" height="255" src="http://www.youtube.com/embed/ZWSxMMTRyfI?rel=0" width="400"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;You can see the control loop still needs a good amount of tuning. But the test hops also revealed a few other problems that I'll want to fix as well. For one, it could really use some landing gear. And I'm not just saying that because it currently crash lands on its LiPo every time, I don't really care about that. But taking off is actually the most difficult part, because it's not very stable in ground effect. Having four solid points of contact would help a lot at keeping it level during take-off, I think. Right now, the only real solution is to gun it and get it off the ground as quickly as possible, hoping it stays level enough to fly.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The other major problem I encountered was that, even though the props survive crashes very well, the motors are not as durable:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-p1Ervt59foM/TlrAXX51rhI/AAAAAAAABMs/hIhj1SWg_NU/s1600/4p40.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/-p1Ervt59foM/TlrAXX51rhI/AAAAAAAABMs/hIhj1SWg_NU/s400/4p40.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;After several hits, the cans started to detach from the faceplates of a couple motors. They are held on only by a press fit with a short interface. Once the can comes off, the motor locks up. To attempt to fix this problem, I've been adding superglue to them as they come off. It would also help if I would stop crashing it.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Mostly, though, I think the flight can be improved with control loop tweaking. I'll be playing around with the P and D constants, to start with. The control loop is currently running at 100Hz, which should be fast enough to stabilize the system, but it's possible that there is some unaccounted-for lag in the motor control or sensors. The tradeoff seems to always be between oscillation and drift. Higher gains cause more overshoot and oscillation, but do a better job of holding it level. Lower gains are more stable, but it flies away in one direction or another. Finding exactly the right combination is frustrating, since it also depends on your ability to trim and fly it. So, hopefully with more tweaking and practice, I'll get it to the point where I can legitimately call it "flying".&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8200098102909041178-55639076821121066?l=scolton.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scolton.blogspot.com/feeds/55639076821121066/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scolton.blogspot.com/2011/08/hurricane-special-navbar-updates-4pcbs.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/55639076821121066'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/55639076821121066'/><link rel='alternate' type='text/html' href='http://scolton.blogspot.com/2011/08/hurricane-special-navbar-updates-4pcbs.html' title='Hurricane Special: Navbar Updates + 4pcb&apos;s First Hops'/><author><name>Shane Colton</name><uri>http://www.blogger.com/profile/10603406287033587039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-M4F0a9qQ5wc/Tlqs6BiGCeI/AAAAAAAABMA/g1fdn1WB6fk/s72-c/4p23.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8200098102909041178.post-7383001829531342572</id><published>2011-08-21T20:03:00.000-07:00</published><updated>2011-08-21T21:01:56.129-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tinykart'/><title type='text'>tinyKart: Round 5</title><content type='html'>tl;dr tinyKart works:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;iframe allowfullscreen="" frameborder="0" height="255" src="http://www.youtube.com/embed/QwEmhRm-WZ4?rel=0" width="400"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;br /&gt;It ran outdoors for the first time at &lt;a href="http://web.mit.edu/w1mx/www/swapfest/swapfest-2011.08.pdf"&gt;Swapfest&lt;/a&gt;, our de-facto &lt;a href="http://techtv.mit.edu/collections/scolton/videos/661-close-encounters-of-the-self-balancing-kind"&gt;vehicle debut venue&lt;/a&gt;. This time, tinyKart and Charles Guan's&amp;nbsp;&lt;a href="http://www.etotheipiplusone.net/?p=1539"&gt;Straight RazEr&lt;/a&gt; were revealed to the &lt;strike&gt;world&lt;/strike&gt; crazy swapfolk. It took a while to get there, as evidenced by the greater-than two week gap between tinyKart posts. But here's where I fill in that gap. When we left off the kart was mechanically complete, minus the steering wheel.&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-NdDMUYEbJL4/TlGgU6XrLoI/AAAAAAAABK8/osKZo2RanLE/s1600/dm94.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-NdDMUYEbJL4/TlGgU6XrLoI/AAAAAAAABK8/osKZo2RanLE/s400/dm94.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Problem solved.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;The angular butterfly design courtesy of &lt;a href="http://lmh-tech.blogspot.com/"&gt;Max H.&lt;/a&gt; fits very nicely with the overall aesthetic of the kart, plus it's all 1/8" aluminum plate welded to thin-wall aluminum tubes, so it weighs less than a pound. For various reasons I can't quite say how this nice thing came into existence. But did you know that &lt;a href="http://amymakesstuff.com/"&gt;Amy Q.&lt;/a&gt; is awesome? Just sayin'.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The steering wheel is very important on tinyKart. It holds all of the driver inputs; there are no pedals. The two front disk brakes are controlled by cables which go to a really awesome &lt;a href="http://www.amazon.com/TerraTrike-Dual-Control-Brake-Lever/dp/B001FYEOIE/ref=sr_1_2?ie=UTF8&amp;amp;qid=1313973460&amp;amp;sr=8-2"&gt;double pull lever&lt;/a&gt; I found on Amazon. We had some issues stemming from unequal length brake cables (different amounts of friction). But a trip to the bike shop for two new 48" cables solved that problem. The throttle is a trigger from an RC car controller, and it really does work like an RC car. (Pull to go, push to brake, push twice to reverse.)&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-AmjaLaMCY6g/TlGlqcX63vI/AAAAAAAABLA/HDjj7B6a7AQ/s1600/dn14.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="312" src="http://1.bp.blogspot.com/-AmjaLaMCY6g/TlGlqcX63vI/AAAAAAAABLA/HDjj7B6a7AQ/s400/dn14.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;One interesting consequence of having no pedals is that you can put your feet wherever you want...&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-BVhYAhltOFs/TlGmN8JCR2I/AAAAAAAABLE/tR6xzqmOnZY/s1600/dm95.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-BVhYAhltOFs/TlGmN8JCR2I/AAAAAAAABLE/tR6xzqmOnZY/s400/dm95.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;...&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;One other minor mechanical detail came up during the week: the drive pulleys which attach to the motor shafts had been bored out to 10mm, but that left very few threads for the set screws. As a preventative measure, I took the four prop adapters that came with the motors and pressed them into the even-more-bored-out pulleys. The Frankenpulleys are held together only by a 0.003" press fit and large quantities of retaining compound, but I still think they're better than the stock ones.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-wJgnF1BGa7Q/TlG1omoITtI/AAAAAAAABLo/eeM3BQLuWZE/s1600/dn03.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/-wJgnF1BGa7Q/TlG1omoITtI/AAAAAAAABLo/eeM3BQLuWZE/s400/dn03.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Before attaching the pulleys to the motor shafts, I filed small flats on each side for the set screws to grab. The other side of the pulley attaches to a 10mm aluminum idler shaft that runs in a bearing in the outer plate of the drive module. This way, the pulley is supported on both sides and motor shaft incurs less bending moment, all of which helps my MechE side sleep at night.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;And with that, all that remained was a crapload of electronics work. The first step in that process was to mount the batteries and the motor controllers. Up until we thought about it hard enough to realize that nobody should sit in between two 3lb LiPo batteries, the plan was to put them along the sides of the kart. But it turned out that the two batteries and the controllers fit nicely in some space behind the seat. To isolated them from mechanical shock, they are attached to a separate 1/8" aluminum plate floating on left-over &lt;a href="http://web.mit.edu/first/scooter/"&gt;BWD wheel urethane&lt;/a&gt;:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-bbIr7RCbyE8/TlGoLhb-MmI/AAAAAAAABLI/L-yjqgFb83g/s1600/dm89.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-bbIr7RCbyE8/TlGoLhb-MmI/AAAAAAAABLI/L-yjqgFb83g/s400/dm89.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-l3QcxAsgpJM/TlGoRMjMh-I/AAAAAAAABLM/Z4KoOKQjYrM/s1600/dm88.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/-l3QcxAsgpJM/TlGoRMjMh-I/AAAAAAAABLM/Z4KoOKQjYrM/s400/dm88.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;But weren't BWD's wheels stupidly hard?&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-TiuUnIHGBeo/TlGooVG7qWI/AAAAAAAABLQ/1ce0fDMNCzE/s1600/dm84.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-TiuUnIHGBeo/TlGooVG7qWI/AAAAAAAABLQ/1ce0fDMNCzE/s400/dm84.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;If you feel the seat warmer kick in...GTFO!&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;This is the second time I've used giant "long pack" LiPos on a vehicle. The first was &lt;a href="http://scolton.blogspot.com/2010/11/pneu-scooter-singapore-edition.html"&gt;Pneu Scooter's maiden voyage in Singapore&lt;/a&gt;. To be honest, they scare me...and I am &lt;a href="http://3.bp.blogspot.com/-9V_sU48NqQA/TbeqpQyVLrI/AAAAAAAAA_Y/XMB3a8eQ85U/s1600/cell_abuser2.jpg"&gt;not easily scared by batteries&lt;/a&gt;. I am used to the potential for 1,000A short-circuit currents and the precautions that go with that. I know how to monitor cell voltages and protect the pack from damage. But all I can think about with these is how far away I need to be if the battery starts &lt;a href="http://www.youtube.com/watch?v=21IySOMmFU4&amp;amp;feature=related"&gt;spewing flame in all directions&lt;/a&gt;.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Tangential thought: I think I will spend some time in the near future making a 12S3P A123 pack for tinyKart. To keep the same weight while switching from LiPo to LiFe, some capacity must be sacrificed (273Wh instead of 333Wh). But I could make a couple of packs and swap them. And as much as we fret over the safety and liability of having loose cells and homemade battery packs lying around, I still feel safer that way than with these giant LiPo bombs &lt;i&gt;that I can buy freely on the internet&lt;/i&gt;.&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-T-Gyu9hHaYQ/TlGuGTZarKI/AAAAAAAABLU/WTC--d3TKYw/s1600/dn10.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-T-Gyu9hHaYQ/TlGuGTZarKI/AAAAAAAABLU/WTC--d3TKYw/s400/dn10.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Finally, a good load test for &lt;a href="http://scolton.blogspot.com/2011/05/ebay-hack-charger-7523.html"&gt;eBay Hack Charger #7,523&lt;/a&gt;. Set at 41.0V cutoff and 5.0A, it would take almost two hours to fully charge the batteries. They arrive about half-charged, so this was a good one-hour full power (200W) test of the Vicor brick power supply I built. Seems to hold up just fine. And no fiery LiPo death yet.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-Uff0Osez_Xg/TlGvRTFRHoI/AAAAAAAABLY/bb12PH2DEd0/s1600/dn11.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-Uff0Osez_Xg/TlGvRTFRHoI/AAAAAAAABLY/bb12PH2DEd0/s400/dn11.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Thank you, &amp;nbsp;Cell Loggers, for giving me at least some peace of mind.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;With the batteries and controller mounted, the wiring could begin:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-itm8tsEPCtE/TlGxl97ht2I/AAAAAAAABLc/OED2PUF21qk/s1600/dm92.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-itm8tsEPCtE/TlGxl97ht2I/AAAAAAAABLc/OED2PUF21qk/s400/dm92.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The wiring for this kart wasn't nearly as bad as Cap Kart. For one, the primary wiring could be done with double 10AWG instead of single 2AWG. So, the hammer crimper was not required for this one. Each battery gets its own 60A fuse. Then, the two positive wires come together inside a master switch, which has a precharge circuit bypassing it. Chris C-T. decided to put all of this &lt;i&gt;inside&lt;/i&gt;&amp;nbsp;the master switch, because that's just what he does.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-N5jSsNvRR5Q/TlGz4Zsjh9I/AAAAAAAABLg/EABv2wAVzBk/s1600/dn05.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/-N5jSsNvRR5Q/TlGz4Zsjh9I/AAAAAAAABLg/EABv2wAVzBk/s400/dn05.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;A switch within a switch...&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;The master switch needs to be easily reachable by the driver, so it is attached to the right 80/20 frame rail:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-KlL3s4kuxLU/TlG0WACK5PI/AAAAAAAABLk/PbXIi5udqfU/s1600/dn09.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/-KlL3s4kuxLU/TlG0WACK5PI/AAAAAAAABLk/PbXIi5udqfU/s400/dn09.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The rest of the primary wiring was easy. Well, I shouldn't say that, because it turns out that the 5.5mm bullet connectors on the batteries are not that same size at the 5.5mm bullet connectors I bought... So, a couple hours of tense giant LiPo connector surgery were necessary. But other than that it was easy. The signal wiring, on the other hand, took a very long time.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-0uourzoY8Bg/TlG2sCpoBOI/AAAAAAAABLs/S-phGuQCldk/s1600/dn07.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/-0uourzoY8Bg/TlG2sCpoBOI/AAAAAAAABLs/S-phGuQCldk/s400/dn07.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Cue wiring montage...&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;Each Kelly controller needed a total of 12 signal connections: 5 for the Hall effect sensors and 7 for the throttle, brake, reverse, and diagnostic signals. The Hall effect sensors ride on a laser-cut acrylic mount (&lt;a href="https://lh4.googleusercontent.com/-HtX5OLzUn3I/TXYiidzAfaI/AAAAAAAAA-w/7w92vCNjuUU/s1600/nt19.jpg"&gt;a la Pneu Scooter&lt;/a&gt;) that holds them just off the motor can, at the &lt;a href="http://mitrocketscience.blogspot.com/2011/08/hall-effect-sensor-placement-for.html"&gt;proper electrical angle&lt;/a&gt;. The cans on these motors are thin enough that the magnetic field is easily picked up from outside; no need to bury the sensors in the motor windings. The acrylic mount is tangentially adjustable so that the motor timing can be fine-tuned after finding the proper combination of wires. The process by which this happens is a matter for another entire post, but generally it's sufficient to set them for minimum current at a given throttle position.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Throttle, brake, and reverse are controlled by a &lt;strike&gt;sophisticated central vehicle processor&lt;/strike&gt; Arduino that intercepts the throttle signal from the RC trigger and decides what to do with it. The Arduino reads in the trigger analog input and generates four PWMs which are low-pass filtered, buffered, and set out to the throttle and brake sensor inputs on both Kelly controllers. Ted G. and Catherine C-T. set up this fancy throttle interceptor to capture the brake/reverse function of the trigger, but also because we want to implement steering angle-based differential torque on the two motors. Future feature, once the steering potentiometer is installed.&amp;nbsp;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;As it turns out, regenerative braking will also have to wait for some minor modifications. The Kelly controllers can use an analog brake signal, but apparently they still need their digital brake switch pulled low at the correct time for the braking feature to work at all. So, there will actually be 8 signal wires for each controller, one of which may not be zip-tied to the nice wiring harness that was already made.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;After a week of wiring, we finally got a chance to test drive it this weekend. Here are the two videos:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.youtube.com/watch?v=qCx3AsDT1aU"&gt;8/20/11&lt;/a&gt;- Maiden voyage in N52.&lt;br /&gt;&lt;a href="http://www.youtube.com/watch?v=QwEmhRm-WZ4"&gt;8/21/11&lt;/a&gt; - Outdoor testing at MIT Swapfest.&lt;br /&gt;&lt;br /&gt;So, one year to the day after &lt;a href="http://techtv.mit.edu/collections/scolton/videos/8163-cap-kart-20-8212010-test-drive"&gt;Cap Kart v2.0's first successful test drive&lt;/a&gt;, and three years after &lt;a href="http://www.youtube.com/watch?v=Omk3FqXStdg"&gt;Cap Kart v1.0 first touched pavement&lt;/a&gt;, we made it back out to our favorite strip of trackside delivery road. This time, though, &amp;nbsp;we didn't need four people and a pick-up truck to get there. One person can easily tow tinyKart with two wheels on the ground, and two people can carry it for a long distance. It also fits in elevators and through doors.&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-oWvR2hz2RN0/TlHAv2ejqVI/AAAAAAAABLw/-DZ4D5J5_Jc/s1600/dn12.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/-oWvR2hz2RN0/TlHAv2ejqVI/AAAAAAAABLw/-DZ4D5J5_Jc/s400/dn12.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;d'awwwwww&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;The test drive validates some of the mechanics of tinyKart: The 17mm aluminum wheel axles seem okay, the brakes and steering work as they should, and the frame holds itself together. In the video, you can see that the chassis does flex, a lot. You can feel it in the seat. But it's not the kind of flex that will break things - more like an airplane wing flapping a bit because it's just an aluminum truss. Interestingly, it keeps all four tires on the ground.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;There are definitely still some weak points, some of which we knew about and some of which were revealed in this test drive:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;The left side motor can is loose and has a tendency to shift axially, once to the point of binding so hard that the entire rotor shifted, changing the motor timing. The only question is: repair or replace?&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Both controllers exhibit a well-know problem of cutting out under heavy load (80A?). This seems to be common with RC outrunners running on Kelly's. I've seen it at least twice before. Since I pretty much spend all my time debugging motor controllers anyway, I can probably find a quick fix. If not, there is a higher PWM frequency option for Kelly controllers that could be worth a try. (The inductance on these motors is so low that the current ripple at 16kHz is still large.) If nothing else works, tinyKart may some day be merged with &lt;a href="http://scolton.blogspot.com/2011/07/directdrive-v10-24kva-test.html"&gt;DirectDrive&lt;/a&gt;...&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;The weight.&lt;/li&gt;&lt;/ul&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-eurqeV4zKn4/TlHCLwXDVMI/AAAAAAAABL0/GClFpvbaKV8/s1600/dn08.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/-eurqeV4zKn4/TlHCLwXDVMI/AAAAAAAABL0/GClFpvbaKV8/s400/dn08.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The current weight is just under 55lbs. To get down to the target of 53lbs (less than one of Cap Kart's old lead acid batteries), we will have to do a bit of trimming. The current weight already represents the first major cut - the side seat mounts that Max put so much effort into had to go. We were worried about whether the rear seat mounts by themselves could handle high cornering forces, so we did a quick 1G turning test:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-5nEGFQ85YT8/TlHC16wfDEI/AAAAAAAABL4/idDBPkRATyE/s1600/dn04.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://4.bp.blogspot.com/-5nEGFQ85YT8/TlHC16wfDEI/AAAAAAAABL4/idDBPkRATyE/s400/dn04.jpg" width="300" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Removing the side seat mounts only saved 0.85lbs, though. To cut an addition 2lbs, we will have to take small bits off of several places. Some easy targets are the belt tensioners, the front of the frame, and a few of the lateral 80/20 braces which could be swapped for lighter box extrusion. After that maybe we'll drill some holes in the LiPos to reduce weight...&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;In the meantime, a bit more test driving may be in the near future. Also, exciting news: We will be bringing tinyKart to &lt;a href="http://makerfaire.com/newyork/2011/"&gt;NY Maker Faire&lt;/a&gt; in mid-September. Look for it there!&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-VHbCdGmLlfI/TlHDZIZzObI/AAAAAAAABL8/fD0uUxlRNbA/s1600/dn13.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-VHbCdGmLlfI/TlHDZIZzObI/AAAAAAAABL8/fD0uUxlRNbA/s400/dn13.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8200098102909041178-7383001829531342572?l=scolton.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scolton.blogspot.com/feeds/7383001829531342572/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scolton.blogspot.com/2011/08/tinykart-round-5.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/7383001829531342572'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/7383001829531342572'/><link rel='alternate' type='text/html' href='http://scolton.blogspot.com/2011/08/tinykart-round-5.html' title='tinyKart: Round 5'/><author><name>Shane Colton</name><uri>http://www.blogger.com/profile/10603406287033587039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://img.youtube.com/vi/QwEmhRm-WZ4/default.jpg' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8200098102909041178.post-8093965413815011304</id><published>2011-08-12T19:30:00.000-07:00</published><updated>2011-08-13T07:52:23.429-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='4pcb'/><category scheme='http://www.blogger.com/atom/ns#' term='quadrotor'/><title type='text'>4pcb: A Printed Circuit Board Quadrotor.</title><content type='html'>I know I have too many project tags open right now, but this is one that I just couldn't resist:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-uFt1GupjZLE/TkXDpV116HI/AAAAAAAABKk/AyhvNGZG2RA/s1600/4p14.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://1.bp.blogspot.com/-uFt1GupjZLE/TkXDpV116HI/AAAAAAAABKk/AyhvNGZG2RA/s400/4p14.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Lately I've seen a number of things that &lt;a href="http://www.etotheipiplusone.net/?p=1483"&gt;almost&lt;/a&gt; &lt;a href="http://www.etotheipiplusone.net/?p=1497"&gt;fly&lt;/a&gt;, and they reminded me of a project idea that I put in the queue a long time ago: a printed circuit board-based quadrotor. Fiberglass, like the FR4 used in PCBs, is actually a pretty nice structural material - lightweight and stiff. So why not integrate the electronics and the structure into a single printable frame? I named it "4pcb" after the URL for &lt;a href="http://www.4pcb.com/"&gt;Advanced Circuits&lt;/a&gt;, where you can go to print your very own. (Though now that I think about it, &lt;a href="http://www.myropcb.com/"&gt;Myrocopter&lt;/a&gt; would have been a cool name, too.)&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;I've actually helped with a quadrotor before:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.instructables.com/image/F7S6N7RGDMUSDX7/quadrotor.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://www.instructables.com/image/F7S6N7RGDMUSDX7/quadrotor.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;It was built by high school students as part of the &lt;a href="http://web.mit.edu/Edgerton/"&gt;Edgerton Center&lt;/a&gt; summer engineering class in 2010. You can see the details in &lt;a href="http://www.instructables.com/id/Quadrotor/"&gt;this Instructable&lt;/a&gt;, the first and for some time only Instructable on how to build a quadrotor. (Credit goes to June K. for the write-up.) This one has a pulltruded carbon fiber frame and is built mostly from &lt;a href="http://www.google.com/search?sourceid=chrome&amp;amp;ie=UTF-8&amp;amp;q=pulltruded#pq=pulltruded&amp;amp;hl=en&amp;amp;sugexp=gsihc&amp;amp;cp=12&amp;amp;gs_id=6&amp;amp;xhr=t&amp;amp;q=pultruded+windows&amp;amp;qe=cHVsbHRydWRlZCB3&amp;amp;qesig=oRIm7BRKEHKVt_iy4MGOhg&amp;amp;pkc=AFgZ2tnmaskjoPncC-G8FTdQHnYvE7Zov_CEc1Z2P97ON4n5njY1Oshj7jhzbhvVLVSNgY0hbW3QygRX8cFaE0FVjAJblWSqlw&amp;amp;pf=p&amp;amp;sclient=psy&amp;amp;source=hp&amp;amp;pbx=1&amp;amp;oq=pulltruded+w&amp;amp;aq=0s&amp;amp;aqi=g-s1&amp;amp;aql=f&amp;amp;gs_sm=&amp;amp;gs_upl=&amp;amp;bav=on.2,or.r_gc.r_pw.r_cp.&amp;amp;fp=c399d5fd337e1303&amp;amp;biw=1098&amp;amp;bih=630"&gt;Hobby King&lt;/a&gt; parts. It uses 7" props, two right-handed and two left-handed, and is controlled by feedback from gyros and accelerometers.&amp;nbsp;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The nature of the control system is what appealed to me about building a quadrotor, and I pretty much drew it up from scratch the way I knew it would work. The internet does have a lot of good and bad information on the topic, all of which I skipped over. But if you're new to this game you might want to read some of the following:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;The&amp;nbsp;&lt;a href="http://en.wikipedia.org/wiki/Quadrotor#Flight_Control"&gt;basic idea&lt;/a&gt;, and why you need counter-rotating props.&lt;/li&gt;&lt;li&gt;My surprisingly well-traveled &lt;a href="http://web.mit.edu/scolton/www/filter.pdf"&gt;white paper&lt;/a&gt; on the angle estimating filter.&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.instructables.com/id/Segstick/step9/Two-sensors-one-angle/"&gt;Sensors&lt;/a&gt; and &lt;a href="http://www.instructables.com/id/Segstick/step10/A-very-flattering-filter/"&gt;filtering&lt;/a&gt; sections from my other Instructable.&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.instructables.com/id/Quadrotor/step23/Code/"&gt;Code&lt;/a&gt; and &lt;a href="http://www.instructables.com/id/Quadrotor/step24/Tuning/"&gt;tuning&lt;/a&gt; sections from the quadrotor Instructable.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Props to Welkin U. for translating my ranting into workable code for the Edgerton quadrotor - it did in fact fly stably, if only for about 10 seconds at a time. I think with a bit more work on the yaw control, and a lot more pilot training, it would have been almost easy to fly.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Anyway, now I want to build a small one.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-j3WgdlsJqMQ/TkXJPjXve0I/AAAAAAAABKo/_Dgh-IoJUkk/s1600/4p15.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="297" src="http://3.bp.blogspot.com/-j3WgdlsJqMQ/TkXJPjXve0I/AAAAAAAABKo/_Dgh-IoJUkk/s400/4p15.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;I settled on a 4" prop (4x2.5) and pretty much the tiniest motor that Hobby King sells, the &lt;a href="http://www.hobbyking.com/hobbyking/store/__6312__hexTronik_5gram_Brushless_Outrunner_2000kv.html"&gt;HXM1400-2000&lt;/a&gt;. Despite its size, this is a 12-slot, 16-pole brushless outrunner.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-4VuayfkRWhM/TkXKKbyT5BI/AAAAAAAABKs/u7_nxtrnUKs/s1600/4p16.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="315" src="http://3.bp.blogspot.com/-4VuayfkRWhM/TkXKKbyT5BI/AAAAAAAABKs/u7_nxtrnUKs/s400/4p16.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Yes, 16 poles!&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;And it is an incredibly nice little motor. The build quality seems a lot higher than other tiny motors I've seen, including the ones from our last quadrotor. For example the can does not feel like it's going to separate from the motor and fly away under load. The prop adapter that it comes with actually fits the prop, and the whole assembly (motor and prop) weighs only about 10 grams. With the 4x2.5 prop and a 7.4V supply, reviews suggest the thrust will be about 50 grams.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;And I've somehow made it several paragraphs into a post without talking about motor control yet. Well, I can fix that. I was browsing for a piece of enabling technology: an integrated sensorless control IC. There are plenty of cheap, small brushless ESCs on Hobby King and elsewhere, but what's the point of a PCB quadrotor if I still have to zip tie ESCs to it? Also, there's a fundamental bandwidth limit with RC ESCs due to the ~20ms gap between servo PWM pulses. We definitely battled with this limit on the Edgerton quadrotor, and a smaller quadrotor will need an even faster control loop.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;So, I was very happy to find this:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-ljHnwv4vcLA/TkXS5hoaA6I/AAAAAAAABKw/pTbv54GwmOY/s1600/4p17.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="247" src="http://2.bp.blogspot.com/-ljHnwv4vcLA/TkXS5hoaA6I/AAAAAAAABKw/pTbv54GwmOY/s400/4p17.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;It's part of Toshiba's line of small, integrated motor control chips. The &lt;a href="http://www.toshiba-components.com/motorcontrol/pdfs/TB6588FG_E_P20_080424_.pdf"&gt;TB6588FG&lt;/a&gt; is the brushless version. They contain both the power and the signal electronics, so it really is almost like having an ESC on a chip. You do have to add a few passives.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-0eefxkJZUuI/TkXUSvtJq7I/AAAAAAAABK0/INFm4A0v6UA/s1600/4p07.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="400" src="http://4.bp.blogspot.com/-0eefxkJZUuI/TkXUSvtJq7I/AAAAAAAABK0/INFm4A0v6UA/s400/4p07.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Okay, a lot of passives.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;But still you get a sensorless ESC in about a 1"x1" PCB footprint with no wasted weight for packaging or heat sinking. It has some features you wouldn't get on a cheap RC ESC too: analog speed input (very high bandwidth), adjustable frequency PWM, adjustable timing, over-current protection, and some others. But there are also a few drawbacks: It's designed for higher voltages (7-42V), so running it off a 7.4V battery is borderline. It also may have issues with the extremely high electrical frequency of these motors. The datasheet mentions an optional commutation frequency limit, but doesn't say what happens when you turn the limit off. Only one way to find out.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;Since I'm working in EAGLE, I have to live within the constraints of the 100mmx80mm board size limit. That's one of the reasons I put this project on hold originally - I figured I might have to go back to FreePCB or some other layout program to do it. But recently I remembered that the board size limit only applies to placing components. The free version of EAGLE will definitely let you create a board outline (dimension layer) and even traces that go outside the limits. So, I just had to place all the components in the 100mmx80mm dashed rectangle in the title picture, which has the origin at its lower-left corner.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;After laying out a single ESC block, I just had to copy-paste three times and - &lt;b&gt;oh right, this is EAGLE, FML.&lt;/b&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;As it turns out, even the already convoluted process of copy-pasting a group of components and wires in EAGLE is not enough to get you through this one. If you do so in the schematic, an unorganized batch of new components inserts itself into the bottom-left corner of your board. If you try to do so in the board, it just yells at you. A combination of Googling and random screwing around got me to a workable solution:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;ol&gt;&lt;li&gt;Close the board file. This breaks the link that automatically inserts new components into the board when you copy-paste schematic groups.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Copy-paste the group in the schematic. If you don't know how to copy-paste groups in EAGLE, you might want to figure that out first.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Open the board. It will now yell at you because the board and schematic are not consistent.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Copy-paste the group on the board. Make sure the board group contains exactly the same elements as the schematic group. (Same components and nets.)&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;If you have not re-named any nets, or used any power supply nets, then you are probably done. If you have, go on to Step 6.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Power supply nets and user-named nets copy properly on the schematic, but not on the board. On the board, GND becomes GND1, VCC becomes VCC1. USERNET becomes USERNET1, OTHERNET1 becomes OTHERNET2. It either appends the number 1 to the name, or if there already is a number, it increments. Depending on your intentions, you may have to change the net name on either the schematic or the board. Usually for power supply nets, you'd be renaming the board nets to GND, VCC, etc. But for user nets, you may actually want the automatic number incrementing. In that case, you can update the schematic net names appropriately. The ERC shows the inconsistent nets. Once you have cleared all these, you're done. Unless...&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;The numbered nets (N$1, N$2, etc.)&amp;nbsp;&lt;i&gt;should&lt;/i&gt;&amp;nbsp;increment properly on the board and the schematic when you copy-paste. But, I found that if you have extra nets on the board that are not present on the schematic, it offsets the net numbering on the board. For example, the 20 motor mounting holes I had were numbered N$25 through N$44. They were not represented by anything in the schematic. So, to avoid the problem, I had to rename all the nets associated with these isolated vias so that there were exactly the same quantity of numbered nets on the schematic as on the board. &lt;i&gt;Only then&lt;/i&gt;&amp;nbsp;could I successfully execute Steps 1-6. So maybe this is actually Step 0.&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;And after all that:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-6CuyL146Ivc/TkXcs498pXI/AAAAAAAABK4/7RxOY9-gtu4/s1600/4p13.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="238" src="http://4.bp.blogspot.com/-6CuyL146Ivc/TkXcs498pXI/AAAAAAAABK4/7RxOY9-gtu4/s400/4p13.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Three hours to copy-paste three instances. WHY!?&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;Now that I know how to do it, it would probably only take me five minutes or so to copy-paste a block of this complexity in the future. And I'm not sure I can blame EAGLE, since it does do a reasonable job of re-syncing net and component numbers, or at least telling you when it makes a mistake. But dammit, there must be a better way!&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;After that adventure, routing the few remaining signals was easy. I opted for an &lt;a href="http://www.sparkfun.com/products/9218"&gt;Arduino Mini&lt;/a&gt; this time, just due to the space constraint. The sensors are on a Sparkfun Razor 6DOF IMU, which I would link to but Sparkfun seems to have discontinued it within the last day or two. I've got a few buffered, but it does bother me that they're ditching the only analog-output 6DOF board, and that I will have to rework the documentation for this and other projects that relied on this part. &amp;nbsp;&amp;gt;_&amp;lt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;For wireless control, an &lt;a href="http://www.digi.com/products/wireless-wired-embedded-solutions/zigbee-rf-modules/point-multipoint-rfmodules/xbee-series1-module#overview"&gt;XBee&lt;/a&gt; radio module is hidden on the bottom layer. These have become my standard for &lt;a href="http://scolton.blogspot.com/p/pirate-radio-control.html"&gt;custom RC&lt;/a&gt;, one of the building blocks I can rely on to just work. The XBee link has several advantages over normal RC Tx/Rx systems. First, it is not constrained by the 20ms servo PWM &amp;nbsp;period, so the control bandwidth can be higher. It can have bidirectional data transfer, which is useful for debugging and real-time data visualization (virtual quadrotor!). And since the other end of the XBee goes to my laptop, I can control it with any USB HID controller.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The full layout is in the title image above, and in high-res &lt;a href="http://1.bp.blogspot.com/-uFt1GupjZLE/TkXDpV116HI/AAAAAAAABKk/AyhvNGZG2RA/s1600/4p14.jpg"&gt;here&lt;/a&gt;. Lead time on the boards will be about 10 days, so the next update will be in a couple weeks. Back to tinyKart...&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8200098102909041178-8093965413815011304?l=scolton.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scolton.blogspot.com/feeds/8093965413815011304/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scolton.blogspot.com/2011/08/4pcb-printed-circuit-board-quadrotor.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/8093965413815011304'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/8093965413815011304'/><link rel='alternate' type='text/html' href='http://scolton.blogspot.com/2011/08/4pcb-printed-circuit-board-quadrotor.html' title='4pcb: A Printed Circuit Board Quadrotor.'/><author><name>Shane Colton</name><uri>http://www.blogger.com/profile/10603406287033587039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-uFt1GupjZLE/TkXDpV116HI/AAAAAAAABKk/AyhvNGZG2RA/s72-c/4p14.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8200098102909041178.post-6367087596287954720</id><published>2011-08-04T12:28:00.000-07:00</published><updated>2011-08-04T12:55:32.474-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tinykart'/><title type='text'>tinyKart: Round 4</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;iframe allowfullscreen="" frameborder="0" height="330" src="http://www.youtube.com/embed/HY4HKl693IY?rel=0" width="400"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;I've been preoccupied with&amp;nbsp;&lt;a href="https://stellar.mit.edu/S/project/robocon-2011/"&gt;Robocon&lt;/a&gt;, the International Design Contest which this year is hosted at MIT. But somewhere in the past week we found some time to complete the rolling chassis on tinyKart. The tires came in, so this was the moment of truth for the custom aluminum frame. And as you can see in the video above, it actually rolls (past the unfortunately copper-deficient &lt;a href="http://www.etotheipiplusone.net/?page_id=197"&gt;LOLrioKart&lt;/a&gt;).&amp;nbsp;The chassis itself weighs only about 40lbs, so we were quite happy to see it handle the full weight of a driver and not simple bend in half.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The tires are 8"x2" pneumatics with tubes from &lt;a href="http://www.electricscooterparts.com/"&gt;ElectricScooterParts&lt;/a&gt;. They're certainly not for racing, but they &lt;i&gt;are&lt;/i&gt;&amp;nbsp;remarkably light, which is the point in this case. They are high-pressure (70-80psi) so they roll very well, though the ride may be a little rough outside. We will probably run them closer to 60psi since we have four points of contact with the ground and they're normally used on scooters with two.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-ivZ4kHJd2Mo/TjrqzW0KJ7I/AAAAAAAABKQ/o_M-5ruOe1A/s1600/dm78.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-ivZ4kHJd2Mo/TjrqzW0KJ7I/AAAAAAAABKQ/o_M-5ruOe1A/s400/dm78.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Other than that, the only addition here is a Vise-Grip steering wheel. That will soon be replaced with a custom job. One interesting thing about tinyKart will be the hand-based throttle and brake (no pedals). More on that to come when we install them, but I think it will be incredibly fun to drive.&amp;nbsp;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;A few more pictures of the substantially completed chassis:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-X7c6tg41lgs/Tjrw5lFHDOI/AAAAAAAABKU/rauy7is7OPg/s1600/dm79.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-X7c6tg41lgs/Tjrw5lFHDOI/AAAAAAAABKU/rauy7is7OPg/s400/dm79.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Slackermann steering geometry at work.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-Owb1TkMLl8o/TjrxCcNVJoI/AAAAAAAABKY/K_v2d76evmQ/s1600/dm77.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/-Owb1TkMLl8o/TjrxCcNVJoI/AAAAAAAABKY/K_v2d76evmQ/s400/dm77.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;More 80/20 for the steering column support.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-4MDjjkmpTog/TjrxEt_cCpI/AAAAAAAABKc/xz0dGHUBJsU/s1600/dm80.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-4MDjjkmpTog/TjrxEt_cCpI/AAAAAAAABKc/xz0dGHUBJsU/s400/dm80.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Thin as a razor blade...&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-biKRuRC1ibM/TjrxGGLwjqI/AAAAAAAABKg/QXcBZS5ccrw/s1600/dm81.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-biKRuRC1ibM/TjrxGGLwjqI/AAAAAAAABKg/QXcBZS5ccrw/s400/dm81.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Convenient storage position.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;div style="text-align: left;"&gt;Next up: Electrons. Thousands of them. Actually thousands of billions of billions of them...per second.&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8200098102909041178-6367087596287954720?l=scolton.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scolton.blogspot.com/feeds/6367087596287954720/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scolton.blogspot.com/2011/08/tinykart-round-4.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/6367087596287954720'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/6367087596287954720'/><link rel='alternate' type='text/html' href='http://scolton.blogspot.com/2011/08/tinykart-round-4.html' title='tinyKart: Round 4'/><author><name>Shane Colton</name><uri>http://www.blogger.com/profile/10603406287033587039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://img.youtube.com/vi/HY4HKl693IY/default.jpg' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8200098102909041178.post-4615347612636218706</id><published>2011-07-30T18:57:00.000-07:00</published><updated>2011-07-30T18:58:02.025-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tinykart'/><title type='text'>tinyKart: Round 3</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: left;"&gt;The quest for an ultralight go-kart continues...&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-ZLvL3BctZDI/TjSoQbVx1QI/AAAAAAAABJQ/0hF0dgS6UcA/s1600/dm75.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/-ZLvL3BctZDI/TjSoQbVx1QI/AAAAAAAABJQ/0hF0dgS6UcA/s400/dm75.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;In the &lt;a href="http://scolton.blogspot.com/2011/07/tinykart-round-2.html"&gt;last update&lt;/a&gt;, we had assembled the two critical front wheel modules, which allowed us to complete the aluminum plate and 80/20 sandwich that is the front of the chassis. With that, the basic structure of the kart was complete and we could get a look at the full size and shape of tinyKart:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-Runs8ABRec0/TjSo8XoZKvI/AAAAAAAABJU/g-Wb6wtSIsA/s1600/dm65.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-Runs8ABRec0/TjSo8XoZKvI/AAAAAAAABJU/g-Wb6wtSIsA/s400/dm65.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;So tempted to throw this on the railroad tracks...&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;The &lt;a href="http://1.bp.blogspot.com/-5vmbDCTaXUo/Tgv1OndFeYI/AAAAAAAABEA/TK9Ys-VsHEE/s1600/dm18.jpg"&gt;rear drive modules&lt;/a&gt; attach to the rear 80/20 frame using standard t-nuts, though we did have to drill an access hole on the inside of the side rails for the single 1/4-20 screw which holds the rear wheel shafts in place. Each drive module has a single Turnigy &lt;a href="http://www.hobbyking.com/hobbyking/store/uh_viewItem.asp?idProduct=7870"&gt;SK6374-170&lt;/a&gt; motor driving an HTD 5M-15 belt with a gear ratio of 4.5:1. This will give a top speed of....I have no idea. It depends on the motor's performance under sensored control. More on that to come.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-S2QVkqWautM/TjSqaEgT3II/AAAAAAAABJY/MzhcdRx_qzk/s1600/dm63.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/-S2QVkqWautM/TjSqaEgT3II/AAAAAAAABJY/MzhcdRx_qzk/s400/dm63.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The standoffs and outboard plates for the drive modules have been fabricated, so all that remains are the belt tensioners. We may also modify the motor pulley to have a set screw hub on both sides to leave open the possibility of attaching a second motor to the outboard plate, with the two shafts coupled by the pulley itself. This would not be for the ultralight version, but rather for a high-performance follow-up. With just one motor per side, the peak force at the ground should still be close to 100lbf.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Thus far, the build had been fairly 2D: plates, extrusions, and right angles. The steering linkages and seat mount are where the interesting angles start to come in. Here's one of the tie rods:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-nctwM2MJ790/TjSs_5UvfpI/AAAAAAAABJc/wIeDEGoimgA/s1600/dm60.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/-nctwM2MJ790/TjSs_5UvfpI/AAAAAAAABJc/wIeDEGoimgA/s400/dm60.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Normally, a tie rod would just have one ball joint on each end, the 3D equivalent to a pin joint in a planar mechanism. But here I wanted the steering linkage to go in the 1" gap between the front chassis plates. So, I came up with this Non-Collocated Ball Joint which is really just two pin joints, one in the horizontal plane and one in a vertical plane. Together, they remove the same degrees of freedom as a single pin joint, but they allow part of the tie rod to be completely planar and thus fit in the tight space between chassis plates:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-USFL1y1Fw0k/TjSubjpvU5I/AAAAAAAABJk/-wbFHzO9g8c/s1600/dm67.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-USFL1y1Fw0k/TjSubjpvU5I/AAAAAAAABJk/-wbFHzO9g8c/s400/dm67.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Vertical pin joint.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-j6d7ppVLKM8/TjSuNBSVCJI/AAAAAAAABJg/NBt2H0RkzjU/s1600/dm69.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-j6d7ppVLKM8/TjSuNBSVCJI/AAAAAAAABJg/NBt2H0RkzjU/s400/dm69.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;The horizontal pin joint fits, just barely.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;The other end of the tie rod is a straightforward ball joint going to the driving link on the steering column:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-FodFBwzlDYc/TjSur3EysaI/AAAAAAAABJo/uGihhsB4kA4/s1600/dm68.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/-FodFBwzlDYc/TjSur3EysaI/AAAAAAAABJo/uGihhsB4kA4/s400/dm68.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The rod itself is 1/4-28 threaded steel rod with a 3/8" aluminum sleeve over it. Bling nuts on either side of the sleeve put the sleeve in compression and the rod in tension. This bit of preload makes the combined rod much stiffer and ensures it won't buckle on the "pushing" side of the steering linkage. Here's the whole linkage:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-w_jGLKCWXGY/TjSvUHOx1ZI/AAAAAAAABJs/cjUlHchGr84/s1600/dm66.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-w_jGLKCWXGY/TjSvUHOx1ZI/AAAAAAAABJs/cjUlHchGr84/s400/dm66.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;There are several ways to adjust the linkage: The easiest seems to be to change the length of threaded rod passing through the vertical pin joint block. This can be used to adjust the toe angle and alignment of the front wheels. These dimensions also depend on the angle of the steering column, which is adjustable (for now) by pivoting a block that acts as the bottom bearing for the column itself:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-4id4IzLQeW0/TjSwRHWfkqI/AAAAAAAABJw/YdYfCNXuvKo/s1600/dm70.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-4id4IzLQeW0/TjSwRHWfkqI/AAAAAAAABJw/YdYfCNXuvKo/s400/dm70.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;That potentiometer might come in handy...&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;Still to be fabricated is the second support for the steering column. Once that is in place, an overall fine-tuning and stiffness assessment will be necessary. Some of the pin joints could use a bit of tweaking to take out as much play as possible, but overall it &lt;i&gt;seems&lt;/i&gt;&amp;nbsp;like it will do the job. If there is one thing I am still worried about, though, it's the performance of the front wheel systems under load. It all went together too easily...&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The seat mount was the last bit of critical structure to add. The bottom of the seat is just bolted to the 80/20 rail that comes across the front of the rear chassis assembly. The back, though, needs to be supported in 3D by a set of braces:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-KbIWE-jaGV0/TjSyAU4gAqI/AAAAAAAABJ0/EOvD7WFitvk/s1600/dm71.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/-KbIWE-jaGV0/TjSyAU4gAqI/AAAAAAAABJ0/EOvD7WFitvk/s400/dm71.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;One brace, constructed in a manner similar to the steering linkage, connects the side of the seat to the side rail of the rear chassis. Another brace, a strip of 1/4" aluminum, links the side of the seat to the rear rail. &amp;nbsp;This provides stiffness in all directions and actually makes the frame itself stiffer as well, since it now has structure outside the plane of the main chassis rails. Okay, so it's not a space frame, but for a group that makes everything out of 80/20 and plate stock, I think we did pretty well in 3D.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The moment of truth: a weigh-in with a makeshift steering wheel (vise grip), the controllers, and the batteries dangling from various frame rails:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-8XONR4A2Lus/TjSzXR0ryhI/AAAAAAAABJ8/JQzuewVXmXQ/s1600/dm73.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="400" src="http://1.bp.blogspot.com/-8XONR4A2Lus/TjSzXR0ryhI/AAAAAAAABJ8/JQzuewVXmXQ/s400/dm73.jpg" width="300" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Shaaady...&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-s7GOaGNYNtQ/TjSzhN3qVjI/AAAAAAAABKA/Udu9aGPVuFc/s1600/dm72.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240" src="http://2.bp.blogspot.com/-s7GOaGNYNtQ/TjSzhN3qVjI/AAAAAAAABKA/Udu9aGPVuFc/s320/dm72.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Noticeably absent are the tires and tubes, which should weigh about 3lbs total, the tensioners, the second steering column support, and the wiring. Not noticeably absent but probably the weight killer is minor hardware like controller mounts, switches, etc. I think we will need to take about 2-3lbs off of our current configuration to meet a 50lb target. Otherwise, 53lbs is the weight of one of Cap Kart's old lead-acid batteries, which was also a potential target. I would not be disappointed either way.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-OtxJwU4toqY/TjSzERnd4xI/AAAAAAAABJ4/UtF8PUvq9po/s1600/dm61.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-OtxJwU4toqY/TjSzERnd4xI/AAAAAAAABJ4/UtF8PUvq9po/s400/dm61.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Onward...&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8200098102909041178-4615347612636218706?l=scolton.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scolton.blogspot.com/feeds/4615347612636218706/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scolton.blogspot.com/2011/07/tinykart-round-3.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/4615347612636218706'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/4615347612636218706'/><link rel='alternate' type='text/html' href='http://scolton.blogspot.com/2011/07/tinykart-round-3.html' title='tinyKart: Round 3'/><author><name>Shane Colton</name><uri>http://www.blogger.com/profile/10603406287033587039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-ZLvL3BctZDI/TjSoQbVx1QI/AAAAAAAABJQ/0hF0dgS6UcA/s72-c/dm75.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8200098102909041178.post-6686730558747108134</id><published>2011-07-21T20:51:00.000-07:00</published><updated>2011-08-21T21:01:15.663-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tinykart'/><title type='text'>tinyKart: Round 2</title><content type='html'>Round 2 is all about putting together the steering things:&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-W6bokj0ZEUw/Tgv7RZ0FSLI/AAAAAAAABEI/9MAfMi0xo2k/s1600/dm22.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="333" src="http://2.bp.blogspot.com/-W6bokj0ZEUw/Tgv7RZ0FSLI/AAAAAAAABEI/9MAfMi0xo2k/s400/dm22.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;These things.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;But first, armed with many more t-nuts, we finished putting together the lightweight 80/20 frame:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-RLPmy58N2IU/TijrYNLmcqI/AAAAAAAABIs/V1b2HKZjBoQ/s1600/dm45.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="298" src="http://2.bp.blogspot.com/-RLPmy58N2IU/TijrYNLmcqI/AAAAAAAABIs/V1b2HKZjBoQ/s400/dm45.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;It's more like 0.75-scale kart.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"&gt;Next up, pressing 1/2" ID bearings into the steering reinforcement wings, a.k.a. the "cool parts":&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-ufE3B-9HSe0/Tijr5AplyDI/AAAAAAAABIw/G7yThzmkSg4/s1600/dm46.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-ufE3B-9HSe0/Tijr5AplyDI/AAAAAAAABIw/G7yThzmkSg4/s400/dm46.jpg" style="cursor: move;" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Easy so far. The moving assembly includes a front wheel, brake disk, brake caliper, and a control arm (not shown in the above picture because it's between the chassis plates). To hold all of this together, there's a little bit of 1/4" plate jigsaw puzzling:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-4xiRG3iIU90/TijogRuUQjI/AAAAAAAABIg/0W2uOPNyTYE/s1600/dm58.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="310" src="http://2.bp.blogspot.com/-4xiRG3iIU90/TijogRuUQjI/AAAAAAAABIg/0W2uOPNyTYE/s400/dm58.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The control arm doubles as a support for the lower thrust bearing. It, and the upper thrust bearing support, slip (press) into what would normally be called the upright, if it wasn't so short not-upright. I'll just call it the shaft mount. Then, three 4-40 screws pass through the shaft mount, the upper thrust bearing support, the shaft mount again, and finally thread into the control arm.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-aVc-SVuVknc/TijpLDbITdI/AAAAAAAABIk/kdbfUqYo7ho/s1600/dm48.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/-aVc-SVuVknc/TijpLDbITdI/AAAAAAAABIk/kdbfUqYo7ho/s400/dm48.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Like so.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;I guess I forgot one important step (in real life, too, the first time): &lt;i&gt;First&lt;/i&gt;, the 1/4-20 cap screw that threads into the front wheel shaft must be in place, with its head in the relief cut in the top and bottom thrust bearing supports. So far, so good. &amp;nbsp;To properly align and stiffen the thrust bearing supports, three countersunk 1/4-20 screws with plastic spacers pass from top to bottom:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-3iS92xGps6c/Tijp9HsvcKI/AAAAAAAABIo/Fx9_wl40DuQ/s1600/dm51.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-3iS92xGps6c/Tijp9HsvcKI/AAAAAAAABIo/Fx9_wl40DuQ/s400/dm51.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The image above also shows the brake caliper mount. The brake calipers will need some shimming, but they're at least located to within a few millimeters axially. No major machining or design mistakes there. Finally, we attached the front wheel shaft. This requires removing one of the screw/spacer combos and shoving a hex key in between the thrust bearing supports. It's kind-of a pain, and we don't want it to come loose ever, so we Loctited the shit out of it.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-GgsGWXg5FYg/Tijsp5-6BYI/AAAAAAAABI0/c3ZbO08hMN8/s1600/dm59.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-GgsGWXg5FYg/Tijsp5-6BYI/AAAAAAAABI0/c3ZbO08hMN8/s400/dm59.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;After the two front wheel assemblies were together, we had to ream the kingpin holes since (a) they were undersized to begin with and (b) there's nothing really aligning the top and bottom thrust bearing supports. Luckily, we bought a 0.499" reamer two years ago for reaming &lt;a href="http://scolton.blogspot.com/p/bwd-scooter.html#bwd"&gt;BWD&lt;/a&gt;'s stators, and it hasn't disappeared.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-LHxqF_PYGcU/TijtkiH0-ZI/AAAAAAAABI4/kdh2aPYPSO0/s1600/dm44.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/-LHxqF_PYGcU/TijtkiH0-ZI/AAAAAAAABI4/kdh2aPYPSO0/s400/dm44.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;MillKart&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;The kingpins were quickly fabricated from 1/2" 7075:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-uwKJQUL0Jtc/TijvBREj1hI/AAAAAAAABI8/HTYffcVhWUI/s1600/dm50.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-uwKJQUL0Jtc/TijvBREj1hI/AAAAAAAABI8/HTYffcVhWUI/s400/dm50.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The result is a tight fit to the 0.499" hole, but not so tight that you can't force it back and forth with a rubber mallet. And it's a slip fit in the two "cool part" bearings. Those are the radial bearings that support the bending load on the kingpin, but there are also two needle-roller thrust bearings:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-dRFUC1UwxoM/Tijvb6V6u4I/AAAAAAAABJA/fBNQiP4QV0M/s1600/dm53.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-dRFUC1UwxoM/Tijvb6V6u4I/AAAAAAAABJA/fBNQiP4QV0M/s400/dm53.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;And then the top plates complete the sandwich:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-IhdMX6k1y7g/TijvqNr_qjI/AAAAAAAABJE/1WRIbrIzEG4/s1600/dm54.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-IhdMX6k1y7g/TijvqNr_qjI/AAAAAAAABJE/1WRIbrIzEG4/s400/dm54.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-HreYPLYVRq0/TijvvrrNZkI/AAAAAAAABJI/8qxu9C_sXoM/s1600/dm56.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-HreYPLYVRq0/TijvvrrNZkI/AAAAAAAABJI/8qxu9C_sXoM/s400/dm56.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-iDUcZIyp2n0/TijwEtF04aI/AAAAAAAABJM/a7Lgy5LrSGA/s1600/dm57.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-iDUcZIyp2n0/TijwEtF04aI/AAAAAAAABJM/a7Lgy5LrSGA/s400/dm57.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The end result is a nice, stiff steering pivot with radial and thrust bearings on top and bottom.The frame passes the "stand on it" test, though it is a little more flexible than I thought it would be. We'll see how it changes with the added structure from the seat mounts. Total weight of the chassis so far is 21.5lbs. Still have the entire powertrain to add. The good news is that the controllers are a bit lighter than expected, so 50lbs still seems within reach.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Next up: steering linkage, motor mounts, and controller testing.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8200098102909041178-6686730558747108134?l=scolton.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scolton.blogspot.com/feeds/6686730558747108134/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scolton.blogspot.com/2011/07/tinykart-round-2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/6686730558747108134'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/6686730558747108134'/><link rel='alternate' type='text/html' href='http://scolton.blogspot.com/2011/07/tinykart-round-2.html' title='tinyKart: Round 2'/><author><name>Shane Colton</name><uri>http://www.blogger.com/profile/10603406287033587039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-W6bokj0ZEUw/Tgv7RZ0FSLI/AAAAAAAABEI/9MAfMi0xo2k/s72-c/dm22.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8200098102909041178.post-4357814426426417</id><published>2011-07-18T01:28:00.000-07:00</published><updated>2011-07-18T01:28:00.696-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='directdrive'/><category scheme='http://www.blogger.com/atom/ns#' term='motor control'/><title type='text'>DirectDrive v1.0: 2.4kVA Test</title><content type='html'>After my &lt;a href="http://scolton.blogspot.com/2011/07/directdrive-v10-first-three-phase-tests.html"&gt;ducted fan load tester&lt;/a&gt; turned out to be basically unworkable, I decided to go back to lower-RPM motors. This way I'm not simultaneously testing the controller's basic functionality and the ability of my FOC algorithm to handle greater than 1,000Hz electrical frequency (it can't).&lt;br /&gt;&lt;br /&gt;The first candidate: a re-wound and sensored Turnigy 8085-170 motor:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-NyQIxiociHY/TiPhVNT-hrI/AAAAAAAABIM/ShZ6MxY_A98/s1600/dd67.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/-NyQIxiociHY/TiPhVNT-hrI/AAAAAAAABIM/ShZ6MxY_A98/s400/dd67.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Well this pretty much didn't work at all. There's some issue with the sensors that makes it sound horrible, and also it's too small to be able to sink a lot of power internally.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-LAZ1azKlY8Y/TiPhwxqgCHI/AAAAAAAABIQ/66gODSJ50Wg/s1600/dd68.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-LAZ1azKlY8Y/TiPhwxqgCHI/AAAAAAAABIQ/66gODSJ50Wg/s400/dd68.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;I decided to stop when the hot glue holding the sensors in started melting.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;Anyway, that was just a little distraction before the real show:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-UPJYxGnfWaY/TiPiArLfLmI/AAAAAAAABIU/tToMq6S7uU4/s1600/dd69.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/-UPJYxGnfWaY/TiPiArLfLmI/AAAAAAAABIU/tToMq6S7uU4/s400/dd69.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Eeeeeteeek.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;The &lt;a href="http://www.robotmarketplace.com/products/ETK-ETEKBL.html"&gt;Mars PMAC&lt;/a&gt; (brushless Etek) is probably my favorite load-test motor. It's so big that you can't really hurt it, at least not in the time scales of a bench test. I put the DirectDrive controller on its edge to give the heat sink a tiny bit of natural convection, but no active cooling for this test. I wanted to see the temperature rise. Nice, steady temperature rise, and no spontaneous FET destruction.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Now here is where it gets interesting. Short of coupling it to a second Etek, there's not much I can do to apply mechanical load to the motor. (At least with the ducted fan, I had a way of doing so.) So, instead, I brought the motor up to speed under ideal timing conditions, i.e. manipulating the phase of the drive voltage until the current draw is at a minimum. Then, at nearly full voltage amplitude, I threw the timing way off so that the motor begins to draw 100A (phase peak).&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-IPtF3vASmmE/TiPkbUVSZkI/AAAAAAAABIY/IFVPtskfOEE/s1600/Etek1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="377" src="http://4.bp.blogspot.com/-IPtF3vASmmE/TiPkbUVSZkI/AAAAAAAABIY/IFVPtskfOEE/s400/Etek1.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;And I let it sit that way for one minute. The phase voltage is a sine wave with an amplitude of 16V. The phase current is a sine wave with an amplitude of 100A. But...they're not in phase. So the real power is still low, but the &lt;a href="http://en.wikipedia.org/wiki/AC_power#Real.2C_reactive.2C_and_apparent_powers"&gt;apparent power&lt;/a&gt; is 2.4kVA (1.5*100A*16V). The good thing about this load is that it can all be run off a bench power supply, no need to break out the giant batteries yet.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;But is it actually a representative test of the controller? It doesn't really test anything outside of the bus capacitor, where the DC current is determined by real power only. But what I'm still not sure about is how it looks to the inverter itself. Here's what it comes down to:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-CAbj0EVxbXE/TiPpQoVs9PI/AAAAAAAABIc/UI-uY5ynYMo/s1600/dd70.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://1.bp.blogspot.com/-CAbj0EVxbXE/TiPpQoVs9PI/AAAAAAAABIc/UI-uY5ynYMo/s320/dd70.jpg" width="229" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The RMS current is the same regardless of the phase angle. The only thing that changes is the phase of the sine wave that the duty cycle traces out. But, the MOSFETs are still either blocking 36V or carrying their share of the current at any given instant. It makes sense, then, that both the conduction losses and the switching losses should be the same regardless of the relative phase of the current with respect to the duty cycle. Anyone care to confirm or refute this?&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;If that is the case, than I'm happy with the test results. A minute of running at 100A with passive cooling yielded a temperature rise of 15ºC. I would guess that the heat sink mass is about 0.25kg. If it was mostly just absorbing power (with no active cooling and very little temperature gradient, this is true), then a &lt;a href="http://www.wolframalpha.com/input/?i=%28copper+specific+heat%29*%2815+Kelvin+difference%29*0.25kg%2F%2860+seconds%29"&gt;quick estimate&lt;/a&gt; of the power dissipated in the inverter is 24W, which is exactly where it should be for 100A.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;More testing to come.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8200098102909041178-4357814426426417?l=scolton.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scolton.blogspot.com/feeds/4357814426426417/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scolton.blogspot.com/2011/07/directdrive-v10-24kva-test.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/4357814426426417'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/4357814426426417'/><link rel='alternate' type='text/html' href='http://scolton.blogspot.com/2011/07/directdrive-v10-24kva-test.html' title='DirectDrive v1.0: 2.4kVA Test'/><author><name>Shane Colton</name><uri>http://www.blogger.com/profile/10603406287033587039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-NyQIxiociHY/TiPhVNT-hrI/AAAAAAAABIM/ShZ6MxY_A98/s72-c/dd67.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8200098102909041178.post-8071010854013655999</id><published>2011-07-15T02:15:00.000-07:00</published><updated>2011-07-15T02:15:19.567-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='directdrive'/><category scheme='http://www.blogger.com/atom/ns#' term='motor control'/><title type='text'>DirectDrive v1.0: First Three-Phase Tests</title><content type='html'>After &lt;a href="http://scolton.blogspot.com/2011/06/directdrive-simple-meche-solution.html"&gt;provisionally solving&lt;/a&gt; the first big problem with &lt;a href="http://scolton.blogspot.com/2011/06/directdrive-well-it-certainly-looks.html"&gt;DirectDrive v1.0&lt;/a&gt;, the current sensor coupling, it was time to port my three-phase brushless field-oriented control software over and do some testing on an actual motor. I decided not to bother with &lt;a href="http://scolton.blogspot.com/p/bwd-scooter.html#pneu"&gt;Pneu Scooter&lt;/a&gt;'s hub motor, since at most it could handle 750-1,000W for a short period of time and I'm looking to hit 5-10kW peak. Though really it would be a better intermediate step than what I wound up using...&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-5pMiskh8X7w/Th_zer1jLmI/AAAAAAAABHg/0tuRP2OHOCI/s1600/dd59.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/-5pMiskh8X7w/Th_zer1jLmI/AAAAAAAABHg/0tuRP2OHOCI/s400/dd59.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Nothing about this seems like a good idea now.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;"Isn't using an electric ducted fan to load test a motor controller a great idea? It can sink tons of power and it cools itself!" Well, that was the original thought anyway. This is the giant &lt;a href="http://www.hobbyking.com/hobbyking/store/uh_viewItem.asp?idProduct=17617"&gt;120mm EDF&lt;/a&gt; from Hobby King, which can produce upwards of 4kg of thrust (the same as &lt;a href="http://scolton.blogspot.com/p/bwd-scooter.html#KM"&gt;KM Scooter&lt;/a&gt;'s eight blower fans...combined). They're meant to be used in model jets, but you could probably &lt;a href="http://www.etotheipiplusone.net/?p=1462"&gt;do other things silly things&lt;/a&gt; with them if you wanted. I bought one specifically for load testing, since they're only $43. Mine uses a &lt;a href="http://www.hobbyking.com/hobbyking/store/uh_viewItem.asp?idProduct=11102"&gt;this 4030-1100 motor&lt;/a&gt;.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;With this load tester, I thought I would try something new for sensing rotor position. I printed out an optical encoder disk with eight black and white segments, which I double-side taped to the back of the motor:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-jNVTw6L1-gE/Th_2rhwb8bI/AAAAAAAABHk/MUTffJDxCkc/s1600/dd54.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-jNVTw6L1-gE/Th_2rhwb8bI/AAAAAAAABHk/MUTffJDxCkc/s400/dd54.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;And I used a three-phase set of infrared optical reflectance sensors to pick up the signal:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-eJ3lo5zpJNI/Th_3MLO2qvI/AAAAAAAABHo/2L2pOny6rUQ/s1600/dd55.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-eJ3lo5zpJNI/Th_3MLO2qvI/AAAAAAAABHo/2L2pOny6rUQ/s400/dd55.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-NAHtzIxQo3I/Th_3RQ1_eAI/AAAAAAAABHs/RHVz5mL2FBA/s1600/dd57.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-NAHtzIxQo3I/Th_3RQ1_eAI/AAAAAAAABHs/RHVz5mL2FBA/s400/dd57.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;These mimic the function of the Hall effect sensors I would normally use in this application. They differ in a few important and annoying ways, though. For one, they are analog sensors, producing a variable voltage in response to the relative reflectance of the surface in front of them. To get them to act as digital inputs, I have to set them up with a 10k pull-up resistor and put them at about 4mm from the encoder disk. Then, they produce a 4Vpp square-ish wave. But with a 10k resistor, the normal RC filter I would use on the Hall effect sensors won't work, so I had to swap it for one with lower capacitance. The net result is a sensor signal that is less precise and more vulnerable to noise than Hall effect sensors would be.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Back to that in a minute. First, I made the awesome copper heat sink a more permanent feature by drilling and tapping 4-40 mounting holes for it:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-KgQb6qoYVbA/Th_42kNvXpI/AAAAAAAABHw/_jPLJ_-6zq8/s1600/dd61.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-KgQb6qoYVbA/Th_42kNvXpI/AAAAAAAABHw/_jPLJ_-6zq8/s400/dd61.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-9SJAyEn2H40/Th_46wUPsNI/AAAAAAAABH0/apDsdBhAKrg/s1600/dd62.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-9SJAyEn2H40/Th_46wUPsNI/AAAAAAAABH0/apDsdBhAKrg/s400/dd62.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Notice that I still have the wires coming straight off the board in the direction that minimizes coupling of the two Hall effect-based phase current sensors. I set up the load test rig on what has become the Table of Load Test Rigs:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-QDB2vcwFRHA/Th_5QXfc2VI/AAAAAAAABH4/AY4jV74kx3Q/s1600/dd60.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-QDB2vcwFRHA/Th_5QXfc2VI/AAAAAAAABH4/AY4jV74kx3Q/s400/dd60.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Notice the face-to-face dynamometer in the background.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;The software on my laptop might look familiar. It's the same GUI and data logging setup I used for Cap Kart and Pneu Scooter - very handy tool. One thing that's nice about DirectDrive is that, for whatever reason, it doesn't cause my USB port to freak out when it's under load. So far I have not had to use the XBee radio to collect data.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;I somehow managed to get the right sensor and phase combinations on the first try, and was happy to see that &amp;nbsp;the motor spun up nicely. The current sensors, temperature sensor, and other bits and pieces seemed to be working properly. But the motor was drawing way too much current, even no-load (with the fan rotor removed). By that I mean it was drawing almost as much current with the fan as without. Now, this &lt;i&gt;is&lt;/i&gt;&amp;nbsp;a load test, so in some sense that's good, but I would prefer the majority of the power to get dumped into the air, not the motor.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;After a day of debating (grad student-ing), I decided that the most likely cause was the shady optical sensor rig. On a hunch, I took the data I had collected from the test run and did a histogram of the sensor states. There are six: 001, 011, 010, 110, 100, and 101. If everything is working properly, they should all occur with the same frequency.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-_8iRLATWES0/Th_9cJ4QbcI/AAAAAAAABIA/3UAo8jmUJF8/s1600/dd66.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="293" src="http://2.bp.blogspot.com/-_8iRLATWES0/Th_9cJ4QbcI/AAAAAAAABIA/3UAo8jmUJF8/s400/dd66.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;If instead your sensor histogram is giving you the middle finger, well then you know you have issues. You can even figure out what the issue is with a little bit of logic:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-GdLcgsr5B1o/Th_9nak_5vI/AAAAAAAABIE/XS4y2CjNS7A/s1600/DD65.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-GdLcgsr5B1o/Th_9nak_5vI/AAAAAAAABIE/XS4y2CjNS7A/s400/DD65.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The top set is what the sensor signals should look like if things are working properly. The bottom set has Phase A shifted left a bit. The result adds time to states 3 and 4 and removes time from states 2 and 5. And guess what:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-tGBj5W5KA5E/Th_-S67hCxI/AAAAAAAABII/NPqt1JwkzK0/s1600/dd64.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/-tGBj5W5KA5E/Th_-S67hCxI/AAAAAAAABII/NPqt1JwkzK0/s400/dd64.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;That was exactly the problem.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;I was able to tweak the position of the Phase A, and it definitely helped, but I think the motor still draws a lot more no-load current than it could if the sensor timing were more consistent. The edges of the square waves are also pretty soft, and I'm relying on the input pin &lt;a href="http://en.wikipedia.org/wiki/Schmitt_trigger"&gt;Schmitt triggers&lt;/a&gt; to make it work. It only gets uglier at higher speeds.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Speaking of high speeds, there is another reason why this is a stupid load test. Thus far, the fastest motor I've run with my FOC code is the 40,000rpm 2-pole inrunner from my &lt;a href="http://scolton.blogspot.com/p/pirate-radio-control.html#rc10"&gt;RC car&lt;/a&gt;. But at those speeds, the rotor position estimate starts to become imprecise and unreliable. Now this is a 20,000rpm 8-pole outrunner. The electrical frequency is over 1,000Hz. Trying to fit a sine wave at 10kHz onto 1,000Hz is almost useless. High speed FOC &lt;i&gt;is&lt;/i&gt; an interesting problem, but not one that I want to solve&amp;nbsp;simultaneously&amp;nbsp;while load-testing a brand new controller design.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;So, sadly, I may have to abandon my new load tester. It &lt;i&gt;can&lt;/i&gt;&amp;nbsp;get to high currents, since the motor has such a low resistance. De-tuning the timing by even a few degrees in either direction causes the current to quickly shoot up, even at low speeds. So I ran it at 50A, and nothing seemed to mind, but it's 50A at something like 6V output instead of the 50A at 40V output, which would be a much more interesting test. Unless I can get the fan rotor up above 10,000rpm, which isn't going to happen easily, there's just no way to get any power through it.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Time for a &lt;a href="http://www.etotheipiplusone.net/pics/xshield5.jpg"&gt;new plan&lt;/a&gt;.&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8200098102909041178-8071010854013655999?l=scolton.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scolton.blogspot.com/feeds/8071010854013655999/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scolton.blogspot.com/2011/07/directdrive-v10-first-three-phase-tests.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/8071010854013655999'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/8071010854013655999'/><link rel='alternate' type='text/html' href='http://scolton.blogspot.com/2011/07/directdrive-v10-first-three-phase-tests.html' title='DirectDrive v1.0: First Three-Phase Tests'/><author><name>Shane Colton</name><uri>http://www.blogger.com/profile/10603406287033587039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-5pMiskh8X7w/Th_zer1jLmI/AAAAAAAABHg/0tuRP2OHOCI/s72-c/dd59.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8200098102909041178.post-7992092485140274106</id><published>2011-07-11T21:25:00.000-07:00</published><updated>2011-07-11T21:31:20.024-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tinykart'/><title type='text'>tinyKart: Round 1</title><content type='html'>By popular demand, more picture of crazy vehicles, and less math:&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-W5BvGxfZFd4/Thu8gWEcfSI/AAAAAAAABGo/0lnFYxMfIQ0/s1600/dm30.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/-W5BvGxfZFd4/Thu8gWEcfSI/AAAAAAAABGo/0lnFYxMfIQ0/s400/dm30.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Extrude...thin feature...mid-plane...&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;That's the size of tinyKart. So I don't know, maybe it's not really in the &lt;a href="http://amymakesstuffdotcom.files.wordpress.com/2011/06/go-cart-01-wd.jpg"&gt;tiny&lt;/a&gt; class, more like miniKart. But whatever, we'll still call it tinyKart since it's going to be 1/5th the weight of Cap Kart.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Step one in the tinyKart fabrication adventure is the acquisition of a large amount of waterjet-cut aluminum plate. The front half of tinyKart is a sandwich consisting of two 1/8" plates with 1" 80/20 t-slot extrusion in the middle. In addition to this, the rear frame, motor mounts, steering system, and brake caliper mounts are made of a combination of 1/8" and 1/4" aluminum plate. None of the waterjets that I have access to can handle 30" lengths of plate, so the entirety of the plate stock was sent out to the &lt;a href="http://www.bigbluesaw.com/"&gt;Big Blue Saw&lt;/a&gt;. A week or so later,&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-NM99_Ny8W8M/Thu-gHHEtKI/AAAAAAAABGs/h8wcZy_DnHA/s1600/dm28.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/-NM99_Ny8W8M/Thu-gHHEtKI/AAAAAAAABGs/h8wcZy_DnHA/s400/dm28.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Kit Kart!&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;It's always fun to see your 3D model almost instantly become a real thing.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-rFtmcTGv8Fc/Thu-3rXogQI/AAAAAAAABGw/m1hMOdjPR8w/s1600/dm33.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/-rFtmcTGv8Fc/Thu-3rXogQI/AAAAAAAABGw/m1hMOdjPR8w/s400/dm33.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Maybe we'll get in the 80/20 flipbook &lt;a href="http://www.8020.net/8020-Stuff-Flip-Book2.html"&gt;again&lt;/a&gt;.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;The only problem is we ran out of t-nuts. But the frame is together enough to get a feel for the size. It's a good deal smaller than Cap Kart, but it doesn't look tiny. In other words, a reasonable person would probably call it a go-kart, not a tinyKart. But whatever.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The motors also arrived, so of course I took them apart:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-ZdkQd5iKsEQ/ThvAbpq3FFI/AAAAAAAABG0/2kUUwqjbNX0/s1600/dm31.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/-ZdkQd5iKsEQ/ThvAbpq3FFI/AAAAAAAABG0/2kUUwqjbNX0/s400/dm31.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-ouWmyDVrks4/ThvAgG6tPCI/AAAAAAAABG4/CCm4EVGGhAw/s1600/dm32.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-ouWmyDVrks4/ThvAgG6tPCI/AAAAAAAABG4/CCm4EVGGhAw/s400/dm32.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;I was a little disappointed, but not really surprised, by the overall construction quality. The magnets, which are the source of most of the negative reviews for this particular motor (&lt;a href="http://www.hobbyking.com/hobbyking/store/uh_viewItem.asp?idProduct=7870"&gt;Turnigy SK6374-170&lt;/a&gt;), actually seemed to be pretty well glued. But the windings are very loose and in fact on a couple of the motors, one or two strands of wire were sticking out into the air gap. So while the motors were open, I took the opportunity to epoxy all the windings in place. I also tested the resistance, and they were all right around 23mΩ, line-to-line, which is a lot lower than the specs say. And there were no shorts, so that's good.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The next order of business was to machine the shafts, which &lt;a href="http://lmh-tech.blogspot.com/"&gt;Max&lt;/a&gt;, et. al., made short work of:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-mst0dMMp_7A/ThvE_OgvdTI/AAAAAAAABG8/7iQ3pqfcw6Y/s1600/dm35.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-mst0dMMp_7A/ThvE_OgvdTI/AAAAAAAABG8/7iQ3pqfcw6Y/s400/dm35.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;These shafts are made of 6061 aluminum and the entire weight of the kart and driver are transmitted through them. They start as 3/4" stock and are turned down to 17mm to fit the special replacement bearings for the 8" scooter wheels we're using. The rims get sandwiched on and the shafts are bolted to the chassis with a single 1/4-20 cap screw.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-gjnkOHkKZE8/ThvGNrENQtI/AAAAAAAABHA/Q4on8ydNL9U/s1600/dm39.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/-gjnkOHkKZE8/ThvGNrENQtI/AAAAAAAABHA/Q4on8ydNL9U/s400/dm39.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The load carrying capacity of this configuration has been verified in simulation and also by the more scientific method of jumping up and down on it:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-M3nl4Mz-VAM/ThvGb7_dP6I/AAAAAAAABHE/4qAHvV9clU8/s1600/dm36.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-M3nl4Mz-VAM/ThvGb7_dP6I/AAAAAAAABHE/4qAHvV9clU8/s400/dm36.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The rims needed only minor modifications: For the rear wheels, the brake mounting threads were machined off to make the overall width of the kart as small as possible. For the front wheels, the drive pulleys were machined off to save a bit of weight:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-A6-dGlbfK7g/ThvG-ZXelFI/AAAAAAAABHI/aixZBBmXLRo/s1600/dm37.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/-A6-dGlbfK7g/ThvG-ZXelFI/AAAAAAAABHI/aixZBBmXLRo/s400/dm37.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-C85bJyEYBEE/ThvHUb-FhTI/AAAAAAAABHM/xI52LXDXH-o/s1600/dm38.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/-C85bJyEYBEE/ThvHUb-FhTI/AAAAAAAABHM/xI52LXDXH-o/s400/dm38.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;And the last little bit of machining for Round 1, boring out the steering reinforcement plates. These are the 1/4" plates that hold the bearings for the steering kingpins. They are probably the coolest-looking parts of the front frame. I decided to bore them out all at once, which &lt;a href="http://www.etotheipiplusone.net/"&gt;Charles&lt;/a&gt; and I decided was a 2 on the scale of bad ideas from 1 to Eating at &lt;a href="http://www.yelp.com/biz/shinkansen-cambridge"&gt;Bullet Train&lt;/a&gt;:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-VpdI1MaGsfM/ThvJflP8LcI/AAAAAAAABHQ/dule68opeSA/s1600/dm40.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="400" src="http://1.bp.blogspot.com/-VpdI1MaGsfM/ThvJflP8LcI/AAAAAAAABHQ/dule68opeSA/s400/dm40.jpg" width="300" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Turned out fine.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;Here's the frame at the end of Round 1:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-D6-nCBtIWsk/ThvJ58d0YsI/AAAAAAAABHU/mvYA4g-rtZI/s1600/dm29.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-D6-nCBtIWsk/ThvJ58d0YsI/AAAAAAAABHU/mvYA4g-rtZI/s400/dm29.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;It's certainly come a long way since the tape version on the floor. But there's a lot more work to be done on just the mechanicals, including all of the steering system. To get a quick estimate of how we're doing on weight, I hung the frame and a box of many of the parts that are to go on it from my favorite shady hook scale:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-FcqOSka774s/ThvKthArpXI/AAAAAAAABHY/NsC7JDHwiT8/s1600/dm41.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://1.bp.blogspot.com/-FcqOSka774s/ThvKthArpXI/AAAAAAAABHY/NsC7JDHwiT8/s400/dm41.jpg" width="300" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-wSq-6ctuT1c/ThvK1Almt3I/AAAAAAAABHc/0xVB8SB-uAc/s1600/dm42.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://3.bp.blogspot.com/-wSq-6ctuT1c/ThvK1Almt3I/AAAAAAAABHc/0xVB8SB-uAc/s400/dm42.jpg" width="300" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;17.63kg, or just under 39lbs, including the batteries and motors, and the weight of the milk crate.. What's missing is only the seat, four tires, the two motor controllers, the steering column and wheel, the brake cables and lever, and any other miscellany that we decide we need. So, 50lbs looks tough but still possible.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8200098102909041178-7992092485140274106?l=scolton.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scolton.blogspot.com/feeds/7992092485140274106/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scolton.blogspot.com/2011/07/tinykart-round-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/7992092485140274106'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/7992092485140274106'/><link rel='alternate' type='text/html' href='http://scolton.blogspot.com/2011/07/tinykart-round-1.html' title='tinyKart: Round 1'/><author><name>Shane Colton</name><uri>http://www.blogger.com/profile/10603406287033587039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-W5BvGxfZFd4/Thu8gWEcfSI/AAAAAAAABGo/0lnFYxMfIQ0/s72-c/dm30.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8200098102909041178.post-6009413619537328947</id><published>2011-07-05T04:10:00.000-07:00</published><updated>2011-07-05T04:10:40.984-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sensorless'/><category scheme='http://www.blogger.com/atom/ns#' term='motor control'/><title type='text'>Sensorless FOC: More Analysis</title><content type='html'>I've been away from hardware for a (much needed) week off. But whenever I'm away from hardware, I inevitably start to think about software. So for the last couple of days I've been going back over all the references I've collected for sensorless field-oriented control, partly to refresh my memory, partly to categorize and compare them, and partly to choose one to actually implement.&lt;br /&gt;&lt;br /&gt;I feel like this is where I should make fun of myself for being a grad student and spending all my time thinking about the solution instead of actually solving the problem. But I think in this one particular case, the analysis time will pay back many times over if I correctly choose an approach that will actually work as opposed to one that only works on paper, with properly-chosen gains, and ideal current sensors, and a perfect system model, and on a Wednesday with low relative humidity.&lt;br /&gt;&lt;br /&gt;First, a baseline against which to compare any potential solution: In the &lt;a href="http://scolton.blogspot.com/2011/04/sensorless.html"&gt;post&lt;/a&gt; where I first looked into sensorless field-oriented control, I put up the following bit of motor math:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-Ypa-aGgQjuI/TaJhoXwBGqI/AAAAAAAAA_Q/tTs77VGgnxw/s1600/maths.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="125" src="http://2.bp.blogspot.com/-Ypa-aGgQjuI/TaJhoXwBGqI/AAAAAAAAA_Q/tTs77VGgnxw/s320/maths.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;This shows how you can estimate the back EMF or the flux linkage using only the voltage applied to the terminals of the motor and the measured current. You can do this on any phase of the motor to find the back EMF of that phase. The flux linkage will give a somewhat cleaner estimate in real life because it doesn't need the derivative of a noisy current signal. You can also convert all the quantities into vectors and find the magnitude and phase of the resultant flux linkage. The phase of the flux linkage&amp;nbsp;&lt;i&gt;is&lt;/i&gt;&amp;nbsp;the rotor electrical angle, and can be used for field-oriented control.&lt;br /&gt;&lt;br /&gt;The drawback of this approach is that it's entirely open-loop, which means it is heavily dependent on model accuracy. If the values for resistance or inductance are off, the estimate will have a magnitude and phase error, and the phase error will hurt the performance of the FOC. It's still a valid approach, though, and almost certain to be stable. So any alternative closed-loop approach must outperform this baseline.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-nUeO5IfkbXI/TaJwXyiHKpI/AAAAAAAAA_U/CZCQGYmEe5Y/s1600/cl.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="181" src="http://2.bp.blogspot.com/-nUeO5IfkbXI/TaJwXyiHKpI/AAAAAAAAA_U/CZCQGYmEe5Y/s400/cl.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;The general idea of a closed-loop observer.&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Last post, I had become a fan of &lt;a href="http://ww1.microchip.com/downloads/en/AppNotes/01078A.pdf"&gt;Microchip AN1078&lt;/a&gt;'s closed-loop observer, so I'll start with my latest impressions of that one. It's a sliding-mode observer, which in this case means that the thing occupying the &lt;b&gt;Observer Compensator&lt;/b&gt; black box is just a comparator. If the estimated current is higher than the measured current, it feeds back +K, else, it feeds back -K. So, it's not a linear observer. The switching structure appealed to me because&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;It's computationally easy, saving precious time in the fast loop that would otherwise be spent multiplying out linear observer feedbacks.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;It is highly noise-immune with respect to the current sensor signal. As long as the noise is unbiased (zero mean) and of high enough frequency, it will get drowned out by the switching feedback. This is a huge benefit since my controllers so far have had pretty crappy current sensors.&amp;nbsp;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;The part that confused me about AN1078 is what the &lt;b&gt;Fake Motor&lt;/b&gt; box does with the stream of +K/-K feedback. It applies a series of low-pass filters which magically produce the back EMF estimate, but doesn't show mathematically why this is the case. More disturbingly, it requires a "phase compensation" which is simply pulled from a look-up table. The explanation for this? "It is recommended that phase compensation be fine&amp;nbsp;tuned for any particular motor." It might still be better than the open-loop estimate, but a true observer should not need phase compensation as a function of motor speed.&lt;br /&gt;&lt;br /&gt;I decided that I won't be taken seriously as a grad student unless I run MATLAB Simulations for a significant portion of my life:&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-hKQuUELe584/ThLM1ZUjseI/AAAAAAAABEo/kvQfGyI0Eck/s1600/microchip_sensorless.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="251" src="http://4.bp.blogspot.com/-hKQuUELe584/ThLM1ZUjseI/AAAAAAAABEo/kvQfGyI0Eck/s400/microchip_sensorless.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Microchip AN1078 in Simulink&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;That is Microchip's AN1078 observer implemented in Simulink, including the phase compensation (bottom left). It's estimating the back EMF on a single phase, but the same exact observer could be used to estimate the two back EMF vector components (often called α and β components). The values used for the motor model come from &lt;a href="http://scolton.blogspot.com/p/bwd-scooter.html#pneu"&gt;Pneu Scooter&lt;/a&gt;'s wheel motor, since it'll likely be the first test of any sensorless FOC I implement.&amp;nbsp;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;At first glance, AN1078 does pretty well:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-xZA8L9S2OtE/ThLO9K04U-I/AAAAAAAABEs/23qrsydkD40/s1600/mc01.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="291" src="http://2.bp.blogspot.com/-xZA8L9S2OtE/ThLO9K04U-I/AAAAAAAABEs/23qrsydkD40/s400/mc01.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;&lt;span class="Apple-style-span" style="color: yellow;"&gt;Yellow:&lt;/span&gt; Actual back EMF. &lt;span class="Apple-style-span" style="color: #741b47;"&gt;Purple:&lt;/span&gt; Estimated back EMF.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;This is at at about 2,000rpm and 40A peak amplitude, with all model parameters accurately tuned. The phase compensation is taken to be the combined phase of the two low-pass filters at this electrical frequency. (Or, sticking with the Microchip plan, pulled from a look-up table.) The phase of the back EMF estimate is insensitive to current sensor noise, applied voltage phase, and a wide parameter variation of resistance. But, crucially, it doesn't seem to like error in the inductance parameter of the model. With the inductance set to 1.5x the true value...&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-qkS_0mkVyqM/ThLRaR3ZTMI/AAAAAAAABEw/gk-utZz6lEM/s1600/mc02.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="292" src="http://2.bp.blogspot.com/-qkS_0mkVyqM/ThLRaR3ZTMI/AAAAAAAABEw/gk-utZz6lEM/s400/mc02.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;&lt;span class="Apple-style-span" style="color: yellow;"&gt;Yellow:&lt;/span&gt;&amp;nbsp;Actual back EMF.&amp;nbsp;&lt;span class="Apple-style-span" style="color: #741b47;"&gt;Purple:&lt;/span&gt;&amp;nbsp;Estimated back EMF.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;...the back EMF estimate lags significantly. The inductance is the harder parameter to measure, so an error of 50% or even more must be tolerable. Increasing the feedback gain can diminish the phase error. But now my threshold for tweaking has been crossed. The phase compensation table, the sensitivity to inductance variation, and the overall lack of explanation for how two low-pass filters produce a back EMF estimate have led me to question AN1078, even though up to this point it has been my favorite. Having tweaked it more than I care to, I went searching some more.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Some old and new references that only very few people would find interesting enough to read (I read them all):&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;Of course there is James Mevey's thesis &lt;b&gt;entitled&lt;/b&gt;&amp;nbsp;&lt;i&gt;&lt;a href="http://krex.k-state.edu/dspace/bitstream/2097/1507/1/JamesMevey2009.pdf"&gt;Sensorless Field Oriented Control of Brushless Permanent Magnet Synchronous Motors&lt;/a&gt;. &lt;/i&gt;Chapter 6 contains all the information one would need to do this, in the most general way, with a full-order linear observer. I understand the theory, and if I went back to my controls notes I could find information on how to place the observer poles in such a way to force the back EMF error to zero. It's just...a lot of linear algebra to compute in the fast loop. But this is my back-up plan if all other options fail...Mevey to the rescue.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Another approach, which Mevey references (Mevey references more papers than I have ever read...) is in a paper called "High performance PMSM drives without rotational position sensors&amp;nbsp;using reduced order observer." It's an IEEE paper, which means I can't quite link to it. But the general idea is to skip the hassle of making an observer for currents, which are known anyway from the sensors. With only two states to track (α and β components of back EMF) the computation is quicker. I just don't know enough about reduced-order observers to be able to have an opinion on this one. Didn't I learn this stuff at some point?&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;I also found&amp;nbsp;&lt;a href="http://cache.freescale.com/files/microcontrollers/doc/ref_manual/DRM099.pdf?fpsp=1&amp;amp;WT_TYPE=Reference%20Manuals&amp;amp;WT_VENDOR=FREESCALE&amp;amp;WT_FILE_FORMAT=pdf&amp;amp;WT_ASSET=Documentation"&gt;Freescale App Note DRM099&lt;/a&gt;, which has a much more thorough explanation of a sliding mode observer than the Microchip AN1078. Rather than magical low-pass filters, the Freescale approach sends the switching feedback into a full-state observer. It's a bang-bang version of the full order observer that Mevey presents. It also explains &lt;i&gt;why&lt;/i&gt;&amp;nbsp;the back EMF error converges to zero even in the presence of modeling errors, though it does not talk about how to set the feedback gains. It also has discrete time versions of everything, which is nice for quick translation to software. And no "phase compensation" table. This looks very promising.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;But now, I feel like I am back where I started, just looking at examples of sensorless algorithms and trying to decide which one I like best. I guess I could really be a good grad student and run more simulations of each one, with a standard set of test cases. But I have a feeling any of them can be made to work with enough tweaking, so how should I decide?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Fuck it, I was bored in the airport so I just made my own:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-RCa_K0RHilM/ThLdrNFyhUI/AAAAAAAABE0/SJBRjGcAqeE/s1600/mc03.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="251" src="http://1.bp.blogspot.com/-RCa_K0RHilM/ThLdrNFyhUI/AAAAAAAABE0/SJBRjGcAqeE/s400/mc03.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Click to enlarge.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;I stole the sliding-mode idea from Microchip and Freescale, but in this implementation I have abandoned just about every other aspect from the observers detailed above. Specifically, I don't want to do any coordinate transformations in the fast loop...at all. The way I avoided coordinate transforms when I was crunched for computing power in &lt;a href="http://scolton.blogspot.com/2010/01/3ph-duo-wrap-up-part-1-field-oriented.html"&gt;my first FOC implementation&lt;/a&gt; was to use a sine wave generator, which steps through a table of sine values with some given speed. So I'm doing the same thing here, generating the back EMF estimates for phases A, B, and C as a set of three sine waves offset by 120º in the table.&amp;nbsp;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The inputs to the back EMF sine wave generator are the magnitude and the speed, which are each compensated by the sliding-mode feedback with some gains, G1, and G2. The magnitude feedback isn't as critical, but it corrects for variation of the torque constant in the motor model. The speed feedback adjusts how fast a certain magical index steps through the sine table array. This behaves like a &lt;a href="http://en.wikipedia.org/wiki/Phase-locked_loop"&gt;phase lock loop&lt;/a&gt;, shifting the back EMF until it is in phase with the true back EMF. Don't ask me to explain it in any more detail than that. Here's it starting with a 180º phase offset and locking in:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-7BTYDyMuKMo/ThLiOZ79hDI/AAAAAAAABE4/yn0H-gGw4k8/s1600/mc04.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="182" src="http://1.bp.blogspot.com/-7BTYDyMuKMo/ThLiOZ79hDI/AAAAAAAABE4/yn0H-gGw4k8/s400/mc04.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;span class="Apple-style-span" style="color: yellow;"&gt;Yellow:&lt;/span&gt;&amp;nbsp;Actual back EMF.&amp;nbsp;&lt;span class="Apple-style-span" style="color: #741b47;"&gt;Purple:&lt;/span&gt;&amp;nbsp;Estimated back EMF.&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The nice thing about the PLL effect is that it doesn't matter if the feedback is positive or negative. As with the AN1078 method, this observer is immune to sensor noise, applied voltage phase, and variations from the model resistance value. But, it also doesn't mind very much having the model inductance off by a factor of 2:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-AeRWt1cVe2s/ThLjyfRr9nI/AAAAAAAABE8/MNrUOagg5GA/s1600/mc05.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="280" src="http://2.bp.blogspot.com/-AeRWt1cVe2s/ThLjyfRr9nI/AAAAAAAABE8/MNrUOagg5GA/s400/mc05.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;&lt;span class="Apple-style-span" style="color: yellow;"&gt;Yellow:&lt;/span&gt;&amp;nbsp;Actual back EMF.&amp;nbsp;&lt;span class="Apple-style-span" style="color: #741b47;"&gt;Purple:&lt;/span&gt;&amp;nbsp;Estimated back EMF.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;It might still need some tweaking to get just the right gains, but at least there is no "phase compensation" table. It also abandons linearity and state space in favor of ease of implementation. The comparisons for the sliding mode observer occur on each phase individually, and in fact only one phase is needed to run the observer. With all three phase currents, an averaging effect should make it work even better. Another interesting possibility is that the table through which the back EMF generator steps need not be a table of sine values. It could very well be an table of measured back EMF values, which should improve the position estimate in the case of trapezoidal EMF motors.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Once again I've created something that I can't really analyze. Time to try implementing it in hardware.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8200098102909041178-6009413619537328947?l=scolton.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scolton.blogspot.com/feeds/6009413619537328947/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scolton.blogspot.com/2011/07/sensorless-foc-more-analysis.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/6009413619537328947'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/6009413619537328947'/><link rel='alternate' type='text/html' href='http://scolton.blogspot.com/2011/07/sensorless-foc-more-analysis.html' title='Sensorless FOC: More Analysis'/><author><name>Shane Colton</name><uri>http://www.blogger.com/profile/10603406287033587039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-Ypa-aGgQjuI/TaJhoXwBGqI/AAAAAAAAA_Q/tTs77VGgnxw/s72-c/maths.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8200098102909041178.post-4267179122003455939</id><published>2011-06-29T22:21:00.000-07:00</published><updated>2011-06-29T22:21:26.722-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tinykart'/><title type='text'>ECSEW V: tinyKart</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-MOs8Inoz73U/TgvhVmjBnKI/AAAAAAAABD0/nXRJlP_72jU/s1600/dm09.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="231" src="http://2.bp.blogspot.com/-MOs8Inoz73U/TgvhVmjBnKI/AAAAAAAABD0/nXRJlP_72jU/s400/dm09.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Believe it or not (I don't), this is the &lt;i&gt;fifth&lt;/i&gt;&amp;nbsp;year of the Edgerton Center Summer Engineering Workshop, an ad-hoc team of like-minded engineering students interested in &lt;a href="http://web.mit.edu/first/www/07media/Atlanta/video/fountain.wmv"&gt;things you can ride&lt;/a&gt;. Of all my past projects, I think the ones that I've enjoyed the most have been the Workshop ones. Since 2007, we've made:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;The &lt;a href="http://web.mit.edu/first/segway/"&gt;DIY Segway&lt;/a&gt;, &lt;strike&gt;probably&lt;/strike&gt;&amp;nbsp;definitely our most popular vehicle, which helped spawn a new era of smaller, lighter, cheaper, simpler DIY self-balancing...things.&lt;/li&gt;&lt;li&gt;The &lt;a href="http://web.mit.edu/first/kart/"&gt;Cap Kart&lt;/a&gt;, our largest, most ambitious vehicle, which underwent a revision in 2010. Its name comes from the 16V/110F capacitor that gives it a speed boost from a bit of regenerated energy.&lt;/li&gt;&lt;li&gt;&lt;a href="http://web.mit.edu/first/scooter/"&gt;BWD Scooter&lt;/a&gt;, which led me in the direction of brushless motor design and control that occupies so much of my time these days.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;But for 2011, we are returning to four wheels to create an ultralight go-kart. (Okay, maybe not &lt;a href="http://www.youtube.com/watch?v=CL1P68PN4jw&amp;amp;feature=player_embedded#at=29"&gt;&lt;i&gt;this&lt;/i&gt;&amp;nbsp;ultralight&lt;/a&gt;.) One of the drawbacks of Cap Kart, even the newer, lighter version, is that it takes three people and a truck to move around. With tinyKart, the target weight is something like "less than one of Cap Kart's old batteries."&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-AE8kYgVT7CA/Tgvo7lkaxbI/AAAAAAAABD4/E8TrJ2JNt8I/s1600/IMG_0315.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/-AE8kYgVT7CA/Tgvo7lkaxbI/AAAAAAAABD4/E8TrJ2JNt8I/s400/IMG_0315.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Cap Kart's original 53lb deep-cycle marine batteries.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;So obviously we're gonna need lighter batteries. Cap Kart v2.0 uses 42lbs of LiFePO4 batteries from Thundersky, now &lt;a href="http://www.thunder-sky.com/products_en.asp"&gt;Winston Battery Limited&lt;/a&gt;. For that weight, you get 1.58kWh of energy storage and a peak power of 7.5kW. The only way to do better than that, in terms of power and energy density, is with lithium polymer.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;tinyKart will use between two and four &lt;a href="http://www.hobbyking.com/hobbyking/store/uh_viewItem.asp?idProduct=17914"&gt;10S, 4500mAh LiPos&lt;/a&gt;, making it only marginally less of a fire hazard than a gas go-kart. At a maximum, this gives 0.67kWh of energy storage. But since they specialize in absurdly high power density, there is the possibility of using just two batteries, a weight of just over 6lbs, to power the whole kart for a few minutes at a time.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Next comes the question of propulsion. The ultralight kart as I've always imagined it was powered by two&amp;nbsp;&lt;a href="http://www.robotmarketplace.com/products/MAG-S28-150.html"&gt;short Magmotors&lt;/a&gt;, but they're just not cost-effective anymore. For less than the cost of one Magmotor, we got a set of four&amp;nbsp;&lt;a href="http://www.hobbyking.com/hobbyking/store/uh_viewItem.asp?idProduct=7870"&gt;Turnigy SK6374-170&lt;/a&gt; brushless outrunners. They're not the biggest brushless motors, but two will certainly propel a go-kart and four would make it a competitor for Cap Kart, in terms of acceleration. (One of the emerging themes of this project seems to be modularity; we can change the number of motors and batteries quickly to go between the lightest configuration and the most powerful.)&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-O6eLAdkt34o/Tgvza0bclWI/AAAAAAAABD8/6vAcQzBTS4s/s1600/dm19.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="318" src="http://2.bp.blogspot.com/-O6eLAdkt34o/Tgvza0bclWI/AAAAAAAABD8/6vAcQzBTS4s/s400/dm19.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The drivetrain is really simple: RWD with independent belt drives on each wheel. This is enabled by the cheap and light aluminum rims from &lt;a href="http://www.electricscooterparts.com/wheels.html"&gt;electricscooterparts&lt;/a&gt;, which have a 72-tooth belt pulley integrated into the rim casting. The rim and tire together weigh less than 2lbs. The motors are light enough to face-mount to a 1/4" aluminum plate and ball bearings on an eccentric standoff provide adjustable belt tension. As-pictured, the gear ratio is 4.5:1, yielding a top speed of about 30mph with the 8" wheel.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;These wheels are designed for electric scooter use, where they would fit on 10mm shafts supported on both sides by the rear fork of a scooter. One of the easily-overlooked little details that I think makes this all possible is 6903 bearings. These are the same O.D. (30mm) as the 6200 bearings normally used in these rims, but they have a 17mm I.D. instead of 10mm. Thus tinyKart's four wheels are supported by cantilevered 17mm aluminum shafts.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-5vmbDCTaXUo/Tgv1OndFeYI/AAAAAAAABEA/TK9Ys-VsHEE/s1600/dm18.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="277" src="http://1.bp.blogspot.com/-5vmbDCTaXUo/Tgv1OndFeYI/AAAAAAAABEA/TK9Ys-VsHEE/s400/dm18.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Ask &lt;a href="http://lmh-tech.blogspot.com/"&gt;Max&lt;/a&gt; why the plate is at a weird angle like that...&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;One of the things I've always had in mind for an independent RWD electric kart is torque vectoring, a neat trick where you force more current into the motor driving the outside wheel to help shove the vehicle into the turn. This of course requires measurement of the steering wheel angle, but that's not hard. It might make up for the natural understeer of a kart that has 70+% of its weight on the rear wheels.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Between all of us, we have a ton of experience building electrically-propelled drivetrains, so I'm not very worried about the propulsion side of things. What makes this project interesting is that, unlike Cap Kart, we're building the entire chassis from scratch. And as you can probably tell from the CAD, it is not a typical go-kart build. We briefly debated the idea of making a welded tube frame, but then decided that 80/20 is the &lt;strike&gt;only structural material we know how to utilize&lt;/strike&gt;&amp;nbsp;ultimate expression of lightweight structural modularity.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-QKn1DOklqHY/Tgv5WAZKGEI/AAAAAAAABEE/YuqR6s30FAQ/s1600/dm14.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://2.bp.blogspot.com/-QKn1DOklqHY/Tgv5WAZKGEI/AAAAAAAABEE/YuqR6s30FAQ/s400/dm14.jpg" width="301" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The kart chassis is split into two halves: the front, which has a lot of platework for aligning steering linkages, and the back, which contains drivetrain components and the seat. The overall width is about 34" and the length is 48", though it can easily be made an few inches longer or shorter to accommodate different drivers. The front and back overlap by an adjustable amount to provide rigidity.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The front wheels are also electricscooterparts rims, but with brake disks instead of drive pulleys. We'll machine off the drive pulleys on those wheels and face the brake mount inwards. This will cause a bit of an issue on the left side, since the brake disk hubs are threaded and the braking force will tend to unscrew that side's hub. But I suspect this problem is easy to solve with enough Loctite.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-W6bokj0ZEUw/Tgv7RZ0FSLI/AAAAAAAABEI/9MAfMi0xo2k/s1600/dm22.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="333" src="http://2.bp.blogspot.com/-W6bokj0ZEUw/Tgv7RZ0FSLI/AAAAAAAABEI/9MAfMi0xo2k/s400/dm22.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;I went with a relatively low-tech method for working out the geometry of the brake caliper mounts:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-vTkZmtw-Nac/Tgv7sDaopuI/AAAAAAAABEM/CqiwYA8Q7Q0/s1600/dm05.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/-vTkZmtw-Nac/Tgv7sDaopuI/AAAAAAAABEM/CqiwYA8Q7Q0/s400/dm05.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The other tricky bit of geometry to solve in the front of the kart was the steering linkage.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-ILCO3LqTfXw/Tgv-FLsvbhI/AAAAAAAABEQ/cHHYcTgH8n8/s1600/dm15.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="122" src="http://2.bp.blogspot.com/-ILCO3LqTfXw/Tgv-FLsvbhI/AAAAAAAABEQ/cHHYcTgH8n8/s400/dm15.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;From above, it's a pretty straightforward &lt;a href="http://en.wikipedia.org/wiki/Ackermann_steering_geometry"&gt;Ackermann steering geometry&lt;/a&gt;, with a drive link off the steering column very similar to Cap Kart.&amp;nbsp;But I tried my hardest to contain the entire thing in the 1" vertical space between the plates, which meant that I couldn't use ball joints on the steering pivots. Instead, the two degrees of freedom are split into a horizontal and a vertical pin joint:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-pHi1WmAcX80/Tgv_PRyoX6I/AAAAAAAABEU/-xti0cxe0Uo/s1600/dm12.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="250" src="http://4.bp.blogspot.com/-pHi1WmAcX80/Tgv_PRyoX6I/AAAAAAAABEU/-xti0cxe0Uo/s400/dm12.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The horizontal pin joint is just a shoulder screw with some brass washers. The vertical pin joint, which is far enough inside the kart not to interfere with the plates, attaches to threaded rod that goes to the drive plate on the steering column. Since I know nothing about proper steering geometry, everything is adjustable. The only thing we've sacrificed from Cap Kart's steering is the &lt;a href="http://en.wikipedia.org/wiki/Caster_angle"&gt;caster angle&lt;/a&gt;, which is by necessity zero in this design. To make up for it (or do nothing at all, idk), the center of the front wheels is just slightly behind the kingpin pivots.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Since the 1/8" aluminum plates don't really provide much rigidity, the gap between the 80/20 rails framing the front of the kart are spanned above and below by 1/4" steering reinforcement plates, which also hold the radial kingpin bearings. The thrust bearings are between the 1/8" plates. It might be overkill, but flimsy steering is one failure that we don't want to deal with.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;There are plenty of other little details that went into the design so far, but I'm sure we'll be highlighting them as they get built. For now, we're waiting on parts and I'm on my first real vacation in a long time. The build begins next week and it will drive by mid-August.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/--e7wOrlSl1s/TgwFJbouzAI/AAAAAAAABEc/q-SuvuDQLbE/s1600/dm13.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="233" src="http://4.bp.blogspot.com/--e7wOrlSl1s/TgwFJbouzAI/AAAAAAAABEc/q-SuvuDQLbE/s400/dm13.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-_uDHtDpHni0/TgwFQqS2nqI/AAAAAAAABEg/Ox7_sgJPKwQ/s1600/dm17.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="231" src="http://2.bp.blogspot.com/-_uDHtDpHni0/TgwFQqS2nqI/AAAAAAAABEg/Ox7_sgJPKwQ/s400/dm17.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-box8uJCbuBs/TgwFbsI4gzI/AAAAAAAABEk/LUklAZAPgBY/s1600/dm24.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="233" src="http://1.bp.blogspot.com/-box8uJCbuBs/TgwFbsI4gzI/AAAAAAAABEk/LUklAZAPgBY/s400/dm24.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8200098102909041178-4267179122003455939?l=scolton.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scolton.blogspot.com/feeds/4267179122003455939/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scolton.blogspot.com/2011/06/ecsew-v-tinykart.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/4267179122003455939'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/4267179122003455939'/><link rel='alternate' type='text/html' href='http://scolton.blogspot.com/2011/06/ecsew-v-tinykart.html' title='ECSEW V: tinyKart'/><author><name>Shane Colton</name><uri>http://www.blogger.com/profile/10603406287033587039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-MOs8Inoz73U/TgvhVmjBnKI/AAAAAAAABD0/nXRJlP_72jU/s72-c/dm09.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8200098102909041178.post-8160383133579977282</id><published>2011-06-24T20:03:00.000-07:00</published><updated>2011-06-24T20:06:27.491-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='directdrive'/><category scheme='http://www.blogger.com/atom/ns#' term='motor control'/><title type='text'>DirectDrive: A Simple MechE Solution</title><content type='html'>The trivial solution to decoupling my Hall effect phase current sensors:&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-0hGHRj9Cn0c/TgVJMHxrbZI/AAAAAAAABDk/TQkxRh3nDeQ/s1600/dd53.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-0hGHRj9Cn0c/TgVJMHxrbZI/AAAAAAAABDk/TQkxRh3nDeQ/s400/dd53.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;With the three phase outputs coming off the bottom of the board (top in this picture) rather than the side, they don't all pass over the Phase A current sensor, &lt;a href="http://scolton.blogspot.com/2011/06/directdrive-well-it-certainly-looks.html"&gt;messing with its reading&lt;/a&gt;. With this new arrangement, the coupling between phases is much less. Here's the before and after:&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-CGFZ8OApIK8/TgVJu0qOy-I/AAAAAAAABDo/sRVa3AgTOiA/s1600/dd50.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="144" src="http://2.bp.blogspot.com/-CGFZ8OApIK8/TgVJu0qOy-I/AAAAAAAABDo/sRVa3AgTOiA/s320/dd50.jpg" width="320" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Before.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-WjKhyaBdOAw/TgVJ4IuGWgI/AAAAAAAABDs/Dkm_qE9PHhE/s1600/dd51.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="98" src="http://4.bp.blogspot.com/-WjKhyaBdOAw/TgVJ4IuGWgI/AAAAAAAABDs/Dkm_qE9PHhE/s320/dd51.jpg" width="320" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;After.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;This quick fix brings the coupling down to tolerable levels for moving on to other testing. I'm amazed at how close the actual gains are (~15LSB/A) to what the first coupling matrix came up with. I guess linear algebra does work. With these gains, the maximum phase current that can be sensed is about 100A, so if I make it past that mark I will have to reconfigure the traces for a less sensitive current measurement. At that point, I will need bigger wires anyway.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;I'm still leaning towards a return to the &lt;a href="http://www.allegromicro.com/en/Products/Part_Numbers/0714/0714.pdf"&gt;ACS714&lt;/a&gt; integrated-conductor Hall effect current sensors, but before I give up on the through-the-board sensors, I will also try shielding the wires and/or sensors in such a way that they can only pick up the field from the traces passing under them. Then, I may be able to re-route the wires the way I want, which is off the side of the board.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;The next milestone was a light load test on a single phase with a current-limited bench supply. Using the SepEx motor field as a giant thermal sink, I ran one phase for 10 minutes at about 350W (48V/7.5A in, 24V/15A out) with passive heat sinking only. No problems passing this test. The temperature reading was clean and the rate of temperature rise on the sink was a mere 0.5ºC/min. Ballpark thermal estimates (the only type I can do) suggest this is reasonable for such a light load.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-uK8ehxkoRQU/TgVL1E3hdzI/AAAAAAAABDw/dIpufdRThQ0/s1600/dd52.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="268" src="http://2.bp.blogspot.com/-uK8ehxkoRQU/TgVL1E3hdzI/AAAAAAAABDw/dIpufdRThQ0/s400/dd52.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;At this point I'm past the bench supply stage and the next thing to do is run off a battery. If destruction is to occur, this is the point at which it will happen. Shoot-through on a power supply is survivable, but with a large battery pack ready to shove in hundreds of amps, almost any failure is a catastrophic one for the controller. I will also need a suitable load, since the SepEx was already pretty unhappy after sinking 350W for 10 minutes. The next target to hit will be about 2.5kW, in full three-phase operation. Perhaps I need something that cools itself..........&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8200098102909041178-8160383133579977282?l=scolton.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scolton.blogspot.com/feeds/8160383133579977282/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scolton.blogspot.com/2011/06/directdrive-simple-meche-solution.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/8160383133579977282'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/8160383133579977282'/><link rel='alternate' type='text/html' href='http://scolton.blogspot.com/2011/06/directdrive-simple-meche-solution.html' title='DirectDrive: A Simple MechE Solution'/><author><name>Shane Colton</name><uri>http://www.blogger.com/profile/10603406287033587039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-0hGHRj9Cn0c/TgVJMHxrbZI/AAAAAAAABDk/TQkxRh3nDeQ/s72-c/dd53.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8200098102909041178.post-2193622562066704420</id><published>2011-06-21T19:58:00.000-07:00</published><updated>2011-06-22T04:25:08.783-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='directdrive'/><category scheme='http://www.blogger.com/atom/ns#' term='motor control'/><title type='text'>DirectDrive: Well, it certainly looks nice...</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-_iHsfhXjTWE/TgFDTHTBn4I/AAAAAAAABDA/FTKxPa0xc0w/s1600/dd40.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-_iHsfhXjTWE/TgFDTHTBn4I/AAAAAAAABDA/FTKxPa0xc0w/s400/dd40.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-MlVb7lEA0Ws/TgFEVmNAqbI/AAAAAAAABDE/xAFoaxIoVVc/s1600/dd43.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/-MlVb7lEA0Ws/TgFEVmNAqbI/AAAAAAAABDE/xAFoaxIoVVc/s400/dd43.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;I finished soldering up the first prototype of DirectDrive, my new higher-power three-phase controller. Without a doubt I can say it's certainly the nicest &lt;i&gt;looking&lt;/i&gt;&amp;nbsp;controller I've made, to date. But if history is any indicator, it is most likely doomed to failure like almost all of my other v1.0 controllers. The only real question is: Will it be some fundamental design flaw, a layout problem, noise issues, or a fiery death?. Or all of the above? Well,&amp;nbsp;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;In the &lt;a href="http://scolton.blogspot.com/2011/06/pan-project-update-61611.html"&gt;last post&lt;/a&gt; I mentioned that the &lt;a href="http://www.avagotech.com/pages/en/optocouplers_plastic/plastic_integrated_gate_drive_optocoupler/acnw3190-000e/"&gt;ACNW-3190&lt;/a&gt; gate drivers I wanted to use were in fact not the package I thought they were, and so I went back to the &lt;a href="http://www.avagotech.com/docs/AV02-0161EN"&gt;HCPL-3120&lt;/a&gt;, my standard high-current gate drive solution since &lt;a href="http://scolton.blogspot.com/p/motor-controllers.html#halfbridge"&gt;Cap Kart&lt;/a&gt;. They have "only" 2.5A of gate drive, though, which is a bit weak for driving four of the DirectFETs. Using 20Ω gate resistors, the switching waveforms looked like this:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-4i7ZHgAS80U/TgFGKNr1k-I/AAAAAAAABDI/uNnCrSpx9-s/s1600/dd44.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="311" src="http://3.bp.blogspot.com/-4i7ZHgAS80U/TgFGKNr1k-I/AAAAAAAABDI/uNnCrSpx9-s/s400/dd44.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;The trace that starts high is the Vds. The trace that starts low is Vgs.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;I learned a lot about MOSFET switching characteristics, including that the length of the &lt;a href="http://www.digikey.com/Web%20Export/Supplier%20Content/Vishay_8026/PDF/VishaySiliconix_MOSFETBasics.pdf?redirected=1"&gt;Miller plateau&lt;/a&gt;&amp;nbsp;depends on the voltage across the MOSFET. So to test the true switching time, I applied 36V across the FET and measured both the gate voltage and the drain-to-source voltage. The switching time, where the FET is dissipating the most power, begins when the gate voltage reaches the threshold voltage (about 3V) and ends after the Miller charge is satisfied. I measured this to be about 290ns. That's right in line with what I would predict, but my initial calculations suggested that these switching losses would make 50V/200A operation very difficult to achieve. So, I am trying out 10Ω gate resistors:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-PL2tzSjgEgM/TgFIee3fl8I/AAAAAAAABDM/TanLbZpamug/s1600/dd46.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="321" src="http://3.bp.blogspot.com/-PL2tzSjgEgM/TgFIee3fl8I/AAAAAAAABDM/TanLbZpamug/s400/dd46.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Wow, that's ugly.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;While it's definitely shorter, down to about 110ns, the switching waveforms have much more ringing now. The gate drive traces are fairly long and wander around to get out from under the DirectFETs and bus capacitors. I was definitely worried about the inductance, and here's a clear example of why it helps to put the gate drivers as close as possible to the FETs. The good news is that this was measured up by the TVS diodes that "protect" the gate:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-Knr0lXX_oyM/TgFJlYbSccI/AAAAAAAABDQ/VOzc1B--Rac/s1600/dd47.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="293" src="http://1.bp.blogspot.com/-Knr0lXX_oyM/TgFJlYbSccI/AAAAAAAABDQ/VOzc1B--Rac/s400/dd47.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Measuring right at the gate instead reveals a moderately cleaner signal:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-x9JVHkiGRSw/TgFJuhi2HyI/AAAAAAAABDU/PV6pD31PCsY/s1600/dd45.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="358" src="http://4.bp.blogspot.com/-x9JVHkiGRSw/TgFJuhi2HyI/AAAAAAAABDU/PV6pD31PCsY/s400/dd45.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;As ugly as it is, I've seen worse, and I'm tempted for now to just leave the 10Ω gate resistors in for the rest of the testing phase. On to the next problem!&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;After I tested a collection of low-side FETs, I attempted to get one full half-bridge up and running. In doing so, I was temporarily stopped by another issue that I swear I've had to solve on&amp;nbsp;&lt;i&gt;several&lt;/i&gt;&amp;nbsp;occasions in past motor controller projects. The problem is that the HCPL-3120 gate drivers have a very unforgiving undervoltage lock-out that &lt;i&gt;will&lt;/i&gt;&amp;nbsp;shut down the output if the gate drive supply voltage drops below 11V. This isn't a problem for the low-side, which is fed directly by the 15V switching supply. But the high side is bootstrapped and as it turns out, I needed a bigger bootstrap cap to keep the high side on. So, I switched to 4.7μF and the problem went away. With the half-bridges working properly, I finished soldering the rest of the board.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;I discovered the first real board flaw when none of my gate drives would turn on, despite all three channels of PWM being active. I've used a hex inverter (74xx04) before to generate the complementary PWM signals, but I guess I forgot that the 74LS series doesn't work on 3.3V. So I'll have to get some 74HCs. In the mean time, I'm not above little-blue-wire hacks:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-luGVg2eXBfA/TgFMDHtSmxI/AAAAAAAABDY/p9Cdreh-6qI/s1600/dd48.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-luGVg2eXBfA/TgFMDHtSmxI/AAAAAAAABDY/p9Cdreh-6qI/s400/dd48.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Little yellow wire...whatever.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;I also soldered a current sensor in upside down, but nevermind that. After a few minor fixes, everything seems to be up and running. The tiny temperature sensor and phase current sensors both provide stable zero outputs and the three phases do what they should in response to PWM signals. Moving on to light load testing...&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-3T9bRlNlC3c/TgFOQ3zE73I/AAAAAAAABDc/iT6vbssv3-k/s1600/dd49.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-3T9bRlNlC3c/TgFOQ3zE73I/AAAAAAAABDc/iT6vbssv3-k/s400/dd49.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;It's a light load, I swear.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="text-align: left;"&gt;Cap Kart's SepEx motor has a 1.3Ω field winding that makes a terrific power resistor. It's big enough to not get hot for a while and it has an assload of inductance, so the current going into it will be smooth at any reasonably PWM frequency. However, for some reason, it has killed a number of controllers in its lifetime, including a &lt;a href="http://www.robotmarketplace.com/products/IFI-HV48.html"&gt;Victor HV&lt;/a&gt;. So I was a little nervous about hooking it up, but it seemed like the best light-load option.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Mainly, I was looking to test the through-the-board Hall effect current sensors. (If the FETs have issues with this ~20A load, then I'd be pretty much screwed.) The good news is that both current sensors produce a repeatable, stable, and clean output and can resolve current to better than 1A. The range is about +/-80A as configured by copper braid jumpers on the bottom of the board. The bad news is that the current measurements are disappointingly coupled...&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-Y4ibt0ADekM/TgFR-TJ5VLI/AAAAAAAABDg/OT5PKgvsgds/s1600/dd50.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="144" src="http://3.bp.blogspot.com/-Y4ibt0ADekM/TgFR-TJ5VLI/AAAAAAAABDg/OT5PKgvsgds/s320/dd50.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Through the magic ways of &lt;a href="http://ocw.mit.edu/courses/mathematics/18-06-linear-algebra-spring-2010/"&gt;Gilbert Strang&lt;/a&gt;, I was able to produce this coupling coefficient matrix which shows just how bad it is. The lowercase &lt;i&gt;i&lt;/i&gt; is the sensor reading and the uppercase &lt;i&gt;I&lt;/i&gt; is the actual phase or DC current. The coefficients show how much of each component of actual current winds up coupling into the sensed current on phase A and C. It's not all bad news: the 14.1 and -13.4 make perfect sense (lol) given the &amp;nbsp;gains I expected and the fact that one current sensor is "upside down". The cross-coupling on the C phase is not &lt;i&gt;terrible&lt;/i&gt;; it picks up a bit of A and a bit of DC. But the coupling from phase C onto the A sensor (the -10.5 value) is really bad. It means that the A sensor is picking up almost as much C phase current as A phase current. Physically, this all makes some sense: All the wires pass over the A sensor, while the C sensor sits sort-of off to the side. But it's very not good for current control...&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;So, the options I am now considering:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;ol&gt;&lt;li&gt;Presumably if I can find a coupling matrix, I can find a decoupling matrix to recover the true currents from the sensor readings. This is a horrible idea that I will probably try out of morbid curiosity.&lt;/li&gt;&lt;li&gt;Re-routing the wires to come straight off the board instead of passing sideways over the phase A sensor. This is a quick fix that might minimize the coupling, but it's not space efficient and I probably wouldn't be satisfied even if it got rid of a lot of the coupling.&lt;/li&gt;&lt;li&gt;Returning to the &lt;a href="http://www.allegromicro.com/en/Products/Part_Numbers/0714/0714.pdf"&gt;ACS714&lt;/a&gt; current sensor and using the back of the board to create an epic bypass shunt to change it from a +/-30A sensor to a +/-200A sensor. It's still a Hall effect sensor, but with an internal conductor and measurement, so the coupling should be much less of a problem. This is the solution I am leaning towards.&lt;/li&gt;&lt;li&gt;Switching to a shunt resistor measurement. I don't really want to think about the isolation issues, but it would be the most accurate. The other problem with small shunts for 200A is they will have very low voltage drops and be hard to amplify.&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;So I'll have to do a v1.1 to implement a more permanent fix for the current sensing. But in the mean time,&amp;nbsp;Option 2 will probably allow me to continue testing with this board, and I won't feel as bad if I destroy it under heavy load testing. More to come.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8200098102909041178-2193622562066704420?l=scolton.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scolton.blogspot.com/feeds/2193622562066704420/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://scolton.blogspot.com/2011/06/directdrive-well-it-certainly-looks.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/2193622562066704420'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8200098102909041178/posts/default/2193622562066704420'/><link rel='alternate' type='text/html' href='http://scolton.blogspot.com/2011/06/directdrive-well-it-certainly-looks.html' title='DirectDrive: Well, it certainly looks nice...'/><author><name>Shane Colton</name><uri>http://www.blogger.com/profile/10603406287033587039</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-_iHsfhXjTWE/TgFDTHTBn4I/AAAAAAAABDA/FTKxPa0xc0w/s72-c/dd40.jpg' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8200098102909041178.post-6649523520569029025</id><published>2011-06-16T12:33:00.000-07:00</published><updated>2011-06-16T12:40:15.975-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='directdrive'/><category scheme='http://www.blogger.com/atom/ns#' term='flinch'/><category scheme='http://www.blogger.com/atom/ns#' term='tinykart'/><title type='text'>Pan-Project Update 6/16/11</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;I got a little distracted last weekend...&lt;/span&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: inherit; margin-left: auto; margin-right: auto;"&gt;&lt;a href="http://2.bp.blogspot.com/-DzNfd0ixrP8/TfgZI5bscMI/AAAAAAAAAUo/OPWAp6va870/s400/P1000365.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-DzNfd0ixrP8/TfgZI5bscMI/AAAAAAAAAUo/OPWAp6va870/s400/P1000365.JPG" width="400" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit; font-size: x-small;"&gt;...by F1 cars.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;I took a spontaneous trip to the F1 Canada Grand Prix, the only F1 race held in North America. It turned out to be a very rainy weekend, but even so the F1 cars were impressively fast and loud:&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;iframe allowfullscreen="" frameborder="0" height="303" src="http://www.youtube.com/embed/XI7nEqepOMo?rel=0" width="480"&gt;&lt;/iframe&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;It's literally not possible to capture the sound of an F1 car passing 15 feet in front of you with my camera. The microphone just saturates and it just sounds like an explosion. Then again, that's sort-of what it sounds like in real life too, when your eardrum saturates. Combine the sound with the ominous sprays of water shooting 20 feet above the treeline on the far side of the track and it's like something out of a monster movie: You know it's coming for you next. Max has a &lt;a href="http://lmh-tech.blogspot.com/2011/06/grand-prix-du-canada-done-right.html"&gt;more thorough summary of the experience&lt;/a&gt;, plus some &lt;a href="http://www.youtube.com/watch?v=VYLGJX-oaok&amp;amp;feature=player_embedded"&gt;better video&lt;/a&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;But since we ran into car trouble (lol) on the way back from Montreal, I've had to spend a few days catching up with work. I made a bit of progress on some projects before and after the weekend, but not enough to justify an entire post for any individual one. So, I will do the thing I hate doing and make a Pan-Project Update to &lt;strike&gt;make excuses for&lt;/strike&gt; &lt;i&gt;highlight&lt;/i&gt; the &lt;strike&gt;lack of&lt;/strike&gt;&amp;nbsp; progress on each.&lt;br /&gt;&lt;br /&gt;First and easiest,&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif; font-size: large;"&gt;Sensorless Field-Oriented Control&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I've made no progress on this. I have a decent idea of &lt;a href="http://scolton.blogspot.com/2011/04/sensorless.html"&gt;how to start&lt;/a&gt;, and I maintain my opinion that you can do pretty much anything in software if you spend enough time messing with it. Some day soon I will do it, and nobody will care because it's software and has no tangible meaning, but then I'll just laugh at everyone.&lt;br /&gt;&lt;br /&gt;Moving on then,&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Flinch&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I got the M3 screws I needed to finish mounting Flinch's four gearmotors, so I did that:&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit; margin-left: 1em; margin-right: 1em;"&gt;&lt;a href="http://4.bp.blogspot.com/-xx_7Dv4AiS4/Tfop-FdI3MI/AAAAAAAABCg/C6pyexa5fpg/s1600/f022.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/-xx_7Dv4AiS4/Tfop-FdI3MI/AAAAAAAABCg/C6pyexa5fpg/s400/f022.jpg" width="400" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;Flinch is a straightforward 4WD robot layout, so there were no surprises here. It's essentially the same size and shape as &lt;a href="http://scolton.blogspot.com/2011/02/2007-mini4wdbot.html"&gt;mini4WDbot&lt;/a&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-MK7-EZm7anQ/TfoqxghjERI/AAAAAAAABCk/uvusShM3W50/s1600/f023.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-MK7-EZm7anQ/TfoqxghjERI/AAAAAAAABCk/uvusShM3W50/s400/f023.jpg" width="400" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;In fact, as a starting point I just transfered mini4WDbot's entire electrical system over to Flinch. That includes four repurposed VS-11 servo drivers, an Arduino Nano Carrier, and a 7.4V LiPo. I wanted to test the open-loop performance of the FingerTech mini-Mecanum wheels before investing&amp;nbsp;significant&amp;nbsp;effort into the inertial sensors for high-speed Mecanum-ing.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;Unfortunately the low-speed tests didn't work out so well. I've worked with larger Mecanum wheels before and even those are very sensitive to weight distribution, driving surface, and the condition of the rollers. The rollers on these wheels are rubber with brass axles riding in plastic wheel hubs. Off the ground, they roll just fine. But under axial loading, the steel washer spacing the rubber roller out from the wheel does not make a very good thrust bearing. Maybe with a lot of tweaking they might do something Mecanum-like, but I don't have the patience for that.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;Plan B involves putting real rolling-contact bearings on each roller axle. FingerTech &lt;a href="http://www.fingertechrobotics.com/proddetail.php?prod=ft-mecanum-bearing-kit"&gt;sells these&lt;/a&gt;&amp;nbsp;(an implicit admission that the regular axles leave something to be desired?), but they're needle bearings, which won't help much with friction between axial-contact surfaces. So I instead opted for &lt;a href="http://www.vxb.com/page/bearings/PROD/kit721"&gt;SR144ZZ&lt;/a&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt; tiny ball bearings. At least with these I can use tiny shaft spacers to keep the washer from making contact with the side of the wheel. Of course, this means carefully drilling out each roller axle and pressing/gluing in a tiny bearing. After that, another open-loop test to evaluate the new level of Mecanumosity.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Next,&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif; font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif; font-size: large;"&gt;DirectDrive&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;I'm starting work on my larger motor controller, called DirectDrive because it uses a crapload of &lt;a href="http://www.irf.com/product-info/datasheets/data/irf7759l2pbf.pdf"&gt;DirectFETs&lt;/a&gt;. I ordered a single board for testing, since usually my v1.0 motor controllers wind up failing spectacularly in some way anyway. But I can still be hopeful, right? Plus, I get to play with a new toy:&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-pqhRWpKvkyo/TfowAKDWi6I/AAAAAAAABCo/qBe7QbQpg7A/s1600/dd33.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-pqhRWpKvkyo/TfowAKDWi6I/AAAAAAAABCo/qBe7QbQpg7A/s400/dd33.jpg" width="400" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;Add it to the list of things that are absurdly cheap if you buy them from China, a &lt;strike&gt;bagel toaster&lt;/strike&gt; programmable reflow oven. DirectFETs cannot be soldered with an iron, since the gate and source pads are under the device. I was planning to use a h
