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

Friday, May 7, 2010

3 More Days?!

MAKE changed the entry deadline for the Coasterbot build - it was May 7 (today, Friday), now it's May 10th (Monday). Damn them, not only 3 more days, but it's over a weekend...

The competition has set the bar pretty high - Curl, HUL 10 Version 2Crepton, and Mult-CD all look pretty sweet. So I may need to up my game a bit by adding motor encoders. Fortunately, the Arduino community comes to the rescue again with a nice write up of interfacing to a PS2 mouse. Using this code I was able to get rotation and switch info back from the mouse this morning. Off loading the quadrature encoding to the mouse chip is a good idea - lightens the load on the motor control Arduino considerably. And I get 3 free switches. All for the cost of 2 digital pins on the Arduino.

a good use for a dead mouse

I don't think the mouse will fit in the Coasterbot as is LOL (and the encoders aren't oriented the way I need them anyway), so I'm going to have to do some cutting to make it fit.



cut on the black lines...



a little hot glue and I'll have a Lego compatible encoder wheel

The hardware won't be too bad, but there's a lot of code to change in the motor controller to make use of the encoder info. We'll see if I have time this weekend - Ironman 2 came out yesterday, I'm judging all day Saturday at Robofest, Sunday is Mother's Day. So I might not get it done this weekend, but I'll give it a try.

Brian
The Black Dog

Monday, May 3, 2010

Whew!

It's done - the entry for the Coasterbot challenge, that is. Shot, edited, and posted the better quality video on youtube, filled out the entry form at MAKE, did the final edit on the Google slideshow, posted all the pictures to Flickr and uploaded the code to Scribd.



On of the questions in the MAKE entry form was "What did you learn during this project?" I didn't think of it at the time, but probably the most important thing I learned was how to use all the web-based tools available to pull together and document the project.

There will be more entries on the Coasterbot later - I plan on using it as a base platform for experimenting with more sensors and navigation software, and I'll have to announce the contest results sometime in mid-May. But for now I have some other projects in mind. Stay tuned....

Brian
The Black Dog

Sunday, May 2, 2010

As usual, the documentation takes forever...

Although the blog has been pretty quiet lately, I've been busy working on the entry for the MAKE Coasterbot build. Here's the Black Dog Coasterbot slideshow.



The slideshow isn't quite complete - I changed the behavior of the robot from 'locate and avoid' to just 'avoid'. Just avoiding obstacles is simpler, and actually shows the robot's capabilities better in a small area with lots of obstacles. I need to publish the state diagram for this.

I also need to update the control schematics to reflect the addition of the front bumpers.

And finally, I need to get a video of the robot doing it's thing.

But it's pretty close to done - should have no trouble getting it completed for the contest deadline on May 7th.

Brian
The Black Dog