Thursday, February 14, 2013

When starting a new project, RTFM first!

How do you turn this
mag trainer

into this?
Computrainer

Short answer is you don't, you order a Computrainer from Racermate, they charge you around $1600 and then you sell the old one on Craig's List.

Long answer is you don't, but I think you can get some of the same features by automating the old mag trainer. Equipment list is:
  • Arduino with USB or XBee communication to a PC for data logging/display
  • Reed switch speed and cadence pickups, suitably debounced
  • Polar receiver from Sparkfun
  • Stepper motor and stepper motor driver, also from Sparkfun
  • Some hardware, especially to adapt the stepper motor to the mag trainer resistance adjustment cable
  • Software for the PC (some coding required)
Goals are:
  • Estimate average and instantaneous power output, based on trainer documentation
  • Graph power vs crank position
  • Automated resistance adjustment for training sessions
  • Record HR, speed, cadence, power results for session
  • I'll pass on all the fancy graphics (other riders, etc) and dead accurate power values - the homebrew solution should at least be consistent, give me some better training feedback, and cost under $200 (my development time not included. Could be packaged and sold I guess, but at least for now that's not the main goal.
The stepper motor and driver are the big question marks for me - I've never used either before, and I'm not sure how much force I'll need to pull the resistance cable - so I decided to start there. And promptly released the driver board's magic smoke. I pulled a wire from the motor driver output side while the motor was powered and fried the driver chip. Had I read the warning on the web page (not even buried at the back of the datasheet!) I would have known better 

Note: Do not connect or disconnect a motor while the driver is energized. This will cause permanent damage to the A3967 IC.

How many times have I told students "DO NOT MESS WITH THE WIRING WITHOUT REMOVING POWER!"? At least I have another example of why you need to do that.

So, development of the resistance adjustment is stalled while I wait for a new driver board. Guess I have to start with the speed/cadence and heart rate side first.

RTFM, RTFM, RTFM....



Tuesday, February 12, 2013

Rebooting another blog

It's not that I haven't been making stuff. I just haven't been making a lot of my own robots lately. This is mostly due to being involved with FIRST, and specifically getting the FTC (FIRST Tech Challenge) middle school pilot program started with FIRST in Michigan. Very worthwhile programs and rewarding when you see the next generation of engineers start to get excited about problem solving and making stuff, but it can take over all your available time. And some that isn't really available, so you end up getting behind in other projects. Like sleep.

But now that I've pretty much passed FTC on to the next generation of coaches and mentors, I'll be getting back to my own maker projects and other interests like mountain bike racing. My upcoming projects live at the intersection of bikes and tech - turning my dumb indoor trainer into a computer controlled bicycle dyno, building a chain break in rig and using paraffin as chain lube, and developing a data acquisition system for mountain bike suspension tuning.

And I've started home brewing beer, so there will be some mention of that I'm sure. Not just brewing and tasting, but also developing recipes and building some equipment like wort chillers, all-grain brewing system, and kegging.

Other possible projects include some FTC training materials (you have to go into witness protection to get completely out of FIRST I think), PowerWheels racing at Detroit Maker Fair, working on an I2C bus motor controller using Digispark, quadcopters, and learning to use the Freescale Freedom board and K40 Tower system.

Some of this may end up on Instructables, some may get turned into open source projects, some may actually become products. This blog will be my live engineering notebook, so all the dead ends, discoveries, missed deadlines, abandoned ideas, unexpectedly easy successes and surprisingly hard tasks will be visible.

If you want to follow my bike racing adventures, check out CatVI. For more on FTC, check out FTC Coaches Corner.

Tuesday, July 27, 2010

We interrupt this blog for a short rant

GM has finally defeated me in my quest to change my own oil. Should be easy - a13mm socket, a wrench filter, a drain pan. Maybe a socket extension.

The vehicle in question - a 2007 GMC Acadia. Between me and the drain plug, a support for the exhaust pipe that could have been moved UP 5mm; and a chassis cross member that wouldn't have been too bad except for the exhaust support. I know they use CAD, they should check for this kind of stuff.

Better sell it before it needs new spark plugs!

This weekend is Detroit Maker Fair at Henry Ford - going to help the Frog Force, Novi FLL teams, and show off some of my stuff as well. Should be fun!

Brian
The Black Dog

Saturday, June 26, 2010

Getting ready for Maker Fair Detroit, Part 1

Nothing like a deadline for motivation to complete a project, and I NOW have a deadline - the Detroit Maker Fair on July 31-August 1 at Henry Ford Museum. My main goal is to get some more booth space for the Frog Force exhibit, but I'd like to get some of my own stuff out of the notebook and into hardware and software.

First up is the Coasterbot, which has a couple of improvements since the last post.


