Let's Make Robots!

My First Robot

Draft Robot Page: http://letsmakerobots.com/node/12713

My first robot is a Valkyrie CNC using TinHead's example: http://letsmakerobots.com/node/9006

clone_CNC_Dec09_small.jpg
http://letsmakerobots.com/files/clone_cnc_closeup_1500px.jpg
http://letsmakerobots.com/files/clone_cnc_1500px.jpg

Vector Drawings: http://letsmakerobots.com/files/clone_cnc_vector.pdf (draft)
Measurements will be available for these drawings by December 2009 or if somebody bugs me for it.

Cost will be more than $200 -- The motor drivers were the most expensive bit of it.  One could bring down the cost by hand-building the driver boards, but I sourced the PCBs from BatchPCB.

Plans for this robot: learn about CNC machines and control systems, and machine prototype PCBs for other robots. [...]

Credit where credit is due: My CNC is deeply indebted to TinHead's work on the motor driver (node/6967), driver software, Arduino controller software, and hardware design, along with the discussions on the "Valkyrie" robot page (node/9006).  Driver software is http://github.com/TinHead/Valkyrie-CNC-source-code/tree/master .  Somewhere in the driver and Arduino source code, the RepRap project gets kudos as well.  Debt is also owed to http://buildyourcnc.com for some of the construction tips.  I wouldn't be able to join the wood so well without learning good drilling technique.  Also, ladyada's AVR tutorial ( http://www.ladyada.net/learn/avr/ ) was essential to programming the ATTINY2313 used in the stepper drivers.  The controllers were programmed on a minimalist target board from evilmadscientist.com ( http://www.evilmadscientist.com/article.php/avrtargetboards ). 

Giving back: I'll be posting more detailed plans for my iteration of this machine.  It is TinHead's design, but where there needed to be alterations (e.g. the PCB design needed changes before BatchPCB would accept it) I made changes, and where there were ambiguities, I had to figure them out (for example, the views of the robot from the back, sides, and bottom I wished I could see).  Also, I ground a copper-clad board into my first prototype circuit board (first ever!) while waiting for BatchPCB, and if I wanted to spend many hours grinding copies of that prototype motor driver board, I could have saved easily $70 on manufacturing the boards (toner transfer would have been quicker but I had a new rotary tool to try out).  If the proto driver board works, I'll post that as well.  My plans for this homage to the Valkyrie is to document the building as best I can, so that more pics and plans are available online for folks like me who want to tinker.

