Monday, February 24, 2014

Chinese CNC 3040T Router/Mill through USB Easily

I finally got a CNC Router.  This one is one of the low cost Chinese CNC Routers.  It's a great machine for the price.

The first problem I had with it though was the CNC Controller being Parallel port.  I could've sworn I had a PC laying around that had Windows XP and a Parallel port, but I was wrong.  Wanting to get this Router up and running I decided to look into a USB to Parallel bridge via an Arduino UNO I had laying around.

After doing some research I came accross GRBL (https://github.com/grbl/grbl).  This opensource firmware for the Arduino will take G code via USB Serial and output the corresponding step/direction signals to a Stepper controller.

I had a female parallel port connector in a bin and straightened out pins 2-7 and just inserted them into the arduino digital pins 2-7. I then connected Pin 25 to GND on the Arduino.








I then downloaded and modified the GRBL source code (pin_map.h) to reflect the YOOCNC pinout to the DB-25 connector.


#define STEPPING_DDR DDRD
#define STEPPING_PORT PORTD
#define X_STEP_BIT 2 // Uno Digital Pin 2
#define Y_STEP_BIT 4 // Uno Digital Pin 4
#define Z_STEP_BIT 6 // Uno Digital Pin 6
#define X_DIRECTION_BIT 3 // Uno Digital Pin 3
#define Y_DIRECTION_BIT 5 // Uno Digital Pin 5
#define Z_DIRECTION_BIT 7 // Uno Digital Pin 7
Recompiled. Loaded into the Arduino... And within 20 minutes had my Chinese CNC up
and running using a USB port and Gcode sender.
https://github.com/winder/Universal-G-Code-Sender 



If you would like to donate to my projects fund, my paypal is: zothar@zothar.com  All donations will contribute to open source efforts and documentation to make others lives easier.  It's a pain trailblazing a new or dirty path, especially with limited funds...

11 comments:

  1. I didn't realize you had gotten a 3040T too! Thanks for this post, super useful!

    How has your milling been? Do any aluminum?

    ReplyDelete
  2. Thanks! For the price I think the 3040T is a great deal. I've done a little aluminum; still playing with the feed rates and tool depth per pass. It's doable, just painfully slow at the moment. Not sure if its the used endmills I bought on ebay or the build up of aluminum dust... I'll see if I can get some of the settings off my CNC pc to post.

    ReplyDelete
  3. Hi, I was curious if you wouldn't mind me turning this idea into a conversion kit (microcontroller) through oshpark?

    Thanks

    ReplyDelete
    Replies
    1. That's a good idea. I couldn't see why it couldn't become an Arduino Shield. I'll get my Eagle CAD fired up :)

      Delete
    2. Ya, I had made a complete controller out of it. But a shield ya that would work. Could etch it at home that way as well.

      Delete
  4. Let me know what you come up with.

    ReplyDelete
  5. Thank you for this guide! What are your exact $$ settings in grbl? I'm having trouble getting the motors moving at the proper speeds

    ReplyDelete
    Replies
    1. Grbl 0.8c ['$' for help]
      $0=403.000 (x, step/mm)
      $1=403.000 (y, step/mm)
      $2=403.000 (z, step/mm)
      $3=11 (step pulse, usec)
      $4=900.000 (default feed, mm/min)
      $5=900.000 (default seek, mm/min)
      $6=160 (step port invert mask, int:10100000)
      $7=10 (step idle delay, msec)
      $8=40.000 (acceleration, mm/sec^2)
      $9=0.050 (junction deviation, mm)
      $10=0.100 (arc, mm/segment)
      $11=25 (n-arc correction, int)
      $12=3 (n-decimals, int)
      $13=0 (report inches, bool)
      $14=1 (auto start, bool)
      $15=0 (invert step enable, bool)
      $16=0 (hard limits, bool)
      $17=0 (homing cycle, bool)
      $18=0 (homing dir invert mask, int:00000000)
      $19=25.000 (homing feed, mm/min)
      $20=250.000 (homing seek, mm/min)
      $21=100 (homing debounce, msec)
      $22=1.000 (homing pull-off, mm)

      Delete
    2. Awesome! Thank you so much!

      Delete
  6. I ditched the standard motor controller board on mine in favour of a Ghecko G540. But as I recall the Parrallel connection is broken out to 0.1' pads inside the YouCNC controller. It should be easy to do this with an Arduino Nano and point to point wiring in the case

    ReplyDelete
  7. I ditched the standard motor controller board on mine in favour of a Ghecko G540. But as I recall the Parrallel connection is broken out to 0.1' pads inside the YouCNC controller. It should be easy to do this with an Arduino Nano and point to point wiring in the case

    ReplyDelete