tag:blogger.com,1999:blog-76089322775588070832024-03-14T07:39:04.532-07:00Spinning things and more!Bankshttp://www.blogger.com/profile/06935190198890093740noreply@blogger.comBlogger11125tag:blogger.com,1999:blog-7608932277558807083.post-10155953013391653982014-08-09T20:34:00.000-07:002015-08-01T18:28:52.884-07:00Sending data over IR with a PIC: the DAC methodAlright, so I had what I thought was a relatively mundane problem: I wanted to send data over IR with a PIC I'm using (specifically, a PIC12LF1572). Should be simple, right? Turns out it's actually a bit of a pain to do in an efficient way, and hopefully it's common enough that my write-up here will be useful to someone trying to do something similar. I certainly looked pretty hard for a solution to this online and didn't come up with anything useful.<br />
<br />
This write-up will assume some basic familiarity with microcontrollers (PICs especially) and so I'm not going to spend any time going over the basics like PWM/interrupts/etc.<br />
<br />
I'm also not going to go into detail about what my overall project here is right now, instead I'll just focus on this specific solution because I believe it's deserving of it's own post. For now we'll just say I'm working on a generic IR transceiver.<br />
<br />
So, why's this an interesting problem? Well, generally when sending data over IR you really want to avoid having all the environmental garbage clutter up your signal (sunlight, a variety of household lights, etc all give off a ton of IR). This is accomplished by filtering out any frequencies that aren't specifically what your receiver accepts, i.e. with a band-pass filter. Because your IR signal has to be sent at this frequency, you actually need to modulate your data with it. For example, if your original data signal looks something like this:<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7okubhZx6ww2hcXrB_bSToi_BxBNIueB_y4kjxfsA9AXDOhyphenhyphenC34lOBiI94ww7JxITtOKq1B2FTTwa6ipNZ0WJeogHyxsduxp5lBD3rjzgfn9gb2q2pB5y73oIJeB87JK70Va0iX7Zn4I/s1600/Original+waveform.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="144" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7okubhZx6ww2hcXrB_bSToi_BxBNIueB_y4kjxfsA9AXDOhyphenhyphenC34lOBiI94ww7JxITtOKq1B2FTTwa6ipNZ0WJeogHyxsduxp5lBD3rjzgfn9gb2q2pB5y73oIJeB87JK70Va0iX7Zn4I/s1600/Original+waveform.png" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Original data</td></tr>
</tbody></table>
Then in order to be read by the photodetector your modulated output needs to look something like the blue plotted here:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidWZbbgUNHd3ebzkme8jzm8gSyLpvZ3aid79UEQJEozuUEPrEjaeYW5pGiz6B0ZMhlWcxtz0iFuslIz08OVdNk03e7GM0a1sjD4us0TYiUkTDMyXWzwNZy99bXDZO-LcEQk_NVXfycowo/s1600/Original+waveform+overlay.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="115" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidWZbbgUNHd3ebzkme8jzm8gSyLpvZ3aid79UEQJEozuUEPrEjaeYW5pGiz6B0ZMhlWcxtz0iFuslIz08OVdNk03e7GM0a1sjD4us0TYiUkTDMyXWzwNZy99bXDZO-LcEQk_NVXfycowo/s1600/Original+waveform+overlay.png" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Original data with modulated signal</td></tr>
</tbody></table>
So, how do we generate the modulated signal? The most obvious answer would be using an AND logic gate, like so:<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwAdrrpj0iTCJ3wg92shGZNWqnNPIm-dlMKuqtq1-icFarGIgZC92nsvuYWe23PTDVgBj_AY0hpSuShD7sTfrkNSs7ad4yRS0QmhvTKmkO-11-6jjXLOP9m6-nA5fXU-Ma7lLBDs_t8LM/s1600/Waveform+AND+gate.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="128" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwAdrrpj0iTCJ3wg92shGZNWqnNPIm-dlMKuqtq1-icFarGIgZC92nsvuYWe23PTDVgBj_AY0hpSuShD7sTfrkNSs7ad4yRS0QmhvTKmkO-11-6jjXLOP9m6-nA5fXU-Ma7lLBDs_t8LM/s1600/Waveform+AND+gate.png" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Combined signals with AND gate</td></tr>
</tbody></table>
This is actually a perfectly fine solution in many cases, but there are a couple of major drawbacks which meant that there was no way I could use it in my design. The AND gate adds a whole extra unnecessary component, which drives up the cost of your project (not a big deal if you're just making one, but I'm making 50-100 of these). The other problem is that it requires the use of an additional microcontroller pin (or external PWM source), and considering that I was already making use of <i>all of the output pins</i> on my 8-pin PIC, there simply wasn't an extra pin I could use.<br />
<br />
What's the alternative solution? Use the DAC to modulate the data. Seriously. I'll walk you through the process I used to figure this out, and provide the code I used in case you'd like to implement it yourself.<br />
<br />
I wanted a decent amount of range with my transmitter, so instead of driving my IR LED at 25mA (the max an I/O pin can safely handle), I decided to drive it with a simple BJT (2n3904). Obviously I wanted the drive signal to be the TX pin of the PIC, so I threw together a quick schematic:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZ8XIqkMezYh7P735WeLjbCtc0g4ICZ1H95HJlDTGaKwGVojCDT5yTERb4c5Ty3OdyA-0uDyLO4HniDmXtoDtjt0hvIiRhb5yFvVIjglYJbY283GKtQSnisPHF6HgGEC6u-Y_6aB-YMTU/s1600/PIC+IR+data+schematic.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="291" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZ8XIqkMezYh7P735WeLjbCtc0g4ICZ1H95HJlDTGaKwGVojCDT5yTERb4c5Ty3OdyA-0uDyLO4HniDmXtoDtjt0hvIiRhb5yFvVIjglYJbY283GKtQSnisPHF6HgGEC6u-Y_6aB-YMTU/s1600/PIC+IR+data+schematic.png" width="640" /></a></div>
<br />
You can see the IR LED hooked up to the BJT's collector, and the base is driven with the PIC's primary TX pin (pin 7), with a series resistor to limit current.<br />
<br />
I knew that the <a href="http://www.digikey.com/product-detail/en/TSOP34838/751-1386-5-ND/1768188">photodetector I'm using</a> has a band-pass filter that harshly attenuates signals outside of 38KHz, which means that I didn't have an option other than to modulate my data at 38KHz. As seems to be a common trend with my microcontroller projects, I simply decided "Oh, I'll do something clever in software later." With that, I went ahead and placed an order for a few prototype boards without looking all that closely at the PIC's datasheet.<br />
<br />
With the boards on the way, I started cracking on the firmware. To begin with I had some vague notion that I'd write data out using the USART while simultaneously toggling the TX pin between input/output at 38KHz. Well, my boards came in and quickly after soldering one together and checking the data on a scope, I discovered that my original plan wasn't going to work. The USART was writing data out just fine, but unfortunately it just wasn't being modulated at all. The module just overwrites the pin state to output if you set the TRISA register declaring it an input.<br />
<br />
Following a couple of days of painful troubleshooting, trying alternative methods, and just generally not getting anything to work, I noticed this unassuming chart right here:<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1hJOqLQZTVSCETBFvBES1fOFDDiI09T2-Eq0VjgD19u9GqQzdANmrINBo3RdRTqRH1MVkmDddPDGTRMVXN0ImhJVZUOKgtx9GPF_poicODCbzJHOUo0bnTGF5I605oyZxo1E_wN_m6ms/s1600/Data+priority.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1hJOqLQZTVSCETBFvBES1fOFDDiI09T2-Eq0VjgD19u9GqQzdANmrINBo3RdRTqRH1MVkmDddPDGTRMVXN0ImhJVZUOKgtx9GPF_poicODCbzJHOUo0bnTGF5I605oyZxo1E_wN_m6ms/s1600/Data+priority.png" width="300" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">(Taken straight from the datasheet)</td></tr>
</tbody></table>
Basically, functions higher on the list are able to dominate the state of the associated pin. Notice how pin RA0 (the main TX pin) has 3 functions with a higher priority than the TX function? Well, ICSPDAT is just used for programming so it's not helpful in this case. However, CWG1B (an output of the complimentary waveform generator) and the DAC (DAC1OUT) are both listed as higher priority. That means that if the CWG or the DAC to outputs to the pin while TX is writing to the output buffer, the TX is going to get overridden.<br />
<br />
Okay, so that's one piece of the problem, the other one is how to convince the CWG or the DAC to take control of the pin at exactly 38KHz. The CWG is basically able to PWM, so you'd think it'd be the best choice in this case - it turns out that wasn't super helpful because I didn't actually want to drive the pin high then low, I just wanted to change its state between driven and undriven by a specific peripheral. Accordingly it didn't really matter whether I used the CWG or the DAC, so naturally I went with the DAC for extra hilarity (seriously, how can you resist being able to write obtuse comments like "<code>// Enable DAC to send data over serial<code>"?)</code></code><br />
<code><code><br /></code></code>I used Timer1 to hit overflow at about 38KHz*2 = 76KHz, triggering an interrupt which toggles the output state of the DAC (which defaults to writing 0V). When the DAC's output is on, it drives the TX pin at 0V, and when the output is disabled the TX is allowed to regain control of the pin state. I also made sure to use a slow baud rate (4545) in order to allow enough 38KHz pulses to sufficiently modulate the signal.<br />
<br />
Without further ado, the code:<br />
<br />
<div style="height: 700px; overflow-y: auto; overflow: -moz-scrollbars-vertical; width: 700px;">
<pre><code>void Setup(void)
{
OSCCON = 0b01111010; //16MHz internal clock
TRISAbits.TRISA0 = 0; // Set RA0 as output
}</code></pre>
<pre><code>void Send_Packet(uint8_t data)
{
DACCON0bits.DACEN = 1; // Enable DAC to send data over serial
Modulate_Serial();
SPBRGL = 54; // Baud rate is 4545
TXSTAbits.SYNC = 0; // Asynchronous mode
RCSTAbits.SPEN = 1; // Enable EUSART
BAUDCONbits.SCKP = 1; // Inverted mode (idle low)
TXSTAbits.TXEN = 1; // Enable transmitter
TXREG = data;
while(!TXSTAbits.TRMT); // Wait for USART to send all data
Disable_Modulation();
TRISAbits.TRISA0 = 0; // Allow RA0 to drive low
DACCON0bits.DACEN = 0;
}
void Modulate_Serial(void){
INTCONbits.GIE = 1; // Enable interrupts
INTCONbits.PEIE = 1; // Enable peripheral interrupts
PIE1bits.TMR1IE = 1; // Enable Timer1 overflow interrupt
T1CONbits.nT1SYNC = 1; // Don't synchronize external clock input
T1CONbits.TMR1ON = 1; // Turn on timer
TMR1 = 65484; // Initialize TMR1 value for desired frequency
}
void Disable_Modulation(void){
INTCONbits.GIE = 0;
T1CONbits.TMR1ON = 0;
}
// Interrupts
void interrupt High_Priority_Interrupt(){
if(PIR1bits.TMR1IF == 1) // TMR1 register overflowed
{
DACCON0bits.DACEN ^= 1; // Use DAC to generate 38KHz carrier wave
TMR1 += 65484;
PIR1bits.TMR1IF = 0; // Clear the interupt flag
}
}</code></pre>
</div>
<br />
That's pretty much it! All you'd need to do to use this (in MPLAB X with XC8 as your compiler) is add a header file with prototypes for those functions.<br />
<br />
He's the final scope shot showing off the modulated waveform, thanks to the DAC:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5ynmDo7HKC-pCuR-YiPRhQekwz7cDR8I8BC17yJtUbqvHikbpRTCNsxT061koP58hfYXM2D7QOJO1AobLiJEyH6ZG71TdRkeLNanyCDn86NvmWbyW6wZq-2QNHOWXZj3YOCQJGfqjbQw/s1600/Modulated+USART+output.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="281" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5ynmDo7HKC-pCuR-YiPRhQekwz7cDR8I8BC17yJtUbqvHikbpRTCNsxT061koP58hfYXM2D7QOJO1AobLiJEyH6ZG71TdRkeLNanyCDn86NvmWbyW6wZq-2QNHOWXZj3YOCQJGfqjbQw/s1600/Modulated+USART+output.jpg" width="400" /></a></div>
<br />
Yay! Everything works the way it's supposed to.<br />
<br />
Over all it was an exciting few days coming up with this somewhat disgusting (but mostly hilarious) hack, and I figured it was actually worth posting about since someone might find it useful. Let me know if you have any questions!Bankshttp://www.blogger.com/profile/06935190198890093740noreply@blogger.com3tag:blogger.com,1999:blog-7608932277558807083.post-84625930186504865472014-03-02T16:48:00.003-08:002014-03-02T17:07:48.251-08:00Audible Altimeter part 1I was looking for a new electronics project to work on, and found some inspiration in the skydiving world. While you're in freefall, it's absolutely critical to know what altitude you're at, so you can know when to safely pull your parachute. Skydivers wear something along the lines of <a href="http://i.imgur.com/HJmG2ri.png">this</a> so they can keep track of altitude, but another useful indicator is what's called an "audible altimeter", an electronic device that's placed in your helmet and sends out a series of warning beeps at pre-programmed altitudes. I was looking into purchasing an audible altimeter for myself, and found that <a href="http://www.chutingstar.com/skydive/altimeters/audible">they're all super expensive</a> (over $200), which seemed pretty ridiculous to me considering how simple they are. I decided it would be a fun project to try and make my own since I thought I could produce one for cheaper, and learn a lot in the process.<br />
<br />
It's definitely an interesting project because everything has to be made as small and low-power as possible, in order to have it be completely portable and so that you don't have to constantly worry about the battery dying. I decided to go with a rechargeable lithium polymer battery (specifically <a href="https://www.sparkfun.com/products/10718">this one</a>) since they have great energy density and charge rates. I found a <a href="http://www.digikey.com/product-detail/en/MCP73831T-2DCI%2FOT/MCP73831T-2DCI%2FOTCT-ND/1979804">fantastic chip</a> which is built to charge a single cell LiPo at up to half an amp from a 5V source, which is great for USB charging. I'd also gotten some experience soldering <a href="http://upload.wikimedia.org/wikipedia/commons/2/23/28_pin_MLP_integrated_circuit.jpg">QFN (leadless) surface mount parts</a> over the summer, and I thought it'd be neat to design a board with these to make it as small as possible.<br />
<br />
I wanted to branch out in microcontroller selection and pick a new architecture that I could learn about. I ended up going with an <a href="http://www.digikey.com/product-detail/en/STM32F050G4U6/497-13619-ND/3947371">STM32F050</a> because it's quite powerful for how much it costs, and it's a good match for the features I need.<br />
<br />
Other than that, I picked:<br />
<ul>
<li>a <a href="http://www.digikey.com/product-detail/en/BMP180/828-1027-1-ND/2688260">fast barometer</a> (many of them could only be read as fast as once a second, but this one gives up to 200 readings per second) so that I can get an accurate reading of pressure to calculate altitude from. </li>
<li>a <a href="http://www.digikey.com/product-search/en?vendor=0&keywords=458-1077-ND">loud 4KHz buzzer</a> so that it would be easy to hear</li>
<li>an <a href="http://www.digikey.com/product-detail/en/FT234XD-R/768-1178-1-ND/3904926">FTDI USB to UART bridge</a> so that I could program it over USB</li>
<li>a 3.3V buck converter, because the LiPo battery outputs anywhere from around 3.6 to 4.2 volts, and everything runs on 3.3V. The buck converter isn't completely necessary because it could be replaced with a linear regulator, but I figured it was worth it to pay a few cents more for something like 20% longer battery life due to the extra efficiency.</li>
<li>a bunch of <a href="http://upload.wikimedia.org/wikipedia/commons/3/34/SMT_sizes%2C_based_on_original_by_Zureks.svg">0603 (metric 1608)</a> passive resistors, capacitors, and LEDs, as well as a few miscellaneous parts like buttons, an inductor, etc.</li>
</ul>
<div>
I started out with a quick block diagram of how I wanted to hook everything up:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://i.imgur.com/iws24rt.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://i.imgur.com/iws24rt.jpg" height="480" width="640" /></a></div>
<div>
<br /></div>
<div>
I forgot to label Vdd from the STM and the BMP180, but they're going to the 3.3V buck output, not the battery voltage.</div>
<div>
<br /></div>
<div>
I basically sat down for a day or two and CADed all of the part packages using Eagle, and put together a schematic that pretty closely follows the block diagram above, plus a bunch of passives, buttons, and a couple other things.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjL9hyphenhyphenmmVPRa7O3eDtKmPEiDZOxg_1Y_fjLyK8QX_r4hCNcO5YajFq9Ieg2kfS4uK7sQ6kfvfjetuGdiGGDTh74obN61jdYMMMZOGnBLGmog3mvNIy-lZE3nj9bn4y3BRjprv4eOyVe7YQ/s1600/Schematic.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjL9hyphenhyphenmmVPRa7O3eDtKmPEiDZOxg_1Y_fjLyK8QX_r4hCNcO5YajFq9Ieg2kfS4uK7sQ6kfvfjetuGdiGGDTh74obN61jdYMMMZOGnBLGmog3mvNIy-lZE3nj9bn4y3BRjprv4eOyVe7YQ/s1600/Schematic.png" height="304" width="640" /></a></div>
<div>
<br /></div>
<div>
Unfortunately I was in one of those ultra-focused "make this project without thinking about anything else" states while putting this together, so I forgot to take screenshots showing the process.</div>
<div>
<br /></div>
<div>
One interesting challenge was that I wanted the whole board to be completely powered off while not in use, turn on when a button is pressed, and then be able to turn off when the <i>same button</i> is pressed again. Since I'm only using on/off tactile buttons, I had to get a little creative in order to build this behavior. Basically the buck converter's enable pin (EN) is hooked up to a microcontroller output, so the microcontroller can drive it low to turn off power to everything (including the micro itself). The power button is <i>also</i> hooked up to EN, so that when the board is off and you press the power button, the buck converter turns on, turning on power to the whole board. The micro then has to immediately hold EN high in order for the buck to stay on when you release the button. So far so good, right? The one problem is that the micro has to have a way of knowing when you hit the power button a second time, so that it knows when to turn off the buck and power down. I ended up coming up with a resistor divider pulls a pin on the micro low whenever the micro is driving EN, and pulls the pin high when the button is driving EN, allowing the micro to read the state of that pin to decide if it should power off.</div>
<div>
<br /></div>
<div>
With the schematic out of the way, it was time to lay out/route the board! I wanted all the parts to be on one side so that I could put a battery flush on the other. Here's what I was looking at after placing components:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLRav5y_eCSTMMTYDp9XW4fcOkBq12z5EC-OAefRgWXOnyLXDcF7qvIWbqlOCc-kFqp4nqoyx-gAtKVFjKiV3UtKGroBVD1Oc8Et4b39fBcHgYEo23K-0zQELRH-G8KdNRVHt4DWQ0Ckc/s1600/Tnames+and+Tvalues+hidden+-+unrouted.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLRav5y_eCSTMMTYDp9XW4fcOkBq12z5EC-OAefRgWXOnyLXDcF7qvIWbqlOCc-kFqp4nqoyx-gAtKVFjKiV3UtKGroBVD1Oc8Et4b39fBcHgYEo23K-0zQELRH-G8KdNRVHt4DWQ0Ckc/s1600/Tnames+and+Tvalues+hidden+-+unrouted.png" height="326" width="640" /></a></div>
<div>
<br /></div>
<div>
You can't tell from the picture, but the battery connector (bottom right) is actually on the underside of the board to make it easy to plug the battery into. The yellow lines are "airwires", or connections that haven't yet been physically made. The whole board comes in pretty small at just under 2" by 1", which I'm pretty happy with.</div>
<div>
<br /></div>
<div>
Routing time! This is one of my favorite parts of making boards, it always creates some interesting challenges, especially with smaller boards. Once again, I was in in-the-zone-mode, so I forgot to take pictures of the process.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUf5VEDGruq9otgrrNrF6Y-HZvD6CaE6C1dT4sXgXSjiUB5MokoJWenhsPFHt7PIouEylap33IUL6lJvxIRoIdXgeP7JxncUPg0-YQhwVRSUHbCWoPcBrZbVyBeSu5S6pPjKt24LQIR-k/s1600/Tnames+and+Tvalues+hidden+-+routed.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUf5VEDGruq9otgrrNrF6Y-HZvD6CaE6C1dT4sXgXSjiUB5MokoJWenhsPFHt7PIouEylap33IUL6lJvxIRoIdXgeP7JxncUPg0-YQhwVRSUHbCWoPcBrZbVyBeSu5S6pPjKt24LQIR-k/s1600/Tnames+and+Tvalues+hidden+-+routed.png" height="316" width="640" /></a></div>
<div>
<br /></div>
<div>
Looking back I'm a little unhappy with what I consider slightly sloppy routing, all those vias (connections from one side to the other) in the center look pretty messy. Oh well, for revision 1, as long as it works right?</div>
<div>
<br /></div>
<div>
I decided to go with <a href="http://www.seeedstudio.com/service/index.php?r=site/pcbService">Seeed Studio</a> to get the board fabricated, for smaller boards like this they have an awesome deal of 10 boards for $10, not counting shipping. After placing the order, it was time for the few weeks of eager anticipation that I've come to know over the last year or two since I started making boards.</div>
<div>
<br /></div>
<div>
Of course, it's always worth it when you get a package in the mail and suddenly it feels like Christmas. Here's the top and bottom, with a quarter for scale:<br />
<br /></div>
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhvdljh319Hfltb89B-qlGgg2K4H2vfyAdahPR-dT1e58v77GydhxNErrU0ZWpkkvOo70hcVhCZp9vB8JGfgokR3854RbC2WCm4gyKv8bPcjzlanQKiz157v64iRlzJnUnIUQuZCqjtok/s1600/Altimeter_Boards.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhvdljh319Hfltb89B-qlGgg2K4H2vfyAdahPR-dT1e58v77GydhxNErrU0ZWpkkvOo70hcVhCZp9vB8JGfgokR3854RbC2WCm4gyKv8bPcjzlanQKiz157v64iRlzJnUnIUQuZCqjtok/s1600/Altimeter_Boards.jpg" height="480" width="640" /></a></div>
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div>
<br /></div>
<div>
Sorry for the picture quality, maybe one of these days I'll stop spending all my money on skydiving/engineering projects and actually buy a camera instead of using my phone.</div>
<div>
<br /></div>
<div>
Of course as soon as I got these I put everything else aside and rushed to populate one of these with parts, so here's a picture taken a few hours later with everything soldered on:<br />
<br /></div>
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3lXktA-g8K7U_S1OwJNPB5UdfSfaCBuhyvyv9XcFzxRaRssJHP_pe_0iVCJ2e8JbmIu8fdPrjjyF0ksi34Bg5Z4JIqn5C2dUlsTfdqjnGlBJa0LBZVmp1lfduhW3byh4hcB5BVhs9zck/s1600/Altimeter_Populated.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3lXktA-g8K7U_S1OwJNPB5UdfSfaCBuhyvyv9XcFzxRaRssJHP_pe_0iVCJ2e8JbmIu8fdPrjjyF0ksi34Bg5Z4JIqn5C2dUlsTfdqjnGlBJa0LBZVmp1lfduhW3byh4hcB5BVhs9zck/s1600/Altimeter_Populated.jpg" height="480" width="640" /></a></div>
<br /></div>
<div>
From there I moved on to trying to turn on the board, and immediately starting having a few problems with the buck converter that it took me a while to get to the bottom of. After decreasing the bypass capacitance on the VCC line I was able to get it to boot up, which allowed me to start programming the microcontroller. Time to learn how the STM32F050 works! Fortunately there's a lot of example code and guides around which make it pretty easy to get things going. I won't go into to much detail about how the code works, I don't think it's useful to paste a bunch of lines of initialization/etc here, so instead I'll describe what I generally did. I started out writing a basic program which holds the buck's EN pin high, turns on the yellow LED, and turns on the blue LED whenever the "ZERO" button is pressed. After getting that all working, I noticed some weird behavior where the board would turn off seemingly randomly. I eventually realized that putting my finger on the top of the board was what was causing it to turn off, most specifically whenever I touched the buck converter. Hmm. It turns out that I had used a large resistor in my voltage divider (the one described above) which caused the EN pin on the buck to be sort of floating, and the transient produced by touching it with your finger was enough to bounce it low, causing the whole board to turn off. Once I knew about this I actually elected not to patch in a bypass capacitor on EN (which would fix the issue), because while debugging I actually prefer the option to have a quick "hard off" available (where the off button is basically touching the EN on the buck).<br />
<br />
From there I moved on to figuring out how PWM works on these chips and wrote a function to drive the piezo at different frequencies (e.g. a low frequency/relatively quiet 'boop' when it boots up). I continued to fiddle with it for a week or two, then more or less set the board aside for a while to focus on schoolwork. This semester I have a bit more free time, so I picked the board back up a few weeks ago and continued to work on the code for it. <a href="http://en.wikipedia.org/wiki/I%C2%B2C">I²C</a>, the communication protocol that the barometer uses, was particularly difficult to get working. I learned that I should have included an extra header for debugging I²C because I had to measure everything by jamming scope probes into the tiny vias on the I²C signal lines. After a few days of working on it, though, I finally got the two chips successfully talking and was able to get a pressure reading out of the barometer.<br />
<br />
I took a snapshot of the communication between the microcontroller and the pressure sensor with an oscilloscope:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQxIOqaDDxyISGYFdJfSBBEAShwo-iSeBhT6Y6KO-9aJNAFqnOC-0FXfHoXaOkh3ipWrYcpIBDHsuOs8fJc4N7PQU6i8IgTAg1qMj0b9nhqVrjLkdqpKyTvvRUWcecaC77KmbwBvtY05g/s1600/Altimeter_I2C_Scope.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQxIOqaDDxyISGYFdJfSBBEAShwo-iSeBhT6Y6KO-9aJNAFqnOC-0FXfHoXaOkh3ipWrYcpIBDHsuOs8fJc4N7PQU6i8IgTAg1qMj0b9nhqVrjLkdqpKyTvvRUWcecaC77KmbwBvtY05g/s1600/Altimeter_I2C_Scope.jpg" height="480" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
The other board you can see is ST's awesome <a href="http://www.digikey.com/product-detail/en/STM32VLDISCOVERY/497-10633-ND/2344529">Discovery board</a>, which runs for $10 and has an STM32F1 that you can program, as well as a built-in ST programmer which I'm using here to program my board. On the scope, you can see that the first eight data bits (blue) write out 11101110 where they coincide with the clock pulses (yellow). Converted to hex, this is 0xEE, which is the 'write to' address of the barometer, meaning that I'm telling it I'm about to write data to it. The next clock pulse after this is the barometer pulling the data line low, which is an I²C 'ACK', or acknowledgement that it received the previous byte. After that, you can read 11110110, or 0xF6, which is the micro telling the sensor which address it wants to read from (in this case, the address where the last pressure reading is stored). Not currently shown on the scope, the altimeter then sends out its 'uncompensated' pressure reading, which the micro uses (along with a variety of factory calibration parameters previously read from the barometer's memory over I²C) along with a temperature to calculate the 'true' pressure, and then calculates altitude from the pressure.<br />
<br />
I had been debugging everything from my laptop, and using debug mode to keep track of variables, which I decided wasn't a great solution for actually tracking how the measured altitude changed as I moved around. I ordered a cheap LCD from ebay and threw it on a breadboard with an Arduino to try and get a portable display which would read out the altitude difference from the zero point in real time, allowing me to run up and down tall buildings and see how well it tracks changes. Because of the way the I²C protocol works, you're able to add new devices to your communication lines whenever you want, which allowed me to simply add the Arduino onto the existing I²C line in order to talk to it. Unfortunately this required somewhat sketchily soldering thin wires onto very small pads on the pull-up resistors on my board, but once I got them there I coated them with hot glue to keep them in place.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixHQJN1qDfkra2PHVUhBp01AfJHio7xIMNG0isRPoz5poH-_FrZR-sZU9zKQIE6lSf9j6cUMGbj2tAKWVR75RrhAdYYeMj-j0NwqYLWB_7dvYS71lYczMDmCdZ1qE776EKfPdyWo1uGKU/s1600/Altimeter_Arduino_LCD.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixHQJN1qDfkra2PHVUhBp01AfJHio7xIMNG0isRPoz5poH-_FrZR-sZU9zKQIE6lSf9j6cUMGbj2tAKWVR75RrhAdYYeMj-j0NwqYLWB_7dvYS71lYczMDmCdZ1qE776EKfPdyWo1uGKU/s1600/Altimeter_Arduino_LCD.jpg" height="480" width="640" /></a></div>
<br />
Unfortunately, while for some reason the Arduino reads its address correctly (sends an ACK) and does appear to read <i>some </i>of the data sent to it, I've got a bug somewhere because somehow it's not actually reading the data I'm sending. It'll probably take another few days of poking at the Arduino to get it to read data in properly, but my board itself seems to be working as I want it to, for the most part. Pretty close to having it actually be usable for skydiving! I'll probably 3D print a case for it as well.<br />
<br />
That's the current state of my altimeter board, I've also got a new project that I'm really excited about (and just ordered boards for!) which I'll write up in the next post.</div>
Bankshttp://www.blogger.com/profile/06935190198890093740noreply@blogger.com0tag:blogger.com,1999:blog-7608932277558807083.post-7902129473370516082014-01-18T21:18:00.003-08:002014-08-11T17:28:30.774-07:00I'm back - let's write some assembly!Hey! It's been a while. I'll go ahead and explain where I've been, and then talk about some stuff I've been working on recently. I stopped posting before the start of last summer, where I got to intern at a really cool company called <a href="http://www.freeflysystems.com/">Freefly</a>, who primarily make giant camera-hauling multirotors for professional cinema, as well as more recently a sweet 3-axis handheld camera stabilizer. They're based in my hometown, Seattle, and staying there was pretty awesome because I got to rock climb every weekday evening, and then head to the dropzone and skydive every weekend! Unfortunately this left me without a lot of time for personal projects, but I did manage to pick up my skydiving license towards the start of the summer, and I'm up to 54 jumps now. Here's a pretty cool picture my friend Andrew from the MIT Skydiving Club took of me this fall:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPi0RWnsop84K6WzqllTYch1wGFRUm4le0EkygP8YglkhJJ4R3edaubsSbmhHm5hRejhPgEryd9Nk781k3KDm05L-kfd_KgHbH3ez2DIJf5w5yIgGpnNRJAq9q8pp1tKe9_JpQoum17EM/s1600/Skydive.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPi0RWnsop84K6WzqllTYch1wGFRUm4le0EkygP8YglkhJJ4R3edaubsSbmhHm5hRejhPgEryd9Nk781k3KDm05L-kfd_KgHbH3ez2DIJf5w5yIgGpnNRJAq9q8pp1tKe9_JpQoum17EM/s1600/Skydive.png" height="356" width="640" /></a></div>
<br />
I also have a video from early in the summer, just after I got my license. I'm wearing all black with a black helmet and a navy blue parachute with red highlights:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/df7sfoJmJn4?feature=player_embedded' frameborder='0'></iframe></div>
<br />
Anyway, enough about that. Let's move on to the really interesting stuff - x86 assembly! Last semester I took a pretty cool class called Intro to Robotics, in which we were provided with 3D printed, jointed legs, and had to build a driven exoskeleton to allow them to walk on a treadmill. I was primarily in charge of my team's programming and electronics (it was a MechE class so I had the most experience in these), and I was able to write some functional code and get it to walk:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/9VVxFeEBD94?feature=player_embedded' frameborder='0'></iframe></div>
<br />
The robot uses a gyro inside the hip to determine the hip angle, and has a control loop which speeds up the walk cycle as the hip tilts forwards, allowing it to match the speed of the treadmill. I also got to witness a bit of control system magic when the robot walked up on the front piece of the treadmill (stepping off of the belt entirely), paused for a second, and then <i>started walking backwards</i> back down onto the treadmill. Since walking too far forward had caused the hip to tilt backward, it actually slowed down the walking cycle until it reversed it entirely. Unfortunately this wasn't captured on video, but it was a pretty magical moment!<br />
<br />
Despite this, I wasn't too proud of my code because to me it felt pretty hacked together. I decided I really wanted to make an effort to get better at programming - of course step one was to immediately add a linux (Ubuntu) install to my laptop, and after working on a few Python projects I decided I wanted to try and learn some assembly language. Despite having spent a fair amount of time with various microcontrollers, everything I've written for them has been in C, so I didn't have any experience writing assembly until now. I thought that it would be fun to write something that runs on my laptop, so I installed nasm, a common assembler, and started reading online tutorials. I'll try to keep this post limited to explaining what I've done, rather than making it an assembly tutorial on its own, but I'll link you a few of the tutorials/pages I found useful if you're interested in really learning this stuff on your own:<br />
<br />
<a href="http://docs.cs.up.ac.za/programming/asm/derick_tut/">http://docs.cs.up.ac.za/programming/asm/derick_tut/</a> - very useful tutorial, explains procedures, the stack, jumping, and just generally how to get started.<br />
<a href="http://leto.net/writing/nasm.php">http://leto.net/writing/nasm.php</a> - a very similar tutorial, slightly less in-depth<br />
<a href="https://www.cs.uaf.edu/2005/fall/cs301/support/x86/nasm.html">https://www.cs.uaf.edu/2005/fall/cs301/support/x86/nasm.html</a> - a cheat sheet with some common commands<br />
<a href="http://home.myfairpoint.net/fbkotler/nasmdocc.html">http://home.myfairpoint.net/fbkotler/nasmdocc.html</a> - the entire nasm instruction set reference<br />
<a href="http://blog.rchapman.org/post/36801038863/linux-system-call-table-for-x86-64">http://blog.rchapman.org/post/36801038863/linux-system-call-table-for-x86-64</a> - a table of system calls (more on what that is later) for 64-bit linux<br />
<br />
Unfortunately all of those tutorials are for 32-bit linux, and since I wanted to write for my 64-bit machine I had to use different registers than the ones in their examples, as well as having entirely different system calls.<br />
<br />
First let's go over what I wrote, and then I'll explain it a bit. I started out writing a program that takes in a command line argument (when you run a program from the command line you can give it one or more 'arguments', which are just strings that get pushed to <a href="http://en.wikipedia.org/wiki/Call_stack">the stack</a>) and then prints it back out. This really isn't useful to me (more useful versions of this already exist, like echo), but it's a good place to start learning. Here's the behavior:<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCqE3jLBfOtdZFOOuKoQZ-7Xx964lzJmOHDR2LsuykNqsjGTKHgZixRIaDxue5pPFQFaDx2sZzqmz3sL_gRITIizvkAUlcKVbhV_94nHO4stORS-V32OUEH6Q4UlfRup6C-0sptTpdln0/s1600/2014-01-18-205314_798x447_scrot.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCqE3jLBfOtdZFOOuKoQZ-7Xx964lzJmOHDR2LsuykNqsjGTKHgZixRIaDxue5pPFQFaDx2sZzqmz3sL_gRITIizvkAUlcKVbhV_94nHO4stORS-V32OUEH6Q4UlfRup6C-0sptTpdln0/s1600/2014-01-18-205314_798x447_scrot.png" height="356" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The battery monitor at the bottom [charge state, charge%, remaining time] is one of the Python projects I mentioned earlier</td></tr>
</tbody></table>
You'll see me calling the program to run it: <code>./args_old</code>, and then giving it a single string: "this is a sample string!" as a command line argument. The backslashes are just escapes for the spaces and exclamation mark, so they become part of the string instead of splitting the text into separate arguments. As you can see, running it will just print the string I gave back through standard output.<br />
<br />
Now, let's take a look under the hood:<br />
<br />
<div style="height: 400px; overflow-y: auto; overflow: -moz-scrollbars-vertical; width: 500px;">
<code>
section .text<br />
global _start<br />
<br />
_start:<br />
pop rax ; get number of args<br />
pop rbx ; get program name<br />
cmp rax,2<br />
jne _bad; if there isn't just 1 arg, go to _bad<br />
pop rcx ; first argument<br />
<br />
call _length_entry<br />
<br />
_output:<br />
mov rax,1<br />
mov rdi,1<br />
mov rsi,rcx<br />
mov rdx,[strLen] ; length of str into rdx<br />
<br />
syscall ; kernel halp<br />
<br />
_newline:<br />
mov rax,1<br />
mov rdi,1<br />
mov rsi,ten<br />
mov rdx,1<br />
syscall<br />
<br />
_exit:<br />
mov rax,60 ; exit<br />
mov rdi,0 ; don't error<br />
syscall ; laterz<br />
<br />
_bad:<br />
mov rax,1<br />
mov rdi,1<br />
mov rsi,feelbad<br />
mov rdx,feelLen<br />
syscall<br />
jmp _exit<br />
<br />
_length_entry:<br />
mov qword [strLen],0<br />
jmp _length_test<br />
<br />
_length:<br />
add qword [strLen],1<br />
add rcx,1<br />
<br />
_length_test:<br />
cmp byte [rcx],0<br />
jne _length<br />
sub rcx,[strLen]<br />
ret ; if null byte, ret<br />
<br />
section .data<br />
strLen dq 0 ; reserve some space for length<br />
ten db 10 ; -_-<br />
feelbad db 'Your args are bad and you should feel bad.',10<br />
feelLen equ $-feelbad<br />
</code></div>
<br />
Woo, assembly! 60+ lines just to print something back at you. In order to make a system call to <code>write</code>, you have to give it both a string and the length of the string, so it knows where to stop. Because of this, I had to write a routine that counts the length of the argument, conveniently named <code>_length</code>. Basically it uses the <code>strLen</code> as a counter, counting characters in the string until it hits a null byte (0), meaning there are no more characters and it's hit the end of the string. The <a href="http://en.wikipedia.org/wiki/Processor_register">register</a> <code>rcx</code> holds a <a href="http://en.wikipedia.org/wiki/Pointer_(computer_programming)">pointer</a> to the argument string from the start. It gets shifted forward in each loop of <code>_length</code> to always point to the next character until finding the null byte, then it gets subtracted by <code>strLen</code> so that it points back to the beginning of the string. Also, if you don't have exactly one argument, it'll jump to the label <code>_bad</code> which prints an error message. Finally, the <code>_output</code> routine sets registers to make a system <code>write</code> call, puts the string pointer into the <code>rsi</code> register which is where the system looks for the string to write, and similarly puts <code>strLen</code> into <code>rdx</code>. Then <code>syscall</code> actually tells the kernel to run the instruction.<br />
<br />
Once I got that working, I decided to make it a bit more interesting. How about making it take in two arguments, both a number %n and a string, and then printing the string %n times?<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKGUkMtjLcf6RPAUoH01twBNH7zEH0FK7vwiowbF2Du_s_HxsIGrlq-x9vbKQHQ3mjUcVBw9c3VhVxeMq2iWtJjkRN8LMR7ugFYhkcNi95AcOEvVED9M7P4gqgkdZOw4-9ONEE-4a-wAE/s1600/2014-01-18-205410_798x447_scrot.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKGUkMtjLcf6RPAUoH01twBNH7zEH0FK7vwiowbF2Du_s_HxsIGrlq-x9vbKQHQ3mjUcVBw9c3VhVxeMq2iWtJjkRN8LMR7ugFYhkcNi95AcOEvVED9M7P4gqgkdZOw4-9ONEE-4a-wAE/s1600/2014-01-18-205410_798x447_scrot.png" height="358" width="640" /></a></div>
<br />
<br />
Because arguments are always pushed to your program as strings, this means that something like "3523" is still a string, so I had to write a routine to convert a string into an integer. Here's the full code for the new version (also a <a href="http://pastebin.com/raw.php?i=tHK9JiC8">pastebin</a>):<br />
<br />
<div style="height: 600px; overflow-y: auto; overflow: -moz-scrollbars-vertical; width: 700px;">
<code>
section .text<br /> global _start<br /><br />_start:<br /> pop rax ; get number of args<br /> pop rbx ; get program name<br /> cmp rax,3 ; make sure there are 2 arguments (+1 for program name)<br /> jne _bad ; if not, jump to error message<br /> pop rdx ; first argument<br /> pop rcx ; second argument<br /><br /> call _length_entry<br /> mov [stra],rcx<br /> call _atoi_entry<br /> call _text_entry<br /> call _exit<br /><br />_output:<br /> mov rax,1<br /> mov rdi,1<br /> mov rsi,[stra] ; move pointer of the string start into rsi<br /> mov rdx,[strLen] ; length of str into rdx<br /> syscall ; kernel halp<br /><br />_newline:<br /> mov rax,1<br /> mov rdi,1<br /> mov rsi,ten<br /> mov rdx,1<br /> syscall<br /> ret<br /><br />_exit:<br /> mov rax,60 ; exit<br /> xor rdi,rdi ; don't error<br /> syscall ; peace out<br /><br />_bad:<br /> mov qword [stra],feelbad ; write feelbad to output string<br /> mov qword [strLen],feelLen ; write feelLen to output string length<br /> call _output<br /> jmp _exit<br /><br />_length_entry:<br /> mov qword [strLen],0 ; zero string length<br /> jmp _length_test<br /><br />_length:<br /> inc qword [strLen] ; increment string length<br /> inc rcx ; string pointer to next character<br /><br />_length_test:<br /> cmp byte [rcx],0 ; check if null character<br /> jne _length<br /> sub rcx,[strLen] ; set rcx back to beginning of string<br /> ret ; if null byte, ret<br /><br />_atoi_entry:<br /> xor r9,r9 ; zero accumulator<br /> mov [asciinum],rdx ; write string pointer to [asciinum]<br /><br />_atoi:<br /> xor rax,rax ; set rax to 0<br /> mov r10,[asciinum] ; pointer to asciinum in r10<br /> mov al,[r10] ; first byte of string into first byte of al<br /> cmp al,0 ; make sure we haven't hit end of string<br /> je _atoi_exit<br /><br /> lea r11,[r9*8]<br /> lea r9,[r11+r9*2] ; multiply r9 by 10<br /><br /> sub al,48 ; ascii -> digits<br /> cmp al,9 ; make sure they're numbers 0-9<br /> ja _bad<br /><br /> add r9,rax ; incriment accumulator<br /> inc qword [asciinum] ; shift pointer to string up by 1 (next character)<br /><br /> jmp _atoi<br /><br />_atoi_exit:<br /> mov [asciiInt],r9 ; write accumulator to asciiInt<br /> ret<br /> <br />_text_entry:<br /> xor r12,r12 ; zero a counter<br /> jmp _text_mult_cmp<br /><br />_text_mult: ; text_mult is effectively a while loop that prints our<br /> ; string r9 times, since r9 is our accumulator from before<br /> call _output<br /> inc r12<br /><br />_text_mult_cmp:<br /> cmp r12,r9<br /> je _exit<br /> jmp _text_mult<br /><br /><br />section .data<br /> stra dq 0 ; reserve space for string pointer<br /> strLen dq 0 ; reserve some space for length<br /> asciinum dq 0<br /> asciiInt dq 0<br /> ten db 10 ; sigh. set the value of ten to be 10<br /> feelbad db 'Your args are bad and you should feel bad. Proper syntax: args <int> <str>'<br /> feelLen equ $-feelbad ; set length of feelbad to feelLen<br /><br />
</code></div>
<br />
You can see the label <code>_atoi</code> which converts a string to an integer. It's similar to <code>_length</code>, except each time it moves to a new character, it multiplies the whole thing by 10. This makes sense if you think about how a base-10 system works, if you type in a single digit - say, 4 - then it reads the first character, adds it to the accumulator register <code>r9</code>, finds that the next character is a null byte, and writes 4 to <code>asciiInt</code>. If you give it two digits - how about 24 - then it reads the first character, adds it to the accumulator (now the accumulator = 2), finds the next character isn't a null byte, <i>multiplies the accumulator by 10</i> so the accumulator = 20, reads in the next character (4), and adds it to the accumulator to get a value of 24. The algorithm works the same way as you continue increasing the length of the number you give it. My program also checks each character with <code>cmp al,9</code> then <code>ja _bad</code> which makes sure it's 0-9 instead of some other ascii character, and if not then it goes to the <code>_bad</code> routine to print an error message.<br />
<br />
Here's a quick demo of the error message:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhib7JlL7qiRPZ5r6ukpi-50HQRJXv81MT5wfzFQIvL386RHdV_RRrA898aUSVD9ADPqtzRnvaR1cWtvnYKdQLPpsCfZkkV8KrS_owxt5y8eLXb0FhV5MfO8R2g43RyNK7JLPtnzxdpWDc/s1600/2014-01-18-205649_798x447_scrot.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhib7JlL7qiRPZ5r6ukpi-50HQRJXv81MT5wfzFQIvL386RHdV_RRrA898aUSVD9ADPqtzRnvaR1cWtvnYKdQLPpsCfZkkV8KrS_owxt5y8eLXb0FhV5MfO8R2g43RyNK7JLPtnzxdpWDc/s1600/2014-01-18-205649_798x447_scrot.png" height="358" width="640" /></a></div>
<br />
It also still prints the error message if the number of arguments given isn't exactly 2.<br />
<br />
That's pretty much it!<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkx-rg7cL_oBRIjURTh4d9_LutnRP_3WsCzdfmzyJWZgmgXfbKqRFvrNynJxI-HdSK-tZnBBinQovpB33ErcddCrMUhP0FnBzdjs60uVDXd5FX1RHB1dRL0FnIOwEvMYhJaH4fbRrygQM/s1600/2014-01-18-205754_798x447_scrot.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkx-rg7cL_oBRIjURTh4d9_LutnRP_3WsCzdfmzyJWZgmgXfbKqRFvrNynJxI-HdSK-tZnBBinQovpB33ErcddCrMUhP0FnBzdjs60uVDXd5FX1RHB1dRL0FnIOwEvMYhJaH4fbRrygQM/s1600/2014-01-18-205754_798x447_scrot.png" height="358" width="640" /></a></div>
<br />
Once you write assembly code like my example above, you need to assemble it into <a href="http://en.wikipedia.org/wiki/Machine_Code">machine code</a>, which I do with <code>nasm -f elf64 args.asm</code>. This produces an object file (args.o) which is just raw machine language. There's also a program called objdump which can print out the object file and the associated instructions if you do something like <code>objdump -d args.o</code>, the output of which can be found <a href="http://pastebin.com/raw.php?i=PYE8Kqg0">here on pastebin</a> (check it out, it's cool!). After making the object file, I then use the linker ld to convert it into an executable, for example <code>ld -s -o args args.o</code> which produces an executable file called <code>args</code>. To debug, there's a great program called gdb which allows you to step through your code one instruction at a time, and check all the register values at each step.<br />
<br />
Unfortunately the speed of my program is pretty much limited by the overhead of the system <code>write</code> calls, but I still got it to write a 10 character line 10,000,000 times (into /dev/null which is a place to dump unwanted text) in about 6 seconds.<br />
<br />
If you're running 64-bit Linux and want to try this out for yourself, you can download the executable from <a href="https://www.dropbox.com/s/7t6shbarnr1zvcw/args">https://www.dropbox.com/s/7t6shbarnr1zvcw/args</a>.<br />
<br />
I may not have made any explicitly useful programs, but I definitely learned a lot about how my computer works by learning some assembly. In the future if I need to write a function to do some really fast math, I could definitely see myself implementing it in assembly then calling it every time I need it. I definitely recommend doing this kind of thing on your own, it's fun!<br />
<br />
In addition to programming, I've also been doing a fair amount of electronics work recently. Next post will be a write-up of a new board I've put together!Bankshttp://www.blogger.com/profile/06935190198890093740noreply@blogger.com1tag:blogger.com,1999:blog-7608932277558807083.post-47001309513509410092013-03-10T17:51:00.004-07:002013-03-11T14:50:29.018-07:00The Long Overdue Go-kart Post: The Birth of SmartKart<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
So, I'm probably going to have to give a little bit of background on this one. <a href="http://ocw.mit.edu/courses/mechanical-engineering/2-007-design-and-manufacturing-i-spring-2009/index.htm">2.007</a> is one of the primary design/build courses for MIT mechanical engineering undergrads, and also served to inspire tons of other robotic competitions across the globe (eg <a href="http://www.usfirst.org/roboticsprograms/frc">FIRST</a>). Incidentally, the class is also one of the reasons that high-school me was so enraptured by the idea of attending MIT. And now, like so many funny twists that life often brings, I can safely say that <i>I will never take 2.007</i>. I probably wouldn't have believed you if you'd told me that, even just a year ago. But when I found myself in a position to actually sign up for the class, I realized that there was no longer much reason for me to do so. Through clever (not really, this was actually totally accidental) selection of my <a href="http://meche.mit.edu/academic/undergraduate/course2a/requirements/">requirements</a> for my 2-A degree, I'd inadvertently rendered 2.007 no longer necessary for me to graduate. Additionally, by the time I got to the point where I'd be taking 2.007, I felt I'd gathered enough design experience to render the class largely redundant for me. Sorry to disappoint you, high-school me, but it turns out the alternative is even more fun.<br />
<br />
And what is this magical alternative, you ask? Well, to be honest, it's not really even a <i>real thing</i>. More just a chain of serendipity leading to me racing around in a go-kart and teaching other MechE's how to build their own. It all pretty much started when I decided that I <a href="http://omgitgoes.blogspot.com/search/label/Scooter">really wanted to build a hub motor-powered scooter</a>, and solicited advice from MIT's resident <a href="http://www.etotheipiplusone.net/?page_id=2128">silly</a>-<a href="http://www.etotheipiplusone.net/?page_id=700">hub</a>-<a href="http://www.etotheipiplusone.net/?page_id=1987">motor</a>-<a href="http://www.etotheipiplusone.net/?page_id=133">powered</a>-<a href="http://www.etotheipiplusone.net/?page_id=978">things</a>, <a href="http://www.etotheipiplusone.net/">Charles</a>. Basically, this initiated a new major interest in electric vehicles for me, and after going to the 2012 <a href="http://makerfaire.com/">Maker Faire</a> last October and witnessing all the <a href="http://www.etotheipiplusone.net/?p=2300">crazy go-kart racing</a>, I knew what I had to build next. Fortunately, Charles had run an electric vehicles special section of 2.007 last year, and had plans to bring it back as a more specific go-kart section this spring. I didn't want to wait and take the section for a number of reasons; such as not wanting to wait for a whole semester before starting, as well as not wanting one of my projects to be given all the additional constraints that come along with being part of an academic class. This was about when a rather clever idea came to mind: Charles was a grad student at the time, and an interesting property of grad students is that they're able to acquire <a href="http://web.mit.edu/urop/">UROPs</a>. So, naturally, I decided that I wanted to UROP for Charles and build a go-kart. Conveniently, this actually lined up exactly with what he was looking for at the time: someone to run a sample, 'pilot' of the 2.007 go-kart section (affectionately dubbed '2.00gokart') in order to iron out kinks in the intended curriculum, and give a better idea of what was expected for the course.<br />
<br />
Administrative details handled, I pretty much dove right in and started designing. Initially the proposed budget for the course was $300 for the kart (not including batteries, three sticks of <a href="http://www.8020.net/">80/20</a> aluminum extrusion, and 24" x 24" plates of both 1/4" and 1/8" aluminum), so I went with just about the cheapest option for motors I could find: <a href="http://www.andymark.com/CIM-motor-FIRST-p/am-0255.htm">two CIMs</a>. If you did FIRST, you almost certainly remember these. Since the rated 337W max output of the motors sounded a bit low to me, I opted to run them on 24V batteries instead of their rated 12. For reasons that I'm going to try not to go into <i>too</i> much detail about, this effectively bumps their maximum power by a factor of 4, up to 1348W. I whipped up a couple of MATLAB plots to show both conditions:<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinrXrr76lxt_jCjJZVKKBwqENCrZm356db7-1hi9o6CkwuWaUYqtqpQuj6cQ7khIlbuAjFA2m3g78WUb18siZQja4FKAneE0ZoQwX6lkJb_GcYy6SsN6wLMONYv-h9Ix6niWGJ0z5mN88/s1600/12V_CIM_Curve.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="313" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinrXrr76lxt_jCjJZVKKBwqENCrZm356db7-1hi9o6CkwuWaUYqtqpQuj6cQ7khIlbuAjFA2m3g78WUb18siZQja4FKAneE0ZoQwX6lkJb_GcYy6SsN6wLMONYv-h9Ix6niWGJ0z5mN88/s640/12V_CIM_Curve.jpg" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiurGwoWEHfE8JzL_SEaikjEe4NZup5PyXQ8CIVizDCsEx_fxagHJ4lliXGIKOPXBoOIltdGaRgp4rFdUctarj4Yf_B6aiRplZPleSunekhiAi-aSG5OoVtcwt1urM26bNsPBAkeBXMkj0/s1600/24V_CIM_Curve.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="312" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiurGwoWEHfE8JzL_SEaikjEe4NZup5PyXQ8CIVizDCsEx_fxagHJ4lliXGIKOPXBoOIltdGaRgp4rFdUctarj4Yf_B6aiRplZPleSunekhiAi-aSG5OoVtcwt1urM26bNsPBAkeBXMkj0/s640/24V_CIM_Curve.jpg" width="640" /></a></div>
<br />
As you can see, the motor's power output is the product of its speed*torque, which has a maximum at the halfway point of each. However, owing to the stall current of each motor (133A each at 12V), I'll never <i>actually</i> be able to hit anywhere near their max power output. At 24V, each motor would draw 266A at stall, or 133A at max power output, for a total of 266A for both motors operating at max power. What's the problem with that? Well, that's 1348W*2 = 2696W of power output at the motors, but unfortunately both the <a href="http://www.a123systems.com/products-systems-lead-acid.htm">batteries I was given</a> and the <a href="http://kellycontroller.com/kds24100100a12v-24v-mini-brushed-controller-p-73.html">controller I selected</a> are limited to 100A. 100A*24V = 2400W maximum going into the controller, so I'll never be able to hit 2696W output (not to mention the ~15-20% loss due to resistance in the motor).<br />
<br />
Why am I okay with this? Well, the controller is able to limit its output to 100A so nothing in it will explode, meaning I'll be capped at 2400W when I'm getting going. However, as soon as my motors are spinning faster than 556 rad/sec (5310 rpm), I'll be to the right of the max power point, meaning my motors will be outputting less power but operating in a more efficient region (less torque generally means more efficiency, because torque is related to current, power loss is I<sup>2</sup>*R, so minimizing torque/current means less power loss). How fast do I need to be going to make this happen? Well, I chose a relatively high (fast) gear ratio of 13:70 coming off of my motor, and I'm using 8" diameter wheels. At 556 rad/sec, I'll be going 556 rad/sec * 13/70 * 4 in = 23.5 mph, so any faster than that and my efficiency starts improving.<br />
<br />
Okay, enough math, on to CAD:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqsCntoEg3CFo_x1X_hmBEd4OrRyeH2a4CWeKc0gbr-DORt5R-CXG8wxqz9OdkWkVVJqQg-iFHGt_b5B3PNbeyOdCAmNuQRtIGiQU2TkNeZpMjeu6vjzZ94AmW7btPAAIyVPDCKVHOzMw/s1600/go-kart+frame.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqsCntoEg3CFo_x1X_hmBEd4OrRyeH2a4CWeKc0gbr-DORt5R-CXG8wxqz9OdkWkVVJqQg-iFHGt_b5B3PNbeyOdCAmNuQRtIGiQU2TkNeZpMjeu6vjzZ94AmW7btPAAIyVPDCKVHOzMw/s640/go-kart+frame.jpg" width="640" /></a></div>
<br />
I started with a frame mock-up, which consisted of spending somewhat inordinate amounts of time slicing up 80/20 into chunks and then mashing it together into a shape I more or less liked (funnily enough, that's a decent summary of the physical build process as well). I knew I wanted to keep the frame fairly short and compact, because I wanted it to be (relatively) portable and lightweight.<br />
<br />
Next I threw in motor mounts and brackets:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh94Nbg5H5iQ5Xd2TWfiPiRPR9rYeynWwbHE78TX8OcfJkExxtdkO3EM0As_V1rRcDNrSzfv4uWhnyRnHpuoP5sz0PXweIt-N62nAVjASXsjhPOJ0ffjRKOm5qSsX9kCkL3rO3MdSi5PS4/s1600/go-kart+with+motor+brackets.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="324" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh94Nbg5H5iQ5Xd2TWfiPiRPR9rYeynWwbHE78TX8OcfJkExxtdkO3EM0As_V1rRcDNrSzfv4uWhnyRnHpuoP5sz0PXweIt-N62nAVjASXsjhPOJ0ffjRKOm5qSsX9kCkL3rO3MdSi5PS4/s640/go-kart+with+motor+brackets.png" width="640" /></a></div>
<br />
I used 1/4" plate for all the primary structural frame brackets, because I was worried about 1/8" plates bending. At this point I started building whenever I had parts in and then CADding in parallel. This was probably a poor methodology for design, but I had a fairly complete structure in my head of how the cart would turn out, and certain elements like brake calipers and the seat were impossible to CAD until they were physically in front of me to measure for mounts.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigYS1nOFWCOBWpoHYOdAfmu7Kn0bCqyIAyW3LKpRxqtMYY5idn-Di1_w_qMcu952XZLmachMelP4ZMGalRLwaPk03eg0BynVFYql_JwuKFABd7tkn6XZrq3moBGLCSnXPnebt0YcSSmX8/s1600/full+go-kart+CAD.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="" border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigYS1nOFWCOBWpoHYOdAfmu7Kn0bCqyIAyW3LKpRxqtMYY5idn-Di1_w_qMcu952XZLmachMelP4ZMGalRLwaPk03eg0BynVFYql_JwuKFABd7tkn6XZrq3moBGLCSnXPnebt0YcSSmX8/s640/full+go-kart+CAD.jpg" title="final go-kart CAD" width="640" /></a></div>
<br />
Here's how the final CAD turned out. This assembly doesn't contain a few things, so I'll just go ahead and describe them/mention why they aren't present:<br />
<ul>
<li>Battery/electronics mounts, because I quickly whipped them up in 2D and didn't update the CAD with them (mostly laziness here)</li>
<li>Steering wheel, same as above</li>
<li>Seat mounts, because the seat was rather organically shaped which forced me to produce a mount by hand, as such it was more something that I just threw together rather than something meticulously planned.</li>
</ul>
<div>
So, on to building! I started out by cutting some of the 80/20 frame elements on the MITER saw.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXTCseFS3IGJ8EYEwqiEnB8XQBx2w4hWlj48baBcva3XkVNjjhBkxyNi7SIK5cuR8vd9bD1h5poKwWR7abscqyZ2o_AT0UILc9t6Eu3GQdm1Qjq1xQWZ0oXIgaGrr0yoYVyZVzDNQR7FA/s1600/2012-12-09_00-07-10_262.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="" border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXTCseFS3IGJ8EYEwqiEnB8XQBx2w4hWlj48baBcva3XkVNjjhBkxyNi7SIK5cuR8vd9bD1h5poKwWR7abscqyZ2o_AT0UILc9t6Eu3GQdm1Qjq1xQWZ0oXIgaGrr0yoYVyZVzDNQR7FA/s640/2012-12-09_00-07-10_262.jpg" title="cutting 80/20 on MITER saw" width="640" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
I then got my CIM motors in, which ship with a keyed shaft:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLzcAYMR3jsb4xZYbauEn7ezMjRAPOgwpBYKJgkhGD84rcaXqX0RM5illQFDaoghWui6MAn5qqrvSENGxiM_rDYiN3aRt_s_FEs8FLxBIRwObD1PYCWdHt_P0m0Y9LAorl2hFlBhR66xs/s1600/2012-11-04_15-54-58_443.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="" border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLzcAYMR3jsb4xZYbauEn7ezMjRAPOgwpBYKJgkhGD84rcaXqX0RM5illQFDaoghWui6MAn5qqrvSENGxiM_rDYiN3aRt_s_FEs8FLxBIRwObD1PYCWdHt_P0m0Y9LAorl2hFlBhR66xs/s640/2012-11-04_15-54-58_443.jpg" title="CIM motor original keyway" width="640" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
In order to interface this with the small, smooth-bore drive sprocket I bought from McMaster, I had to mill a flat on the shaft to convert it into a D-shaft.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgy6un5QxGMmui2hrqKt8bvOfh0ADzW126pIF3-xeOMdXJHTSETlo5Bb-ClT7MlMzK_kkx8d5E5v7FY45xcoTjP7rIJ9adIgJNIBbhrVzdJ-Xo0vQKGMmkXIG0_c9QjmFCYcakI4kgFphg/s1600/2012-11-04_15-36-06_752.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="" border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgy6un5QxGMmui2hrqKt8bvOfh0ADzW126pIF3-xeOMdXJHTSETlo5Bb-ClT7MlMzK_kkx8d5E5v7FY45xcoTjP7rIJ9adIgJNIBbhrVzdJ-Xo0vQKGMmkXIG0_c9QjmFCYcakI4kgFphg/s640/2012-11-04_15-36-06_752.jpg" title="milling CIM motor D shaft" width="640" /></a></div>
<div>
<br /></div>
<div>
Afterwards, it looked like this:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiRmFzUfIfj4DNpcozifRdxr3xt7FUj2psPzznJSCZTCmM_unAsPxzAQukLOLCOx03Q40IFuHdHgucGPbSWDB2m_-b8VpXU5dWDqrOmgGnbeNM_p_8CDiSQKXU3UiUXmk8Ek5x-s68SoY/s1600/2012-11-04_16-09-11_358.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="" border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiRmFzUfIfj4DNpcozifRdxr3xt7FUj2psPzznJSCZTCmM_unAsPxzAQukLOLCOx03Q40IFuHdHgucGPbSWDB2m_-b8VpXU5dWDqrOmgGnbeNM_p_8CDiSQKXU3UiUXmk8Ek5x-s68SoY/s640/2012-11-04_16-09-11_358.jpg" title="CIM motor with D shaft" width="640" /></a></div>
<div>
<br /></div>
<div>
Next was similar treatment for the sprockets themselves - I drilled out the 1/4" bore to 8mm to match the 8mm shaft of the CIM motors, and I drilled and tapped a set screw hole.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXd3agFjlfObSb8ZmFnuXZ4K1QnRBvKovnd149qOpYQa2VfSYBxbyt-7FxGrPODFDF1-nIxDbXtSBEgt45tSnnxrt4g3Z9XrQJ0I37DQENQ33XtUSysAHqCB-BZ0EtVPUbZhNnfPn8BQA/s1600/2012-11-04_16-29-24_144.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXd3agFjlfObSb8ZmFnuXZ4K1QnRBvKovnd149qOpYQa2VfSYBxbyt-7FxGrPODFDF1-nIxDbXtSBEgt45tSnnxrt4g3Z9XrQJ0I37DQENQ33XtUSysAHqCB-BZ0EtVPUbZhNnfPn8BQA/s640/2012-11-04_16-29-24_144.jpg" width="640" /></a></div>
<div>
<br /></div>
<div>
And here it is fixed on the motor shaft:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiy_Kl2GEehzY3Jj2VB-qWmxPAAnVw2ZMMbd-VC70CGKfhxmnv7q9Nk_3snQagcg0h2G8o4fBUPNRac7LuCQsnAwoq7J0kmIF742TClAtTss0vI0x-UVA1emXuOPGEf1O5Wq8Hsp-BKl68/s1600/2012-11-04_16-47-13_166.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiy_Kl2GEehzY3Jj2VB-qWmxPAAnVw2ZMMbd-VC70CGKfhxmnv7q9Nk_3snQagcg0h2G8o4fBUPNRac7LuCQsnAwoq7J0kmIF742TClAtTss0vI0x-UVA1emXuOPGEf1O5Wq8Hsp-BKl68/s640/2012-11-04_16-47-13_166.jpg" width="640" /></a></div>
<div>
<br /></div>
<div>
Next, I waterjet out the preliminary mounting brackets, cut some more 80/20 lengths, and just started throwing screws into things.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgu0uCeYvWTyJX177I0lwDiMKFB3Ummf7Wz8pHOtu8Q0obY-eUxIyw_DyH9NUAJGIeLwDX6PJ_yw0pKsha_sVH3MnEPz0jAxIg5MklZAf3-nNdjwjW-iw94wIX3a4KBLL3hB4AcinYIA6s/s1600/2012-11-11_20-54-57_402.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="" border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgu0uCeYvWTyJX177I0lwDiMKFB3Ummf7Wz8pHOtu8Q0obY-eUxIyw_DyH9NUAJGIeLwDX6PJ_yw0pKsha_sVH3MnEPz0jAxIg5MklZAf3-nNdjwjW-iw94wIX3a4KBLL3hB4AcinYIA6s/s640/2012-11-11_20-54-57_402.jpg" title="go-kart rear end" width="640" /></a></div>
<div>
<br /></div>
<div>
Because I had designed (and actually cut out, which was a mistake) the aluminum sprockets prior to getting my Harbor Freight wheels shipped in, I estimated the hole pattern as a 2.5" diameter when in fact it's actually 2.6". Accordingly, there was a bit of this involved:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuzU2MK_UYh2aZQX2quMZ3LmLmnHSpZw55HpsPO6FIefw4naBJgVE2Z-1lFTuUphJLzjJHbDGzma_dCfS9kYa0RtOAk_MmPlyXB7q2t7phAIP6KM8kfL_OIalMUptjsLh4I9G5a8F-a4I/s1600/2012-11-11_23-43-34_997.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="" border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuzU2MK_UYh2aZQX2quMZ3LmLmnHSpZw55HpsPO6FIefw4naBJgVE2Z-1lFTuUphJLzjJHbDGzma_dCfS9kYa0RtOAk_MmPlyXB7q2t7phAIP6KM8kfL_OIalMUptjsLh4I9G5a8F-a4I/s640/2012-11-11_23-43-34_997.jpg" title="drilling new sprocket mount holes" width="640" /></a></div>
<div>
<br /></div>
<div>
As the waterjet can only cut parts in 2D, I also had to chamfer the edges of the sprocket to allow the chain edges to slide over it. I just eyeballed this one on the MITERS lathe.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirGnu_wkElZqCKWb6wbcGPNbc6l4y6PnVyN2MI5GIfcM1sC3FZyd-VQ0TuAY46XSh-2jMJYY6ps127RaRTJbT_wKV8SzanuZ1JFsNrawcu-6s5fPdf1suIVv0kuVJUP61qT0aYndWq2JE/s1600/2012-11-12_00-11-31_315.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="" border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirGnu_wkElZqCKWb6wbcGPNbc6l4y6PnVyN2MI5GIfcM1sC3FZyd-VQ0TuAY46XSh-2jMJYY6ps127RaRTJbT_wKV8SzanuZ1JFsNrawcu-6s5fPdf1suIVv0kuVJUP61qT0aYndWq2JE/s640/2012-11-12_00-11-31_315.jpg" title="turning sprocket chamfer" width="640" /></a></div>
<div>
<br /></div>
<div>
Next, I had to part and tap a bunch of little spacer doohickeys to attach the sprockets to the wheels.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3OEE97VU91zaIP1jSE9UBkHZ83svCBEaIm5AgRsWRAHyiYV7HuH_wMm9ZuTIN8TIoqNc6CAaxCIeFM7iUrmm5q-wGR4rvDD1PT06tRsbUnjIatDh9GB7XoCzdlorFU1uwUmSoPXVDAB8/s1600/2012-11-12_01-10-06_206.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="" border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3OEE97VU91zaIP1jSE9UBkHZ83svCBEaIm5AgRsWRAHyiYV7HuH_wMm9ZuTIN8TIoqNc6CAaxCIeFM7iUrmm5q-wGR4rvDD1PT06tRsbUnjIatDh9GB7XoCzdlorFU1uwUmSoPXVDAB8/s640/2012-11-12_01-10-06_206.jpg" title="tapping tons of spacers" width="640" /></a></div>
<div>
<br /></div>
<div>
I also made some delrin spacers to axially support my wheel on one side, they have a chunk milled out of them so they can slide under the bar of 80/20 that the axle mounts are attached to.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQQApM8h8WOJNQR5YdDIfpALD2UCTzIPt5pdIERdov7yqvAzREIlsMHvK7R_CYraQ4dfyJadN4Z5_wAVSPw5Dy4eb001bDGi2UR0IZ7D1ej62br_NKrRg0E3fHxqNKnWXHzrpf2NwsqtM/s1600/2012-11-12_17-17-12_127.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="" border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQQApM8h8WOJNQR5YdDIfpALD2UCTzIPt5pdIERdov7yqvAzREIlsMHvK7R_CYraQ4dfyJadN4Z5_wAVSPw5Dy4eb001bDGi2UR0IZ7D1ej62br_NKrRg0E3fHxqNKnWXHzrpf2NwsqtM/s640/2012-11-12_17-17-12_127.jpg" title="milling out delrin spacer" width="640" /></a></div>
<div>
<br /></div>
<div>
And a shot of the part in action:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIxEAJnl31FP7nYv2WYz5HWPUYDGTm-BOGZBC9Ec4dZXH_sc_lWh8KeYKqZW2rr8WMAeBpUc3u1PyjCandkAr1qBZS4XIkT2s_r4g-1Eh6lYcN6JpdRgAB2v4_KNtTKb7C19-3jETbFM8/s1600/2012-11-12_17-30-16_652.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="" border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIxEAJnl31FP7nYv2WYz5HWPUYDGTm-BOGZBC9Ec4dZXH_sc_lWh8KeYKqZW2rr8WMAeBpUc3u1PyjCandkAr1qBZS4XIkT2s_r4g-1Eh6lYcN6JpdRgAB2v4_KNtTKb7C19-3jETbFM8/s640/2012-11-12_17-30-16_652.jpg" title="wheel with chain and spacer" width="640" /></a></div>
<div>
<br /></div>
<div>
The chain was pretty sticky on my waterjet sprockets, so I went ahead and tensioned them and ran them in for 15-20 minutes each, just to get the chain to grind down the interfering aluminum on the sprocket.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgb4omWr_BizoD_nGXpO43nr5HmZkqtBw2cIvNhG75Bvc5XIG5lI-i3utCDzQJEWtGXPaDByZaptKlry2BUb5tusU4TEpaRh9LK3XWlFXgzzOEkRFz7KJV1mW1f5lwegdc8TkIlzjcaj-s/s1600/2012-11-18_17-48-14_771.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="" border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgb4omWr_BizoD_nGXpO43nr5HmZkqtBw2cIvNhG75Bvc5XIG5lI-i3utCDzQJEWtGXPaDByZaptKlry2BUb5tusU4TEpaRh9LK3XWlFXgzzOEkRFz7KJV1mW1f5lwegdc8TkIlzjcaj-s/s640/2012-11-18_17-48-14_771.jpg" title="running in chain" width="640" /></a></div>
<div>
<br /></div>
<div>
Somewhere along the line, boredom and lack of a front half of the vehicle led to a rather monstrous contraption, with <a href="http://www.etotheipiplusone.net/?cat=96">the combat robot Null Hypothesis</a> serving solely as a temporary motor controller:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqqfBO_3psaTAxK3clQFboPFNKPpdhk03l2A-HfNgpva5htaEucjZ4USNIbHUSy-8aSYZZe6E5r3q6gevPUB2eulvR2QqOJfk1qEZO2xa_669yulLngcd1JMxynldwfYu5Z4IWU8YvNKU/s1600/2012-11-18_23-06-47_976.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="" border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqqfBO_3psaTAxK3clQFboPFNKPpdhk03l2A-HfNgpva5htaEucjZ4USNIbHUSy-8aSYZZe6E5r3q6gevPUB2eulvR2QqOJfk1qEZO2xa_669yulLngcd1JMxynldwfYu5Z4IWU8YvNKU/s640/2012-11-18_23-06-47_976.jpg" title="frankenkart" width="640" /></a></div>
<div>
<br /></div>
<div>
Then I waited a couple weeks and focused on <a href="http://omgitgoes.blogspot.com/search/label/Blitzcopter">Blizcopter</a> while I waited for parts to ship in. I also made another giant waterjetting run, resulting in a pretty massive pile of parts.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglQ-kzqEBGKaPXkbllvXlw3uxIioMWY4b6lLSWR4MTVnEtmqjY-RrC7CszTxde4lZntYKQdAuesMHcBsXrAw9bdrQUt05Gmg4M_l5OLPECxq8ohf3JPQorfu_T24BUbJMrCPsfWehKlpQ/s1600/2012-12-08_23-59-55_335.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="" border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglQ-kzqEBGKaPXkbllvXlw3uxIioMWY4b6lLSWR4MTVnEtmqjY-RrC7CszTxde4lZntYKQdAuesMHcBsXrAw9bdrQUt05Gmg4M_l5OLPECxq8ohf3JPQorfu_T24BUbJMrCPsfWehKlpQ/s640/2012-12-08_23-59-55_335.jpg" title="big pile of kart parts" width="640" /></a></div>
<div>
<br /></div>
<div>
I had to make some real tiny Delrin bore adapters for my steering knuckles, which honestly scared me a bit to turn because of how thin/fragile they were.</div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWRU117_r_VRGe92-CC53VxMoLQk0I82b48lHDk4XX5BlfUMIwdJ-DEVKgvL4q3YLN1FGbUpmoySJ0pHs9xUOvxraAWOvG1R12qfNJuj6-a-gLdLcx9bXIzRcq8TE5B3NX-azmCu7ym8Y/s1600/2012-12-09_22-56-13_32.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="" border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWRU117_r_VRGe92-CC53VxMoLQk0I82b48lHDk4XX5BlfUMIwdJ-DEVKgvL4q3YLN1FGbUpmoySJ0pHs9xUOvxraAWOvG1R12qfNJuj6-a-gLdLcx9bXIzRcq8TE5B3NX-azmCu7ym8Y/s640/2012-12-09_22-56-13_32.jpg" title="turning small delrin spacer" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Yikes.</td></tr>
</tbody></table>
<div>
My waterjet holes on the front of the steering knuckles also didn't quite fit the 5/8" shaft I was using because it was about .005" over diameter, coupled with the fact that waterjet holes end up a little smaller than designed. So, naturally, the solution is to find a pointy 5/8" thing and just beast the hole wider (the shop I was in at the time definitely doesn't carry 5/8" drill bits).</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhyphenhyphenSrZW4wh-fCQQq3O2UiuoQbhlysZPUM-5KpuBhI8uKjmeyT0JOrI_iPbkgCPLAUujKsek8b8keEFXYSNFchtf1h4b03l-1iZ5gqoz1o4YtkDZFoFE6pmNcmYsmuq5jUV06ttNxTozfM/s1600/2012-12-10_02-34-58_746.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="" border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhyphenhyphenSrZW4wh-fCQQq3O2UiuoQbhlysZPUM-5KpuBhI8uKjmeyT0JOrI_iPbkgCPLAUujKsek8b8keEFXYSNFchtf1h4b03l-1iZ5gqoz1o4YtkDZFoFE6pmNcmYsmuq5jUV06ttNxTozfM/s640/2012-12-10_02-34-58_746.jpg" title="beasting out hole" width="640" /></a></div>
<div>
<br /></div>
<div>
And here's what the steering knuckles look like when mounted on the frame:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIU_OvAPBtRGq1v6QuZ8l2RwNxzANmea75wGyp9DEvz1UwwSOnaLWyqj2dZ25W04zie4XLWWtPFmjdHE3zCa0YvvEpglIywRRvF0tYEcb2IP5cUBRKoNJ9ncWxYO9Teyr2ZoTqd2UtQe8/s1600/2012-12-10_02-48-07_732.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="" border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIU_OvAPBtRGq1v6QuZ8l2RwNxzANmea75wGyp9DEvz1UwwSOnaLWyqj2dZ25W04zie4XLWWtPFmjdHE3zCa0YvvEpglIywRRvF0tYEcb2IP5cUBRKoNJ9ncWxYO9Teyr2ZoTqd2UtQe8/s640/2012-12-10_02-48-07_732.jpg" title="steering knuckles mounted" width="640" /></a></div>
<div>
<br /></div>
<div>
I then hack-sawed some threaded rod to put in the tie rods driving the steering linkage, and mounted front wheels.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlKag9-0X11wCVJSiYUHl8qWwgMXo4zg3Pd-KrRPSXwlNJLWcuU13TcZtpkY8Wf77lXylCURoGU_aG6frpwSpctzPqcJLoy7aaNFr60uOAAOxtKMWLyD8WtV1PYsr5YQVa21bWDVL4Nyw/s1600/2012-12-10_04-25-04_240.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="" border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlKag9-0X11wCVJSiYUHl8qWwgMXo4zg3Pd-KrRPSXwlNJLWcuU13TcZtpkY8Wf77lXylCURoGU_aG6frpwSpctzPqcJLoy7aaNFr60uOAAOxtKMWLyD8WtV1PYsr5YQVa21bWDVL4Nyw/s640/2012-12-10_04-25-04_240.jpg" title="front wheels attached" width="640" /></a></div>
<div>
<br /></div>
<div>
Unfortunately the rest of my 5/8" stock didn't quite fit inside the bearings I'd bought for my steering linkage, so I had to move to the GIANT lathe downstairs and turn down the whole thing by just a few thousandths.</div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUns3ji1BuP_v1jnERAzag9GrKq5-EvDlMMXIGuEm78og6oVRJwewMfOrx0AL0Y67Iir9Zq6fmFqltwlHYsxiTAvV9fl3g7I4Xa4IUt8s9NcnK79FbsxA0f8rNiHBLH35TksxzqZTtETI/s1600/2012-12-10_23-17-38_846.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="" border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUns3ji1BuP_v1jnERAzag9GrKq5-EvDlMMXIGuEm78og6oVRJwewMfOrx0AL0Y67Iir9Zq6fmFqltwlHYsxiTAvV9fl3g7I4Xa4IUt8s9NcnK79FbsxA0f8rNiHBLH35TksxzqZTtETI/s640/2012-12-10_23-17-38_846.jpg" title="giant lathe turning down steering rod" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Seriously, this thing is massive. That shaft is easily 2.5' long.</td></tr>
</tbody></table>
<div>
Now the basic frame was close to complete! Obligatory celebration dance:</div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcxygZoUoF5kReWfW8a9Q4g6mvx8gD5O6bvOQU_zAnTRH8TRHQV8pQDEZmXimINumRB81YUCMDMFA9JhFdvSpggKl3YqCEftvm0UAoJ7LMBTCU4Uyz1Jd2ePWE2617p8B6uWeCF5VseOU/s1600/2012-12-11_00-40-38_254.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="" border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcxygZoUoF5kReWfW8a9Q4g6mvx8gD5O6bvOQU_zAnTRH8TRHQV8pQDEZmXimINumRB81YUCMDMFA9JhFdvSpggKl3YqCEftvm0UAoJ7LMBTCU4Uyz1Jd2ePWE2617p8B6uWeCF5VseOU/s640/2012-12-11_00-40-38_254.jpg" title="dancing on gokart" width="480" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">As you can see, the wheelbase is pretty miniscule.</td></tr>
</tbody></table>
<div>
Next, I needed a lot of T-plates to set up the attachment for the seat to the frame, and I didn't have enough patience to go waterjet these. So, I enlisted the help of a friend, and we started beasting out mount plates by hand. I started by cutting out some squares, clamping them together, tracing out the outline of the part, marking holes, and then drilling them out:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZpzUqxrr0zcu-36dSMeuaodusrFhe6sa19eVmW_xTxVZD5l04WkXiU1y_ADt30ERHgZjdLwynwam4aRtvMKq7S_kaLQ7-udTwHm5BFqdbRBHNcCKWxcD_836JDahJgYi3afa8mQZY7Zc/s1600/2012-12-11_18-37-49_729.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="" border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZpzUqxrr0zcu-36dSMeuaodusrFhe6sa19eVmW_xTxVZD5l04WkXiU1y_ADt30ERHgZjdLwynwam4aRtvMKq7S_kaLQ7-udTwHm5BFqdbRBHNcCKWxcD_836JDahJgYi3afa8mQZY7Zc/s640/2012-12-11_18-37-49_729.jpg" title="T bracket plate rough ilne" width="640" /></a></div>
<div>
<br /></div>
<div>
Next I bandsawed off the excess.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDZdWtJD6b2CQRlDRntX8OW5YJ_J5A0eM-OH5CfLh9tHaRpT4-xUaUxUj0KNl30YBbEqDjRvQRyroTTxQ122G8k-6j139o-qDx5uSl0e9vnZzlhgLGDalNsDsTGjoCowC9pSEgfpkXZ9I/s1600/2012-12-11_19-16-32_202.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="" border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDZdWtJD6b2CQRlDRntX8OW5YJ_J5A0eM-OH5CfLh9tHaRpT4-xUaUxUj0KNl30YBbEqDjRvQRyroTTxQ122G8k-6j139o-qDx5uSl0e9vnZzlhgLGDalNsDsTGjoCowC9pSEgfpkXZ9I/s640/2012-12-11_19-16-32_202.jpg" title="bandsawing out T-bracket" width="640" /></a></div>
<div>
<br /></div>
<div>
I went ahead and drilled some holes through the bottom of the seat and attached them to the tops of some 80/20 mounted to the brackets I'd just made. I also threw the steering 'wheel' (lol) on top of the steering rod, but it wasn't fully mounted at this point.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnAy9EaA5qUEdZYpFaWUWxDbi_38qbzKsiL1l267zPsmKBtSZ1Fq1YKbAHrkMga7PkAgebts9JZL1oiIPzkUbLZU6OM-j-Wp-wJw8USZBjMGgHnz7IE23gtwJzolHCisbDEhfq1YKJdE8/s1600/2012-12-14_22-35-26_345.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="" border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnAy9EaA5qUEdZYpFaWUWxDbi_38qbzKsiL1l267zPsmKBtSZ1Fq1YKbAHrkMga7PkAgebts9JZL1oiIPzkUbLZU6OM-j-Wp-wJw8USZBjMGgHnz7IE23gtwJzolHCisbDEhfq1YKJdE8/s640/2012-12-14_22-35-26_345.jpg" title="seat mounted on gokart" width="640" /></a></div>
<div>
<br /></div>
<div>
The seat was super wobbly in left/right bending, so I just attached a giant plate of 1/4" polycarbonate (yeah, that bullet-proof glass stuff) to the back to support it better. I also lasercut some quick acrylic battery mounts, and got started on wiring up the electronics.</div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipRQ6KwxcvJC5uIxIC0AHzXO_PrE5kt6Oxle9Byvm5rZemhEYK8Mg6GQjxDeguMUk3SLFZ4ah-5IMxVPd5OcqxaI64-xBv7PAvDnvM7sBvZpeWtfEHUjveJ0h94rHkPy2g7fw-ckpgo3I/s1600/2012-12-20_06-18-20_28.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="" border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipRQ6KwxcvJC5uIxIC0AHzXO_PrE5kt6Oxle9Byvm5rZemhEYK8Mg6GQjxDeguMUk3SLFZ4ah-5IMxVPd5OcqxaI64-xBv7PAvDnvM7sBvZpeWtfEHUjveJ0h94rHkPy2g7fw-ckpgo3I/s640/2012-12-20_06-18-20_28.jpg" title="gokart on electronics table" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Shh, don't tell the shop guys I did this...</td></tr>
</tbody></table>
<div>
I fit a laser-cut acrylic electronics mount into the center of the kart, where it holds the motor controller and ignition key.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8oGQN_ipIfkbb9v12I-r65aUg1UPhGUP3JqCf2EyErz5WjnSSxY5g89fUqZj7eQomPDnY4VNiOvDiAVjR1Z7MlbQ6Kr42fce-0OLvG3LJL5RWxiCmoQEfHalqKiAAidjdyh9te-uiUPA/s1600/2013-03-11_12-28-22_615.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="" border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8oGQN_ipIfkbb9v12I-r65aUg1UPhGUP3JqCf2EyErz5WjnSSxY5g89fUqZj7eQomPDnY4VNiOvDiAVjR1Z7MlbQ6Kr42fce-0OLvG3LJL5RWxiCmoQEfHalqKiAAidjdyh9te-uiUPA/s640/2013-03-11_12-28-22_615.jpg" title="go-kart electronics mount" width="640" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
I went ahead and installed some requisite glow-lighting, finished up the wiring, and was left with a reasonably functional go-kart:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-IQUL21hPmxdfCsCP-8zwsIR4rPVilAHY37NbKjvSDSBws9vh9_EEq4gCZ87M4JYqCXDYdU1gUZEPpUxPwFxC6voEmDHHMfRkRdSkzb_qhtjuuh7ascjXHBA0PlGgkjte5pSkwIp_c2k/s1600/2012-12-22_02-40-47_970.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="" border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-IQUL21hPmxdfCsCP-8zwsIR4rPVilAHY37NbKjvSDSBws9vh9_EEq4gCZ87M4JYqCXDYdU1gUZEPpUxPwFxC6voEmDHHMfRkRdSkzb_qhtjuuh7ascjXHBA0PlGgkjte5pSkwIp_c2k/s640/2012-12-22_02-40-47_970.jpg" title="go-kart with underglow" width="640" /></a></div>
<div>
<br /></div>
<div>
Done? Not quite, there are still brakes to worry about. I cut out a cute little brake-pedal-mount-box, accidentally failed the clearance on the sides a little bit, and milled them out a touch.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGlHZ8x4tfqkYL2r18DBGU0JuPBL0vQNNsZM1UsZxwWhkP12gFct1A5EvHxfmZSZrGuPSZHI2WzdIKG8Blu50VvmosDpInh_grt9CWrlurF7kxPgwzsOgiDB9-OG1D2oO_qN3n0M1ElXQ/s1600/2013-02-02_23-17-25_812.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="" border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGlHZ8x4tfqkYL2r18DBGU0JuPBL0vQNNsZM1UsZxwWhkP12gFct1A5EvHxfmZSZrGuPSZHI2WzdIKG8Blu50VvmosDpInh_grt9CWrlurF7kxPgwzsOgiDB9-OG1D2oO_qN3n0M1ElXQ/s640/2013-02-02_23-17-25_812.jpg" title="go-kart brake box" width="640" /></a></div>
<div>
<br /></div>
<div>
I turned some little spacers to go between the brake discs and my sprockets, drilled more holes in the sprockets (same process as last time) and attached them together:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhK-Wm9aJLCOHP6d0BGiBUn-KHeHnPR_UwRWpko3NEMyctr5aTVWHSBMGh-LqbcI2NaELakdEZKXEekwwiSE3RKbUBDw5_H1gt9HpNZd2LZcozYuS-pFzVIGM9ax9jJKz4I7NfV8zwNvmg/s1600/2013-02-04_01-05-54_682.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="" border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhK-Wm9aJLCOHP6d0BGiBUn-KHeHnPR_UwRWpko3NEMyctr5aTVWHSBMGh-LqbcI2NaELakdEZKXEekwwiSE3RKbUBDw5_H1gt9HpNZd2LZcozYuS-pFzVIGM9ax9jJKz4I7NfV8zwNvmg/s640/2013-02-04_01-05-54_682.jpg" title="sprockets with disc brakes" width="640" /></a></div>
<div>
<br /></div>
<div>
I still had some slight clearance problems with the brake calipers, so I had to dremel the face down just a little bit.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizp5GoXMR20fq0Cymjv8cnvvhETWPG5Gk7dlWUmo8ZssBDjF494usm-wVYfSmKUCq-JzElaar4UJ99nsF5n87YGTaYf1x6eHmV6Jnoq3ClA2d4oVj9PCTDNZnZUJAvwzloY3-KY8iwyuM/s1600/2013-02-04_07-33-53_108.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="" border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizp5GoXMR20fq0Cymjv8cnvvhETWPG5Gk7dlWUmo8ZssBDjF494usm-wVYfSmKUCq-JzElaar4UJ99nsF5n87YGTaYf1x6eHmV6Jnoq3ClA2d4oVj9PCTDNZnZUJAvwzloY3-KY8iwyuM/s640/2013-02-04_07-33-53_108.jpg" title="cutting down disc brake caliper" width="480" /></a></div>
<div>
<br /></div>
<div>
And a close-up showing the brake caliper mounted, as well as exactly where it was hitting the chain:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWB5YLmydLUWdwh3EPLFQig8tgyFYeRUW-Lr5AEjFxmEbHAo-y8sSvrXdwYEGwhBT9ezZOIRffI4h-oPEa-7Jyo2ee3WyE2oWZdxXmF6stJMv6SXLqLpVtZ87WHYbTOelNRTvXkX0VjbM/s1600/2013-03-11_12-27-48_887.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="" border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWB5YLmydLUWdwh3EPLFQig8tgyFYeRUW-Lr5AEjFxmEbHAo-y8sSvrXdwYEGwhBT9ezZOIRffI4h-oPEa-7Jyo2ee3WyE2oWZdxXmF6stJMv6SXLqLpVtZ87WHYbTOelNRTvXkX0VjbM/s640/2013-03-11_12-27-48_887.jpg" title="gokart brake caliper" width="640" /></a></div>
<div>
<br /></div>
<div>
I also finished the brake pedal and added that to the front.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAnwueZwC7nNO0GFOFcP3pl7hl4xtVTN5_DXow6PiVHClQb9xemx3jH3kfysRSvE5M7a46ytVaTlGvSnOkqXu2JHxVcNn-E2QZUonfXMTlOSErO-NRslELSH3EJHIsiTungFyinXNQiFc/s1600/2013-03-11_12-28-45_453.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="" border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAnwueZwC7nNO0GFOFcP3pl7hl4xtVTN5_DXow6PiVHClQb9xemx3jH3kfysRSvE5M7a46ytVaTlGvSnOkqXu2JHxVcNn-E2QZUonfXMTlOSErO-NRslELSH3EJHIsiTungFyinXNQiFc/s640/2013-03-11_12-28-45_453.jpg" title="go-kart brake pedal" width="640" /></a></div>
<div>
<br /></div>
<div>
So, the state the kart is currently in:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSlmjlPX9W4kGWDBpTdhcSObcIx7lxDuJvlvMbrWC5irBY818pxijciUQpmTIg8RPoRXmQuiNLrR5kd9CNLCOQBrG3Hb7Rxwl_dmKbKGO2cM-VMoFO9UTklZQHtI-bXVSznGJStmPDsPU/s1600/2013-03-11_12-29-06_693.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="" border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSlmjlPX9W4kGWDBpTdhcSObcIx7lxDuJvlvMbrWC5irBY818pxijciUQpmTIg8RPoRXmQuiNLrR5kd9CNLCOQBrG3Hb7Rxwl_dmKbKGO2cM-VMoFO9UTklZQHtI-bXVSznGJStmPDsPU/s640/2013-03-11_12-29-06_693.jpg" title="SmartKart" width="640" /></a></div>
<div>
<br /></div>
<div>
And of course, obligatory underglow picture.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTvssJTAYo9fGW7jEQ-vbSH2tycwsV76UNrttaBYIQsJVqnJbCtMU15JO3Vssfl5Va7FVQciexUt-DVUEPDO6t058NWwQnI5EvHQzqwuRX_g0jA6PQxnIGjwB0dkay3VaPCSdY86BRU8w/s1600/Finished+SmartKart.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="" border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTvssJTAYo9fGW7jEQ-vbSH2tycwsV76UNrttaBYIQsJVqnJbCtMU15JO3Vssfl5Va7FVQciexUt-DVUEPDO6t058NWwQnI5EvHQzqwuRX_g0jA6PQxnIGjwB0dkay3VaPCSdY86BRU8w/s640/Finished+SmartKart.JPG" title="finished SmartKart" width="640" /></a></div>
<br />
<br />
As you can see, the original front bumper I designed hasn't been fabricated yet because it's not essential to the function of the kart, and I haven't gotten a chance to go waterjet the mounts for it yet.</div>
<div>
<br /></div>
<div>
I decided to dub this kart the SmartKart, owing to its short wheelbase and passing resemblance to the <a href="http://www.smartusa.com/">similarly named car</a>. The top speed is a calculated ~33mph, unfortunately the range is rather lacking as it only has two batteries, so it's only able to run for a continuous 5-10 minutes before running out of battery. Overall I'm pretty happy with how the project came out, and I'm looking forward to 'back-modding' it a bit now that my original design constraints (pretending to be in 2.00gokart) have been alleviated. It's not the most practical project, but it's a lot of fun to joyride in, and the tight turning radius makes drifting pretty easy. Now that the weather's picking up, I'll try to take it garaging sometime soon and update this post with a bit of video.</div>
<div>
<br /></div>
<div>
I've been pretty busy with classes this semester, which is why SmartKart took me so long to write up (it was effectively done a couple of months ago), but hopefully I'll be able to write another post soon (BE3P is way overdue for an update).</div>
<div>
<br /></div>
<div>
With SmartKart finished, the real 2.00gokart section started this semester, and I'm tagging along as a TA for the section and helping other students go through this process on their own. I'm hoping for some pretty crazy ideas/execution from them, and if I can manage to talk any of them into writing up their kart builds on blogs, I'll be sure to put up links here.</div>
Bankshttp://www.blogger.com/profile/06935190198890093740noreply@blogger.com10tag:blogger.com,1999:blog-7608932277558807083.post-13932913671552918632013-01-22T09:49:00.002-08:002014-03-02T16:49:23.405-08:00Introducing the BE3PIn a bit of a departure from my typical posts, I'm going to write one about something that doesn't actually physically exist yet: a brushless 3-phase motor controller I've spent the last week working on with my friend Erik; the BE3P (Banks Erik 3-Phase). Traditional brushed motor control effectively provides the motor with an average DC voltage and then brush contacts in the motor shift as it rotates, causing the magnetic field generated by the coils to always attract the next set of magnet poles, producing torque. Brushless control is a bit trickier, because this switching of the field needs to be handled in software, i.e. the controller needs to determine where the motor coils are in relation to the magnets in order to switch current through them accordingly. We got a bit of a crash-course in brushless motor control from our friend <a href="http://scolton.blogspot.com/">Shane</a> as well as a few online <a href="http://ww1.microchip.com/downloads/en/appnotes/00857a.pdf">resources</a>, then we immediately started browsing for the major components. We decided to make the controller optimized for the <a href="http://omgitgoes.blogspot.com/search/label/Hub%20motor">hub motor I built</a>, which probably isn't able to handle more than about 1200 Watts peak. My battery runs around 40V, meaning we're aiming for ~30A peak. Since exploding your components is kind of bad, we over-specced everything a bit (especially the MOSFETs) in order to (hopefully) be able to handle 30A at 40V peak without substantial heatsinking. We centered our design around an Atmega328 microcontroller, an HCPL3120 optocoupled gate drive, and surface-mount MOSFETs rated to 120A at 60V.<br />
<br />
Just to warn you, I'm going to try to start basic but this post is necessarily going to get progressively more difficult to understand if you don't already have some idea of motor control theory.<br />
<br />
Okay, quick intro: the easiest way to control the average voltage (voltage relates to speed) given to a motor is by taking your battery voltage and pulsing it (relatively quickly, on the order of 10's of kHz) across the motor. You can vary the exact average by controlling the duty cycle (percentage of time that you're applying battery voltage) of the pulses. This type of voltage control is called <a href="http://en.wikipedia.org/wiki/Pulse-width_modulation">PWM</a>. So, how do you quickly switch between battery voltage and ground? Transistors! A <a href="http://en.wikipedia.org/wiki/MOSFET">MOSFET</a> (metal-oxide-semiconductor field-effect transistor) is a type of transistor that can turn on quickly and takes relatively little power to do so. Effectively, the MOSFET has a capacitor ("gate") inside it that turns the "switch" on when you give it a voltage on the order of ~5-15V. "Okay, sweet, my <a href="http://www.arduino.cc/">Arduino</a> can do that!", you say? No, not exactly. The problem is that the MOSFET doesn't behave nearly as nicely while the gate capacitance lies between 0V and the "turn-on" voltage of ~5-15V. While your Arduino <i><strike>would</strike></i> (actually it wouldn't, Arduinos have fairly fragile output current limits) be able to drive an "ideal" MOSFET (zero resistance between your output pin and the gate capacitor), in reality there's some amount of resistance along that path, which means that there'll some nonzero amount of time required to charge the gate up. Why? <a href="http://en.wikipedia.org/wiki/RC_circuit"><i>Physics</i></a>. It ends up being much more efficient to drive the gate with higher voltages (~12-15V) in order to throw higher currents (remember that current is rate of charge flow) into your gate, charging it faster.<br />
<br />
So now we need something that can quickly switch between 0 and 15V to drive our MOSFET which can quickly switch between 0 and ~40V. What, you thought this was going to be simple? (I'm not even going to go into other problems like the necessity of <a href="http://en.wikipedia.org/wiki/Bootstrapping_(electronics)#Driving_MOS_transistors">bootstrapping</a> your high-side nFETs to enforce gate drive voltage between the gate and the source by leaving the source voltage floating). Well, this is where gate drivers come into play. Gate drivers are devices that can throw quick bursts of charge onto your MOSFET gates. Perfect! The gate drivers we picked out are <a href="http://en.wikipedia.org/wiki/Opto-isolator">opto-coupled</a>, which basically means they have a tiny LED inside them and they dump charge onto your FET gates whenever the LED is turned on. This is great, because it means that all your little 5V microcontroller has to do is <i>turn on an LED</i> in order to drive the motor. Additionally, it means that your 5V systems and your 15V systems are <i>only connected</i> by light, which protects your low-voltage electronics and prevents high noise levels on your signal wires.<br />
<br />
All of the above basically needs to be copy/pasted 3 times for brushless 3-phase control, which I'm not going to try to explain too heavily so as to avoid turning this blog post into a <a href="http://web.mit.edu/scolton/www/SCThG.pdf">dissertation</a>. The main important thing is that for "sensorless" control, meaning the controller doesn't directly know where the motor coils are relative to its magnets, it needs to have voltage sensors on each of the phases such that it can turn one off at a time and sense the voltage coming back out of it, from which you can determine the "electrical position" (basically the position of the coils relative to the magnet poles) of the motor, which in turn lets you drive it to the next desired position.<br />
<br />
Okay, now that we've gotten physics/theory out of the way, let's move on to the interesting part: actually designing. Not only is this my first foray into brushless motor control, it's also my first time using Eagle CAD for a major board as well as using surface mount parts at all. This was basically a "learn everything as you go" style project for me, so I just kind of jumped into Eagle and started designing.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAkjE-Sqqq793fNMxZp8uahMt9F7RCQadcLOsQObfzFU2ytgKg0ImxiHyzHEBmBoD27kxAAsXIu2iry5PMmqjwBv5PfUeQPhcRsRrS403RjGR3q0SsFEZw_vfbiIXPhfMXaCWSVpcLlbg/s1600/Early+schematic.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="350" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAkjE-Sqqq793fNMxZp8uahMt9F7RCQadcLOsQObfzFU2ytgKg0ImxiHyzHEBmBoD27kxAAsXIu2iry5PMmqjwBv5PfUeQPhcRsRrS403RjGR3q0SsFEZw_vfbiIXPhfMXaCWSVpcLlbg/s640/Early+schematic.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Here's an early schematic which shows the absolute basics. I'll explain starting from the far left, because that's sort of the direction of flow for this design. First there's a 15V switching regulator, which converts the 40 volts off of the battery down to something more manageable. Next, a feedback and filtering circuit which allows the 15V regulator to operate and cleans up its output a bit. I then have a 5V linear regulator which converts the 15V down to 5V in order to power the microcontroller. The giant box with lots of pins is the microcontroller itself (Atmega328), which then connects to a couple of status LEDs, as well as the three giant boxes you see in the middle of the schematic. The boxes are inverters and they along with the little resistor and capacitor to the right of them form a little circuit that takes the PWM signal from the microcontroller, splits it into two opposite signals and adds a little delay between turning each side off and turning the next on. This delay is a form of shoot-through protection, which means it avoids allowing the high-side and the low-side to turn on at the same time, which would directly short your battery through both FETs and explode <i>everything</i>. To the right of this inverting circuit you can see all 6 gate drivers, and finally the 6 FETs that they're driving.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Next, I moved on to adding the voltage and current sensing circuits. The current sensing consists of a very small (.001ohm), high current resistor in series with the motor phase, connected to a sensitive differential amplifier, which determines the voltage drop across the resistor and thus allows you to calculate current passing through the whole phase. Current sensing is extremely useful for a variety of reasons: (warning: physics) it allows you to calculate the phase-lag between your drive voltage and the current response of your phase (because your motor is an <a href="http://en.wikipedia.org/wiki/RL_circuit">RL circuit</a>), and since current is what you <i>really</i> care about in terms the position of the motor (because current creates flux which in combination with the field of the magnets applies torque), you need to offset the voltage by that detected phase-lag in order to time the torque with your phases switching electrical positions. Current sensing also allows you to do some nice things like over-current protection, constant-torque control, and the ability to detect shorts between the outputs and (hopefully) save your FETs from detonation.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
As for voltage sensing, it's absolutely essential for DC sensorless control because, as I said above, it's the only way you can determine the electrical position of the motor.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYNZnG41LKA6Nbl7nqhGNyjI066xh6Eu-8IWpaNeB2onxOsEm8BazxoW8EID0A0MvY6IY_hzCJt4vR0djqu8MVqJuxSb-xhlvk6_J4zaM_MhuwKacVtFmwq4L04idBQVmDPwvBectmXPY/s1600/Mostly+done.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="322" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYNZnG41LKA6Nbl7nqhGNyjI066xh6Eu-8IWpaNeB2onxOsEm8BazxoW8EID0A0MvY6IY_hzCJt4vR0djqu8MVqJuxSb-xhlvk6_J4zaM_MhuwKacVtFmwq4L04idBQVmDPwvBectmXPY/s640/Mostly+done.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Here you can see the current sensors (small boxes to the right of the FETs, and only on 2 phases) followed by the voltage sensors to the far right. The voltage reading is passed through a 2-stage RC low-pass filter, because there are lots of high-frequency voltage transients across the undriven phase due to the PWM on the other two and you want a smooth signal to determine the electical position.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
With the absolute basics out of the way, I moved on to adding various extra stuff, including bus capacitors to smooth the voltage across the FETs/provide them with clean-ish power, a battery voltage sensor, a 20MHz oscillator for the microcontroller, an ISP header so I can actually <i>program</i> the microcontroller, throttle/extra input (or output) pins, and finally an XBee header so that the controller will be able to support wireless data transmission.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicPJF-rmHUmU9DvbIibMyOh0ucVA626SzrU2OtdNAQCZdA89kDKbz-rcdqUrhDNM88sdzpME0YJEq9LBW4V8JEs5xEDv5F0EkmTnQsw1mMTh2IK88iLjPVLTB7Z56UTtAkDMnwwlLlJF0/s1600/Finished+motor+controller+schematic.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="306" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicPJF-rmHUmU9DvbIibMyOh0ucVA626SzrU2OtdNAQCZdA89kDKbz-rcdqUrhDNM88sdzpME0YJEq9LBW4V8JEs5xEDv5F0EkmTnQsw1mMTh2IK88iLjPVLTB7Z56UTtAkDMnwwlLlJF0/s640/Finished+motor+controller+schematic.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Yay! With the schematic finished (after like 4 days of staring at datasheets), I moved on to actually laying out the board. I definitely wanted it to be able to fit in my scooter, so I decided to make the outline 2.75" by 3.75".</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiD3FdjRfmKmN8zEIsXuhdqnjARzO5MmOqxnFpvCf1Hr1oM5Zu0k2pxV6ef_Pf0CDJrLMXZauIKUQO-FgVF_I6TKnyRcHNJygnxdV-yg7qF9WX1d-r2D4T4UJHVyc85WgLL8uHo9F-YxBY/s1600/wut+am+i+doing.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="502" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiD3FdjRfmKmN8zEIsXuhdqnjARzO5MmOqxnFpvCf1Hr1oM5Zu0k2pxV6ef_Pf0CDJrLMXZauIKUQO-FgVF_I6TKnyRcHNJygnxdV-yg7qF9WX1d-r2D4T4UJHVyc85WgLL8uHo9F-YxBY/s640/wut+am+i+doing.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I'd never laid out a board before, so this was my chance to learn Eagle's board layout features. I experimented with a couple of different general layouts before I settled on one I actually liked, the picture above is one of those early layouts.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiziL9WfTRF3UyKWbVhc30z6kPKJ-N2RBKKPHM4I14HHiKC6-aWFV2LBgxZALgOJSg0phCMoBq-uFhtW7RMj4C1pKX12MnlxS_7OPSKpNoAYfP2PqQa_Nsq3CMc_gRCS9sOIxXUyeu2xfg/s1600/airwires+ogod.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="336" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiziL9WfTRF3UyKWbVhc30z6kPKJ-N2RBKKPHM4I14HHiKC6-aWFV2LBgxZALgOJSg0phCMoBq-uFhtW7RMj4C1pKX12MnlxS_7OPSKpNoAYfP2PqQa_Nsq3CMc_gRCS9sOIxXUyeu2xfg/s640/airwires+ogod.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
This is the general layout I ended up settling on, you can see the massive power and ground traces on the left side of the board, and away from everything but the FETs and bus capacitors.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLWdP9iiswGB3hdDSwP_HCXd66yC-46mal1RZ-sek_JbvvSGNs55TmZiQK2P2iXn5Pxuzvqz2EEWWhvi1d_mXoKcGQJleKHroYtTkKTxPLL9vMH_H7YlQjOul2xfcdzsQSJYczk_a6hXI/s1600/end+of+day+1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLWdP9iiswGB3hdDSwP_HCXd66yC-46mal1RZ-sek_JbvvSGNs55TmZiQK2P2iXn5Pxuzvqz2EEWWhvi1d_mXoKcGQJleKHroYtTkKTxPLL9vMH_H7YlQjOul2xfcdzsQSJYczk_a6hXI/s640/end+of+day+1.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Here's a snapshot from the end of the first day of laying out, I got a little panicked about how much space things were taking and started trying to cram everything together towards the bottom, which in retrospect was a little bit of a mistake. It turns out I had more space than I thought, so cramming made my layout look pretty disorganized. On the plus side, however, this meant that the last third or so of routing went extremely quickly because there was an abundance of space available.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4ehctougQ0BZ45X5sxjp6Yf8WMKpmJ86OTG6GoNKI2xVPHtF421vJjbK1QCAYYJAmg2aw07lqAKbfsiuzmrxGcwCtg9BSRnrxuJ8J6-0n5qUo2yElCj_vUK93iGjyEU1CdfQw09I9-9k/s1600/Finished+motor+controller+board.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="466" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4ehctougQ0BZ45X5sxjp6Yf8WMKpmJ86OTG6GoNKI2xVPHtF421vJjbK1QCAYYJAmg2aw07lqAKbfsiuzmrxGcwCtg9BSRnrxuJ8J6-0n5qUo2yElCj_vUK93iGjyEU1CdfQw09I9-9k/s640/Finished+motor+controller+board.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Here's the finished board design with everything routed, and I also added a logo on the back as well as name/date/credits on the front middle.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Erik and I each independently created our own boards and schematics because we wanted the additional practice, and for our PCB order we just put 2 of each of our boards on a panel. We also ordered enough components for 4 boards, so if all goes well we'll end up with 2 controllers each.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
For now, it's time to wait for parts to arrive, which we can fill by starting on the code for the microcontroller. Basically, I'm going to enjoy spending a few days staring at massive spreadsheets which tell me which registers do what.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Hopefully that was at least somewhat intelligible for people of varying levels of experience, let me know if you have questions about the design/components/whatever.</div>
Bankshttp://www.blogger.com/profile/06935190198890093740noreply@blogger.com2tag:blogger.com,1999:blog-7608932277558807083.post-63379466874547975962012-12-08T17:27:00.000-08:002013-01-30T21:48:01.444-08:00The Quadrotor Itch Strikes Again!I was inspired by <a href="http://scolton.blogspot.com/">Shane</a> zipping his small quadrotor across the office, and decided I wanted to make another, smaller quadrotor that I could fly indoors (unlike my other <a href="http://omgitgoes.blogspot.com/2012/08/new-blog-and-old-projects.html">giant one</a>). I wasn't too eager to cough up the relatively large sum of money that I threw down on Derpcopter (if I remember right it totaled something in the neighborhood of $800), so I designed one with cheap hobby parts that I could get for a lot less.<br />
<br />
I decided that I wanted to 3D print the main body components so that they'd be relatively lightweight, and it would also let me do non-2D geometries (as much as I love laser cutters and waterjets, I think I eventually get sick of being stuck in 2D). I based the design on 6mm carbon fiber squaretube, since it's very lightweight but still plenty strong enough for a small quadrotor. I also wanted to try out the relatively new <a href="http://www.hobbyking.com/hobbyking/store/__24723__Hobbyking_KK2_0_Multi_rotor_LCD_Flight_Control_Board.html">KK2 flight control board</a>, so I designed my body specifically to accommodate it (3mm holes spaced on a 45mm square).<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiTf33fKuvqTfPeV9hK3lp40ZWxz8loGMqxQRhVTNrz6CxlqxkrVamEwz1o6Y5kK_Az7Xfz7ABPm-YFZkq38bZPHv6ns45tdZVpZT630rG1FIyx9HUbAMdYiDQVAbgQxcHQzUBSVQC9mo/s1600/Base.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="322" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiTf33fKuvqTfPeV9hK3lp40ZWxz8loGMqxQRhVTNrz6CxlqxkrVamEwz1o6Y5kK_Az7Xfz7ABPm-YFZkq38bZPHv6ns45tdZVpZT630rG1FIyx9HUbAMdYiDQVAbgQxcHQzUBSVQC9mo/s640/Base.png" width="640" /></a></div>
<br />
I added slots for a velcro strap on the bottom side, to hold the battery. The holes for the control board also retain the squaretube arms, which fit into the square slots on the corners. I also split the model in half across the horizontal mid plane, in order to make it much easier to 3D print.<br />
<br />
I wanted to get a head start on picking out components to I order them from China, because shipping takes forever. Here are some links to the major components:<br />
<br />
<ul>
<li><a href="http://www.hobbyking.com/hobbyking/store/__8478__hexTronik_20gram_Brushless_Outrunner_2300kv.html">Motors</a>: 2300 Kv</li>
<li><a href="http://www.hobbyking.com/hobbyking/store/__4312__TURNIGY_Plush_18amp_Speed_Controller.html">ESCs (electronic speed controllers)</a>: max 18A continuous</li>
<li><a href="http://www.hobbyking.com/hobbyking/store/__24723__Hobbyking_KK2_0_Multi_rotor_LCD_Flight_Control_Board.html">Battery</a>: 1300mAh, 2S1P</li>
<li><a href="http://www.hobbyking.com/hobbyking/store/__11316__6x3_Propellers_Standard_Rotating_5Pcs_Bag_.html">Propellers</a>: 6x3</li>
<li><a href="http://www.hobbyking.com/hobbyking/store/__23140__Hobby_King_Quadcopter_Power_Distribution_Board.html">Power distribution board</a></li>
<li><a href="http://www.hobbyking.com/hobbyking/store/__11965__OrangeRx_R610_Spektrum_DSM2_6Ch_2_4Ghz_Receiver_w_Sat_Port_.html">Radio receiver</a></li>
</ul>
<div>
I decided to use the same radio transmitter that I already had for Derpcopter, there wasn't really any reason for me to buy another one. I also picked out substantially bigger ESCs than I needed, really the motors could run on ESCs half that size, but I was considering that I might want to bump up the motor size later, which I can with large ESCs.</div>
<div>
<br /></div>
<div>
I went ahead and ordered two sets of parts (one for me, one for a friend), then worked on the design (and my <a href="http://omgitgoes.blogspot.com/2012/12/big-update-part-2-of-2-finally.html">scooter</a>!) for a few weeks while I waited for them to come. Now that I knew which motors I'd be getting, I went ahead and designed mounts for them which also serve as feet for the copter.</div>
<div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-aAvFJbVob19luFFkEZKHyKgasyBqe8CR5VyXjUq1ClLUWpr0WRSHvRxoS32bVY0vNjDeZ59PrvGnlSeR-B0RgsqK3FBMk4rHNgdF-D4Y7Jk30oXBmbjZh9DEN2wrSCXrq1KaX3O2YJg/s1600/original+motor+mount.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="322" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-aAvFJbVob19luFFkEZKHyKgasyBqe8CR5VyXjUq1ClLUWpr0WRSHvRxoS32bVY0vNjDeZ59PrvGnlSeR-B0RgsqK3FBMk4rHNgdF-D4Y7Jk30oXBmbjZh9DEN2wrSCXrq1KaX3O2YJg/s640/original+motor+mount.jpg" width="640" /></a></div>
<br /></div>
<div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcSfTPvDsYaerID9CxU_6wA5I8RzoH2N-LSfW5muM0mgvGG0iiJeyJEU1fg3URynoKZcClSOrITVTT6R-ao6ykMX3sWtYMdCq6KtHjp8rg0K4WebjAB9KnsENULz19pzortOvmnYGFfY4/s1600/copter+dome+3.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><br /></a>I also wanted a sort of dome structure on the top of the body, which would serve both to protect the control board and mount the radio receiver (mostly just make the quadrotor look more legit, though). I didn't have a very concrete idea of what I wanted the design to look like, though, so I just sketched out a few different designs until I came up with one that I liked.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRcwM-zR8DvPMvNJW-vwYsxzw4doKqMwLTMwF4-YwC5cpWlwrizhxYGsLwC9tEkAnT5Nj2oWR9Vw6QhEDXFgw_YJdX_c-4HzHBbjvuqzK6E7GnZK7LsybAnHO7I81S5zMAc9UBBulVzjY/s1600/copter+dome+1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="160" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRcwM-zR8DvPMvNJW-vwYsxzw4doKqMwLTMwF4-YwC5cpWlwrizhxYGsLwC9tEkAnT5Nj2oWR9Vw6QhEDXFgw_YJdX_c-4HzHBbjvuqzK6E7GnZK7LsybAnHO7I81S5zMAc9UBBulVzjY/s320/copter+dome+1.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXvS9BDWcLupdEt_LUDdi4PIuZNR59lNc-ztrrCzBre7c2RL1mSiZrpeLBG0jecVqSw1sp3OllXdlcoIcbmPBc0m_mvZiO8N3HmC58RyivXPSea6oLwd5Ly2EbsEzBYhY0r8PF4k0Ljyg/s1600/copter+dome+2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="160" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXvS9BDWcLupdEt_LUDdi4PIuZNR59lNc-ztrrCzBre7c2RL1mSiZrpeLBG0jecVqSw1sp3OllXdlcoIcbmPBc0m_mvZiO8N3HmC58RyivXPSea6oLwd5Ly2EbsEzBYhY0r8PF4k0Ljyg/s320/copter+dome+2.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjW4HMA2U2TKek-JUHhzR3pwGtKoqppqrYFk5sgn7e4VswK7g32V5QF6XTAs2blJuIcPf1R8w8uyYjahUBsO4nvpcdd82VQIs9u45IbF9VKi9A8FrPKgO8sfAj3EPrGuU1C24_1eRGoD2I/s1600/copter+dome+3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="161" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjW4HMA2U2TKek-JUHhzR3pwGtKoqppqrYFk5sgn7e4VswK7g32V5QF6XTAs2blJuIcPf1R8w8uyYjahUBsO4nvpcdd82VQIs9u45IbF9VKi9A8FrPKgO8sfAj3EPrGuU1C24_1eRGoD2I/s320/copter+dome+3.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
I ended up going with the third design (the one on the bottom) because it looked the simplest/sturdiest, as well as the easiest of the three to print. Again notice the velcro strap slots for the radio receiver.<br />
<br />
I went ahead and printed out the frame parts while I waited on my electronics to arrive.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNQu31Dt84C96v_9cP6H_UnX19MlQIfxtZkQS49AoC8w3zMbwV2HAkyJ-dEOaw4V7OBBq7JGaDRqKLxU4UfLrT2nSq862Xi5HeApv2-DAzVrZvxDDL32tU5I15FX1Rgpt2ebxjkJeeE0A/s1600/printing+motor+mount.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNQu31Dt84C96v_9cP6H_UnX19MlQIfxtZkQS49AoC8w3zMbwV2HAkyJ-dEOaw4V7OBBq7JGaDRqKLxU4UfLrT2nSq862Xi5HeApv2-DAzVrZvxDDL32tU5I15FX1Rgpt2ebxjkJeeE0A/s640/printing+motor+mount.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Yay printers!</td></tr>
</tbody></table>
There wasn't much else I could do on the copter front, so I spent a couple weeks focusing on school and other projects. I was pretty excited when the giant shipping package of Hobbyking parts came in, so I laid everything out and took a picture:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-mphsft3-0A5cNvnTP2spW5tnp5oDmXWsVA_WgT0wTgukZ3WnV-FXZTwpLwLHgu20nblGnAm1aPl0pFocJJM0ObWlmyvQUOIGna2TgpOW-uafWTF44-d2UlwS0tdXdG_yd9wW4rqY0As/s1600/quadrotor+parts.jpg" imageanchor="1"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-mphsft3-0A5cNvnTP2spW5tnp5oDmXWsVA_WgT0wTgukZ3WnV-FXZTwpLwLHgu20nblGnAm1aPl0pFocJJM0ObWlmyvQUOIGna2TgpOW-uafWTF44-d2UlwS0tdXdG_yd9wW4rqY0As/s640/quadrotor+parts.jpg" width="640" /></a></div>
<br />
I included my old radio transmitter for completeness, the orange and black one you see is the one my friend got for his quadrotor. Also, notice the extra props: I've learned a bit of a lesson there. New quadrotor = broken props, so <i>buy extra</i>.<br />
<br />
I began by cutting my 75cm carbon fiber tube into 4 17cm sections. I also took rather meticulous photos of this whole build, because I'm planning on writing a quadrotor Instructable. Oh, and there happened to be a lightbox sitting at <a href="http://miters.mit.edu/">MITERS</a>, the owners of which kindly decided to let me use it to take some pictures of quadrotor parts.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQfrkoXy0AhdaQ8-5SLc0apWAXbTVOCJCfvDSWGgLLqVOwTX1Z8fW_mNV0O7YDIcSumSpmXxyyYitr0ShqWKZ9T4i4J8qjQSr8YJVXE6BOlV5QzgwhDFrA5Dgb4dB8nZ2VXzxBrq6MGJA/s1600/bandsawing+carbon+fiber.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQfrkoXy0AhdaQ8-5SLc0apWAXbTVOCJCfvDSWGgLLqVOwTX1Z8fW_mNV0O7YDIcSumSpmXxyyYitr0ShqWKZ9T4i4J8qjQSr8YJVXE6BOlV5QzgwhDFrA5Dgb4dB8nZ2VXzxBrq6MGJA/s640/bandsawing+carbon+fiber.JPG" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">I think you're supposed to wear a mask when you do this? Not much dust came up though. I think I held my breath.</td></tr>
</tbody></table>
Cut arms:<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhM2EjcIeb12XgevSpBDquAIwsteTmQCGzSWg2zS01oPbESMtGqpQoyCrBIR9ch-Kp0gc8q8QlVqerQUGe1u8WHirXjcApJDtPhlCOv2tJQ7h6cDwE9AGAfBgIN6lNOXAgdF8yNEaREl6I/s1600/cut+quadrotor+arms.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhM2EjcIeb12XgevSpBDquAIwsteTmQCGzSWg2zS01oPbESMtGqpQoyCrBIR9ch-Kp0gc8q8QlVqerQUGe1u8WHirXjcApJDtPhlCOv2tJQ7h6cDwE9AGAfBgIN6lNOXAgdF8yNEaREl6I/s640/cut+quadrotor+arms.JPG" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Ooh, fancy.</td></tr>
</tbody></table>
The bandsaw didn't make perfect cuts on the CF, but it really doesn't matter for how they're being used (the faces don't need to be perfectly rectangular). Plus, I didn't really feel like sanding it down and throwing dust everywhere.<br />
<br />
I arranged the arms and base together so that I could drill out the holes in the arms.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQEkk5RuZL85xB0Pgh8wFyN6H6PFCurvL70zABvxluNb7IJkNRz17FmtALcsCCIZS6adB_-JpKp29OGyklFiFO07HplLmwjPoAllP3kbcHRhtiqMFjqrRhNhyphenhyphenZpDIYU3SiNMQEvuTV32M/s1600/basic+quadrotor+frame.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="482" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQEkk5RuZL85xB0Pgh8wFyN6H6PFCurvL70zABvxluNb7IJkNRz17FmtALcsCCIZS6adB_-JpKp29OGyklFiFO07HplLmwjPoAllP3kbcHRhtiqMFjqrRhNhyphenhyphenZpDIYU3SiNMQEvuTV32M/s640/basic+quadrotor+frame.JPG" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Sorry it's a little hard to distinguish the white base from the white background, this is why I'm an engineer and not a photographer</td></tr>
</tbody></table>
This was just faster than measuring out and drilling holes for the arms separately, and it works just as well.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjj5QYEJ4eDwkAO-9e8zwE50gE4zcheE_Ele635wGJn0WhAQGvijtJ1lq4BDGFWasqPcSsBQSPjPpQUX43XDp4Q9if-29ojdbNsya6pYS1-d2Z1JTVjlofsn7VI9VxLacmyl9rC_clkK0U/s1600/drilling+out+body.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjj5QYEJ4eDwkAO-9e8zwE50gE4zcheE_Ele635wGJn0WhAQGvijtJ1lq4BDGFWasqPcSsBQSPjPpQUX43XDp4Q9if-29ojdbNsya6pYS1-d2Z1JTVjlofsn7VI9VxLacmyl9rC_clkK0U/s640/drilling+out+body.JPG" width="640" /></a></div>
<br />
I then did essentially the same thing with the motor mounts, except I taped around them a bit to help hold them in place on the arm.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOUvKLd1Sm4GOg_ISNnlyddDfcJh3CGCTdDCFnZkD2Kf054o_NAfrIIYDn0ZOvqYofL15MuJaapby2tcMVTMSeCzlIWdRQvjqpI2XNRAebCfdDR4568n1JOQC7KQ7b0ldiR-fuZEhuCwU/s1600/drilling+motor+mounts.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOUvKLd1Sm4GOg_ISNnlyddDfcJh3CGCTdDCFnZkD2Kf054o_NAfrIIYDn0ZOvqYofL15MuJaapby2tcMVTMSeCzlIWdRQvjqpI2XNRAebCfdDR4568n1JOQC7KQ7b0ldiR-fuZEhuCwU/s640/drilling+motor+mounts.JPG" width="640" /></a></div>
<br />
That done, my basic frame was complete!<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLjMnRd8v0aVBH8gkd2-tK5pU7XiAgTGq3YxBnPjzcEQA87hpqnfcqN7rPkipv4MkeB-vRk2HRB4Mdc9G4hjUWq_89lHswR5cbz70AqpfOm6e9Fzqxz3CQqVRmvzNmaW5yWcOULJuC-CU/s1600/basic+frame.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLjMnRd8v0aVBH8gkd2-tK5pU7XiAgTGq3YxBnPjzcEQA87hpqnfcqN7rPkipv4MkeB-vRk2HRB4Mdc9G4hjUWq_89lHswR5cbz70AqpfOm6e9Fzqxz3CQqVRmvzNmaW5yWcOULJuC-CU/s640/basic+frame.JPG" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">This one didn't quite fit in the lightbox :(</td></tr>
</tbody></table>
With the frame ready, it was time to work on electronics. Primarily I just had to solder lots of <a href="https://www.google.com/search?num=10&hl=en&site=&tbm=isch&source=hp&biw=1600&bih=799&q=bullet+connectors&oq=bullet+connectors&gs_l=img.3..0l2j0i5j0i24l7.1777.4166.0.4258.19.17.1.1.1.0.149.1257.12j4.16.0...0.0...1ac.1.cxYo8Fk41fk">bullet connectors</a> so that I could hook everything together. Oh, and I also got my battery started charging so I'd have it ready by the time I finished everything else. I took a whole lot of pictures of the process for soldering bullet connectors, because I remember they were very confusing to me the first time I had to use them (on Derpcopter). I'll be putting a full detailed guide to doing this on the Instructable, but for now I'll save you having to scroll through 20 pictures and just show you the result:<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYx9hTDHJHgN-BrX91oShRPvPRgpRj0OsaJxAub2btSz1vEi9WnXmscm4wzHsUuRmnfC-ER3rEMOv1-Rddc9p2purPeWkGNicLWJPikxMKel40x1JZ-nhX4eGLtkB3b2oEhTDzAi0Z350/s1600/Quadrotor+motors+and+ESCs.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYx9hTDHJHgN-BrX91oShRPvPRgpRj0OsaJxAub2btSz1vEi9WnXmscm4wzHsUuRmnfC-ER3rEMOv1-Rddc9p2purPeWkGNicLWJPikxMKel40x1JZ-nhX4eGLtkB3b2oEhTDzAi0Z350/s640/Quadrotor+motors+and+ESCs.JPG" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">So pretty!</td></tr>
</tbody></table>
There are all four motors and ESCs, all soldered up and ready to go (only 32 bullet connectors between them).<br />
<br />
Next, I discovered my first major mistake: I'd assumed that the motors used the same 3mm screw size as the control board, but actually the holes are for 2mm screws. Oh well, I didn't have the patience to do this the 'right' way and buy some screws from Amazon, so I just removed the motor mounts and drilled the holes out to 3mm.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiz7xlvRu5a40L9BdnaDIexU4RhfVqGxhyphenhyphenL60nx2eAzcTgnMRK-XZVX9ZfhsnQ2gmZvKaSNAjPP3o4uxqTAx4qvado-ACIGs6fjCuMFywoXB8QDad7H8PWf0il9TgmpyFNhxbSVIfyeCcE/s1600/drilling+out+motor+mounts.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiz7xlvRu5a40L9BdnaDIexU4RhfVqGxhyphenhyphenL60nx2eAzcTgnMRK-XZVX9ZfhsnQ2gmZvKaSNAjPP3o4uxqTAx4qvado-ACIGs6fjCuMFywoXB8QDad7H8PWf0il9TgmpyFNhxbSVIfyeCcE/s640/drilling+out+motor+mounts.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">These are annoying to fixture properly and the alloy is so soft that I just decided to beast it with vice grips.</td></tr>
</tbody></table>
I screwed on the control board and the power distribution board, and then started mounting the motors.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUvkdB7a6K0R-T7aK2z3H4578N1ss1l6CoAXDxjDEqcoP3xJhdNeQyGNNa9QoS0ApJvAzf-z4ahCTVEJb_D3P3ho1OlaQL2ipYfG-RNOwNszNcblkoA3-hPDH2U8dJjQxzqqKg95RD06c/s1600/partially+complete+quadrotor+frame.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUvkdB7a6K0R-T7aK2z3H4578N1ss1l6CoAXDxjDEqcoP3xJhdNeQyGNNa9QoS0ApJvAzf-z4ahCTVEJb_D3P3ho1OlaQL2ipYfG-RNOwNszNcblkoA3-hPDH2U8dJjQxzqqKg95RD06c/s640/partially+complete+quadrotor+frame.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">It's starting to look pretty quadrotor-y!</td></tr>
</tbody></table>
ESCs all wired up:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimZ8PCkQH1Cquxc-oiJNZoCbq3ITEtsw1PbOQxIgJr9g3FVY7uiQaTvLwSHlQwg0Gs9k76NEql9a5T_hyphenhyphen6_gPk_zjLEz4qknPjLWBxZwjr2dSbUpb8nLoQeIVGf6Y-ZAcKt4HMTDP1LoY/s1600/mostly+assembled+quadcopter.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimZ8PCkQH1Cquxc-oiJNZoCbq3ITEtsw1PbOQxIgJr9g3FVY7uiQaTvLwSHlQwg0Gs9k76NEql9a5T_hyphenhyphen6_gPk_zjLEz4qknPjLWBxZwjr2dSbUpb8nLoQeIVGf6Y-ZAcKt4HMTDP1LoY/s640/mostly+assembled+quadcopter.jpg" width="640" /></a></div>
<br />
And a final picture of the finished copter, with battery, radio, and propellers attached:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzDQ2wZuVx4LVDm8eleuP0CKJZd5Esh1x9LCohujGpgd-ZNy19jFUHqrOqTbMVmgdIgVtz9C196j4EL-KAUYA-XTYLDqVZkIq7pc5IYFK5WS3t2BXiDX_lCzbyUdaKWLshC8_kJcrr6SM/s1600/fully+built+quadrotor.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzDQ2wZuVx4LVDm8eleuP0CKJZd5Esh1x9LCohujGpgd-ZNy19jFUHqrOqTbMVmgdIgVtz9C196j4EL-KAUYA-XTYLDqVZkIq7pc5IYFK5WS3t2BXiDX_lCzbyUdaKWLshC8_kJcrr6SM/s640/fully+built+quadrotor.jpg" width="640" /></a></div>
<br />
I zip-tied the ESCs to the arms to clean up the wiring and prevent them from just swinging around in flight. You'll notice that the dome I designed isn't attached in this picture, this is due to the fact that I underestimated the thickness of the power distribution board when I was buying screws. The body screws I got are too short to go through everything and mount the dome, so currently I'm waiting on new screws ordered through Amazon in order to complete the body. Regardless, it's fully capable of flying without the dome, the purpose is mostly aesthetic. I did fly it for a minute or so around when I took that last picture, but it was 5am at that point and the copter was very difficult to control (due to the default PI gains of the flight control being set way too high, causing it to oscillate around whatever desired position I gave it), so I decided to call it a night.<br />
<br />
The next day I worked out the PI (if you're not sure what this means, I recommend reading up on <a href="http://en.wikipedia.org/wiki/PID_controller">PID control on Wikipedia</a>. Copters typically don't have need for the D component because it's highly affected by noise in the sensors, and it slows the system response which isn't very desirable) settings to get a much more stable copter, and came up with a name: I dubbed it the Blitzcopter, owing to how I'd completed the entire construction over the course of one manic night.<br />
<br />
Okay, I'm not going to leave you waiting for the video any longer than that, so here it is:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/IWBAc24RiLg?feature=player_embedded' frameborder='0'></iframe></div>
<br />
Yay! The reason it's flying so loud is that I haven't yet gotten a chance to balance the propellers, which entails adding little bits of mass (i.e. tape) to the blades in order to move the center of mass of the propeller onto the rotational axis, greatly reducing the vibration of the motors.<br />
<br />
I've also taken a couple of hard landings and snapped some of the printed motor mounts due to the impact, for now I've super-glued them back together but I'm going to be designing new sturdier mounts won't break as easily.<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
</div>
Bankshttp://www.blogger.com/profile/06935190198890093740noreply@blogger.com2tag:blogger.com,1999:blog-7608932277558807083.post-79773899995479792142012-12-03T15:49:00.002-08:002013-03-11T12:43:08.744-07:00Big update part 2 of 2: Finally!!Well, it's certainly been an adventure, but I'm pleased to announce that I actually have a finished fully custom scooter frame! I'll save you some anticipation and just give you a look at the final product first:
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYhyphenhyphen7NfdQztDQPfPQhX8ZsQ6pZykb6PmpxtgJYZWiwQMAr_Ib904pcc1ijW7T_QiAL4zV2zb12R8Hxm_bOGA_BtjZcYiLUVtuJZBAvJb0xtG0lzcdGgwefkWTTm_IpLXhiZ7CUFFGsJ3U/s1600/2012-12-01_18-47-09_243.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="aergaerga" border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYhyphenhyphen7NfdQztDQPfPQhX8ZsQ6pZykb6PmpxtgJYZWiwQMAr_Ib904pcc1ijW7T_QiAL4zV2zb12R8Hxm_bOGA_BtjZcYiLUVtuJZBAvJb0xtG0lzcdGgwefkWTTm_IpLXhiZ7CUFFGsJ3U/s640/2012-12-01_18-47-09_243.jpg" title="" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
There it is, in all its water-jetted aluminum glory. No Gorilla tape this time, I swear!</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Alright, now let's dive into the juicy build report:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I started off blocking out a general shape I wanted the deck to end up looking like, using rough dimensions from my battery pack and how big I estimated a scooter should be. I wanted a slight natural curve for the deck, so I made a few splines and then tweaked them until I liked how they looked. I also disassembled my stock scooter to take measurements of the plate to fasten the front fork. This is about where I was as of my last post, <a href="http://omgitgoes.blogspot.com/2012/10/big-update-time-part-1-of-2.html">part 1 of the mega scooter build series</a>. After I had a basic shape I was happy with, I fiddled around with the orientation of the battery pack by CADing it up and spinning it around. I decided I liked the vertical orientation best because it actually minimizes the height of the scooter (which is important, considering how tall it has to be to accommodate the battery at all), at the expense of widening it a bit. I also played around with the spacing of the motor controller until I had something that was about as closely-packed as it could get.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I decided to primarily build the scooter out of 1/8" aluminum rather than 1/4" to minimize its weight, and building the entire thing out of 1/4" would probably make it a lot stronger than it actually needs to be. However, this requires some additional design considerations because 1/8" is too thin to just drive screws into its end. I ended up going with three different fastening schemes across my scooter, because each made the most sense in its own area of application. Here you can see all three schemes I used in one shot:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhd6-07bRUt8NkU6WxjsjyG3ouCSqMaLImbENCatb8K33i0AVx03Q4b0X32cVeQoRobvArlbDduCJdZ9LvvXqvNawcDHXKORGQeRxb3eZvPqRCPS3yDKVRy4iRtuo-PCapgFB_WININ-M/s1600/In+progress+frame.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="340" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhd6-07bRUt8NkU6WxjsjyG3ouCSqMaLImbENCatb8K33i0AVx03Q4b0X32cVeQoRobvArlbDduCJdZ9LvvXqvNawcDHXKORGQeRxb3eZvPqRCPS3yDKVRy4iRtuo-PCapgFB_WININ-M/s640/In+progress+frame.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
So, why the three different fastening methods?</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I didn't want to be riding around in a pure right-angled box, so I wanted the front to have a somewhat visually interesting look, resulting in the angled nose design. The problem, however, is that traditional waterjet T-nut corner blocks are inherently 2D extrusions, which wouldn't be able to hold the separate front plates together. I decided to instead waterjet the top profile of the corner supports, and then post-machine and tap holes on the front (angled) faces.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
In the middle of the body, I had a long stretch of top deck I needed to link to the sides, but I was extremely constrained by the width of the battery (I wanted to build the smallest frame I could). I decided to place 2D T-nut blocks on the <i>outside</i> of my side plates, sticking up into the top deck, so that they didn't take up space in the interior.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
For the back, however, I had some space to spare because the motor controller has a smaller cross-section than the battery. I was able to fit in some angle brackets to hold the whole body together in the rear.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Here's a shot where you can see how the basic body all came together, this is just really an extension of the previous picture:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-UqMmC-YfBYwHb59lNDNBdiA2CTqEq1GqAW1xM_Qg_0M5chalokCFaw-wpPnkhKcJBtnfauSaonI1q2FIaXvf1dkNp5jGx842cNosTgJ7rwKXPYyK1J4siGqQ4kZya6f9nr_nTIzSUwY/s1600/all+but+brake.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="342" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-UqMmC-YfBYwHb59lNDNBdiA2CTqEq1GqAW1xM_Qg_0M5chalokCFaw-wpPnkhKcJBtnfauSaonI1q2FIaXvf1dkNp5jGx842cNosTgJ7rwKXPYyK1J4siGqQ4kZya6f9nr_nTIzSUwY/s640/all+but+brake.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
And another shot with transparent walls so you can see the insides:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_yZOOwpnjjOav2jgXGEHjRXUuvcPvNYnvG09qFN8NowWb23k62ptTCs7a4XWah45ttKUSuOOBtrvzhvDpco7i54EDK6DPVYR2EI1pyMYWDoGc60DhN1J7qPCQ41zj8v1r8Du6ZVJJZvQ/s1600/getting+there+transparent.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="342" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_yZOOwpnjjOav2jgXGEHjRXUuvcPvNYnvG09qFN8NowWb23k62ptTCs7a4XWah45ttKUSuOOBtrvzhvDpco7i54EDK6DPVYR2EI1pyMYWDoGc60DhN1J7qPCQ41zj8v1r8Du6ZVJJZvQ/s640/getting+there+transparent.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Somewhere around here I realized that I'd probably want a brake eventually, so I just added a mount for a brake shaft to the sides near the rear wheel:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLkqihRJNaLOGOf1QYge1IBw6P2p9hhPECn84wZHFxkhLXjbC6zfWcqc_wT4QQ0388hO6-uXqk3gPJf4oJQ4vwzJR4hVIo0iRIbvsY7_SYDW3jFAwE-TQZmPvWSl7wwp6MV4GSNKgMyKs/s1600/pre-brake.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="342" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLkqihRJNaLOGOf1QYge1IBw6P2p9hhPECn84wZHFxkhLXjbC6zfWcqc_wT4QQ0388hO6-uXqk3gPJf4oJQ4vwzJR4hVIo0iRIbvsY7_SYDW3jFAwE-TQZmPvWSl7wwp6MV4GSNKgMyKs/s640/pre-brake.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I was pretty impatient to start on the body itself, so I decided to finish the brake later and go ahead with cutting the parts for the frame.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdSeeCDu-coZre2XNETqQJjrtQ3U4q-biBVhrYzLh4KFfmSshTz7o9lu4dxudGmdEdKA5EeScrrTlQyCaPjeQkzD_0_pX1JMJnSR6a5jIQLhT4E0ozQhPwWw6tf4FAI5JLnBRBemzhppE/s1600/2012-09-28_17-09-12_265.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdSeeCDu-coZre2XNETqQJjrtQ3U4q-biBVhrYzLh4KFfmSshTz7o9lu4dxudGmdEdKA5EeScrrTlQyCaPjeQkzD_0_pX1JMJnSR6a5jIQLhT4E0ozQhPwWw6tf4FAI5JLnBRBemzhppE/s640/2012-09-28_17-09-12_265.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Yaay, the magic of the metalprinter!</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: left;">
I decided that the easiest way to place the holes in the front end of the front plates (remember, the ones I said I'd have to post-machine) would be to just clamp the whole front assembly together and drill the holes by hand using the holes the waterjet cut from the front plates as guides.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioGKr6nAdiNXLLwHzAtWYlAH4D2-7KW_jjLf03yDSoZimOSkiOuH1M192TQRsqj7p8al5OScuWbf3kW3TatZqIWyQa1iFz_wrjbDRtr_Kg3JYS2nsXL6lOUp-09NRqqN_CRfMsK5H6xkg/s1600/2012-09-28_22-23-48_245.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioGKr6nAdiNXLLwHzAtWYlAH4D2-7KW_jjLf03yDSoZimOSkiOuH1M192TQRsqj7p8al5OScuWbf3kW3TatZqIWyQa1iFz_wrjbDRtr_Kg3JYS2nsXL6lOUp-09NRqqN_CRfMsK5H6xkg/s640/2012-09-28_22-23-48_245.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I also went ahead and just attacked everything with a countersink, I decided it was worth the effort to use flat-head screws and not leave pan-heads sticking out of every surface on my scooter.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Here you can see the front assembly mostly complete:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOHbd3NTOLif2mKmPmuxAfepoTintNiyqHrpt-C5wvIGOCiyLblmCo4hLijs84dGbzM5KLt5RtvqzpLEf9Nd6H5S4rOV9W7YzjQofUNHv5tag16lPOGsgyQJKZifibCUcyJBclgspEkd4/s1600/2012-09-28_22-24-21_708.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOHbd3NTOLif2mKmPmuxAfepoTintNiyqHrpt-C5wvIGOCiyLblmCo4hLijs84dGbzM5KLt5RtvqzpLEf9Nd6H5S4rOV9W7YzjQofUNHv5tag16lPOGsgyQJKZifibCUcyJBclgspEkd4/s640/2012-09-28_22-24-21_708.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I also made a slight design error and placed the nuts holding the front fork mount a little too close to the front corner blocks, so I had to bandsaw away some material to allow the nuts to clear the corner block.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0wHDQomklm7dALLQh018t1_t02JJGT-E-ob6TCzrvHPiZkS16r8pq9XPDC7o_sPZc9t7BgSzAherUMaaPs1mjiIgb4YBFPbfLDgJhJrdCeVFu9EngfzDSfC_WdgIvo7FX1Xk3JCg46Kk/s1600/2012-12-01_15-06-57_222.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0wHDQomklm7dALLQh018t1_t02JJGT-E-ob6TCzrvHPiZkS16r8pq9XPDC7o_sPZc9t7BgSzAherUMaaPs1mjiIgb4YBFPbfLDgJhJrdCeVFu9EngfzDSfC_WdgIvo7FX1Xk3JCg46Kk/s640/2012-12-01_15-06-57_222.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Next there was a lot of tedious counter-sinking and tapping, but I was able to put most of the body together and it ended up looking pretty nice:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkuhVWgQj7WYwaTVjo5tast-jN1IkJ8yk9tnCcJ7-PNBVWRHVh3bcu8BaP2s0wdGGCOZEQD6-z-w_UCnQflsl1ZfmMEZoDSWmNqjK42ZnMhWOx7sIEp81k9uB-1mTkr1FQlXDjfzkrywo/s1600/2012-10-01_14-11-48_596.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkuhVWgQj7WYwaTVjo5tast-jN1IkJ8yk9tnCcJ7-PNBVWRHVh3bcu8BaP2s0wdGGCOZEQD6-z-w_UCnQflsl1ZfmMEZoDSWmNqjK42ZnMhWOx7sIEp81k9uB-1mTkr1FQlXDjfzkrywo/s640/2012-10-01_14-11-48_596.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I had really wanted to finish this scooter for <a href="http://makerfaire.com/newyork/2012/">Maker Faire New York</a>, but I was still lacking a front fork and some basic necessary components. Some attempts involved hand-drill and hacksaw insanity with my original front fork, as well as trying to fuse my scooter body with <a href="http://scolton.blogspot.com/p/bwd-scooter.html#pneu">Shane's</a>:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSN8pIyXpTu4S_nhn3UtMAAWA9P98ffuEehclcclXxcPVf8Nq6-vlwexlaZ-pT_98u386k0U8Rg7cZ76Qoxl6ZKaxRmiI0AxC6Sc_Dt2wf-ZhjynTED1mdFTIv5e5mTm3E6Tz80c6ssBg/s1600/scooter_beasting.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSN8pIyXpTu4S_nhn3UtMAAWA9P98ffuEehclcclXxcPVf8Nq6-vlwexlaZ-pT_98u386k0U8Rg7cZ76Qoxl6ZKaxRmiI0AxC6Sc_Dt2wf-ZhjynTED1mdFTIv5e5mTm3E6Tz80c6ssBg/s400/scooter_beasting.JPG" width="298" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I didn't quite manage to get either method working, so I decided to just enjoy the fair for a while and let my scooter sit until I got home and had access to a real shop.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
When I got back to Boston I started working on a brake and handlebars. I wanted a small-profile brake that would spring back, so I designed a little aluminum brake with a slot in it for a leaf spring:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjw2wAcLhWzZSmEu0DO7I1CKSYdQlrn5QXRDSjjfHyie0kO8NbJK77uW0fOpgnLPmcPUMdhx_CbTgi5f-PG_hU_gMYJrvC6mAZKKj1zbbeexzOcFbFeWw8_R1bWpTUGN9S8CFcmwTPE7RY/s1600/lolbrake.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="342" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjw2wAcLhWzZSmEu0DO7I1CKSYdQlrn5QXRDSjjfHyie0kO8NbJK77uW0fOpgnLPmcPUMdhx_CbTgi5f-PG_hU_gMYJrvC6mAZKKj1zbbeexzOcFbFeWw8_R1bWpTUGN9S8CFcmwTPE7RY/s640/lolbrake.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I then cut it out and put it together.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKhBtnE8VQ5XocByamToWe2oYMptQUbvfuJWmp-P_1GRN0aRGwuYp8ykH1Prb9tchzK_JL05zwHTSotLHSim9_ZsFUvAeptQp0XnqE64QlCLRCuCmiAPieDoqONwdj0ouqzMkD9MwtIGE/s1600/2012-10-05_23-35-40_673.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKhBtnE8VQ5XocByamToWe2oYMptQUbvfuJWmp-P_1GRN0aRGwuYp8ykH1Prb9tchzK_JL05zwHTSotLHSim9_ZsFUvAeptQp0XnqE64QlCLRCuCmiAPieDoqONwdj0ouqzMkD9MwtIGE/s640/2012-10-05_23-35-40_673.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
And mounted it on the back of the frame.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyCCBgA-yBAHwsnxNU3d_WKyxdyM52f4YbGQ2PgKbPqMsVgZUHF3BMFNAJQ36RiHkRyLxQz9BHAIsOVl0FoLlsYGxTPvDqqfk2YV4vwyvnCvGUdJMFYN_c-ihE4Qi9KWhGSF-9h5l4Id8/s1600/2012-10-05_23-55-25_798.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyCCBgA-yBAHwsnxNU3d_WKyxdyM52f4YbGQ2PgKbPqMsVgZUHF3BMFNAJQ36RiHkRyLxQz9BHAIsOVl0FoLlsYGxTPvDqqfk2YV4vwyvnCvGUdJMFYN_c-ihE4Qi9KWhGSF-9h5l4Id8/s640/2012-10-05_23-55-25_798.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I also noticed that I had made a small design error on my hub motor: the nylon nuts were on the same side that the wires exited, causing them to clip the wires a bit and shred off some of the insulation.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMb5HCoodPtMIYIyuhMX6e8hBrfGHTduoFpbSz0Ol5ml3zr4WZogoPX5uarphsYFcF-U0G9wlYMRMPyLsMhcrnd6mkseMoXrMoR36ZlSbpA_n_zCcHsB7-1KoCnFalG55yo5UFYDRRpJ4/s1600/2012-10-13_18-07-03_493.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMb5HCoodPtMIYIyuhMX6e8hBrfGHTduoFpbSz0Ol5ml3zr4WZogoPX5uarphsYFcF-U0G9wlYMRMPyLsMhcrnd6mkseMoXrMoR36ZlSbpA_n_zCcHsB7-1KoCnFalG55yo5UFYDRRpJ4/s640/2012-10-13_18-07-03_493.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I just put some additional heatshrink over the parts that were ripped up, and backed out and reversed all of the screws holding the motor together.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I had to extend my original front fork because the much thicker deck required a lot more ground clearance. I also had a bit of a problem because the original scooter's fork is made of welded sheet steel in geometries that are really hard to fasten to. Originally I'd intended to just drill holes in the steel, build an aluminum cage around it with bolts going all the way through both sides. I had also put a couple of haphazard hand-drilled holes through the original during Maker Faire, which made things a bit trickier.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-T2gXkeqQtTgRSidR_k7uo4AJOOjTdgZeOSs_l5Qnd5pG_5aAE2auVUeNDA5azcxSlb0C0k0Hwb7FL6xc9R6qAszL9y55xiOS3SmpnfwxzUz-QBNmfIHsaGCxScNod0amxeYApSNqP1g/s1600/Full+scooter+1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="344" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-T2gXkeqQtTgRSidR_k7uo4AJOOjTdgZeOSs_l5Qnd5pG_5aAE2auVUeNDA5azcxSlb0C0k0Hwb7FL6xc9R6qAszL9y55xiOS3SmpnfwxzUz-QBNmfIHsaGCxScNod0amxeYApSNqP1g/s640/Full+scooter+1.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I ended up not completely compensating for the bends in the original fork, so it refused to quite fit into its intended slot. I ended up just throwing the whole aluminum cage in the mill and attacking the corners with a giant endmill. The original fork took quite a lot of coercion (of the hammering variety) until it would fit in the cage, at which point the holes were no longer in alignment. I decided that due to how solidly it was pressed in and because it's only ever really getting loaded downward, I would just leave it sans through-bolts.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I added a throttle to my original handlebars, then some wiring and loctite, and it was done! The battery, motor controller, and motor were all identical to the previous iteration, so it handled about the same as the sketchy <a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtEx02XB3eQhRgQpb1zsfEvpy6l3QLM6H6aLtMnYedObJgi-Xps5VhjpgHiKpA3irU1fScTeJlojK3a3UdW2s_flXGETbfWQxkEUEqZChvQQDCbn3Ecb_0jXtIxOgpgRNVootYZd1pmjM/s1600/2012-09-09_21-54-01_484.jpg">Johnscooter conversion</a>, but it certainly felt better not having the battery just taped onto the deck.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Hopefully I can post a video of it cruising soon.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I've also spent the last month starting two new major projects, so I'll have posts for those written up shortly!</div>
Bankshttp://www.blogger.com/profile/06935190198890093740noreply@blogger.com0tag:blogger.com,1999:blog-7608932277558807083.post-69103876358417189012012-10-01T15:42:00.000-07:002013-03-11T12:43:08.742-07:00Big update part 1 of 2: Scooter progress!I feel sort of guilty about writing a blog post when I don't actually have any substantial progress done, so I've had a bit of a blogging hiatus while classes started up and my projects slowed down. However, at this point I've definitely gotten far enough to justify a blog post (well, a two-part one, you'll see a logical separation point here), so I'll just pick up where I left off last time:<br />
<br />
The battery!<br />
<br />
Well, as mentioned previously, I decided to go with a 12S 3P (12 cells in series and 3 of those in parallel, for 36 cells total) LiFePO<span style="font-size: xx-small;">4</span> chemistry battery, cells courtesy of an A123 donation to the MIT Electric Vehicles team. I started off just grabbing a big pile of battery cells and metering them to ensure they were at or close to their nominal 3.3V potential, then running hot glue down the sides and sticking the pack into the shape I wanted. Next, I started glomming solder down on the ends of the cells where I'd be connecting them.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSPRUfK6Q537RuEcknf3W1EYqOHDIAi5GtxDUT9xTO1zlAzb37W7vOFzRhTZa-T29SvDrLPCPhYTmYxaD3pcXaCCjDGpBs2rpodUiYKgbYTwYejyz7cFTeuiJrCm4Ebc_fP4pxMnF32lg/s1600/2012-09-08_19-06-02_922.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSPRUfK6Q537RuEcknf3W1EYqOHDIAi5GtxDUT9xTO1zlAzb37W7vOFzRhTZa-T29SvDrLPCPhYTmYxaD3pcXaCCjDGpBs2rpodUiYKgbYTwYejyz7cFTeuiJrCm4Ebc_fP4pxMnF32lg/s640/2012-09-08_19-06-02_922.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><br /></td></tr>
</tbody></table>
You can also see I've started to add thick copper braid to the cells on the left, which serves as the power line through the battery. I went ahead and connected each set of 3 cells in series, then soldered on small (24 gauge) balancing wires which were color coded for my own convenience. These wires allow the cells to be balanced individually to the same voltage when charging, and prevent degradation of your battery (or possibly exploding cells) which would result from trying to charge the pack while some cells were at significantly lower voltages than others.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCbcLfOZOQknEPyfNjdvjJtqZ3KZ31oMfWtSQasMWdKB4FReVo9GLwWGpPxqfS802BGXYFjMzKkK9tp7tWHOFhqy8aZ3_sB-5i76Jh3WOLtBtQT1h0Eitnd1yx6bhLQXZu0ND_jTcUVTw/s1600/2012-09-08_20-37-44_229.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCbcLfOZOQknEPyfNjdvjJtqZ3KZ31oMfWtSQasMWdKB4FReVo9GLwWGpPxqfS802BGXYFjMzKkK9tp7tWHOFhqy8aZ3_sB-5i76Jh3WOLtBtQT1h0Eitnd1yx6bhLQXZu0ND_jTcUVTw/s640/2012-09-08_20-37-44_229.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">I hot glued everything down to prevent it from shifting around</td></tr>
</tbody></table>
I then soldered on the main power outputs at the very front and back of the pack, and finally flipped everything over and repeated the same process using the braid to form the power line, only instead of balancing outputs I placed wires across the parallel points to help the battery discharge evenly.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhb55C6FRmWQmbNYSLwj3Ndjqqf7TFMeLiznd4oYqVL444ey7ei1itZH05h0-dsrFbd3ocPi29zbw23P0pD04rexSD3Gb9VNUMZPdhWQgsnD0vVnE_SssxHSFNqeS4CIEirQXkcc5bJ7eo/s1600/2012-09-08_22-48-39_958.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhb55C6FRmWQmbNYSLwj3Ndjqqf7TFMeLiznd4oYqVL444ey7ei1itZH05h0-dsrFbd3ocPi29zbw23P0pD04rexSD3Gb9VNUMZPdhWQgsnD0vVnE_SssxHSFNqeS4CIEirQXkcc5bJ7eo/s640/2012-09-08_22-48-39_958.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">You can see the gray wires equalizing the cells in parallel</td></tr>
</tbody></table>
Finally, I obtained some of the biggest heatshrink tubing I've ever seen, and slid the battery into it:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivwREvkKAoJu7O0aCUpXeOhvFWT85Cyg-z0rCdKUjnYMmzTX8ll_BJkmf3-QfRDih0emvKs9f3DaAN-iFsUXC_MXCbEzqnEK7j59Fg9R8kNU9g744jOM_1VqtLKJUsPXHeZzRmw6NcbJQ/s1600/2012-09-08_22-59-21_157.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivwREvkKAoJu7O0aCUpXeOhvFWT85Cyg-z0rCdKUjnYMmzTX8ll_BJkmf3-QfRDih0emvKs9f3DaAN-iFsUXC_MXCbEzqnEK7j59Fg9R8kNU9g744jOM_1VqtLKJUsPXHeZzRmw6NcbJQ/s640/2012-09-08_22-59-21_157.jpg" width="640" /></a></div>
<br />
Half an hour later (okay, maybe a <i>slight</i> exaggeration...) with a small heat gun:<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg77RAg-4DVAWUkNVjfaGz7hgEjFsV2F6yzGWQhvBzeXGrmJgCQTeo3TmpKhCOi9JWb6zMu2qb35oJK3DjAjhGjecXgeqU-G26xoSuPyKtJVILO9cUQjKU4U01Pww85gUY63VkdAcceHtU/s1600/2012-09-08_23-11-34_67.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg77RAg-4DVAWUkNVjfaGz7hgEjFsV2F6yzGWQhvBzeXGrmJgCQTeo3TmpKhCOi9JWb6zMu2qb35oJK3DjAjhGjecXgeqU-G26xoSuPyKtJVILO9cUQjKU4U01Pww85gUY63VkdAcceHtU/s640/2012-09-08_23-11-34_67.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-family: inherit;">Voilà!</span></td></tr>
</tbody></table>
A battery!<br />
<br />
Only... it turns out I forgot the middle power outputs, which basically break the battery up into two separate packs that can be charged individually at half the voltage of the entire pack, enabling balancing by most hobby chargers. Oops. Time for some battery-surgery.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-V5wbr1TvvTcHa8nHwiPfVZtkvnDvwU3IzDtOWKWuML7Ixc1msgYDBs9LLsovq8rT-dYfAofTWpIMvUt6JslXatht4effJ8SHEmOPJGWEnPYR2DjVAy_cev1bmkh5_jZgREoxSUQm2SY/s1600/2012-09-09_17-42-02_446.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-V5wbr1TvvTcHa8nHwiPfVZtkvnDvwU3IzDtOWKWuML7Ixc1msgYDBs9LLsovq8rT-dYfAofTWpIMvUt6JslXatht4effJ8SHEmOPJGWEnPYR2DjVAy_cev1bmkh5_jZgREoxSUQm2SY/s640/2012-09-09_17-42-02_446.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Here's the heatshrink cleanly separated at the top</td></tr>
</tbody></table>
I pulled the pack back out of the heatshrink, soldered on the other two sets of power output wires, and slathered hot glue over everything.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivwWkSxnTJ9CBupQiFZYuKOzx5MXmk_wAsK8DBktZZCh-ZURyPOT8ScQyDTj__lMDV6eJZw617DwD3G2W0pe8gH8Ip6srxBAZrWo1oygVtJBSjkN5KTiB6oun3oq0jMeKyD9pLepi-JxU/s1600/2012-09-09_19-03-32_938.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivwWkSxnTJ9CBupQiFZYuKOzx5MXmk_wAsK8DBktZZCh-ZURyPOT8ScQyDTj__lMDV6eJZw617DwD3G2W0pe8gH8Ip6srxBAZrWo1oygVtJBSjkN5KTiB6oun3oq0jMeKyD9pLepi-JxU/s640/2012-09-09_19-03-32_938.jpg" width="640" /></a></div>
<br />
Finally, I applied a new section of heatshrink, charged it up (in something on the order of 20 minutes. Turns out this ~6.6 Amp-hour pack can happily charge at 15-20A within ratings), and was possibly a bit over-eager to ride around with the extra power. The result?<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtEx02XB3eQhRgQpb1zsfEvpy6l3QLM6H6aLtMnYedObJgi-Xps5VhjpgHiKpA3irU1fScTeJlojK3a3UdW2s_flXGETbfWQxkEUEqZChvQQDCbn3Ecb_0jXtIxOgpgRNVootYZd1pmjM/s1600/2012-09-09_21-54-01_484.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtEx02XB3eQhRgQpb1zsfEvpy6l3QLM6H6aLtMnYedObJgi-Xps5VhjpgHiKpA3irU1fScTeJlojK3a3UdW2s_flXGETbfWQxkEUEqZChvQQDCbn3Ecb_0jXtIxOgpgRNVootYZd1pmjM/s640/2012-09-09_21-54-01_484.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Notice how the brake no longer looks functional? Yeah, the brake was no longer functional.</td></tr>
</tbody></table>
I successfully made everyone at MITERS cringe by mounting my battery exclusively with Gorilla tape. Don't worry, 100% legit engineering here.<br />
<br />
In the meantime, I actually received my <a href="http://www.ebay.com/itm/36V-350W-Brushless-E-bike-Controller-Without-Hall-/140858223776?pt=LH_DefaultDomain_0&hash=item20cbcdeca0">slightly more powerful shady Chinese brushless motor controller</a> in the mail, and immediately proceeded to snip off most of the useless cables on the box (powered brakes? side-lighting? Hah!), disassembled the case, and stuck a nice new coating of solder across the built-in current limiting resistor, halving its resistance and drastically increasing the output of the controller.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDUTe8rKrF_Ay0YkcFcO1-eAhd3yeKCFXVGj785B3Al9W9qRBKZfq92fdnM0TRWrqyZEKgEF0y4klxEPkSe9akVpzc1HLf8fXryjqdIJ0cnWJj1k5xeVaFuR0pgc5aOVZ_vTBKN2gN3JM/s1600/current+limiting+resistor.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDUTe8rKrF_Ay0YkcFcO1-eAhd3yeKCFXVGj785B3Al9W9qRBKZfq92fdnM0TRWrqyZEKgEF0y4klxEPkSe9akVpzc1HLf8fXryjqdIJ0cnWJj1k5xeVaFuR0pgc5aOVZ_vTBKN2gN3JM/s640/current+limiting+resistor.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Current limiting resistor circled red</td></tr>
</tbody></table>
I reassembled the case, applied motor controller to scooter, applied battery to motor controller, and guess what? Everything actually worked! My scooter received an immediate upgrade to scary-fast, and at 6.6Ah, the battery will last much longer as a result. Assuming an average consumption of about 600W going at 20mph, the ~43V pack should last for about 28 minutes, or a little over 9 miles.<br />
<br />
That's all for Part 1, but I'll throw in a sneak peak for next time right here:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4uvrQNsW_DcbVOPbPlVHv9dKM1AN92Js9tr-uOUHawHjNwJEghBzn-ebcPRDp82hhsodTM-FhGyWppKIUFAY572DU4yTrTn9VlunV1ivP43zwHsMjDthDpMDYXfcMpdG4S2Qz67ZQ9l4/s1600/Frame2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="340" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4uvrQNsW_DcbVOPbPlVHv9dKM1AN92Js9tr-uOUHawHjNwJEghBzn-ebcPRDp82hhsodTM-FhGyWppKIUFAY572DU4yTrTn9VlunV1ivP43zwHsMjDthDpMDYXfcMpdG4S2Qz67ZQ9l4/s640/Frame2.png" width="640" /></a></div>
<br />
Expect Part 2 to come in the couple weeks or so!Bankshttp://www.blogger.com/profile/06935190198890093740noreply@blogger.com0tag:blogger.com,1999:blog-7608932277558807083.post-89733002048093357102012-08-22T00:08:00.000-07:002013-03-11T12:43:08.746-07:00The long and (not so) tragic tale of the hub motor<div class="separator" style="clear: both; text-align: left;">
Alright, where to begin... I've spent most of the last week in the EC (my dorm) courtyard working on a variety of large Rush projects (showing the new freshmen what we're about with some large-scale engineering insanity), but I squeezed in a bit of time towards my <a href="http://omgitgoes.blogspot.com/2012/08/hub-motor-ohgodherewego.html">hub motor</a> because I really wanted to finish it before classes start.</div>
<br />
I knocked out the rest of the winding from about 2-3:30am leading up to my 5:30am flight:<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsLEIiglKYMVemaH7QLAEZfJ3RMDHTbismdKsw7itC85zg88u-Qz845pPZ3XXzxlDvbb0hlbF7tWeRXBWkj4p_GUMJEo_XVThIxAnF4B-JmYWk8hP4LJ8aAZQKIxnMwodTRSQ_KifECng/s1600/2012-08-11_03-07-59_294.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsLEIiglKYMVemaH7QLAEZfJ3RMDHTbismdKsw7itC85zg88u-Qz845pPZ3XXzxlDvbb0hlbF7tWeRXBWkj4p_GUMJEo_XVThIxAnF4B-JmYWk8hP4LJ8aAZQKIxnMwodTRSQ_KifECng/s640/2012-08-11_03-07-59_294.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="text-align: left;">Note that my C phases (top right and bottom left, here) look far cleaner, I got better at winding as I went</span></td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div>
Then, everything ever arrived! I carefully marked one end of each of my magnets with a Sharpie (it doesn't matter which end, just that I was consistent)</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgV08fGJz17Sw3WCI3272mkArWgRxpltQgHNrds5-H5sjOCxQBwhgjr1mokkRNv1GjAGVFUFzSGdGwodj6m8SuWXtJSQjWCB7ndI2f-jLrenUXSw6RpLTqVoCodEmRrELHCnxVxJEY2wZU/s1600/2012-08-13_18-06-14_321.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgV08fGJz17Sw3WCI3272mkArWgRxpltQgHNrds5-H5sjOCxQBwhgjr1mokkRNv1GjAGVFUFzSGdGwodj6m8SuWXtJSQjWCB7ndI2f-jLrenUXSw6RpLTqVoCodEmRrELHCnxVxJEY2wZU/s640/2012-08-13_18-06-14_321.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Shipped with plastic spacers so that they're actually, you know, separable...</td></tr>
</tbody></table>
<div style="text-align: left;">
I also got two 1" thick 4" diameter aluminum rods, a big sheet of 1/4" 1018 alloy steel (high magnetic permeability), a whole bunch of #4 screws and nylocks, and two 1/2" ID 1-1/8" OD sealed bearings. I decided to start with machining the aluminum into my endcaps, because the <a href="http://web.mit.edu/Edgerton/www/Shop.html">Edgerton shop</a> happened to be open, and they have Nice Machines.</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
I started by drilling a 1" hole with the most monstrous thing I've ever seen in a tail stock:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXXYY7660DfnjRTXtFOpAKIDlpIjTNDghXQsgEKH393qr-nC35tRVAAsXG6Rc0d17Sm3KrEJx7uAoTetv8AvNOGFs7adVAf_EvLPdDoX0hrUWbDq3SdBuu62EM54Ffl13PkjJw2Z1qUrw/s1600/2012-08-15_14-16-44_322.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXXYY7660DfnjRTXtFOpAKIDlpIjTNDghXQsgEKH393qr-nC35tRVAAsXG6Rc0d17Sm3KrEJx7uAoTetv8AvNOGFs7adVAf_EvLPdDoX0hrUWbDq3SdBuu62EM54Ffl13PkjJw2Z1qUrw/s640/2012-08-15_14-16-44_322.jpg" width="640" /></a></div>
<br /></div>
<br />
This gave me room to fit in a very large boring bar, so I could take big swaths out of the inside of the part to create the internal features. Here's the part with most of the dimensions rough-cut to about .02" from their final finishes:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmjne8924DtuXMRxR0dPb1ZAb1hbv2MojZNQFp8aoBMhk8XwUOlx41_UR_mM4A_FEjSkRB2aklpQWWKaDE3pKOc571jr1jvrXqoSRQqrVpEAco42HFRInrgHwo6MrU7YYARM5tDf8FFn8/s1600/2012-08-15_14-59-50_835.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmjne8924DtuXMRxR0dPb1ZAb1hbv2MojZNQFp8aoBMhk8XwUOlx41_UR_mM4A_FEjSkRB2aklpQWWKaDE3pKOc571jr1jvrXqoSRQqrVpEAco42HFRInrgHwo6MrU7YYARM5tDf8FFn8/s640/2012-08-15_14-59-50_835.jpg" width="640" /></a></div>
<br />
<br />
To get the feature which holds the bearing in place, I actually had to run the lathe in reverse and work the boring bar across the backside of my part:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfG8tphDp2RvOBi52LLYvFKZYKAP8TX1SohDnE54lKLN7SFd0zxpI9ydVPjE0eZLZ3JZeTCfCwg-5lgHHLXxNCKgUA_FbKV6PbUhKIZY2KxL7SP9eQrm9dxPEvZadHZRkTPHTjEwRlQXc/s1600/2012-08-15_15-21-15_885.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfG8tphDp2RvOBi52LLYvFKZYKAP8TX1SohDnE54lKLN7SFd0zxpI9ydVPjE0eZLZ3JZeTCfCwg-5lgHHLXxNCKgUA_FbKV6PbUhKIZY2KxL7SP9eQrm9dxPEvZadHZRkTPHTjEwRlQXc/s640/2012-08-15_15-21-15_885.jpg" width="640" /></a></div>
<br />
<br />
And here's the final pass which I did with a much smaller boring bar:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglB_LmY4qeKweIdqkkX0TmaFuGfcFuEJ59sppDGej0LVM9DvQQvAztwqD2B2P58UuyGSuzBdjfKdkbMfSvxBdxEiYXwZIBYx6C8EXIb6ywcCMEviUBt1ry-OKGAdQeRWL2MwN4BTwjizs/s1600/2012-08-15_15-37-00_221.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglB_LmY4qeKweIdqkkX0TmaFuGfcFuEJ59sppDGej0LVM9DvQQvAztwqD2B2P58UuyGSuzBdjfKdkbMfSvxBdxEiYXwZIBYx6C8EXIb6ywcCMEviUBt1ry-OKGAdQeRWL2MwN4BTwjizs/s640/2012-08-15_15-37-00_221.jpg" width="640" /></a></div>
<br />
<br />
Yay! Now, for the holes which I've been dreading...<br />
<br />
Actually, I was very happy to discover that Edgerton's CNC-capable mills have a circular hole pattern function built in, where you just zero the machine on the center of your part, enter in your pattern parameters, and hit go!<br />
<br />
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0lfD10xV1lQ74t4KqoTL7MbjrA2RP73FwRCZtCtOH-ca4fW4js_ctFE87TUGre_cXVkiFWKI_7SgYo0BcWQYaN6qcerQTNhFqxaG1XOjr-a6GLThEYUbLFmLwpMY_u75TYvqAoOeL0EA/s1600/2012-08-15_16-48-19_227.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0lfD10xV1lQ74t4KqoTL7MbjrA2RP73FwRCZtCtOH-ca4fW4js_ctFE87TUGre_cXVkiFWKI_7SgYo0BcWQYaN6qcerQTNhFqxaG1XOjr-a6GLThEYUbLFmLwpMY_u75TYvqAoOeL0EA/s640/2012-08-15_16-48-19_227.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Post-magic shot </td></tr>
</tbody></table>
<div style="font-size: 13px;">
<div style="text-align: center;">
<br /></div>
</div>
<div style="text-align: left;">
After machining both endcaps, I went ahead and <a href="http://en.wikipedia.org/wiki/Water_jet_cutter">Magic'd</a> my can out of my 1/4" steel plate:</div>
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; font-size: 13px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEje4PT_9q5CayYiUR3nIGV3RKp5HIyqda2FVdb78iegz88Fnf1W8xD-RHjiW6NYZeF1uFFLeybbzTPQytT1daEfqdAGa24-uITzNGuyIgYBuxJgRneKrKLadUPmY3mM7FIWs0utig6e_w8/s1600/2012-08-20_18-41-55_786.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEje4PT_9q5CayYiUR3nIGV3RKp5HIyqda2FVdb78iegz88Fnf1W8xD-RHjiW6NYZeF1uFFLeybbzTPQytT1daEfqdAGa24-uITzNGuyIgYBuxJgRneKrKLadUPmY3mM7FIWs0utig6e_w8/s640/2012-08-20_18-41-55_786.jpg" width="640" /></a></div>
<div style="font-size: 13px; text-align: left;">
<br /></div>
<div style="font-size: 13px; text-align: left;">
<br /></div>
<div style="text-align: left;">
I had to file down a couple of the slots to fit magnets better, but overall the can didn't require much finishing on my end. Anyway, with most everything else completed, I decided to move on to wiring connectors onto my stator. I realized that the slot I'd cut into my axle wasn't going to be deep enough to allow 16 gauge wire to pass through, so I had to mill it wider. I just eyeballed this one, since precision isn't a factor and it doesn't need to look pretty.</div>
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; font-size: 13px;">
</div>
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnDRs_aFJS5WF4yE2WZManZAIR2rSatkt92HViKj-llDn3YRPB2U9Ib2-mqgHFytMxR00iMsoSfLfjrpyXyWOCVTpgnq2GBSP7RqzpRphx6NczE845FGdapiqnUxFiIdHHt6mKmUPvC6M/s1600/2012-08-19_00-18-22_330.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnDRs_aFJS5WF4yE2WZManZAIR2rSatkt92HViKj-llDn3YRPB2U9Ib2-mqgHFytMxR00iMsoSfLfjrpyXyWOCVTpgnq2GBSP7RqzpRphx6NczE845FGdapiqnUxFiIdHHt6mKmUPvC6M/s640/2012-08-19_00-18-22_330.jpg" width="640" /></a></div>
<br />
<div style="font-size: 13px;">
<br /></div>
<div style="text-align: left;">
<div>
<br /></div>
<div>
And with the bearing fit on over the wires:<br />
<div>
<br /></div>
</div>
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtRjsY_lZ2opmzvovjwn45JQsRG8tUO-YMXgUFJqCj1pvBOGo-i6oZ6437QQ-RlN1Nmrp3Txk_LtFkPXd9rLMje4LIq2SJgIvXOfL0dvkiGUipec6lwFT4y5o4YiOCH7knK42xEnx3XpQ/s1600/2012-08-19_00-44-09_939.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtRjsY_lZ2opmzvovjwn45JQsRG8tUO-YMXgUFJqCj1pvBOGo-i6oZ6437QQ-RlN1Nmrp3Txk_LtFkPXd9rLMje4LIq2SJgIvXOfL0dvkiGUipec6lwFT4y5o4YiOCH7knK42xEnx3XpQ/s640/2012-08-19_00-44-09_939.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">I had to mash these down with some pliers to get them to lie flush, but they did comply <i>eventually</i>.</td></tr>
</tbody></table>
<div style="text-align: left;">
<br />
<br />
Okay, time to actually place magnets! I just used superglue because I didn't want to wait on epoxy to cure, but it still ended up being something of a lengthy process. I started out with the screws in for alignment, but after I'd gotten several of the magnets in they held the can together pretty rigidly.</div>
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk3lOzFacaSD6A86H-SygLFsZXFydzz3wBFwxmZQtPwecHN7qPqfS3tg6lVE28NFTXs4VqScp9g4kOyX2Uao_w5_VW_ssJizEPPMhBpyASD5sqgWQ-DhZ_NmVbsZIqvlAcfdW-Rd5ZigM/s1600/2012-08-20_19-00-34_923.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk3lOzFacaSD6A86H-SygLFsZXFydzz3wBFwxmZQtPwecHN7qPqfS3tg6lVE28NFTXs4VqScp9g4kOyX2Uao_w5_VW_ssJizEPPMhBpyASD5sqgWQ-DhZ_NmVbsZIqvlAcfdW-Rd5ZigM/s640/2012-08-20_19-00-34_923.jpg" width="640" /></a></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
Some of the way into this process I made a very poor decision and wanted to find out if the clearance between the magnets and the stator was actually large enough to prevent them from scraping.</div>
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtqCIWwjcr8e2W4PzpGwPPevopVUIilxE8SIpDQ2l6faK2f41uTbfN9duVNW-3E9WNAcYKcYuGYKEDe6wI2vxiwDcCmedyEIp61LGKcYJW3HH8Gr0W1HwkKD4jAMF7Cg7bD96PwYHhtX0/s1600/2012-08-20_19-07-06_452.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtqCIWwjcr8e2W4PzpGwPPevopVUIilxE8SIpDQ2l6faK2f41uTbfN9duVNW-3E9WNAcYKcYuGYKEDe6wI2vxiwDcCmedyEIp61LGKcYJW3HH8Gr0W1HwkKD4jAMF7Cg7bD96PwYHhtX0/s640/2012-08-20_19-07-06_452.jpg" width="640" /></a></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
My shirt got a bit eaten in the process. Oh well, at least the clearance was good! Anyway, here's both halves of the can, which I later stuck together using J-B weld due to its magnetic properties (the steel paste wicks into the gap between the can halves and creates a pathway for the magnetic field between the closest two magnets).</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPn2HxqTehSCbYVdHRTDB-G6IyxGxHW0sx0RlIiKM6nCHfEReL_SM_gZeGRoq5yQdTnmM8QaTbv2baYtTEc9H7MxYbeckxXRsxYjsrGsz0gcPbLUaxSOC74crF11r2eXriM-SJoVx_4Go/s1600/2012-08-20_20-00-00_257.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPn2HxqTehSCbYVdHRTDB-G6IyxGxHW0sx0RlIiKM6nCHfEReL_SM_gZeGRoq5yQdTnmM8QaTbv2baYtTEc9H7MxYbeckxXRsxYjsrGsz0gcPbLUaxSOC74crF11r2eXriM-SJoVx_4Go/s640/2012-08-20_20-00-00_257.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I then bored out the core of one of my scooter wheels (oh yeah, the <a href="http://www.walmart.com/ip/Razor-Cruiser-Scooter-Malibu/10929206">scooter </a>I bought shipped) to be a good press-fit with the larger center can segments, and pressed it on:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjP529ad-gSvyk1YxFkHFRIFbOd4F9nNAf4PLYniqzDHDHSlfK0waaSCTspT2hEB2wHeEUpXHjjdLW9MCcCJ-DuXUvjFA57pGWbFeoOXb5BEhUgl33EbVs5lPb_CYNAUirajkpoT6kh3e8/s1600/2012-08-20_23-31-41_998.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjP529ad-gSvyk1YxFkHFRIFbOd4F9nNAf4PLYniqzDHDHSlfK0waaSCTspT2hEB2wHeEUpXHjjdLW9MCcCJ-DuXUvjFA57pGWbFeoOXb5BEhUgl33EbVs5lPb_CYNAUirajkpoT6kh3e8/s640/2012-08-20_23-31-41_998.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Starting to look like something now. Well, time to actually place the stator into the can! And when I say place, I mean "oh god lower it slowly and not by hand otherwise explosion and death". Here's a picture of my somewhat hilarious looking rig to accomplish this:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXhx_2XNmC95sjOsk0wlxyfaVfCx4-eA0jrZPhePMwcb7widDq1abCYvi3bVr3JS_hv2-aokogbIu-DBKngLdL-1G2K29GVwSagLartpG5wITPSarTrAOHkWaoLMoDpQMjTppU6qnE9Ok/s1600/2012-08-20_23-39-51_846.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXhx_2XNmC95sjOsk0wlxyfaVfCx4-eA0jrZPhePMwcb7widDq1abCYvi3bVr3JS_hv2-aokogbIu-DBKngLdL-1G2K29GVwSagLartpG5wITPSarTrAOHkWaoLMoDpQMjTppU6qnE9Ok/s640/2012-08-20_23-39-51_846.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I put a bolt on the end of the axle and then chucked it into a drill press to lower it carefully and in control. The strength of the magnets was actually shifting the drill press table, the clamp, and the vise all around in order to force itself into alignment with the stator.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Immediately after dropping the stator into the can, I realized that I hadn't remembered to actually align the holes, and sure enough they were completely off. Well. Time to get creative? I used the dual-vise method (what, you think I have vise-grips that big?) to force the can around and align it with the holes in the cap.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlhs0lhL7KrN6mbWTxDwCKNkJT3493c1yOpoFkYRgdgz8dEC7p6ow4-pOlk5jAk0MdBwdYOZ-9hY6otGqGr6skXhrEK43jww_pRYVQlBBHRu8NihTJ10fJrFtvkCRAgoGS2B86bF7dr74/s1600/2012-08-20_23-50-00_217.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlhs0lhL7KrN6mbWTxDwCKNkJT3493c1yOpoFkYRgdgz8dEC7p6ow4-pOlk5jAk0MdBwdYOZ-9hY6otGqGr6skXhrEK43jww_pRYVQlBBHRu8NihTJ10fJrFtvkCRAgoGS2B86bF7dr74/s640/2012-08-20_23-50-00_217.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">I wish I could tell you this was the lulziest rig I used all night, but sadly...</td></tr>
</tbody></table>
<div class="separator" style="clear: both; font-size: 13px;">
<br /></div>
<div class="separator" style="clear: both;">
Alright, almost done! Now to just put the other endcap on and tighten a few screws...</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxqzFQ2a_3OyAcNQ6yE6EMletyq4gdIFnhgOdfAjF-2hrAbS7WWhh9k1jHPBzbomhHWQsi_qXBCqWGsjBDVFoWSdkQrbIXhpxYKn0v_tj21ZNJSmZojhfGP8fDryzgA2thmPJcsmLR2iw/s1600/2012-08-20_23-56-07_519.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxqzFQ2a_3OyAcNQ6yE6EMletyq4gdIFnhgOdfAjF-2hrAbS7WWhh9k1jHPBzbomhHWQsi_qXBCqWGsjBDVFoWSdkQrbIXhpxYKn0v_tj21ZNJSmZojhfGP8fDryzgA2thmPJcsmLR2iw/s640/2012-08-20_23-56-07_519.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; font-size: 13px;">
<br /></div>
<div class="separator" style="clear: both; font-size: 13px;">
<br /></div>
<div class="separator" style="clear: both;">
And bolt it to a random plate to actually take it for a spin...</div>
<div class="separator" style="clear: both;">
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkVJMB4ZKg4Q4ZLUM2yAPEC5oe-_NrG3np96zHWbTFbekaHVb96kcGOvBeBnSR6YoOUMjuiuBwWo1WiVwrU9FE9IbznqRMXSLmPAxaQooVHavjVobhgC2a04t2J3nlitJjBj2TOxhQXxE/s1600/2012-08-21_00-08-56_370.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkVJMB4ZKg4Q4ZLUM2yAPEC5oe-_NrG3np96zHWbTFbekaHVb96kcGOvBeBnSR6YoOUMjuiuBwWo1WiVwrU9FE9IbznqRMXSLmPAxaQooVHavjVobhgC2a04t2J3nlitJjBj2TOxhQXxE/s640/2012-08-21_00-08-56_370.jpg" width="360" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">You can see <a href="http://scolton.blogspot.com/">Shane </a>in the background hooking up an airplane ESC to a power supply to drive my motor</td></tr>
</tbody></table>
<div class="separator" style="clear: both;">
And... crap. It just sort of jerks around and it's quite hard to spin by hand. <a href="http://www.etotheipiplusone.net/">Charles</a> identified the motion as consistent with when he placed one of the magnets backwards in a motor, so I took everything back apart. Yes, that means this again:</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpyvPdPKG7oe8evKQyPWhMFDYiyebZoT2BVEZdI6Us3a9kqoRyp-VFzGsRS2ANdVlJmSlO_UoNZkqHbGRRKjq_7cG5agKAJpWMlUBo3L52tyrcxA0l59M31WzwSvof-eJrGvdAxAPqE-8/s1600/2012-08-21_03-01-42_629.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpyvPdPKG7oe8evKQyPWhMFDYiyebZoT2BVEZdI6Us3a9kqoRyp-VFzGsRS2ANdVlJmSlO_UoNZkqHbGRRKjq_7cG5agKAJpWMlUBo3L52tyrcxA0l59M31WzwSvof-eJrGvdAxAPqE-8/s640/2012-08-21_03-01-42_629.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; font-size: 13px;">
<br /></div>
<div class="separator" style="clear: both; font-size: 13px;">
<br /></div>
<div class="separator" style="clear: both;">
I identified the incorrect magnet using one of my spares and checking which had the wrong orientation, and then chiseled it out with a hammer and small flathead screwdriver. I glued in a new magnet, this time in the correct orientation, and placed the stator back into the can. And tried to run it again. And... Crap. Again. This time it would rotate almost a full revolution and then suddenly kick back, as well as still being difficult to rotate by hand. Apparently this was consistent with when <a href="http://www.etotheipiplusone.net/">Charles</a> wound one half of a phase backwards (i.e. two teeth are wound incorrectly). Evidently he's encountered most of the problems you can find while building hub motors, which is fortunate considering that I'm managing to experience most of them on my first build alone. Well, back to the drill press.</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
Fortunately, the fix wasn't as terrible as I'd initially anticipated, because I only had to swap the lead of one tooth from star point to input, and the opposite for the other. After that, I got to put the stator back into the can one final time, reassembled everything and tested it out:</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/7rnqr2xZHc0?feature=player_embedded' frameborder='0'></iframe></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
Yay! It actually works! Now to mount it in a scooter...</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
Fortunately, <a href="http://www.etotheipiplusone.net/?page_id=2117">Johnscooter</a> had been lying about rather dejectedly, so I got the honors of dropping my motor into it to ride it around. There was, however, a small problem: my motor is about 1/8" wider than the mount at the back of Johnscooter. Time for the double-clamp-spreader-clamp! Amidst cries of "oh god no" and "that is a terrible idea", this monstrosity happened:</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNeL2FgXcLBF4dTNxKQrQPDr_hl6_kUSkD3HwWOOZ0R6ta5JzjO1sDWcJiF8ESDf592RUu0yZa-JdEQgBFaeewQDqCHJ_JaesymK7TiCTbgDgcJMyDIS6-GUH4Auj04FqM9AzqbVoSwrg/s1600/2012-08-21_03-26-09_393.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNeL2FgXcLBF4dTNxKQrQPDr_hl6_kUSkD3HwWOOZ0R6ta5JzjO1sDWcJiF8ESDf592RUu0yZa-JdEQgBFaeewQDqCHJ_JaesymK7TiCTbgDgcJMyDIS6-GUH4Auj04FqM9AzqbVoSwrg/s640/2012-08-21_03-26-09_393.jpg" width="640" /></a></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
And, well, it actually worked. Here's a final picture of the motor bolted onto the frame:</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1tBDYRYOW3dzUwxJ3qNBqWaPcIlygkIpH52P136KTTaEJTBbjrsFIAEq8IMeg62MVIqn5ymIJEM0tM4o7YnBQEx6-ALSscx0Bsg3zi9uIfCEx9-ckf3otvEMW4IAfpDRbDuQ_GXeIVCw/s1600/2012-08-21_03-40-16_79.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1tBDYRYOW3dzUwxJ3qNBqWaPcIlygkIpH52P136KTTaEJTBbjrsFIAEq8IMeg62MVIqn5ymIJEM0tM4o7YnBQEx6-ALSscx0Bsg3zi9uIfCEx9-ckf3otvEMW4IAfpDRbDuQ_GXeIVCw/s640/2012-08-21_03-40-16_79.jpg" width="640" /></a></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
And a video of me taking it for a quick spin:</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/nLkbSE18hL4?feature=player_embedded' frameborder='0'></iframe></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
Fortunately, the "tokka tokka tokka" noise evidently resolved itself shortly after this was taken. Also note that I'm using a placeholder motor driver here which is outputting about 500W, the final one I'll be using will be capable of something more like 1000W. Overall though, looks good!</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
Next I'll make a big battery pack, I'm thinking of 3 packs of 12 A123 cells each, which should provide quite a substantial amount of battery life (and at ~40V nominal, no less). I'm also going to be making a full custom scooter frame, <i>hopefully</i> before classes start. It might be a couple weeks until I post again, given that my time is going to get progressively more eaten by Rush, but I promise that as soon as I finish my custom frame I'll write it up!</div>
Bankshttp://www.blogger.com/profile/06935190198890093740noreply@blogger.com0tag:blogger.com,1999:blog-7608932277558807083.post-33333725120707274122012-08-08T21:05:00.000-07:002013-03-11T12:43:08.738-07:00Hub motor! (ohgodherewego)Since clearly I wasn't feeling MITERS-y enough having built just a <a href="http://omgitgoes.blogspot.com/search/label/Derpcopter">quadcopter</a>, I opted to tackle a scooter as well. (Okay, that's kind of false, really I've been wanting a faster way around campus for a while and <a href="http://www.etotheipiplusone.net/">Charles</a> had a super giant <a href="http://en.wikipedia.org/wiki/Brushless_DC_electric_motor">BLDC</a> motor stator he threw my way on the cheap).<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhL3UEYNpV-a7kYROfCjhtJTbhlI-GuGf1VoRncoB6p8bNQfhmYjIA9lHAavwoRfROeIdavc6BLq0gzT__LzglPam2Ig7AUalJQQ27NoQWBANlKvghXJchYkOZbBxPoIIoN02g1B4EMkuw/s1600/2012-07-26_16-26-39_418.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhL3UEYNpV-a7kYROfCjhtJTbhlI-GuGf1VoRncoB6p8bNQfhmYjIA9lHAavwoRfROeIdavc6BLq0gzT__LzglPam2Ig7AUalJQQ27NoQWBANlKvghXJchYkOZbBxPoIIoN02g1B4EMkuw/s640/2012-07-26_16-26-39_418.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td class="tr-caption" style="font-size: 13px;">68mm x 38mm 12 tooth stator in all its massiveness</td></tr>
</tbody></table>
</td></tr>
</tbody></table>
<br />
Also of interest is <i>how</i> I'm building a scooter, which as far as I can tell amounts to approximately the weirdest way that one could possibly conceive of/design a scooter - I'm designing a scooter <i>around a motor</i> which in turn I'm designing <i>around a stator</i>. The only reason for this is that I just happened to acquire a stator before anything else (generally just getting a stator that matches your other constraints is probably a good idea).<br />
<br />
If you'd like a crash course in BLDC motors, read the <a href="http://www.instructables.com/id/Make-Your-Own-Miniature-Electric-Hub-Motor/?ALLSTEPS">really super handy hub motor Instructable</a>. No, really. Read it. Basically the stator is a big chunk of iron made up of a bunch of thin iron sheets which are then laminated together, and epoxy (that green stuff) is slathered all over the inside. The sheets/lamination allow for a high degree of magnetic permeability in the radial direction and much less in the axial, which helps direct the magnetic fields generated by the coils outward, towards the motor can/permanent magnets (don't worry, I'll show you what these are in a second!) and back inwards towards the next coil.<br />
<br />
So, without further ado - the actual motor!<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVHSxQNhkNs6skg6sGYKmfk5NAhYWgVhpyIX2cOs1Box1kxTPx7dFjYJBSaw2daboShwkY29W-CMqljub_Qg9zLnY1gvUDXvZOw9yYewejFHnB3wE0ooJyd6Ag26yma2VnIBq3zBS0IW4/s1600/Motor+with+coils.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVHSxQNhkNs6skg6sGYKmfk5NAhYWgVhpyIX2cOs1Box1kxTPx7dFjYJBSaw2daboShwkY29W-CMqljub_Qg9zLnY1gvUDXvZOw9yYewejFHnB3wE0ooJyd6Ag26yma2VnIBq3zBS0IW4/s640/Motor+with+coils.JPG" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Together and with kinda transparent endcaps</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCFjggHPkzF6FjEpV6UIRVGKRlPZ621h0OgE60eCT-T8CBUknPgzu8FRsYLi1Zb5ywE20Ck3PXUFXmolmWMPTf5AsaQOccSPJcvRaAumdqNYJye7Xpm9njrlIcF-PvNq93VvH9LzmmyWI/s1600/Final+motor+with+coils+exploded.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCFjggHPkzF6FjEpV6UIRVGKRlPZ621h0OgE60eCT-T8CBUknPgzu8FRsYLi1Zb5ywE20Ck3PXUFXmolmWMPTf5AsaQOccSPJcvRaAumdqNYJye7Xpm9njrlIcF-PvNq93VvH9LzmmyWI/s640/Final+motor+with+coils+exploded.JPG" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Fancy exploded view!</td></tr>
</tbody></table>
<br />
So, from left to right, we have:<br />
<ol>
<li>Left endcap</li>
<li>Left bearing</li>
<li>Axle</li>
<li>Tire/wheel</li>
<li>Can</li>
<li>Magnets</li>
<li>Stator (shown with coils)</li>
<li>Right bearing</li>
<li>Right endcap</li>
</ol>
<div>
The endcaps are to be turned from solid aluminum stock, the bearings are 1/4" ID 1-1/8" OD high-load sealed McMaster bearings, the axle was turned from a giant aluminum rod found lying in MITERS scrap, the wheel... well, we'll get to the wheel a bit later, the can is a solid steel tube with channels for screws to pass through, and the magnets are 1-1/2" x 1/2" x 1/8" high strength rare-earth neodymium.</div>
<div>
<br /></div>
<div>
Let's get on with the first machining work for the project, the axle:</div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRLe62fVc4PuZ-5sjlUAS9__WpyoNHALpvb1Ka4rtu2mTVJnCweO5a2FLsdWRLbF0ALRc3NFOPWJ4b8j7EIvg5Qk9knSRpGSROb6NVsUNEV1_9YaU2Yhvqn3AkWUvLEtIlkUK08E5gxIk/s1600/2012-07-29_10-41-50_929.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRLe62fVc4PuZ-5sjlUAS9__WpyoNHALpvb1Ka4rtu2mTVJnCweO5a2FLsdWRLbF0ALRc3NFOPWJ4b8j7EIvg5Qk9knSRpGSROb6NVsUNEV1_9YaU2Yhvqn3AkWUvLEtIlkUK08E5gxIk/s640/2012-07-29_10-41-50_929.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Note that this is AFTER a significant portion of material has already been removed</td></tr>
</tbody></table>
<div>
<br />
Here you can see a giant chunk of pre-axle aluminum, chucked into one of the super classy lathes at the <a href="http://web.mit.edu/Edgerton/www/Shop.html">Edgerton student shop</a>. I did some huge passes until I got close to the flange sticking out of the left end of the axle (rendered above in the exploded view), which serves to easily place the axle into the stator without worrying about positioning it. I then worked the right end of the axle down to the correct sizes, arbitrarily deciding that I'd treat the end currently chucked as the left side. Finally, I drilled out the end with a #7 drill bit (.201") so I could put 1/4"-20 threads in it later.</div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDZzQPrCi4z_0TZFyCqSKn9mC1zCKRomDBhMtPe7x2mM4GuuWuSb1U9-270WI-JoM1mxnbanuIsIb9sylyAnjnIskdhCnmfdSO7xsWmIatHHGqgY4mw3CYJuw_JyGlwVFl88Kcfkm9p1M/s1600/2012-07-29_11-38-00_624.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDZzQPrCi4z_0TZFyCqSKn9mC1zCKRomDBhMtPe7x2mM4GuuWuSb1U9-270WI-JoM1mxnbanuIsIb9sylyAnjnIskdhCnmfdSO7xsWmIatHHGqgY4mw3CYJuw_JyGlwVFl88Kcfkm9p1M/s640/2012-07-29_11-38-00_624.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">This thing spawned an incredible amount of aluminum chips</td></tr>
</tbody></table>
<div>
<br />
I then flipped the part and chucked the center to finish off the left side as well:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4UIUYnmW4CqL3MKE8ejOU8GgBq0BqIrJKsT9AZW_7Pi760VO9xUNSf3Ih45R_g7LWm8x2AFvGWsYfiM6Io0FuVkEmDCEeQeTNQ0pxgcwuR0s7lYHvrKEaXPimXhPIHbkS_mjumR4Ah4g/s1600/2012-07-29_12-06-09_405.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4UIUYnmW4CqL3MKE8ejOU8GgBq0BqIrJKsT9AZW_7Pi760VO9xUNSf3Ih45R_g7LWm8x2AFvGWsYfiM6Io0FuVkEmDCEeQeTNQ0pxgcwuR0s7lYHvrKEaXPimXhPIHbkS_mjumR4Ah4g/s640/2012-07-29_12-06-09_405.jpg" width="640" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
I decided that I didn't want the axle to be press-fit with the stator because then it's less easy to take out/replace and I don't trust press-fits quite as much as axle pins. Thus, of course I had to do it the Classy Way and machine a rounded channel to stick a pin through. I threw the axle on a mill, cut out the channel for the output wires to escape from, and like 8 slooowwww eyeballed passes of a 1/16" ball mill later I had a reasonably good approximation of a 2mm pin channel.</div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizveooCdOUTOZNw587Yn1agAfbYaI3NspT_spU4VfxOZZDvDkl6oGE63rVO8Gu7AGwT6PuHdD_ziPiroTnxb97UyV5aYboL-sJpe57RKaIx8-xlCq5OZH66TTYSLWSEc1Xe4whfbGPAVM/s1600/2012-07-29_13-15-46_93.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizveooCdOUTOZNw587Yn1agAfbYaI3NspT_spU4VfxOZZDvDkl6oGE63rVO8Gu7AGwT6PuHdD_ziPiroTnxb97UyV5aYboL-sJpe57RKaIx8-xlCq5OZH66TTYSLWSEc1Xe4whfbGPAVM/s640/2012-07-29_13-15-46_93.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Did I mention how much cutting oil I went through?</td></tr>
</tbody></table>
<div>
<br />
And a couple shots of the finished product:</div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMH4Ov8VgB6RnQPuI2hMBXNBLA-J1qXdrM93M5CBqKPd3ol92A-ApTrlOioB31Lhr3zPu4DfvvOLWg9kM-X7hynZgoR-zfXnsTDCsXqoGAgDkmBimS70g5exuMr1Oh8O5l5Rm3gaC8xA0/s1600/2012-07-29_14-12-07_147.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMH4Ov8VgB6RnQPuI2hMBXNBLA-J1qXdrM93M5CBqKPd3ol92A-ApTrlOioB31Lhr3zPu4DfvvOLWg9kM-X7hynZgoR-zfXnsTDCsXqoGAgDkmBimS70g5exuMr1Oh8O5l5Rm3gaC8xA0/s640/2012-07-29_14-12-07_147.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Shiny!</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_W8YDIO_wx8CTvr1-MI4-0Kzk0cVNfGqKgNzwzZ9muwZqXNjEnN_thNL7KmYaamu_ANd5QXYNpCmdwVB2wWMRw9hXFhMlAeJu5qs0Axgy2CQZcCQFVr5hv6b9PA1PV1ubzcMECoCI66s/s1600/2012-07-29_14-23-13_931.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_W8YDIO_wx8CTvr1-MI4-0Kzk0cVNfGqKgNzwzZ9muwZqXNjEnN_thNL7KmYaamu_ANd5QXYNpCmdwVB2wWMRw9hXFhMlAeJu5qs0Axgy2CQZcCQFVr5hv6b9PA1PV1ubzcMECoCI66s/s640/2012-07-29_14-23-13_931.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">You can't see the pin, but trust me it's there. And yes, it's just the unfluted half of a #47 drill bit. Whoops.</td></tr>
</tbody></table>
<div>
<br />
Threads were added to the ends a bit later.</div>
<div>
<br /></div>
Alright, as for the down-and-dirty motor-y bits: coils are on 3 independent phases - the A, B, and C phases. Each phase, in turn, has two each of both capital and lowercase winds (where capital indicates one chirality and lowercase indicates the opposite), so if you were to write out a typical (dLRK if you know what that means) winding 'scheme' it would look like this: A a b B C c a A B b c C. Note how there's one letter for each tooth, and in my case I used capitals for clockwise and lowercase for counterclockwise. I calculated I'd need about 88 winds per phase to get the amount of torque I want (how? <a href="http://www.instructables.com/id/Make-Your-Own-Miniature-Electric-Hub-Motor/?ALLSTEPS">READ IT</a>) and I decided I could probably cram that much 20 gauge wire around each tooth. This was a bit of a mistake, as I discovered when I tried to wind it in series with two strands of 20 gauge and found that I couldn't quite manage to pack it in close enough. After failing at winding this in series, I settled on a parallel winding scheme to make winding the motor physically easier. The capital teeth all connect to a common "star" point and the lowercase teeth each go to their respective letter's output cable. With the parallel approach, instead of 22 turns with two strands of 20 gauge wire it's 44 turns of one strand of 20 gauge, which is a bit physically easier to manage.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2XAtn76HHmVl4id-aiM9RDTfcStGlmrvf1Wam8OPp5KiJNG5-ahAPKB9uLc5pHh1_AKR63XHyHwqUaZmxR6YsTPaYDdmVHIzjeioX-Z938Bs__ugxt691JOxICZlDS-GZymZ2L67f64k/s1600/2012-08-01_17-04-06_221.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2XAtn76HHmVl4id-aiM9RDTfcStGlmrvf1Wam8OPp5KiJNG5-ahAPKB9uLc5pHh1_AKR63XHyHwqUaZmxR6YsTPaYDdmVHIzjeioX-Z938Bs__ugxt691JOxICZlDS-GZymZ2L67f64k/s640/2012-08-01_17-04-06_221.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">As you can see, "a bit" easier still isn't <i>easy</i></td></tr>
</tbody></table>
<br />
Well, it was a fun several hours of wrestling wire into areas smaller than it wanted to go, and after the experience I have a few pieces of advice for anyone else wanting to do this:<br />
<br />
<ul>
<li>MAKE SURE that your iron core is fully epoxied everywhere the magnet wire will be coiled around. If you see a gap then seal it with super glue otherwise you'll be stripping coating off the wire and causing a short</li>
<li>Take a small wooden dowel to pack down your windings to create more room. I ended up whittling the end of one down as I went so I had something small and pointy to manipulate the wire with. DON'T use a metal flathead screwdriver/metal anything else to do this, or you WILL strip off your coating and have to restart</li>
<li>Measure (multimeter) and make sure your windings aren't shorted to each other/your axle/the stator core as you finish them, so you don't have to redo them later</li>
<li>Double (and triple, and quadruple) check your chiralities before you start wrapping! Make sure you stay consistent with direction between your windings</li>
</ul>
<div>
I only got as far as 8 teeth wound (2/3rds done!) before I was somewhat displaced from the area I was winding in. I'm going to finish while I'm at home Friday, I promise! I don't want to let this hang over me when I'm back in Boston starting Saturday.</div>
<div>
<br /></div>
<div>
Anyway, here's where I'm at:</div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5QHTbmiiKAdOgjaNEkCWeQSOaH_1CU0KdkLuik3RZhvCOVenPRC_zhL53nCSuZMhOep4uOiIotV2KfPJi9prmTFcTPeZKub3X7xI0XBg5HdjrmI3uE1JwS3TnSkrIwNEJi5yArQtG0Yo/s1600/2012-08-01_23-39-58_163.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5QHTbmiiKAdOgjaNEkCWeQSOaH_1CU0KdkLuik3RZhvCOVenPRC_zhL53nCSuZMhOep4uOiIotV2KfPJi9prmTFcTPeZKub3X7xI0XBg5HdjrmI3uE1JwS3TnSkrIwNEJi5yArQtG0Yo/s640/2012-08-01_23-39-58_163.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">A couple of the teeth look downright disgusting, but if it works, it works!</td></tr>
</tbody></table>
<div>
<br />
tl;dr if anyone links me <a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7tfPoZD8jhMoA6CybUSjqT5mSsjSaEo8WejXkxWHA7onslBqYFrLmXfeJf97pvcWF_WDWsmosBlUOS2LFB7hft0d7OaT4BVWtxSz271g7JJ6ZNrMMiXz7mUyEbrbAlLaWhgK51diP71w/s640/blogger-image--695324002.jpg">this</a> or <a href="http://www.etotheipiplusone.net/pics/sc2/sc2_104.jpg">this</a> I may get slightly irritated. It's quite possible I'm terrible at the whole patience thing.</div>
<div>
<br /></div>
<div>
Anyway, now that I'm at a bit of a stalled point as far as windings go, I decided to go ahead and order the scooter I want - <a href="http://www.walmart.com/ip/Razor-Cruiser-Scooter-Malibu/10929206">this one</a>, owing primarily to its 140mm wheels, which are large enough to comfortably accommodate the rather fat stator (and magnets, and can). The current plan is to get the scooter, measure/CAD the handlebar attachment and wheels, and then design my entire frame around the constraints of my hub motor, the front wheel, the handlebar, and the vast amount (well, 30) of the A123 3.3V battery cells I picked up.<br />
<br />
I've also decided I'm far too lazy to want to machine all those slots in the steel can, so instead I'm going to opt to <a href="http://www.etotheipiplusone.net/?p=2091">kitmotter it</a> and just waterjet a bunch of half-circles complete with screw slots out of 1/4" steel (this will also give me the advantage of being able to include placement slots for the magnets so I don't have to worry about making separate spacer plates for them just to glue them in the correct places). I'm also going to have a fun time of drilling all the through holes in the aluminum endcaps, but frankly that's about the laziest solution I could come up with for holding everything together, so I can live with it.<br />
<br />
I'm hoping to tear through the rest of this when I get back on campus, hopefully I can have most everything out of the way prior to <a href="http://web.mit.edu/dormcon/REX/">REx</a> because my life is going to get completely sucked away by <a href="http://ec.mit.edu/">EC</a> stuff for about a week.</div>
Bankshttp://www.blogger.com/profile/06935190198890093740noreply@blogger.com0tag:blogger.com,1999:blog-7608932277558807083.post-22450851390327584732012-08-08T14:53:00.000-07:002012-12-08T18:15:38.944-08:00New blog and old projects!Alright, so while I'm over in Washington <a href="http://www.youtube.com/watch?v=D43AJ5Z4ofc&feature=g-upl">jumping out of planes</a> and with very limited shop access, I decided my downtime would present the perfect opportunity with which to categorize some old projects, as well as things I'm currently working on. Hence the start of yet another generic Mechanical Engineering blog!<br />
<br />
I figured I'd start with an old project of mine which I recently got working again: Derpcopter! This is one of the few of my projects lying in the "Actually Finished" category of stuff I built/am building.<br />
<br />
Derpcopter was initially conceived as both a good way to make my first foray into CAD, and to satisfy my high school graduation requirement of a senior project.<br />
<br />
So, the first Real Thing I ever CADed:
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiatda9X_UKnNBnM2Q33JEQff2EGQjPI6JMM2UvgyupGOrKvWClRIwhSkJpebYDdUIEYmcl-Lxrmugr2oatTsfzog-tCdjx9t1qJhrxiSLS01Pfydj8-___soUwk0tcGEjNE1-Nee_Pvpw/s1600/derpcopterCAD.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiatda9X_UKnNBnM2Q33JEQff2EGQjPI6JMM2UvgyupGOrKvWClRIwhSkJpebYDdUIEYmcl-Lxrmugr2oatTsfzog-tCdjx9t1qJhrxiSLS01Pfydj8-___soUwk0tcGEjNE1-Nee_Pvpw/s640/derpcopterCAD.jpg" width="640" /></a></div>
<br />
Yes, that's right. AutoCAD for a 3D assembly. It was all I knew at the time, and it got the job done. Notice how this design is currently lacking any motor mounts whatsoever, if I recall correctly I actually just made those in Visio (the only drawing software available on the computer hooked up to the laser cutter). I was initially intending for the lasercut parts to be acrylic, but ended up settling on polycarbonate because it's much stronger/less brittle. (Note: don't <i>ever ever</i> lasercut polycarb, unless you want all manner of delightful brain damage which I probably have by now).<br />
<br />
The platform was based on the <a href="http://code.google.com/p/arducopter/wiki/ArduCopter">Arducopter</a> build of the beginning of 2011, when the project was still very much in beta. Knowing approximately squat about electronics at the time (not that I can really say much has changed on that front), I just went with their default Ardupilot Mega hardware and Arducopter firmware, some 30A ESCs, APC 10x4.7 props, and these <a href="http://www.aeroquadstore.com/BP_A2217_9_Brushless_Outrunner_Motor_p/motor-a2217-9.htm">actually pretty decent motors</a>.<br />
<br />
I specced out 5/16" aluminum squaretube for the arms, 1/4" polycarb for the frame and 1/8" polycarb for the electronics mounts. It turns out 5/16" squaretube with 1/16" wall is commonly used in upscale railings (who knew?) so I picked up a few lengths for free from a contractor who no longer had use for them (not to mention they came pre-painted a sexy matte black). As for the polycarb, TAP Plastics has this great scrap bin in their stores where you can pick up excess sheets for practically free.<br />
<br />
After making three or four passes on the 1/4" polycarb at max laser power with low speed and succeeding at nothing other than charring lines all over the place (and throwing around all manner of nasty fumes), I opted to swap all the structural components to 1/8" as well.<br />
<br />
From that point, machining/assembly went pretty smoothly, and I was able to finish the wiring/electronics assembly with much digging through old forum posts to find any and all relevant info. If you're looking to build an Arducopter now you'll have a much more pleasant time of it, considering documentation by this point is far more substantial.<br />
<br />
Finished build, weighing in at a whopping ~2.6 lbs with battery:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixvbUvV2NXWtEw6j5i7gQGa-CRlWmuzfZc4AUxQ7ELKfpcN-FzuzT9aqYqKbY7MU2L58j2Xp2tEzx6vICklG_WWfNcAqrmt92nqsKFiq-Ly-qflUFdY0n-64cpxxycXJ_Ec5p2mieWlkc/s1600/2012-06-08_18-10-37_359.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixvbUvV2NXWtEw6j5i7gQGa-CRlWmuzfZc4AUxQ7ELKfpcN-FzuzT9aqYqKbY7MU2L58j2Xp2tEzx6vICklG_WWfNcAqrmt92nqsKFiq-Ly-qflUFdY0n-64cpxxycXJ_Ec5p2mieWlkc/s640/2012-06-08_18-10-37_359.jpg" width="640" /></a></div>
<br />
I uploaded the firmware, calibrated ESCs, mounted props and decided to see if Derpcopter would lift itself a bit. I applied what I thought was just a little bit of throttle, and immediately <i>WHRRR-CRACK!</i><br />
Derpcopter flung itself sideways straight into a wall, instantly shattering three of the props. Not only did I grossly underestimate the amount of thrust the over-specced motors I used could produce, I'd also failed to double check directionality of the props and one of them was backwards. Well, crap. I'd only bought one extra of each direction of propeller, so I was stuck waiting over a week for new props to ship (and yes, this time I bought like 10 spares).<br />
<br />
Unfortunately I had to present the project before the new props actually came in, so I just spun it up a bit without props mounted to show my teachers that yes, it actually seemed to do what it was supposed to, which evidently was enough for me to pass with the project.<br />
<br />
New props came, I put them on in the <i>correct direction</i>, flew around my neighborhood a bit, and then I must have given it a few too many hard landings because eventually Derpcopter became pretty much uncontrollable. I monitored direct sensor outputs from the Ardupilot on my PC and noticed that one of the accelerometers was spitting values completely all over the place. Derpcopter thought it was shaking like crazy, so the reason it was impossible to fly was that it was actually just trying to stabilize itself (even though it was already stable) and thus jerking all over the place. At this point I was nearing the end of senior year, and shelved the project in the "I'll fix it eventually" basement shelf.<br />
<br />
Come the end of freshman year at MIT, I started spending some time over with <a href="http://miters.mit.edu/">these guys</a>, who inspired me to dust off Derpcopter and bring it back to life. I noticed an inadvertent but quite convenient feature in my design:<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiA946fFjmWKCOiOXKTrEeB4wUA3R4U9K0-mwxUn4Ka4EqGXJQ6a3UelFEoDMzNrKvYflvISRJGvwEH_2ULdZTEG6Zc7DPbWA87Rw5vD_1TfMudLMLS-LivM-eiirfblCF93dhNDMNaAGQ/s1600/2012-06-08_22-41-28_782.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiA946fFjmWKCOiOXKTrEeB4wUA3R4U9K0-mwxUn4Ka4EqGXJQ6a3UelFEoDMzNrKvYflvISRJGvwEH_2ULdZTEG6Zc7DPbWA87Rw5vD_1TfMudLMLS-LivM-eiirfblCF93dhNDMNaAGQ/s640/2012-06-08_22-41-28_782.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">It folds!</td></tr>
</tbody></table>
It turns out that converting Derpcopter into travel mode only requires taking out a total of 6 screws, yay! Anyway, I brought Derpcopter into my lab to work on, where a perceptive friend noticed that a smoothing cap on the APM board was toast. Whoa, that would explain bad accelerometer readings! Here's a picture with the rather hilarious looking not-at-all-surface-mount replacement cap:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGIkdwULpjmzx7f5geElIhLjKgVOZ4qe-LoVelKQhtozvZR1_cJ2m4-eUcj5_PGgqBvm_JuqKZWS3pSZwe49yeDUPdWkjcC1h5ESSUnF9sNLMcgR0D_Wvm6tCnwiRaGS4AHrgrhm0bjQY/s1600/APMwithcap.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGIkdwULpjmzx7f5geElIhLjKgVOZ4qe-LoVelKQhtozvZR1_cJ2m4-eUcj5_PGgqBvm_JuqKZWS3pSZwe49yeDUPdWkjcC1h5ESSUnF9sNLMcgR0D_Wvm6tCnwiRaGS4AHrgrhm0bjQY/s640/APMwithcap.jpg" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
Looks good! Now to upload the new firmware, and.... crap. It turns out that APM has upgraded their boards and are now based on ATmega2560s instead of 1280s. This means my old board doesn't have enough memory to support the modern Arducopter firmware. The solution? Upload firmware manually using Arduino, after having commented out parts that are irrelevant to my uses (there is a <i>lot </i>of bloat on the main Arducopter code, there are ridiculous amounts of features).<br />
<br />
Somehow in the process of screwing with firmware I managed to get the plane edition of the code. My quadcopter spent several hours fully convinced that <i>it was a plane</i> before I finally got correct code to compile and upload. Planes like to go at mid throttle when the throttle stick of their controller is all the way down. See why a quadcopter that thinks it's a plane is a <i>very bad thing</i>? Fortunately I didn't have props mounted on it, so Derpcopter just spent a while happily spinning all motors when given no throttle input as I tried to figure out what it could possibly be doing.<br />
<br />
I finally got Derpcopter running, fixed orientation issues, and adjusted PID values to get something flyable.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/ZSH4SIqhvh0?feature=player_embedded' frameborder='0'></iframe></div>
<br />
Yay! No one is dying! It still flies backwards (the taped arm should be the front, at the moment it's treated as the back), but I can live with that for now. When I get back to Boston I'll take some footage if it doing crazier stuff over Briggs Field, but for now you'll have to be satisfied with the first working test flight.Bankshttp://www.blogger.com/profile/06935190198890093740noreply@blogger.com0