CNC Machine -- Valkyrie-Clone CNC

Old pic: https://www.robotshop.com/letsmakerobots/files/clone_cnc_closeup_1500px.jpg

TinHead's Original: https://www.robotshop.com/letsmakerobots/node/9006

Vector Drawings: https://www.robotshop.com/letsmakerobots/files/clone_cnc_vector.pdf (draft)
Measurements will be available for these drawings sometime over Christmas Break 2009 or if somebody asks me for it.

Specs:

  • ~175mm x ~115mm cutting area
  • Cuts 4" x 6" copper-clad boards
    (http://www.oselectronics.com/ose_p56.htm)
  • Resolution: On a copper-clad board on a surfaced table, a fresh sharp 60° bit, and a carefully set cutting depth, I can get down to 0.4mm traces in the X-direction.  To minimize errors I try to keep to 1mm traces or larger (1.4mm typical, with 1.6mm pads on vias).  Traces can be made at 0.4mm between pads of a DIP IC if "0.12mm" isolation is selected from the pcb_gcode/pcb_gcode_setup plugin in EagleCAD.
  • ~35mm Z-axis travel (allows boards to be stacked on the base)
  • Cutting speed: I added some pauses to the RepRap feedrate code, so I know it isn't going as fast as the feedrate says it's going.  However, I did surface a 110mmx160mm area with 1.2mm passes in about an hour with a ~2mm bit (cutting off about a millimeter depth of particle board off the surface) -- so about 256mm/minute for surfacing, corresponding to reported feedrate of 1000.  On copper-clad board, with a 60° engraving bit, I have used a feedrate of 1400, but it could go faster.  The feedrate of 1400 means ~360mm/min.  
  • Machine Dimensions: about 20"x17"x22" clearance (X,Y,Z) (0.50 x 0.43 x 0.56 meters) -- the base stage is 18" long by 12" wide with extra room on the sides for the motors/lead screws/X-stage which brings the Y-dimension out to 17" (from 12").  The motors on blocks extends the X-dimension to 22" (from 18").  (1" = 25.4mm)
  • Measurements shall be added to vector drawings soon!
  • Computer runs Inkscape with GCODE plugin for design, EagleCAD with GCODE plugin for PCB.  Code executes on Chris Meighan's "GCODE for RepRap", running on Windows XP. 

Documentation:

  • Blog posts: https://www.robotshop.com/letsmakerobots/node/11287
  • Vector Drawings: https://www.robotshop.com/letsmakerobots/files/clone_cnc_vector.pdf (draft)
  • Part List: https://www.robotshop.com/letsmakerobots/files/cnc_partlist.pdf
  • TinHead's Stepper Driver (modified): https://www.robotshop.com/letsmakerobots/files/tiny2313_stepper.brd (EagleCAD with SparkFun design rules

Tools for construction:

  • Workmate Bench, Drill, Circular Saw, 500 pc (est.) drill set, coping saw for aluminum rails, tape measure, ruler
  • Proxxon 12VDC Rotary tool for spindle, 36pc Dremel set including metal-cutting bits for cutting lead screws
  • Soldering station
  • Adafruit USBtinyISP AVR Programmer (plus WinAVR software)
  • ISP target board with 16MHz Crystal Oscillator (pictures to follow)
  • Wire cutters, pliers, linesman pliers, C-clamps, socket wrench, adjustable wrench
  • (Circuit board etching setup or PCB trace routing machine or PCB vendor)
  • EagleCAD with SparkFun Design Rules plugin (keeps traces from getting too close to each other)

Components:

  • Adafruit DC Boarduino for control (requires FTDI cable) or Arduino Duemilanove
  • Stepper-Driver components described in Bill of Materials https://www.robotshop.com/letsmakerobots/files/cnc_partlist.pdf
  • 24VDC Stepper motors
  • ATX Power Supply Unit, 300W or (http://www.rackmount-devices.com/045-6854.html, http://www.interinar.com/fs-15024-1m.html)
  • 20' CAT-3 cable -- for signal wires (20' = 160' of 24AWG wire)
  • 25' wire -- 20AWG for power wires
  • 1/4" interior diameter clear tubing
  • heat shrink (various sizes)
  • 5/16"-18 fully-threaded bolts x 2" or longer (M8-1.25 equivalent, 60mm or longer) to fit the interior diameter of the skate bearings
  • 40 inline skate bearings (e.g. "China Bones" and "ABEC-1" used for this machine)
  • An IKEA nightstand worth of particle board/MDF -- or 1/3 sheet of particle board or MDF from the lumber yard

Cost: I built up my workshop while building this project, so it is hard to estimate the true cost.  For folks who have access to a wood shop, an electronics lab, an AVR programmer, a circuit-board etching setup, creative part sourcing and a rotary tool, you can probably build this for $150 in about a week.

Code: Based on the Valkyrie CNC stepper driver/Arduino source code: http://github.com/TinHead/Valkyrie-CNC-source-code/tree/master.  Perl Script loaded https://www.robotshop.com/letsmakerobots/files/serial_script.pl_txt, attachment to this page.

Prior Art:

  • Valkyrie CNC: https://www.robotshop.com/letsmakerobots/node/9006
  • $250/$350 CNC: PCB mill and Gantry mill from http://bluumax.com/ (USA)
  • $600-$800 CNC: Sable-2016 PCB prototyping CNC on ebay (lukechan66), (incl. ~$100 freight cost to USA)
  • $1100 CNC: Fireball V90
  • $500-$1100 CNC: Mike Beck's CNC Router Kit at http://www.mikebeck.org/  (USA)
  • $2900 CNC: http://buildyourcnc.com
  • $???? CNC: http://www.cerebralmeltdown.com/cncstuff/mycnc/index.htm
  • ATX PSU Power Supply: http://www.wikihow.com/Convert-a-Computer-ATX-Power-Supply-to-a-Lab-Power-Supply

Tricky Parts:

  • Setting the ATTINY2313 "lfuse" to a 16MHz oscillator: "lfuse" to "0xFF"
  • Aligning the lead screws: I used floating blocks that were aligned at each end and screwed down. (https://www.robotshop.com/letsmakerobots/files/clone_cnc_floating_block.PNG)
  • General alignment problems: Of the four rails used for X-stage travel, the two rails on the top and bottom of the base-stage should be parallel to <1mm, and the rails on each side of the base should be parallel to ~1mm.
  • Aligning the X and Y axis: the X and Y stages should be perpendicular to each other to 1mm over the runout of the stage: "Clone CNC" has 3mm of Y travel over the 165mm X runout :(  I'm not sure whether it'll be a problem while drilling holes in PCBs
  • Alignment of the Z-axis -- the floating block may not be possible, or may have to be positioned on top of the stage near the motor.  Good alignment will make it easy to lift the stage.  Bad alignment will make it difficult for the little motors to lift the stage.  Rails and screws should be parallel.
  • Switching to 24V -- the ATX PSU is not meant to put out a whole lot of power from the -12V (blue) wire -- only about an amp from -12 to GND.  You may only get one quarter amp to work with when you run the steppers on the -12V/+12V wires.  The Clone CNC is running fine, but I have a spare PSU in case the current one dies from too much load on the -12V line.
  • The Boarduino must be hooked up to the same ground as the stepper drivers -- run it from -12 to GND (GND is positive/high, and -12V is ground: confusing?) if you use 24V from the ATX PSU.

Kudos:

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 (last time I joined more than 2 pieces of wood was in Middle School shop class in '93).  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 ).

Rear View:  The picture above shows the Z and Y axis drivers, plus the homemade power and I2C terminal block. The +12V bolt is heat-shrinked in yellow, the -12V bolt is heat-shrinked in blue, and the I2C is bare (because it is >100x less likely to kill me or burn me).  I chose a telephone-style terminal system -- wrap the wires around a bolt, between washers, and tighten.  Fasten the bolt on an insulating surface (wood in this case) and mount the terminal in a convenient place (screwed onto the X-stage).  The pairs of wires are not twisted together for neither power nor I2C pairs -- Instead I run the wires parallel and keep them seperated at a fixed distance with tape.  I got the idea from outdoor "Ladder Line" antenna wires used in ham radio, for which you also don't want crosstalk between wires.

Update 19/11/2009: Trace routing on copper-clad board -- There were some lockups due to bad table surfacing and wrong choice of routing bit.  Also, the machine was losing steps on the Z-lifting steps, so I added rubber bands and zip-ties until it stopped.

Update 21/12/2009: I loaded "serial_script.pl" as an attachment, which is a perl script to control the CNC.   I improved my clamping system and re-surfaced the table.  I still needed 60° trace-routing/engraving bits.  Up-cut router bits are the wrong tool for trace-routing.  In "serial_script.pl", the Perl script receives either no arguments, in which case it runs a script, or a GCODE command string, which it sends to the microcontroller.  So >>./serial_script.pl "G01X10Y10" would step the CNC 10mm in the positive X and Y directions (along a diagonal).  The 5-second delay is needed for the controller to initialize when the script starts.  Also, there needs to be a "Serial.println("zomfg");" inserted in "arduino_gcode.pde" after initialization is complete or the script will never continue.

Update 24/12/2009: https://www.robotshop.com/letsmakerobots/files/clone_CNC_first_trace.JPG -- I got my new 60° trace-etching bits, a new Java application by Chris Meighan (http://www.chrismeighan.com/projects/g-code-for-reprap), courtesy of avantgps and with help from brickbatbae, and a vacation day to play with it all.  I attached the second X-axis lead screw.  I used the back of a used copper-clad board to test my new bits.  The only problem was that there were empty lines in my GCODE file, so the GCODE for RepRap would send the line, but the arduino would not reply, so the script would not continue.  There were no problems with the I2C failing.  From start to finish, the board was routed and drilled without having to home the machine.  As long as I make my EagleCAD boards with wide traces and big pads for the components, I should be able to use the pcb-gcode plugin to make circuits.

Update 29/12/2009: Guitar Effects Pedal Power Supply Project, for which I used EagleCAD and this beautiful little CNC.  https://www.robotshop.com/letsmakerobots/node/13983

Update 09/Jan/2010: 83MB of photos of the Valkyrie-clone CNC at http://www.freakivy.com/clone_cnc_complete.zip

Update 25/Jan/2010: The CNC is hard at work etching and drilling new drivers for some bigger motors for a motor upgrade.  It has been up and working for about a month now (since I got the 60° bits a little before Christmas).  I am a little nervous about changing my machine since it works (it's fabricating its own drivers), and the little printer motors are kind of charming.  I think I'll work on the control system and hold off on building (buying?) a new machine until the old one breaks or starts to fail.

Update 30/Jan/2010: The machine seemed to be failing.  It became extra-sensitive to changes in current, for example, when the machine is cutting.  I blamed changing my power supply from multiple supply wires to a single supply wire (I had my supply wired bundled at first, but then just used a single wire), and also blamed changing the drivers to be inside the box.  I noticed TinHead made a change that seemed to help -- while moving the drivers inside the metal case, he upgraded to a 24V power supply.  I was wondering if my seeming I2C problem was a power supply problem.  Later, I remembered that I also moved the Arduino inside the box from on top.  The final fix was to move the transformer brick for my Proxxon drill from the top of the machine to the other side of the machine, and to plug it into a different outlet.  As of February I'm fabricating boards as good as or better than ever.

Update 11/Feb/2010: I made an 8-channel full-bridge rectified and regulated DC 9.0V power supply for my brother's many guitar pedals.  Another brother will be making a pedal board, and the power supply will allow for no more 9V batteries.  Also, I'm working on the machine upgrade -- I'm planning to change the control system from a smart 4x ATTINY2313 board to a RepRap v1.2 style stepper driver system with a single ATTINY2313 working as a multiplexer via I2C.  I'm cutting the ATTINY2313 multiplexer board now.  The multiplexer will take an I2C command from the Arduino and move one of the stepper drivers.  Since there are 9x digital channels controlling the steppers, I wanted to move these wires to a dedicated board off the Arduino.  The three-wire drivers (x3 unique channels) will be clipped into the ATTINY board.  Schematic attached. GCODE files need to be relabeled from ".nc" before I can attach them.
https://community.robotshop.com/uploads/j/o/john-ny/imported/tiny2313_multiplexer_brd.png
https://www.robotshop.com/letsmakerobots/files/tiny2313_multiplexer_sch.png
https://www.robotshop.com/letsmakerobots/files/tiny2313_stepper_0.sch
https://www.robotshop.com/letsmakerobots/files/tiny2313_stepper_1.brd

 

Update: 17 August 2010 -- New Drivers!

The short of it is that I got the Valkyrie-clone CNC working with new drivers (https://www.robotshop.com/letsmakerobots/node/15686).

In the picture from top-left, clockwise to bottom-left: the terminal block (24V power up to 13A), the 2 X-axis drivers, the Y-axis driver (blue heat sink), and the Z-axis driver (blue heat sink), the Arduino controller (direction x3/enable x3/step x3), and just below the terminal block there is a small 9V regulator board to shift 24V down to 9V for the Arduino.  Everything is mounted on an MDF board, and the board is mounted with baling wire.

More to follow, but it seems to work fine.

Cut, engrave and drill using GCODE scripts

  • Actuators / output devices: cheap stepper motors driving threaded rods
  • Control method: Serial control, Atmel microprocessors, L298
  • CPU: ATtiny2313, adafruit Boarduino
  • Operating system: Windows, for design, Scientific Linux, RHEL, Perl script, for scripting
  • Power source: ATX PSU, 300W
  • Programming language: Arduino C, AVR C, Perl, GCODE
  • Sensors / input devices: Limit Switches
  • Target environment: Indoor/Outdoor, well-ventilated areas

This is a companion discussion topic for the original entry at https://community.robotshop.com/robots/show/cnc-machine-valkyrie-clone-cnc

**amazing **
wow great job

**Ive been following the I2C**<br>Ive been following the I2C woes for a while now seeing as I was intending to use the same setup. If you could afford to spare 4 more pins from the Arduino have you thought about just using direction and step lines instead?

Current draw problem?

I’ve have only recently been noticing these freezes, so TinHead has more experience than I. I do have long I2C wires and short motor wires, so perhaps short I2C wires and long motor wires will solve the problem. Maybe it is an interference problem, or perhaps it is a power problem?

I’m wondering whether further testing will show that the freeze happens when both X and Y axes are trying to move, or whether it is also necessary for the rotary tool to be drawing a lot of current – which presumably happens when the spindle is starting to slow down while trying to cut through a lot of material. The total amount of current drawn by the ATX PSU and the spindle should not be much more than 4 amps at 12V (plus the 2.5 Amp load resistor – which is 10ohm at 5V), so the 120VAC USA mains power should be able to supply that easily as long as there isn’t a large delta in the power demand. I notice a lot of hobby CNC power supplies have large capacitors to cope with the power needs of the machine. Could a large simultaneous change in power demand from seperate spindle and ATX PSU power supplies cause the problem? If it were a problem, I’d think anything on the same surge protector would lose current too, and my laptop (with a bad battery) has never restarted as a result of the de-synchronization of the I2C.

Alternately if the problem is due to the E/M interference of the spindle, it would be dependant on the position of my external Proxxon 12V supply (which I could move away from the unit), and that of the drivers (which I can move away from the spindle). I also might try re-routing the I2C – the clock and data lines are pretty close together, and while testing my machine, I found them to be coupled – that is, if I plug an LED from the data line to Arduino ground, while only plugging in the clock line, the LED becomes lit due either to interference between the clock and the data lines, or because of the ATTINY2313’s “I2C data line” setting (high-impedance?). I don’t notice it unless the clock line is plugged in to the Arduino, so I thought it might be because of crosstalk. I’ll post a diagram if it helps.

-John

Boards picking up EMF?

You have several different options:

 

  • Putting them in a metal case and earth grounding the case
  • Faraday Cage around the board or the EMF transmitting device
  • Seeing if Ferrite bead, cores, rings will cut down on the EMF
  • Use a squirrel as a mechanical power source for the cutter

 

Other than that, I don’t know

 

Mech

Yup, you’re certainly right about the I2C

It does looks like the LED should be lit since the I2C is active low-- an oscilloscope would be fast enough to measure crosstalk, but I expect my eye would not. For the test, I ran a routine to just send the motor test script again and again, while the motors were not connected to the drive screws. I was surprised to notice the LED lit up – but the diagram shows that even if I had disconnected the SCK line, it would have still stayed lit – i.e. the test was faulty. Time for a new hypothesis, or more testing, I guess.

Although the Proxxon tool has a seperate AC-to-DC converter, the spindle still probably contains a brushed motor (the specs say it is “permanent magnet” DC motor == brushed). So I’d have the same problem as the Valkyrie original, just to a different extent, depending on how close my boards and wires are to the spindle.

… But why would it run forever on its own (e.g. surfacing and lightly tracing) but fail when the spindle slows down? I have run two hour-long surfacing scripts and one attempt at tracing that did not attempt to cut deeply, which were uninterrupted (there were mechanical precision issues on the tracing attempt, but no lockup). hmm… -John

clone_cnc_I2C_test.PNG

I worried about crosstalk because the pull-ups are very close together, the traces are thin, there are lots of sharp corners until the +5V line meets the main +5V source, and oscillating clock cycles perhaps could cause small changes in the data line without a lot of current going through the pull-up resistors. Probably no problem compared with the induced current from the long data wires, but it made sense at the time as a possible physical phenomenon. (I tend to look for as many potential causes as possible, quantify the impact of each, and demonstrate it is far too small to affect things -- but I'm unfortunately not so good at doing this for circuits yet).

thanks!

This is sort of what TinHead is suggesting, but more general, so I may try this if there are continued problems. The Z-axis board is closest to the spindle motor, and indeed I recall seeing the lockups when the spindle was on the side where the Z-axis board is mounted. Before I jump to conclusions though, I note that the design I was building was exclusively on the side where the Z-axis board was mounted, so perhaps there’s no correlation until I can show that there is no lockup on the side without the board.

 

  • I have a spare PSU case (empty) that I could put the probably ground. The only problem is that I would want to run a separate “earth” wire in addition to the two power wires – negative 12V is my ground, and I’m inexperienced enough not to know whether GND (black wire) is the same as the earth wire. I do see a green wire hooked to the PSU case, so I’d hook up a wire to that one to give me earth ground. Alternately I could put a big metal sheet between the Z-axis and the Y-axis boards and ground it to help with the shielding.
  • Faraday cage is the most appealing – I’d use the spare PSU case and shield the Z-axis board. The big metal sheet might help too.
  • I think I have beads, cores and rings I could try – but I have more wires than I have cores, so I’d want to locate the most likely culprits.
  • Squirrels are not as common in Los Angeles, trapping them is difficult, and palm trees don’t have acorns. For the price, I might upgrade other parts of the machine rather than build a squirrel treadmill/gearbox assembly.
Thanks for the help! I’ll definitely be continuing to monitor for lockups and try to figure out some sort of pattern to their occurrence. -John

I was thinking
If you were a linux geek, I think hooking up a Beagleboard and a monitor to one of these would be cool. You could even make the designs on the actual device, and have it run the motor drivers itself. I dunno…

neat!

That would be a great way to control it! It could run Mach3 from the side of the X-stage. If I wanted to down-spec my controller instead, there would be some cool possibilities too. My control computer (a 2003 Dell Inspiron 1100) is more than is needed to do the job of sending GCODE scripts – all it needs is the FTDI serial drivers and a perl script to time the execution. Pause/interrupt/abort could be implemented on the microcontroller. If I weren’t short on memory on the Arduino, a WizNet ethernet shield could be added, and the controller could run over LAN, or I could add an SD card reader and it would run the script from the SD card. Right now I’m working on getting it to be an adequate CNC, but some neat things could be done once it runs well.

Another CNC!

Woah, I’ve been looking all last night for people who’ve built cnc’s with an arduino controller, I wake up today and find two more (los angeles). Great, great. I’ve posted on aventgps and tinheads build page to help myself with issues sending g-code through the serial link. I see various people used different things–tinhead using python and you using java. I found your source code for the java program and opened the .jar and .bat files, and nothing. I know I have a JVM on my computer, as I was remember fiddling with java a few weeks ago (maybe I deleted it >.< )

 

Well, the big question do you recommend a certain JVM?

and I can’t seem to find the rxtx libraries on the net for the life of me.

EDIT:

I think I just found them facepalm

Are these it?

http://reprap.org/bin/view/Main/RepRapMicrosoftSoftware#Java_Development_Kit_JDK_Java_Ru

http://reprap.org/bin/view/Main/RepRapMicrosoftSoftware#RXTX_Serial_Library_serial_port

Which version of the rxtx should be used?

Greek to me

I have no idea! I just found the site http://www.chrismeighan.com/projects/g-code-for-reprap after aventgps mentioned the fellow Chris Meighan, and was planning on testing it out over the Christmas break. It is certainly a more refined program than my Perl script.

Thank you for doing the research! I will also be looking to get the “Gcode for Reprap” program and the JVM to work over the holidays. Avantgps may be able to help with the install, and if you do work it out, I’d be interested in how you got it to work. I am definitely looking for an upgrade from my Perl script.

Thanks! -John

ps – I owe comments on my script and a new version that works with Tinhead’s latest revision. For example, one of the “feedback” lines that the script looks for contains “zomfg”. That is not an original TinHead/RepRap message, it is part of a colorful debug line I inserted while discovering that if I did not power up the driver boards, the Arduino would not completely initialize. The “zomfg” line occurs once the drivers are loaded and ready to go. So anyway, I owe some comments and source code. If you are modifying Tinhead’s code and want to use my perl script with minimal changes, I’d insert a line in “arduino_gcode.pde” at the end of the “setup()” sequence after “init_steppers();” that says

void setup()
{
Serial.begin(19200);
Serial.println(“start”);
//other initialization.
init_process_string();
init_steppers();
Serial.println(“finished loading! zomfg!”);
}

Success!

That was a great link! I installed

  1. JDK – development kit, which also installed JRE v1.6
  2. J3D – 3D Java
  3. RXTX – into each of my JRE folders (bin and lib/ext) according to instructions, and also into my JDK/jre/bin and JDK/jre/lib/ext folders
  4. The GCODE for RepRap into an arbitrary folder.
After it was installed, and I restarted my Windows PC, I launched the .bin file in the reprap_gcode folder and it launched the program. Thanks! I’m looking forward to testing it out with the CNC.

always welcome to help, but…

I was actually asking YOU if that was the proper way to set up your gcode to arduino program :smiley: but I’m really glad to be of any help! Haha. Well, I’d love to see if it works with your machine. Also, would you recommend sticking with the l2c motor controllers? I’ve been looking at sparkfun’s stepper motor controller to simplify the build for me. (I’m not too familiar with motor controllers, please excuse my ignorance!

 

And I thought it would be cool to share: I’m building a cnc to devlop build-plans for a simple, cheap and reliable cnc and hopefully a team and I can supply community high schools with these machines to feed the brains of tomorrow’s engineers. For now, I’m trying to figure out the software end of things first as the mechanical aspect is far simpler (imo) than the programming which I’m fairly new to.

 

All in all, I’d love to see how the java program works out, and figure out if I should stick to the l2cs or try out sparkfuns SMcontroller. Hopefully you (and others) will be lurking around during my build.

 

Happy holidays guys!

EDIT: Oh my, I must have mistakened your page for aventgps, I just remember finding somebody mention “gcode to reprap”, and as it was 4 in the morning and me rubbing my eyes over yours, tinheads, and aventgps’ page, I must have gotten a few things confused. But I’m glad to have helped you out, as you will now be my test gineua pig! I hope the code works out for you.

Also, You said you were using perl? Tinhead with python, you and perl, and avent with java. I wonder which one I should use.

Well again, I hope the gcode to reprap works well for you (and me) and please get back to me on the motor drivers! :slight_smile:

 

doublepost.disregard.
doublepost.disregard

>> Also, You said you were

>> Also, You said you were using perl? Tinhead with python, you and perl, and avent with java. I wonder which one I should use.

Yup. I have the code attached to my robot page (I think it’s under the robot pic). I would use the java app! It’s cross-platform (unlike the Visual Basic 6 GUI I was considering building) and it lets you pause your script. The pause button is amazingly useful, let me tell you. I found that Tinhead made almost the same script that I did, so we have about the same features.

>> I’m building a cnc to devlop build-plans for a simple, cheap and reliable cnc and hopefully a team and I can supply community high schools with these machines to feed the brains of tomorrow’s engineers.

That’s a great idea – I’m sure you’ll keep safety considerations in mind, and do some research to find out whether high school administrators most value one of the following: “cheap”/“reliable”/“safe”/“low-maintenance”.

If you check out some of the “prior art” links, there are some good CNC frames available for cheap. Bluumax CNC described his machine on a forum post I had read as a “Playschool” type version (Playschool is a US toy company), made of plastic, that is good enough for light duty and learning, and costs about $230. It would be difficult to beat that price – I’ve spent twice as much as that to build up my workshop so I could make this machine. I heard good things about using a Proxxon Professional Rotary Tool instead of a Dremel – it is reportedly quieter and better-made for the same price. Shopbot is a professional low-cost CNC that may be durable enough for long-term use in a high school classroom, but it costs $20k. The Fireball CNC is a widely used hobbyist frame for about $1200 that should be durable enough. Bosch Colt spindle is recommended as a router for the Fireball CNC.

If I were building a project like yours for a High School classroom, I would be inclined to either use a higher-end machine, or to market a “Build a CNC Machine” class for high school students. Providing a cheap CNC might not be enough. Just my 2¢, so don’t take it too harshly. Great idea, definitely – we do need to train more machinists and more techies in the USA. I’d love to see it take off, so think it through, know your customer, and know how to market your product. I want a shop class in every school and a CNC in every shop. :slight_smile:

>> I2C

Regarding the I2C, I’d say forget about it. I don’t regret building it – I learned a lot about AVR programming, EagleCAD, and parts procurement – but it is a little too smart for what is needed. Get yourself an EZ Driver and Mach 3, and run it on a computer with a DB25 parallel port. http://www.hobbycnc.com/

It seems like every day a new CNC comes out. I just recently saw the “Sable” CNC for $500, now I see a new USA DIY CNC kit at http://www.mikebeck.org for $500 (edit: oops, it’s $500 for frame and router, plus $500 for the high-torque controllers and a sturdy power supply).

Also, this dual-drive system looks familiar: http://www.pdjinc.com/

ahh

I was hoping to use a program using the arduino rather than a standalone stepper motor driver. The idea is based on microcontroller aspect along with machining, to incorportate elec/mech. engineering along with CAD/CAM.

Your links were great, and I’m sure I’ll have a better, more reliable product with it, but I’m bent using the arduino along with a serial port to control a desktop cnc.

My job with this project is to find out if it’s even possible In short, I just have to create a working prototype.

 

The arduino end is fairly straight forward, I just wanted to know what it would take to (coding) to use a different motor controller than the i2c.

Computer -> arduino -> motor controller (http://www.sparkfun.com/commerce/product_info.php?products_id=9402) -> steppers.

And. how did the java work out? :slight_smile:

 

edit wont work!!

You (john_ny) said:

After it was installed, and I restarted my Windows PC, I launched the .bin file in the reprap_gcode folder and it launched the program. Thanks! I’m looking forward to testing it out with the CNC.

Which .bin file is this?

I’ve tried to launch the .bat and the .jar file in my “gcode for reprap” folder, with no success. Frustration is killing me. Would you know how to run it through the command line? When I click the .bat file the cmd shell window pops up and disappears.

Here’s what I did:

Install jdk @ http://java.sun.com/javase/downloads/widget/jdk6.jsp

Install j3d @ http://reprap.svn.sourceforge.net/viewvc/checkout/reprap/trunk/reprap/host/lib/j3d-org-java3d-all.jar

install rxtx @ ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip

download/extract gcode for reprap @ http://sourceforge.net/projects/gcodeforreprap/

I followed the rxtx instructions perfectly.

In the gcode for reprap folder I click the .bat and .jar files and I get nothing. Instructions in the readme has led me to dead end.

AHHHHHH!

EDIT: I forgot to mention.

i’ve gone into the controlpanel>systems>advanced>environmental variables and set up my PATH to be C:\Program Files\Java\jdk1.6.0_17\bin

I run the cmd line and input “java -jar repgcode-0.3.jar” to run the .jar file (essentially, this is what the batch file does), and I get a return, unable to access jarfile repgcode-0.3.jar

MY apologies, I feel like I’m bombarding you with questions…

I can try a fresh install

Oops, not “bin”, it was the “bat” file. Hmm… I am not sure what the problem is. I expect that I may have left out the step where I tried to run Java under command line, but I didn’t think that was an important step. I’d say plug the 3 RXTX files into every JRE version you have on your computer. I had version 1.4, 1.4.2, 1.5.x, and 1.6, along with the JDK, and I installed the files in the bin/ and lib/ext/ folder of each. I didn’t have to mess around with the PATH.

Regarding your specific “unable to access” error, make sure you are in the right folder, and you have the permissions to access the file. For example if you installed the RepGCode folder/files into the Program Files directory (I did not), you may not have access. Are you running XP?

I think I’ll try installing on a fresh computer, and I’ll let you know if there are complications.

hmm.

I’m having so much trouble running one simple program, haha! I’m running on xp. I did the download and installations perfectly…I wonder what the problem is…

I noticed due to your sn that you might live in New York, and I was wondering if you use a messenger program, maybe I can IM you?

I can’t seem to think what the problem with this jarfile might be…

damn gcode parsers…

Edit: I got past the unable to access file by inputting:

"java -jar "c:\documents and settings\andrew bae\desktop\gcodeforreprap\repgcode-0.3.jar,

after somebody told me on a forum that the absolute file path must be specified, instead of just typing

"java -jar repgcode-0.3.jar"


But you said you ran it off the .bat file, which essentially opens the cmd promt and runs:

“java -jar %~dp0repgcode-0.3.jar”

 

That brings me to my question, since you ran it through the .bat file you did not have to specify an absolute path. Why is this? Did you save the contents of the gcode for reprap .zip folder in a specific folder?

Well, after I inputted the absolute path, I recieved this error:

Exception in thread “G-code for RepRap” java.lang.NoClassDefFoundError: gnu/io/C
ommPortIdentifier
at com.chrismeighan.repgcode.GCodeCommunicator.<init>(GCodeCommunicator.
java:43)
at com.chrismeighan.repgcode.Main.initialiseComms(Main.java:168)
at com.chrismeighan.repgcode.Main.loadPreferences(Main.java:638)
at com.chrismeighan.repgcode.Main.<init>(Main.java:136)
at com.chrismeighan.repgcode.Main.main(Main.java:123)
Caused by: java.lang.ClassNotFoundException: gnu.io.CommPortIdentifier
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
… 5 more

Seems like every step I get past there’s another wall!

Again, I’d love it if you and I could have a realtime conversation about this stuff, heck, I’ll even pay for your time.

In any other case, do you mind sharing your perl script? (your link is not working)

hmm…

I shouldn’t say “no” to money, but I don’t think I’d be able to earn it in this case. This morning I was going to install the program fresh on my desktop computer (which does not have JDK/RXTX/J3D installed yet), and document the steps, but instead I ran a script with the GCODE for RepRap program and tested my trace routing with some new 60° bits. Results were good as far as the machine was concerned, but the Java program had some quirks. Not once did it break a drill bit (which my perl script did do) (ps - https://www.robotshop.com/letsmakerobots/files/serial_script.pl_.txt), but I frequently had to manually advance the script by pressing “Go” every line or few.

I am on Pacific time (GMT-8), so PM me with an AIM screen name and I’ll send you an IM. Not sure if I’ll be able to help though, without trying a reinstall. I would like to add that I noticed problems loading the script when the driver boards are disconnected or not communicating. The Arduino code hangs up (since the I2C operation is indefinitely on hold), and the GCODE Java GUI does not load. It didn’t give any messages like you are getting though…