AttachmentSize
Budget example for sourcing components from the USA37.42 KB
clone_CNC_skate_bearings.JPG383.87 KB
clone_CNC_pcb_backlit.JPG350.28 KB
clone_CNC_pcb_front.JPG285.59 KB
clone_CNC_pcb_back.JPG372.71 KB
clone_CNC_copper_front1.JPG347.72 KB
clone_CNC_copper_backlit.JPG336.59 KB
tiny2313_stepper.brd23.75 KB
clone_cnc_600px.jpg125.03 KB
clone_cnc_floating_block.PNG5.74 KB
clone_CNC_1101_front_s.JPG23.07 KB
clone_CNC_1101_back_s.JPG26.48 KB
clone_cnc_captive_nut.png2.44 KB
clone_cnc_1500px.jpg877.57 KB
clone_cnc_vector.pdf99.8 KB
clone_cnc_closeup_sm.jpg102.22 KB
clone_cnc_closeup_1500px.jpg705.01 KB
clone_cnc_I2C_test.PNG7.14 KB
clone_CNC_Dec09_med.jpg319.46 KB
clone_CNC_Dec09_small.jpg122.25 KB

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
I have a few more steps to finish before I'm done, and the robot page goes up.  Once I'm done with the hardware build, my plans include vector drawings for the wood parts (no CAD software here), a parts inventory, and some suggested dimensions to replicate the machine size I have in metric or standard measurements (1"=25.4mm).  The wood frame was the most challenging part for me, as I'm building with battery power hand tools, and I'm pretty sure the last time I joined more than two pieces of wood together was shop class in '91.  So far I've documented nothing, but there's a good chance I'll get around to it.

-John

Nine hours today on the CNC.  Two axes are working and tested under stepper-motor power, and I remade the X-stage and Y-stage so the Y-stage no longer nearly scrapes the base.  My X-axis turns smoothly and effortlessly.  Rather than mounting the X-lead-screw bearings directly on the base, I put one on the base (the one closest to the stepper, since it needs extra room for attaching the stepper), and the other I put on a block behind the base.  With the X-stage positioned near the stepper, I clamped the second block about where I thought it should go, fixed the coupling nut to the X-stage, and ran out the stage to the other end, near the floating block, while allowing the second block to adjust itself.  When the X-stage was at the far side away from the motor, I re-clamped the floating block, ran the stage back and forth a few times, and then drilled the holes to fix the second block and screwed it in.  I found the best position was not where I drilled the holes.

clone_cnc_floating_block.PNG
http://letsmakerobots.com/files/clone_cnc_floating_block.PNG
The Y-axis lead screw I tried to fix without the floating block, and the screw was slightly curved, so the motors could not turn the Y-stage.  After some reconfiguring and re-bending, I got it turning unreliably (it sometimes skips steps).  I may have to repeat my X-stage method with the Y-stage, or get some NEMA 17 motors as on the RepRap (but coupling them will be an expensive pain unless there's a way to cheaply couple the parts).  I think I can get better results if I give the motors more time to work (if I slow it down).   The X-axis runs fine on one motor (the second x-axis lead screw has not been installed) running the motor test script that goes 2 revolutions in 1.5 seconds.  The Y-axis runs this same script for some locations on the lead screw, but the static friction is not as good as the X-axis due to the slightly curved lead screw.  A more powerful motor or slower steps may help, but the little motors were one of the attractions of this project, so I'll have to decide whether I want to lose some of the charm to get better torque.

One more weekend and it should be done!  Then I can decide whether to upgrade the motors and figure out how to couple them to the lead screws.
Pictures later,
-John

Y-stage and Z-stage have been cut!  Woo hoo!  But I ran out of aluminum rails and hadn't bought the lead screws yet, so a trip to Home Depot was needed before I could finish.  The dimensions need some work -- the crossbar on the X-stage was made too wide, so the Y-stage is mounted a centimeter above the base.  That means I can cut traces on copper-clad board (which is thin), but I cannot cut wood or particle board (which is thick).  I decided on trial and error rather than over-planning and am paying the price :)  If I don't remake the X-stage (and fix up the Y-stage to work with the new X-stage), I'll probably be able to complete the hardware in 4 more hours or so.  Once the hardware is assembled, I can finish up the interface and start playing around with the Arduino controller.

One concern I now have is that my rotary tool may have a thermal cut-off that keeps it from melting or burning when it runs too hot.  I've been cutting stainless steel threaded rods to make the lead screws and the rotary tool can get hot when in use or 10 minutes.  If I run the CNC too long and too hard, the spindle might stop, and I'll need to hit a big red "PAUSE" button while it cools down.  Otherwise it might stop spinning, and my oblivious software/controller will destroy the expensive PCB-cutting bit and lose its place in the code.  So a "pause" button and careful monitoring may be the easiest solution until I have some more experience in working with machine controls, or I might implement a "time out" if the machine has been running for 20 minutes straight.  Thinking about potential problems is fun (really!)!

-John

6 hours of work and I have an X-stage.  I thought it would go faster, but  of course I decided to experiment with the build.  So I had fun, the experiments failed, and the X-stage is completed, with lessons learned (The precision of a circular saw cutting at 45 degrees is >> 1mm, so do not design for such precision).   The X-Stage does not roll as effortlessly as I hoped it would, but I blame that on the precision of cutting and aligning the X-stage boards.  If I feel ambitious, I'll re-align the rails on the base so that the X-stage sits perfectly on it, and rolls effortlessly all the way... but as it is it seems to work well enough that I expect the steppers to be able to drive it.  If my X-stage is skewed, all the rail re-aligning attempts in the world will not fix the problem, so perhaps I'll need to measure it and add a crossbar if I'm really hung up on effortless sliding.

Looking forward to completing the Y-Z stage next time I have a few hours to work on it.

I switched to this design, exactly because getting precise 45 degrees cuts is very hard (see the first design, The Beast).
I quickly realized the wisdom of that choice, but I had to try it myself.  I noticed that if I used a 45 degree cut on the Y-rail and Z-rail, I would be able to move the spindle a centimeter or so closer to the X-stage. 

Woo hoo!  The PCBs are good.  Motor test is fine.  I have the driver on BatchPCB: public design, search "stepper".  The board I had fabricated is from board file tiny2313_stepper.brd as attached to my original post; the schematic is same as the original on http://github.com/TinHead/Valkyrie-CNC-source-code/tree/master

The pull-up resistors on the I2C did not work when I used 100kOhm, but work fine at 10kOhm and even at 470 ohms (on my protoboard, I mistook the brown order band for an orange and used 470Ohm instead of 47kOhm as listed in the Eagle file).

Looking forward to completing the hardware (X-Y-Z stage) sometime later.

About the Attiny, it is most likely recoverable (well unless you isbled ISP by mistake), try running  avrdude as follows:

avrdude -c usbtiny -p t2313 -U lfuse:w:0xff:m -B

or if that fails

avrdude -c usbtiny -p t2313 -U lfuse:w:0xff:m -i 100

 

The pinout you seem to sorted out, another way would have be to measure the resistance between the wires so you would have know which belong to one winding and which to the other.

 

Regarding I2C note that all connected logic has to be powered from the same power source so unless you connect the Arduino to the same as the drivers it is most likely not going to work. Also make sure you do not use a twisted wire pair  to connect SDA and SCL or if you do make sure you have SDA on on pair with power GND or and SCL with positive lead.

 

Thank you!  I'll try to reflash the fuse bits with the additional avrdude flags.   In a few minutes with a soldering iron, I attached an Arduino power jack to a ATX PSU 12V/GND lead and now I2C works.  Thanks!

One of my next steps is to increase the number of drivers addressed by the Wire interface.  Would I do that by putting the drivers in parallel?  Arduino pins Analog4 and Analog5 are the wire pins, so I'd guess that I put them in parallel.

-John

It's a kind of bus connection like the obsolete coaxial ethernet but without terminal.... like two wires go from master -> slave-> slave-> etc...