Tuesday, December 27, 2011

< Buildapalooza 2012 >

Did I mention I'm an undergrad? Apparently junior year is is a buttload harder than sophomore year, but after a long semester I'm back for what I call Buildapalooza 2012 (on vacation now won't be building until after the New Year). Here is the plan:

gMeter, the amount of time it will take to write your software, including all the LCD code, was just not feasible this semester. And now that I finally have a break, I simply don't hate myself enough to plow through the datasheets. Unfortunately, I'm putting you on the back shelf until the summer rolls around.

TOBL, you break too much. In the middle of September I brought TOBL to World Maker Faire in New York. Before I could even set up a demo I watched a five year old strip an internal gear on the left servo, by rolling it around like a wind up toy. Maybe that little tyke was trying to tell me something, like "get rid of the servos!" So that's what's going to happen.

Introducing TOBL V2.0 or TOBL2 if you like...there was already a V1.1 when counting the revised XPWMShield board. Some new things I'd like to incorporate into this version:
  • Gear motors
  • Belt/Pulley drive
  • Automated tensioning/clutch
  • Aluminum plates (replacing acrylic)
  • Bearings and proper supporting
  • Revisit the wireless updating on XPWMShield V1.1
  • New control interface (on iPhone)
By swapping the modified plastic geared servos for gear motors the possibility of breaking gears on back-loading should be eliminated. Further to this end, an automated clutch system is in the works to tension and de-tension the drive belts when summoned. The gear motors will also increase TOBL's top speed from a fraction of an MPH up to about 4.6 of them by my maths (using the motors linked above). Swapping the acrylic should work towards the goal of making TOBL more durable, not to mention I'll feel better pressing bearings into aluminum. Oh yeah, and because she'll be running motors I need to design a motor controller to interface w/XPWMShield. So there will be some electronics to keep things interesting too.

Okay, there you have it, Buildapalooza 2012 starts in T-minus one week. Until then I'm gonna go sit on a beach ;-)

Friday, August 19, 2011

gMeter: Electronics

The electronics for this project are simple. So I asked myself, why spend money on a board from Advanced Circuits when I can make my own? After completing the etching process I have plenty of answers to this question, which I will address on a rolling basis.

First, the circuit itself. Laying a board out for single-sided etching adds some headache to the design process. Without vias you have to think a little harder about trace traffic, to minimize using jumper wires. It's a fun game until you realize that's probably something they play at EE parties. I scored a 7 (I think it's like golf). Other modifications for achieving etch-spec: minimum trace size of 24 mil and minimum clearance up to 16 mil. I really wouldn't etch a board that's any more complex than this unless the form factor is less constrained and bigger.

Export to png (monochrome) and...
...ready to be printed.

There are hundreds of DIY PCB etching tutorials out there so I'll spare you the step-by-step procedure. Besides, after etching one board I'm far from pro! I went the iron-on toner transfer route, messing up three blank boards before getting one that was "etchable." Partially that was not my fault because the laser printer I used was good but not great, leaving thin spots of toner here and there. Mainly I wasn't putting enough pressure on the iron. To get it to work, I literally put all of my weight on the iron for two minutes solid. Then 4-5 minutes moving the iron around giving the interior a lot of attention, and still maintaining absurd pressure.

I used a sharpie to touch up the spots the toner missed.

The etching part is where things got really sketchy though. The copper took at least 45 minutes of continuous agitation to etch...? That's at least 15 min longer than what I read online, so I'll need to hunt down the ferric chloride MSDS, perhaps it was diluted more than usual (around 60%). More likely rubbing it with a sponge probably would have cut the time, instead of waiting for the copper to dissolve on its own. As much work as this is, there is an unbeatable zero day lead time and low cost. Having the ability to wake up with an idea for a cool board and use it that day is plain awesome. With practice I'm confident it will take less time and it's far superior to leaving your project at breadboard status.

Soaking in ferric chloride...

Stipped of toner courtesy of spray carb cleaner

Finally got some use out of my Dremel drill press, I think this is what it was designed for.

Next, I soldered it all together and bam....no, who am I kidding it didn't work first shot. Again, I would advise against etching with 24 mil traces, especially in confined spaces. I made this mistake and spent a lot of time with a multimeter and an x-acto knife peeling up traces to resolve about ten different shorts. Finaly I got it to light up.

Ok, the board works. Now there are zero excuses left to procrastinate from coding. Well maybe that classes start next week, but I will do my best not to drag this project too far into the semester. Putting on my software hat...

Monday, July 25, 2011

gMeter: ...

Oops, it's August and gMeter is very incomplete. That's probably because the part I really care about (tangible mechanical things) are not the important part. Alas, progress has still been made and to satisfy the self-imposed minimum project SolidWorks/machining time, I came up with a cool sheet metal enclosure. I've never made one before, but SolidWorks has a great tool for laying them out, with a nice "flatten" tool to get a drawing of the part for construction. Got all the materials, time to cut, mill, and bend!

You'll notice a right flange is omitted, motivation for which will become more apparent later. Out of context, I'll admit, it's not very exciting. Especially following my last project, which could do wall flips! Though, anyone who has ever programmed a microcontroller will appreciate the inherent awesomeness of that itself. Which brings me to my next point -> electronics.

The board containing the logic and everything else is ready for fabrication. I'm going the DIY route and etching it tomorrow, so look for an electronics/etching post soon. I used an Arduino Nano to prototype everything before porting it all over to the ATtiny2313. This would have gone a lot quicker if I hadn't fried the regulator on the Nano and consequently the not-so-cheap ADXL335. Fortunately the Nano still runs off of USB power and a brave friend has loaned me an accelerometer. I look forward to having a nice clean pcb to replace this sea urchin looking setup.

I need to invest in normal-sized breadboards.

On the flip side of all this procrastinating, my attention has been finely concentrated into the sexiest thing on four wheels. In our 5th year of ECSEW, the tinyKart is a sub-50lb e-cart you can essentially wear. The idea being to make it lighter than a single battery from the original cap kart, circa 2008. Mainly this is done through prevalent, if not exclusive, use of 6061 aluminum. Without a driver it will have a better power-to-weight ratio than a Lotus Elise, with a -healthy- driver the figure is more comparable to an E92 BMW 328i. I say will because as you can see it still needs to be wired up. More to come on that and gMeter very soon as the August building marathon begins! Leaving for school in 11 days, bring this.

Tuesday, June 14, 2011

Grand Prix du Canada, done right.

The past weekend marked the only North American stop on the Formula 1 calendar - until 2012 at least - held at Circuit Gilles Villeneuve in Montreal, Quebec. The circuit skirts tiny Île Notre-Dame and features some famous corners, including a hairpin and one named after racing deity Ayrton Senna. The course is a driver's favorite although this year's GP may have temporarily spoiled that sentiment, due to an unprecedented 2-hour rain delay. Quick recap: Mercedes Mclaren's Jenson Button stole what would have been another victory for Vettel, in lap 70. Out of 70! Button deserves the credit though, working his way from dead last at one point, making up for many pit stops, a tussle with team mate Lewis Hamilton, a speeding violation (they have those), weather etc. Also of note, is a 4th place finish from Shumacher, who is on the rise in his second season back from retirement. Hamilton, who has been successful here historically, was forced to retire. Kinda had that coming to him. Anyways, the point of this post is to shed some light on what to expect at a GP and how to do it right, and cost effectively.

Tip number one on the weekend: Do NOT plan a trip last minute. I decided to go to the Canadian Grand Prix just two days before the event. I had an amazing time, and being spontaneous is fun, however, you can save a lot of money if you book in advance. Fortunately I was able to cash in on some frequent flyer points, and didn't pay a cent for lodging. Had it not been for this though, the only hotel less than $100/night was 40 miles away from the race. The city takes the GP very seriously and staying downtown becomes a $500/night affair. Hostels are in the range of $30/night and a good option if you are traveling in a group, but they're almost exclusively 3-night minimum rental, so plan for that. Definitely book on Expedia and maybe they'll mess up and give a free upgrade to here...

Second: Buy general admission tickets. Well sure, if you have the money buy grandstand seats, over by Virage Senna being the best to watch overtaking. For the rest of us, a 3-day GA pass costs $110, which is cheaper than a single day in the stands. You will have to get to the track early to secure an un-obscured spot on the infield, but it will be worth it -there are other races while you wait. If you heed the advice from tip two then you will also need to follow tip 2a: BUY EARPLUGS. We sat about 15 feet from the cars mid-straight and I thought my ears were going to bleed.

Number three: BYOR (bring your own radio). Being at a Formula 1 race is kind of like observing a golf tournament from the 9th hole. Unless you can cover a lot of ground really quickly (~200mph), or are willing to shell out hundreds for seats you will have no idea what's going on. Alternatively you can camp out by a screen but you will be hard-pressed to do so unless you get there seriously early. No matter what time you arrive, you will be able to see the action, though. The earlier the less likely you will be looking through a tree.

Final tip: Pick your transportation wisely. Having a car is essentially useless because there is nowhere to park and there is a metro stop which lets you out right at the front gates of the track. I say this with somewhat of a bias after my car suffered a freak break-down, costing me a couple thousand dollars more than I had planned to spend in one weekend. Even still, there are metro stops scattered all around town and buses to take you to the stations, if you can catch them. Busing up is definitely the most reasonable way to go, $75 one-way from Boston at least, which is currently what you would pay in gas anyways.

Even if you do not follow Formula 1 going to a race is an incredible experience. The sounds of howling V8s revving to 18,000rpm and the brutal shotgun-esque downshifts alone are worth the price of admission. It truly is a symphony but watching the race unfold you realize that this sport does not exist solely for our entertainment. It is a business and a showcase of modern engineering for the companies who sponsor the teams. The cars have presence, they command your respect. Watching the drivers chase down the car in front of them is like watching a really loud game of chess. As was the case with Sebastian Vettel the simplest mental error can lose you a race. The Montreal atmosphere is great too, the locals get really into it and appreciate every ounce of heroic late-braking and high-speed overtaking. I highly recommend the Canadian Grand Prix to anyone and will certainly be back next year, definitely smarter, hopefully dryer.

Saturday, May 28, 2011

gMeter: l'introduction

Preface: As mentioned in the previous post I hit some car trouble in Canada. Actually I had an engine swap, so it's more like a major problem. Between fatigue, sorting that out, and another project in collaboration with ma man Shane, this project is off to a slow and undocumented beginning. To that end, here is an intro while I chip away at the project.

For the longest time I've been interested in doing something with inertial sensors. It's no secret that I am also a car-obsessive, so the logical starting point was to create a g-meter for my car. Does it tell you how "G" or ghetto someone/thing is? No, but later versions may feature a cockometer setting to tell you "how much of a cock you look." Of course, a g-meter measures the lateral cornering force of your car, typically in units of gravities. As a basic reference an average street car can handle just under one gravity, and a formula one car will stay planted while pulling nearly five g's! "How many can the Volvo manage?" I wondered. Time to find out.

Image courtesy of TheEngineersCorner.

The most critical component of this project would be the accelerometer, for which I chose the tried and true 3-axis ADXL335, yours with breakout board for $24. Having no prior experience with accelerometers and no qualitative evidence for comparison I think this is a great sensor. I used it as it came, with 0.1uF decoupling capacitors which restrict the bandwidth to 50Hz. Choosing the bandwidth is a compromise between noise and resolution and the stock setup proved a good balance thus far.

For starters the sensor needed to be calibrated by picking an accurate scaling factor. This is a number in units mV/g which converts the output signal from volts to gravities. The ADXL335 is ratiometric so the data sheet provides experimental values for the scaling factor at the max and min supply voltages. Running the sensor off a 3.3V line I needed to determine the SF in between the given values, which meant linear interpolation. Not the best since clearly the response is not linear, but close enough. To confirm this I devised a shotty test by taping a breadboard with the accelerometer and an Arduino to my dash as a brave friend riding shotgun read the x (lateral axis) outputs off my laptop in realtime. Meanwhile, another friend monitored readings from a free app on my phone and I drove fast (safely, Mom) down a windy road. The results were reasonable, achieving a max of about 0.74g on a particularly tight bend. During this test power was being supplied via USB so I will need to tweak the SF once the power source is finalized, probably a small 2S LiPo.

Quick and dirty g-meter.

This all came together frighteningly quickly. I added an lcd to the mix but even that has a very common HD44780 chipset and pre-made Arduino library of course. I did not like this, and I started to feel guilty about all this Arduino business. Using them is kind of like admitting that you like Britney Spears music...or something. It's just not hardcore. Arduino's are great tools and by no means have I come close to mastering all of their capabilities, but building things shouldn't be like one of those snap-together model airplanes. So instead of soldering what I had together and stuffing it all into a box, it was time to take the project down a windier and potentially bumpy path.

If we're going to dabble in such terrible things as software, then we ought to at least do it right. Enter the AVR ATtiny2313, a very popular microcontroller for small custom applications like this, and most importantly, no Arduino bootloader! In fact, that is the last time I will use the "A-word" in this post. It feels liberating now but pretty soon I'm sure I will begin kicking myself. I bought an AVR ISP II and put together a little target board. In the next few weeks I will work on the software, anticipating that the lcd will probably be the hardest part. No turning back now.

Unnecessary switch, led, and cap. Why not.

After the recent car bill I need to be thriftier than ever. For the circuitry I won't be ordering a shiny new PCB, instead I am researching the process of etching one myself. Failing that look for a perfboard from Radio Shack with a lot of wires. Mechanically, all I can say is I've ordered some 1/16" sheet aluminum...

Monday, May 16, 2011

< Summer Projects >

While studying for finals I realized something, and that is procrastination, NOT necessity, is the mother of invention. With the dark cloud of exams looming overhead my mind naturally started generating ideas for the more exciting ways I could be spending my time. Now that they are over* my ideas are rapidly coming into fruition.

Motors Controllers:

After working with servo's for far too long, I bought some TI SN754410 quad half H-bridges and Sparkfun's cheapest motor, which turned out to also be their smallest! I wrote a quick Arduino/Processing sketch and touchOSC layout to integrate my iPhone control process to this tiny motor. It's very straight-forward, just PWMing the enable pin to control the speed. This was a success.

More recently, a friend handed me a hard drive spindle motor after realizing that a battery and wires alone could not bring it to life. It even has four wires, "what could the extra two do?" he might have asked. I knew it must be brushless and after a little bit of research, it turns out it's a 3-phase BLDC. There is one wire for each phase and the fourth is common. In a trial by fire effort I am in the process of building a controller with some parts I had lying around.

The basic idea is to drive each of the phases with one side with one, or one half-bridge. Thus two SN754410s are used. The Arduino Nano provides the PWMing for the three enable pins, the inputs for the six logic pins, and the back-EMF sensing. The latter will be the tricky part, and I am still doing some reading to determine the best way to do that -both in hardware and software. This is a sensorless motor, meaning instead of onboard hall-effect sensors the position of the rotor is approximated by detecting the back-EMF. Not any easy undertaking, and for now just a clusterfuck of wires.

In the background -or maybe the foreground- another project is in the making. Today I ordered a 3-axis accelerometer and a 20x4 LCD. I've had an itch to start working with inertial sensors for some time and I think I've found the perfect application. Hmm what could those be for? Hint: my car.

*one non-engineering final left

Thursday, April 7, 2011

Something Different

There's more to life than building things. Please enjoy this semi-serious cover of John Lennon's Imagine with my friend Seti on vocals and me with the keys.

Thursday, February 24, 2011

TOBL: It's Working.

It's working, it's working. It = TOBL and here are some stats:
  • 6 wheels
  • 18 gears (think about it...)
  • 84 oz/in Torque
  • iPhone-controlled via TouchOSC app interface
  • OSC/Serial communication
  • 8 zip-ties
  • Top speed of 0.413 mph (my personal favorite)
After much adieu, TOBL has been captured on film with my new camera -a Pansonic Lumix DMC-ZS7. It's about to make this blog a whole mess snazzier, 9.1 megapixels more snazzy to be exact. Henceforth, all videos shall be shot in 720p HD, like this one (fast-forward to 2:34 for wall flips):

Kind of dark but I still recommend watching in 720p.

Now held together by 8 zip-ties, thats 4X as strong as last time!

One of the finishing touches on TOBL was trimming the servos. However, PWMShield V1.0 is not yet wirelessly-updateable and in the monotony of disconnecting and reconnecting all the controls hardware, I vaporized yet another trace. This board should be renamed "GhettoShield" after all the loose wires I've had to solder to busted traces. The circuit works fine though, and using it saves $33. After fixing the trace the servos were trimmed.

Can you spot the latest exo-trace?

I don't talk about software very often, and that's because I don't know much about it. I do like to share the code I use though, isn't that the point of the whole open-source movement? After all, most of the communication software for TOBL was "taken" from this iPhone-controlled tank and this SFE tutorial (Thanks to both!). I modified bits of this software and wrote the rest to interface this existing code with my TouchOSC layout and electronics. In order to return the favor here is the Arduino and Processing code. You'd think a wireless iPhone-controlled robot would have denser code than ardWINDo, but take a look, it's surprisingly compact.

This project was a lot of fun. It's rare that you can take an idea and bring it into fruition exactly the way you imagined it. My initial goals were to make it iPhone-controlled and able to drive after rolling over -TOBL does both of those things. It wasn't cheap, I would estimate ~$250 including redundancies, but TOBL is an awesomely fun desk toy and an even better platform for playing with software, different sensors, and whatever else.

I also learned that servos are great for being servos, but not so great at being drive motors (especially modified micro-servos). For future projects I will venture down the new and exciting road of custom motor-controllers. Time to start playing with H-bridges...

Wednesday, February 2, 2011

TOBL: Testing

Done with my first exam of the semester and feeling like it's time to get back to TOBL, however briefly. I still don't have a camera to record test footage but that may change soon. Until then, here is the little guy in his most primitive form a.k.a. being held together by two whole zip-ties.

Yup, two.

So far testing has been limited to some laps around the apartment, during which I have already broken yet another spline gear. Reassembling the HS-81 plastic gear servos has worked out well. One of the wheel gears was a little tight, but has since been fixed. So now the plastic gears should last longer than 10 minutes.

Since the servos were modified they don't center very well. I suspect this is because the resistors that replaced the potentiometer do not match exactly. However, I did trim them in software and even after wearing the battery down a bit the neutral point doesn't drift much. As often as I ramble about servos I've learned my lesson and my future projects will likely use motors, for drive purposes at least.

Speaking of future projects, my V1.1 XPWMShields are finally in. Somehow they were delivered twice? Go figure. I think the perfectly good V1.0 board will remain on TOBL as not to have wasted $33 and shipping. I'll be able to comment more on the functionality (namely wireless uploading!) once I get some new Nanos to test them.

On a side note, I've recently started working at the Micro Robotics Research Lab. I thought I was into making things on a small scale...not even close! This lab concentrates on MEMS, fabrication techniques, and small scale robotics in general. For example, one team is designing a similar wireless communications board to XPWMShield, except that the board is approximately 1cmx1cm! Very cool stuff. Technically I'm working there for a program I'm in, but we'll see what happens. As for TOBL I will try to acquire a camera asafp!

Saturday, January 29, 2011

XPWMShield V1.1: ...??

According to UPS tracking my Advanced Circuits order was delivered yesterday at 12:47pm and signed by a fellow named "WILSON." It's true, I could see the truck out my window! Regrettably, somewhere along the 100ft path from that truck to the front desk of South Campus Commons 1, the package was vaporized. It was never logged and nobody knows where it is. All I can say now is WIILLLSSSOOOOOOOOOOOOOOONNNNN!! And some four letter words which I already shared with the elevator and don't need to be shared here. I'll wait a few days before re-ordering, ugh.

Sunday, January 23, 2011

TOBL: Teaser

What happened to TOBL?? Well it's alive, better than alive. In an effort to actually finish the thing before returning to school I focused more on the building and less on the documenting. It was close but I had to take it back with me to school:

What's up TSA?

I used 1-1/2" Dubro tail wheels for the drivetrain, mainly because they have ridiculous grip and aluminum hubs. To my surprise, the smallest outer diameter of the hubs was ~0.401". To support the steel standoffs I bored them out to 3/8", so that's like 0.013" wall thickness or less at the very center. We're good though, the two halves didn't torque themselves apart on the lathe. The hub diameter just barely supported the gear-mounting holes as well, but they don't post these dimensions online so not my fault.

This just looks goofy.

Small snack for the mill.

After making those aluminum plates I thought lasering some out of acrylic would be cooler. It was good milling experience still, I guess? It took a few tries to adjust from the gears' theoretical to actual pitch diameter -in the end an extra 0.02" radius. The servo-gears are also not properly supported i.e.they are cantilevered off of the spline gear. So they wobble, just a little. Enough though that the servos stalled and stripped some teeth internally. This was actually a good wakeup call because the stronger HS-82MG motor wasn't designed with the HS-81 plastic gears in mind. New gears are on the way, enough to bring two HS-81s to life.

Not even including the set that actually made it to production.

Look for test footage next post! (waiting on parts in the meantime :/)

Monday, January 10, 2011

XPWMShield V1.0

After a long wait (it says 2010 on the board because it was sent out last year!) XPWMShield has arrived from AdvancedCircuits. And with a bag of microwave popcorn in the packaging? Awesome company.

XPWMShield V1.0

This revision of the board lived a short life. I only got it yesterday, soldered on all the components today, and just broke it five minutes ago. Before that though here's V1.0 in all its glory, running off a 1300mAh, 7.4V, 2-cell, LiPo battery I got off HobbyKing:

Font size
She lives.

Need a better camera.

Just as I was going to test the wireless, one of the leads from the battery touched the bottom of the board, contacted a pin/via and blew up a trace coming out of the voltage regulator. Great. But at least the $34 Arduino Nano and $24 XBee are alright.

As it turns out the diode I put in between the XBee DOUT and Arduino RX was disabling radio communication. I put it there so that the software could be updated wirelessly without having to remove the XBee. So, I removed the diode and soldered a wire in its place -the same for the busted trace.

Ghetto wiring aside I can't complain, it works really well. With some minor revisions it's time to order more for future projects!

Saturday, January 1, 2011

TOBL: Quick Software Update

There was an issue controlling both servos at once. With one fader value being sent over to the Arduino one servo would work fine. With both, that same servo would tweak out. After isolating the error to the Processing side, it turns out the float defining the fader values was preventing the second fader from registering. With that cleared up the code finally works as intended*!

* The interface needs some work to be more user friendly. For example, a deadband at the neutral position so you don't have to land the fader on the exact pixel that corresponds to STOP. Also, there's a point - about halfway through the range - where there's no noticeable change in speed. Playing with the fader ranges in the touchOSC editor should fix that. My only other complaint is a little lag in feedback due to the speed of wifi. On the other hand, it can be controlled from anywhere in range of the network aka college campus, so we'll let that slide.