The chassis is completely new to allow for thru bolts to hold the top and bottom coasters together. Lego plates are not the most robust connectors. The hacked mouse encoders are working nicely with the PID code on the motor control Arduino. The Coasterbot can now talk to the outside world without wires using the XBee module mounted over the left wheel (right side of robot in the picture). And buried under the wires on the main controller breadboard is an HMC6352 I2C Compass. Between the mouse encoders and the compass, I have the basis for a rudimentary navigation system. For Maker Fair, the idea is to write a Processing or .NET app to display the robot's position as reported over the XBee link on a PC (or Mac or Linux box if I use Processing) as the robot drives around avoiding objects. And there's still some room on the chassis that is just asking to be filled with some interesting bit of hardware.

Next up is an Arduino based LED clock - 60 x 3 color LEDs arranged in a circle, red indicates hours, green is minutes, blue is seconds. I've got the electronics and code prototyped, now it's more of a woodworking project. More info later as that project gets under way.

Last up (and I probably won't get to the in the next 5 weeks before Maker Fair) is an Arduino controller wireless lawn sprinkler system control to replace the hopelessly bad (at least from a user interface point of view) Toro controllers we have now. This will be a plumbing project too, since on of the main water lines out to a valve box cracked and turning on the water now results in a muddy fountain in the back yard.     

Brian
The Black Dog

Thursday, May 20, 2010

It does actually work!

It actually works! The mouse encoders read correctly, they can keep up with the wheel rotation (only about 50rpm max),  and everything fits on the motor plate of the MkII chassis.

Black Dog Robotics dyno test cell

Right now I'm running a modified version of the PS2 example from the Arduino website, with enough of the motor control code from the original Coasterbot program to get the wheels turning. So far, so good. Next step is to put it all together - the original Coasterbot motor control software with I2C, PS2 mouse encoder reader, and the Arduino PID Library.

The amount of knowledge out there and everyone's willingness to share it just amazes me. You really have to love the Arduino community!

Brian
The Black Dog

Tuesday, May 18, 2010

Coasterbot update

I found the top 4 entries in the MAKE Robot Build contest
#1 Jartron


#2 UFO


#3 HUL-10


#4 Tortellini


Nice work everyone!

Brian
The Black Dog

Friday, May 14, 2010

It might actually work

A hacked up old mechanical mouse, two Lego pieces, a bit of hot glue, a piece of double sided tape and there you have it - a functional Coasterbot wheel encoder.

Finished encoder (left), parts required (center)

Or at least it looks like it might be functional - the Lego pieces will make it easy to build into the Coasterbot drivertrain, and the Arduino gets counts from the encoder. There are still a few things to test, including  but not limited to:

  • Are the encoder counts valid? The sensor and the encoder wheel have to be lined up pretty accurately in the plane of the encoder wheel (although there can be some play along the shaft axis). Also, the encoder wheel shaft and the Lego axle have to line up accurately, otherwise there will be too much runout in the encoder wheel to ever get the sensor in the right position. If this isn't right, I'll get counts for part of the revolution of the encoder wheel but not all of it - worthless.
  • How many counts are there per revolution? Looks like around 130, but I have to actually count the slots to get this number precisely.
  • Can the encoder keep up? I have no idea how fast the chip in the mouse runs, so I might end up with an encoder that works great, but only for low rotation rates. It would be possible to gear down the shaft driving the encoder to slow the rotation to a readable rate, or use an encoder with fewer slots, but then positioning accuracy suffers. 130 counts/rotation is 2.7 degrees per count. Gearing the read shaft down increases the degrees/count on the rotation I want to measure. Maybe OK for speed control, but not great for measuring distance to determine a position. And putting another Lego gear in the system adds more lash, reducing the accuracy even more. It might end up being a lot of work to get an answer that is less accurate than making an estimate from a pwm value/battery level/motor speed lookup table.
  • Is this robust enough to handle being in the Coasterbot? The sensor isn't worth much if it works great for 2 minutes then falls apart. If it looks promising but not strong enough, I'll have to figure out a better way to mount the encoder wheel and sensor. Maybe drilling a hole in the encoder wheel and mounting it on the axle, then building a housing for the sensor and LED so the final product would look something like an RCX rotation sensor.


If all the above works, then I can start work on the motor control Arduino code to implement PID, using one of the Arduino PID libraries (or writing it myself to learn what's involved).

Side note - the MAKE Coasterbot Build winners are announced today! It will be interesting to see who wins. The BDR Coasterbot should be a contender - it's strong on function, expandability, and documentation; but weak in creative use of the coasters, overall aesthetics, and maybe the design is too simplistic. It's more of a engineering exercise than an art project - I just wanted something that met the goals of the contest, and go me moving on building an expandable Arduino controlled robot. Anyway, we'll see what the results are soon.

Brian
The Black Dog