Step 6: Prepare the Arduino.
I have however changed the pin-out since then and here in the instructable I use the default pin-out of Grbl. This will make it a lot simpler to follow and setup. You can just download the prepared hex file from the Grbl download page .
Important:
The current version of Grbl (0.6b) has a bug in the queue system. The laser on and off (M3, M5) commands are not put in the queue and the laser will be turned on and off as soon as the Arduino receives the commands. This is resolved in the edge branch. You can download and the source from here , or grab the compiled hex I am using from here . This should resolve the issue until the next version of Grbl.
Any way you choose to do it you will end up with a .hex file that you must get into the Arduino. I have tried a couple of different ways and the one I like the most is by a program called XLoader . The programming is pretty straight forward; select the correct serial port for your Arduino. Select the hex file and type of Arduino and press upload. If you are using the new Arduino Uno the XLoader doesn’t work, you will get an upload error. In that case I recommend using ARP/Arduino Uploader but even this uploader has some issues with the Uno. When programming the Arduino select the com port and microcontroller in the respective dropdown. After that you will have to make a change in the “AVR Dude Params” text. Erase the “-b19200” (without the quotes) part and click on the upload button. In any case, a couple of seconds later you are done and are ready to try it out. Exit the XLoader and get to the next paragraph.
The Arduino needs to be set up for the job. Start your favorite serial terminal and open the port your Arduino is connected to. You should get a welcome message:
Grbl 0.6b
'$' to dump current settings"
If you enter $ followed by return you will get a list of options. Something like this:
$0 = 400.0 (steps/mm x)
$1 = 400.0 (steps/mm y)
$2 = 400.0 (steps/mm z)
$3 = 30 (microseconds step pulse)
$4 = 480.0 (mm/sec default feed rate)
$5 = 480.0 (mm/sec default seek rate)
$6 = 0.100 (mm/arc segment)
$7 = 0 (step port invert mask. binary = 0)
$8 = 25 (acceleration in mm/sec^2)
$9 = 300 (max instant cornering speed change in delta mm/min)
'$x=value' to set parameter or just '$' to dump current settings
ok
You must change the steps/mm for X and Y axis to 53.333 on both. Just enter "$0=53.33" followed by return and then "$1=53.333" followed by return. Z axis can be ignored as it is not used. The acceleration can be ramped up to something like 100 ("$8=100" and return). As we move really slowly with this machine acceleration can be high. Another side effect of low acceleration can be that curves get a lot more burnt than straight lines as the controller constantly tries to accelerate and decelerate but never reach full speed. If you build this like me one of your axis might be mirrored. This is easy to fix. Option $7 lets you change direction on axis. I wanted to change direction on the X axis so I type in "$7=8" as I want to change bit 3 (8 = 00001000 binary) if you want to change direction on Y axis you type in 16 (00010000) or 24 (00011000) to change both. The complete documentation of the invert mask can be found here .
Now you are ready for the computer setup. If you want to try some movement you can type "G91 G28 X0 Y0 [return]" to zero the axis. Followed by "X10 Y10 [enter]". You should see 10mm movement on each of the axis.
Remove these ads by
Signing Up













































Visit Our Store »
Go Pro Today »




, to correct the geometry distortion.
You could use the floppydrive-mechanics as well for an engraving machine as above, unfortunately they have a smaller "reach" as DVD-players. I've noticed that some floppy/DVD-drives use unipolar steppermotors/drivers, while other use bipolar steppermotors/drivers. (Some DVD-drives don't use steppermotors b.t.w.) You'll need to be sure driver and motor are the same type.
Well I am Brazilian and I have difficulty understanding English, would aid her.
I'm struggling to understand how to download the files to the arduino, control the motors, which files should I download?
You could pass them to me by email?
Thank you.
great job!!!!
Just make the board and use it for the easydrivers, or just connect the easydrivers with the arduino by simple cables (but I would suggest you to use the board as it seems better way).
1st of all this is the best explained tutorial for CNC (especially for the software part!)
Now to my questions
1st- so the 53.333 is the length of the axis, so if i were to make my laser engraver bigger thats the thing to change right?
and second: If I use the pin-out defined by Grbl i can just use your .hex file , right?
, oh and is the shield schematic you provided uptadet (with the correct pin-out's)
Thanks in advance!
Yes, schematics and hex file will be the correct pinout for grbl. Unless they changed it in the last year and you use the files from Grbl repository. They have come a long way in since this was written.
Oh and i have also seen that people use servos instead of steppers, can they be used with this software?
Thanks!
i can still use the small steppers to drive a bigger rig, right...or are they consuming more current when they are at greater effort
This is the reason you have to take great care when you create your g-code from your drawing. If your drawing is of a box 20cm by 20cm the controlling software will try to make that happen without knowing the physical limits.
For streaming a file to GRBL with G-code sender I not sure what to expect. I put your 2 sample line in, however G-codeSender only ever sends Row 1.
Is g-codesender waiting for some sort of acknowledgement before sedning the next line?
I'm using chipkit max32 (arduino mega clone) and when I try to upload .hex file using xloader - shows "upload failed".
I can't find any software to upload the .hex file.. can you give me some suggestions ?
Thanks.
avrdude.exe -C ../etc/avrdude.conf -c stk500v2 -P COM3 -p pic32 -b 115200 -U flash:w:"C:\Users\Fr0sty\Desktop\Laser\simen-grbl-74576a8\grbl.hex":i -v
then its loading and succes!
100mW, 150mW, 200mW, 400mW, 500mW) all colors.. but is with pushbutton :<..so i must modify the laser driver in order to turn on and off when its needed..
http://dank.bengler.no/-/page/show/5473_connectinggrbl?ref=mst
For GRBL version 0.6, the default Arduino pin assignments should be:
Arduino Pin #
X_STEP_BIT 2
Y_STEP_BIT 3
Z_STEP_BIT 4
X_DIRECTION_BIT 5
Y_DIRECTION_BIT 6
Z_DIRECTION_BIT 7
All is good now.
Bob
Appears not to work with GRBL. GRBL hex file loaded with Xloader just fine. GRBL responds correctly to $ prompt, and can change settings correctly, but still only a slight movement when issuing an X command (testing only X direction now).
Should I have loaded GRBL into the Arduino with a separate hardware programmer like the AVR ISP2? Why would this make any difference compared to Xloader?
Still dead in the water. Thank you to all who offer suggestions!
Bob
However, when I send, for example, a movement command, say X100, all I get is a small movement. In addition, sending X-100 does not reverse the direction. Sending X10000 delivers the same small movement. And the motor is getting hot!
Please offer suggestions! Thank you in advance!
Bob Pigford
Bob
Bob
When attempting to upload the grbl.hex to my arduino mega 1280 (older revision not the new one on sparkfun) I get Upload Failed, on Xloader and something about "not in sync" on ADP is this because this program was not designed for the mega or is soemthing else up ?
Thanks!