Friday, June 14, 2013

Clip position movement and position detection

The WBMD "clip" ended up being a rotating disc design.  It also had to move with high precision, because the proboscis (the thing that would push a tube into another tube to fill the water balloon mounted on the clip) needed very precise alignment.  And, we didn't have time for fancier solutions like image detection/comparison.

I wanted to model something that would work for this.  Several things led up to this:
1.  The kids' earlier Maker Faire project used cat toy lasers and optical sensors for detecting presence
2.  I'd taken apart an H-P printer, and found within it a carriage assembly that was driven by a DC motor, not a stepper, and its position detection was based on a board and a strip of plastic.  The board had the curious words "bar code" on it.  And upon inspecting the strip of plastic under magnification and seeing that it ran through an optosensor, I figured they'd effectively turn an optical mouse upside-down and were using it for positional feedback!  Very clever, and too clever for me to hack apart and use.  But it gave me ideas.
3.  I'd gotten a freebie laptop DVD drive, and had taken it apart to see how it worked.  Inside, I found a cool little board that they use for controlling everything.
What made this fun was that I could ignore all the (nice) electronic components, and just use that part that clips onto an old DVD or CD, giving me a free mount point and bearing.  I liked the idea of using a CD, because it has reflective material between its layers of plastic, and that would block the laser.

To model the clip, I stuck an old DVD+R onto the drive board.  I then kept it in a fixed position, and then clamped a fine-point Sharpie so that it would draw on the DVD.  Then, I just rotated the DVD around to give me one circle on the DVD at a fixed radius.

I then drilled holes into the DVD at various points.  As long as the hole was on the line, and as long as the hole was big enough for the cat toy laser to shine through to an optical resistor, I would be in business.

To rotate the DVD (i.e., simulate rotation of the clip), I ended up with a sloppy but functional solution that involved putting a rubber band on my stepper motor's timing pulley, and putting tension between the DVD's edge and the rubber band.  In doing that, it made it so that every step of the motor would result in a fractional turn of the CD.  It wasn't clear if this would be a reasonable approach for a full-scale build, but seemed promising.

Then, all it took was mounting a laser above (adding tape to keep the switch turned on) and an optical resistor underneath.  I added code that would keep stepping the motor until a dark-light-dark transition had occurred, and calibrated for the actual resistance values seen.  The code would spin the CD around until it'd seen the dark-light, start counting steps, look for the light-dark, and then back off half the number of steps seen.  It was a nice, crude, and pretty precise solution.

Merit badges:
- Disassemble a printer
- Disassemble a laptop DVD drive
- Extra credit: find the pins that make the DVD drive's motor spin, even if you don't have the soldering chops to wire it up for real
- Make a motor move something other than just the motor
- Build a position detection system
- Use a cat toy in some other way than what it was designed for (merit badge only available to those who are not cats)
- Generate an annotated video

While I don't have all the skills needed for it, I still want to try to wire directly to the pins of the BH6546KV chip that's on that drive board and make the motor move.  The pins I want are wired in pairs (three pairs, each effectively solder-bridged already) and so maybe, even though its super tiny, I can wire onto pairs of pins and thereby gain control without damaging things.

No comments:

Post a Comment