Introduction: Cnc Grbl With Adafruit Motot Shield V2

Picture of Cnc Grbl With Adafruit Motot Shield V2

This is not an instructables is most for sharing the grbl software that I modified to work with Adafruit Motor Shied V2.

I had some Adafruit motor shield v2 and some stepper motors saved from some old printers and i sad i can make cnc or 3d printer. For the mechanical part it was quite easy , is a simple design and i think is one of the most reliable design, is the one where you don't move the spindle on x axis, you just move the hole board, it has minuses at the space you need when you use it. The hard part was the part when i cut the aluminium bars and other stuff because i had to cut them manual.

When all was finish I start searching for software to interpret the gcode on arduino but everything i found was not for my stepper drivers or a bit dumb. So i took an old version of grbl (v7d) and i start modifying and it was not as simple as I thought :))

Step 1: Building the Machine

Picture of Building the Machine

At this part is not to much to say, there are a lot of good instructables about cnc's and i have nothing new :p

I decided to make the Z axis a bit higher so I can attach a extruder and transform the cnc to 3dPrinter, so the working area is 500 mm on X, 400 mm on Y and 300 mm on Z.

The motors are not the best for this but they do the job. Two of them are PM55-L and one is PM35-L all having 48 steps/rotation I power them with 12 v from a atx power supply, the small one is connected to Y axis because it doesn't need so much torque.

The frame for Z and Y axis is made from 20/20 mm aluminium square bars, the X axis frame is made from pal and some aluminium.

Instead of linear bearings I used ball drawer sliders, you can find them at furniture stores, also not the best choice but cheap and stable enough.

I used standard M8 threaded rod with 1.25 mm/step.

To couple the motor shaft with the threaded rod i used cable glands , I put some picture of it, you can find it on electrical store, there are used to tightening cables that are going in or out from a panel or some other boxes. I saw a lot of diy cnc couplers but this is very efficient. For the M8 rod you can use M12 x 1.5 cable glands, the rod is fixing good enough inside of it but you can still use some glue.

For the "control unit" I used a big junction box made by Gewise and the cables for motors and limit switches are going trough aluminium pipes

I will attach a SketchUp file so you can take a better look at the cnc and make some measurement .

Step 2: Electrical Connection

Picture of Electrical Connection

The power supply is a atx pc power supply, to use it you need to put a switch on ground(black wire) and PS_ON(green wire) and also a dummy resistor (10k) between +5v(red wire) and ground, you also can look for a instructables on how to convert a atx to a regular power supply. I used 12 v to power the motor drivers and 5 v for arduino and also for a big fan used to cool down the drivers.

Motor drivers are Adafruit motor shield v2, you need 2 pcs . The shields can be stacked so you can easily use them. The driver support up to 12v. The shields connects to arduino through I2C so it came with a default address (0x60) and it have some pads to change the address from 0x60 to 0x61 ... up to 0x65 depending on what pads you solder, you can find more about this here on Adafruit page.

//edit
The limit switches are normal microswitch connected to arduino with a 10k resistor to ground, and connected to a digital pin. Each switch are defined in config.h, I used 2,3,4,5,6,7 digital pin from arduino. Keep in mind that you need serial connection with the pc so do not use pins 0 and 1.

//limit swtch pins    

#define X_LIMIT_START_PIN 2
#define X_LIMIT_END_PIN 3
#define Y_LIMIT_START_PIN 4
#define Y_LIMIT_END_PIN 5
#define Z_LIMIT_START_PIN 6
#define Z_LIMIT_END_PIN 7

//edit

I've made a usb extension cable and glued on the control unit so i can easily connect the cnc to pc.
I think this is all here :P

Step 3: Grbl Firmware

Picture of Grbl Firmware

The initial grbl is using Easy driver to control stepper motors. The Easy driver use 2 pins to control the motor, one pin control the direction and the other one for step.

To implement the Adafruit driver i had to rewrite the motor control and the motion control files, to remake the line and arc algorithms. Also I remade the limit switch functions so now the software knows which limit switch is pressed and throw the exact error. The firmware can be configured to work with limit switch or without them.

At the Gcode level I added some other M functions:

M100 - go to mechanical zero - the machine moves every axis until it hit the mechanical zero position (min limit switch)

M101 - go to mechanical zero without Z axis - the same with M100 but does not move the z axis, because sometimes the tool on z axis is not mounted exact on the min limit switch so you don't wanna hit the working plate with your tool.

M102 -go to park position :P - this move your axis to one end so the machine can be easily stored, this function needs to be modified according to your design, you can find it on stepper_control.cpp file.

Also the settings are remade so you can set on every motor the number of steps/rev, the threaded rod steps, the default feed rate, the length of arc segments, and a lot of stuffs and also a calibrate function that goes from one limit switch to the other, on each axis, count the steps and calculate the exact working area then store it in eeprom.

As a g code sender you can use about any sender, I use the Grbl Controller, you can find it on GitHub here, but is a bit slow so i use it for the settings window, and manual control and for sending bigger gcodes I use JCNC, you can find it here, it is a cool tool, you can edit the g code, you can preview the image and also play a animation, it has manual control but it does not have a command line.

For Gcode generator, or cam software:

2.5D I use Easel by Inventables, is a free browser tool that let you upload a vector file(svg or whatever) or create a design and normaly it should connect to a Carver (a cnc produced by Inventables) but you also can export the g code by going to Machine tab / Advanced.

For 3D milling Vectric Cut 3D, is not free, i think is about 300$, but is super cool.

I will implement a option in settings to configure if you use limit switch or not because now is just defined in config.h

I attached two 7zip files, one of them have inside a .ino file so you can just open it with arduino and the other one contain a NetBeans project and you just need to rename the file grbl_"Adafruit_motor_driverV2.ino.cpp" too "grbl_Adafruit_motor_driverV2.ino"

If you have any suggestion on how to improve or if you wanna improve it by your self please share.

//edit

Update: Added Limit switch enable and Release after move to setttings so you do not need to modify the config file, but the pin number definition is still in config.

Step 4: Cnc Working

Comments

EnnoK (author)2016-07-12

Version 0.9j

Thanks a lot for the work. I used it for my XY-Plotter. But i need to say: The documentation is a little bit poor. One only need the umpackend files to be copied into the Library-folder. Do not rename it because of the *.ino file.

After uploading a wrong message shows up: Type '$' for settings. The present Grpl syntax is '$$'. A '$' means I am asking for help. You implementier already '$$'.???

I am confused about the GRBL controller. I get no values for the axis.

gwilfong (author)2016-02-22

OK testing tonight ....no matter what baud rate I use "$$" or "$" returns "error: bad number format" and "?" returns "error: expected command letter"

Its like the grbl system commands just will not work. I even re-downloaded the zip file and tried a fresh ino file.

I tried directly in the serial monitor at different baud rates, I tried both teleporter and gcode controller at different baud rates.

The G codes tx and rx just fine... any ideas?

vasiliuc (author)gwilfong2016-02-23

"$" should dump a list of settings commands, i'll look at the files later today and try to to put the lastest version i have.

OlivierD22 made it! (author)vasiliuc2016-05-28

Hi.

First thank you for your library. I add to change the include of the adafruit library to this :

#include "utility/Adafruit_MS_PWMServoDriver.h"

Then it worked perfectly. But I have a problem.

I tested both projects NetBeans and the other zip. I still have the error.

"error : expected command letter" It only happens after a few commands.

I'll say between 5 and 8 commands.

Do you have any clue why is this happening ?

gwilfong (author)vasiliuc2016-02-23

thanks! If the ino you're running is working then perhaps it'll do the job.

lgnoni (author)2016-03-09

Hi ppl, i just build my own xy plotter with arduino grbl, adafruit motorshield v1 as driver stepper, now, i need to lift the cutter with a servo/solenoid when the cutter is travelling, what can i use in the grbl firmware? couldn't find anything where i can wire a servo or realy for a solenoid.. thanks ppl! maybe the servo output on adafruit as Z axis?

vasiliuc (author)lgnoni2016-03-10

I guess you could do a class where you implement the shield functionality for the servo motor, methods like one-step() and other methods that are used from the adafruit library and make all your calculation for your z axis so it match the original implementation .In the end you should be able to define the motor[Z_axis] as your custom class and use my software as it is...this wold be nice.

gwilfong (author)2016-02-24

ok we have GRBL! I'm not sure if you updated the files or not, but rather than the standard zip, I tried the Net Beans project zip and It is working!

gwilfong (author)2016-02-19

Alrighty! Motors etc. are up and steppin'! Most standard g codes are operating perfectly, but the grbl system commands aren't working( like "Home" and "Zero")

These are the commands that in grbl usually start with a "$"...is that normal? (e.g. they were not programmed due to available space) or am I still missing something?

Id also like to add an extruder capability which will require an additional stepper, and in the future I might like to add additional axises...

vasiliuc (author)gwilfong2016-02-20

i don't know about grbl system commands but you have g 28 and g 30 for home and also I implemented 3 M codes, M 100 (machine zero), M 101 (machine zero except z axis), M 102 (machine park-puts the machine in a position for storage). The commands with "$" are for settings - in grbl controller you go to advance/grbl settings . there are also some custom stuff like motor step configuration for each motor, rod step in mm, limit switch enable/disable, working area for each axes, recalibrate working area ( this will move all axis from start to end and count the steps between limit switches). I hope this helps you.

gwilfong (author)vasiliuc2016-02-22

Thanks! I haven't installed limit switches yet. Those commands will definitely help.Thus far I've simply moved the x and y axis from one end to the other. So far I have about x12000 and y4500 work area( still not sure if grbl is seeing these requests as mm or step)I did set the mm per step, and steps per revolution.(200 steps per rev, using 18 threads per 254mm or 1inch) I need to check out grbl controller currently I'm working with gcode teleporter.

gwilfong (author)gwilfong2016-02-22

I may also need to simply use a plain serial connection to see if the $ commands issue isnt in the interface software im using

vasiliuc (author)gwilfong2016-02-22

18 threads per 254mm means 1.41 threads pem mm, that is the value to put in settings. I don't understand what is not working for you you said that you set the motor step per rev and some other setting so I understand that the settings command is working and all the commantd that starts with $ are for settings only. I use grbl controller only for settings window for sending g codes i use jcnc.

gwilfong (author)vasiliuc2016-02-22

Those settings I manually configured in the Arduino IDE under the "config.h"

Still haven't got the grbl settings to show by simply typing$$. The settings tab in grbl controller may be just the ticket.Ill try a few things when back home tonight and let ya know.

gwilfong (author)2016-01-26

Vasiliuc, Excellent work on interfacing this shield to GRBL.

Could the eeprom errors below mentioned by Gurpreet may be that the Arduino wasn't flashed with the GRBL hex file.

Could you go through a bit on exactly the process you used to get your hex file, libraries and sketch all loaded correctly and communicating, or did you even have to load the GRBL hex?

Again thanks for your work on this, the stackable configuation of the adafruit would allow a person to do tons of stuff just using simple gcode.

gwilfong (author)gwilfong2016-01-26

Also, what versions of the Arduino are you using and which IDE revision?

vasiliuc (author)gwilfong2016-01-26

I tested on arduino uno and arduino nano, and about ide version I will come back later... That error that Gurpreet had it is not about eeprom, is on every file from the software, compiler find duplicates files in a temp folder from one older build, I have no ideea why.
To use my custom grbl you need a arduino board with atmega 328 processor, a arduino Ide with the adafruit motor shield v2 library instaled. Open the .ino file from my software with arduino ide and upload it to the board, and start use it. To connect the gcode sender(jcnc or grbl sender or whatever you like) you have to set the port where the board is connected to pc and set the bound rate at 115200 and you're good to go.

gwilfong (author)vasiliuc2016-02-03

Thanks Vasiliuc! Just wanted to clarify those few points. Im still getting those duplicates and will continue working on clearing those. I may need to do a complete reinstall on my CnC computer with upgraded IDE( currently running 1.06 and have had other issues with the serial coms with ot)her sketches). Still building on the Hardware portions and will be back to testing motors etc. as soon as I get my Power supply.I'll keep you posted.

AdamJ15 (author)2016-01-09

Has anyone figured out the problem that was posted by Gurpreets21 down below. I am also having the same problem every time i try to compile it throws that error.

I know that i have the ada fruit motor sheild drivers installed.

I had i working before and loaded it into my uno and now need to make some adjustments but i cannot get the program to compile now. I need some help Thank you form your time

vasiliuc (author)AdamJ152016-01-11

Hy, you can try to put the adafruit lib files in the project root, also try to run an example from adafruit and see if is running.

Vikram_ME (author)2015-10-25

Vasiliuc you made a great project, just please tell me is that project runs on motor shield v1 or it can work with only v2?

mboulonne (author)Vikram_ME2015-11-18

Have you made work GRBL, with motor shield v1 and two stepper?

vasiliuc (author)Vikram_ME2015-10-27

Hy, I don't think it is working with v1(I don't know how it's v1working) but I think it shouldn't be to hard to make it. You will need to modify the shield_begin() function and to make sure that you have a onestep() method in your library

GurpreetS21 (author)2015-10-30

it says grbl_Adafruit_motor_driverV2.ino:25:34: fatal error: Adafruit_MotorShield.h: No such file or directory

compilation terminated.

Error compiling.

vasiliuc (author)GurpreetS212015-10-30

you need to have the adafruit shield library. Fallow this :

https://learn.adafruit.com/adafruit-motor-shield-v2-for-arduino/install-software

GurpreetS21 (author)vasiliuc2015-10-30

Thanks for your reply! it post this error message now

Arduino: 1.6.5 (Windows 8.1), Board: "Arduino/Genuino Uno"

grbl_Adafruit_motor_driverV2\eeprom.cpp.o: In function `eeprom_get_char(unsigned int)':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/eeprom.cpp:73: multiple definition of `eeprom_get_char(unsigned int)'

eeprom.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/eeprom.cpp:73: first defined here

grbl_Adafruit_motor_driverV2\eeprom.cpp.o: In function `eeprom_get_char(unsigned int)':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/eeprom.cpp:73: multiple definition of `eeprom_put_char(unsigned int, unsigned char)'

eeprom.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/eeprom.cpp:73: first defined here

grbl_Adafruit_motor_driverV2\eeprom.cpp.o: In function `eeprom_get_char(unsigned int)':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/eeprom.cpp:73: multiple definition of `memcpy_to_eeprom_with_checksum(unsigned int, unsigned char*, unsigned int)'

eeprom.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/eeprom.cpp:73: first defined here

grbl_Adafruit_motor_driverV2\eeprom.cpp.o: In function `eeprom_get_char(unsigned int)':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/eeprom.cpp:73: multiple definition of `memcpy_from_eeprom_with_checksum(unsigned char*, unsigned int, unsigned int)'

eeprom.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/eeprom.cpp:73: first defined here

grbl_Adafruit_motor_driverV2\gcode.cpp.o: In function `gc_init()':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/gcode.cpp:80: multiple definition of `gc_init()'

gcode.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/gcode.cpp:80: first defined here

grbl_Adafruit_motor_driverV2\gcode.cpp.o: In function `next_statement':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/gcode.cpp:373: multiple definition of `gc_execute_line(char*)'

gcode.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/gcode.cpp:373: first defined here

grbl_Adafruit_motor_driverV2\g_print.cpp.o: In function `printString(char const*)':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/g_print.cpp:35: multiple definition of `printString(char const*)'

g_print.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/g_print.cpp:35: first defined here

grbl_Adafruit_motor_driverV2\g_print.cpp.o: In function `printString(char const*)':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/g_print.cpp:35: multiple definition of `printPgmString(char const*)'

g_print.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/g_print.cpp:35: first defined here

grbl_Adafruit_motor_driverV2\g_print.cpp.o: In function `printString(char const*)':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/g_print.cpp:35: multiple definition of `printIntegerInBase(unsigned long, unsigned long)'

g_print.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/g_print.cpp:35: first defined here

grbl_Adafruit_motor_driverV2\g_print.cpp.o: In function `printString(char const*)':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/g_print.cpp:35: multiple definition of `printInteger(long)'

g_print.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/g_print.cpp:35: first defined here

grbl_Adafruit_motor_driverV2\g_print.cpp.o: In function `printString(char const*)':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/g_print.cpp:35: multiple definition of `printFloat(double)'

g_print.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/g_print.cpp:35: first defined here

grbl_Adafruit_motor_driverV2\limit_swtch.cpp.o: In function `ls_check(int, int)':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/limit_swtch.cpp:34: multiple definition of `ls_check(int, int)'

limit_swtch.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/limit_swtch.cpp:34: first defined here

grbl_Adafruit_motor_driverV2\nuts_bolts.cpp.o: In function `read_double(char*, unsigned char*, double*)':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/nuts_bolts.cpp:38: multiple definition of `read_double(char*, unsigned char*, double*)'

nuts_bolts.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/nuts_bolts.cpp:38: first defined here

grbl_Adafruit_motor_driverV2\nuts_bolts.cpp.o: In function `read_double(char*, unsigned char*, double*)':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/nuts_bolts.cpp:38: multiple definition of `delay_ms(unsigned int)'

nuts_bolts.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/nuts_bolts.cpp:38: first defined here

grbl_Adafruit_motor_driverV2\nuts_bolts.cpp.o: In function `read_double(char*, unsigned char*, double*)':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/nuts_bolts.cpp:38: multiple definition of `delay_us(unsigned int)'

nuts_bolts.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/nuts_bolts.cpp:38: first defined here

grbl_Adafruit_motor_driverV2\protocol.cpp.o: In function `protocol_init()':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/protocol.cpp:105: multiple definition of `protocol_init()'

protocol.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/protocol.cpp:105: first defined here

grbl_Adafruit_motor_driverV2\protocol.cpp.o: In function `status_message':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/protocol.cpp:54: multiple definition of `protocol_execute_line(char*)'

protocol.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/protocol.cpp:54: first defined here

grbl_Adafruit_motor_driverV2\protocol.cpp.o: In function `status_message':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/protocol.cpp:54: multiple definition of `protocol_process()'

protocol.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/protocol.cpp:54: first defined here

grbl_Adafruit_motor_driverV2\serial.cpp.o: In function `serial_init(long)':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/serial.cpp:31: multiple definition of `serial_init(long)'

serial.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/serial.cpp:31: first defined here

grbl_Adafruit_motor_driverV2\serial.cpp.o: In function `serial_init(long)':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/serial.cpp:31: multiple definition of `serial_write(unsigned char)'

serial.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/serial.cpp:31: first defined here

grbl_Adafruit_motor_driverV2\serial.cpp.o: In function `serial_init(long)':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/serial.cpp:31: multiple definition of `serial_read()'

serial.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/serial.cpp:31: first defined here

grbl_Adafruit_motor_driverV2\settings.cpp.o: In function `settings_reset()':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/settings.cpp:57: multiple definition of `settings_reset()'

settings.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/settings.cpp:57: first defined here

grbl_Adafruit_motor_driverV2\settings.cpp.o: In function `settings_reset()':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/settings.cpp:57: multiple definition of `settings'

settings.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/settings.cpp:57: first defined here

grbl_Adafruit_motor_driverV2\settings.cpp.o: In function `settings_reset()':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/settings.cpp:57: multiple definition of `settings_dump()'

settings.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/settings.cpp:57: first defined here

grbl_Adafruit_motor_driverV2\settings.cpp.o: In function `settings_reset()':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/settings.cpp:57: multiple definition of `write_settings()'

settings.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/settings.cpp:57: first defined here

grbl_Adafruit_motor_driverV2\settings.cpp.o: In function `settings_reset()':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/settings.cpp:57: multiple definition of `read_settings()'

settings.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/settings.cpp:57: first defined here

grbl_Adafruit_motor_driverV2\settings.cpp.o: In function `settings_reset()':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/settings.cpp:57: multiple definition of `settings_store_setting(int, double)'

settings.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/settings.cpp:57: first defined here

grbl_Adafruit_motor_driverV2\settings.cpp.o: In function `settings_reset()':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/settings.cpp:57: multiple definition of `settings_execute_line(char*)'

settings.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/settings.cpp:57: first defined here

grbl_Adafruit_motor_driverV2\settings.cpp.o: In function `settings_reset()':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/settings.cpp:57: multiple definition of `settings_init()'

settings.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/settings.cpp:57: first defined here

grbl_Adafruit_motor_driverV2\stepper_control.cpp.o: In function `shield_begin()':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/stepper_control.cpp:56: multiple definition of `shield_begin()'

stepper_control.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/stepper_control.cpp:56: first defined here

grbl_Adafruit_motor_driverV2\stepper_control.cpp.o: In function `shield_begin()':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/stepper_control.cpp:56: multiple definition of `YZ_shield'

stepper_control.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/stepper_control.cpp:56: first defined here

grbl_Adafruit_motor_driverV2\stepper_control.cpp.o: In function `shield_begin()':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/stepper_control.cpp:56: multiple definition of `XSpindle_shield'

stepper_control.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/stepper_control.cpp:56: first defined here

grbl_Adafruit_motor_driverV2\stepper_control.cpp.o: In function `shield_begin()':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/stepper_control.cpp:56: multiple definition of `motors_init()'

stepper_control.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/stepper_control.cpp:56: first defined here

grbl_Adafruit_motor_driverV2\stepper_control.cpp.o: In function `shield_begin()':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/stepper_control.cpp:56: multiple definition of `Motor'

stepper_control.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/stepper_control.cpp:56: first defined here

grbl_Adafruit_motor_driverV2\stepper_control.cpp.o: In function `shield_begin()':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/stepper_control.cpp:56: multiple definition of `spindle_run(int, unsigned long)'

stepper_control.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/stepper_control.cpp:56: first defined here

grbl_Adafruit_motor_driverV2\stepper_control.cpp.o: In function `shield_begin()':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/stepper_control.cpp:56: multiple definition of `spindle'

stepper_control.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/stepper_control.cpp:56: first defined here

grbl_Adafruit_motor_driverV2\stepper_control.cpp.o: In function `shield_begin()':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/stepper_control.cpp:56: multiple definition of `spindle_stop()'

stepper_control.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/stepper_control.cpp:56: first defined here

grbl_Adafruit_motor_driverV2\stepper_control.cpp.o: In function `shield_begin()':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/stepper_control.cpp:56: multiple definition of `st_onestep(int, int)'

stepper_control.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/stepper_control.cpp:56: first defined here

grbl_Adafruit_motor_driverV2\stepper_control.cpp.o: In function `shield_begin()':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/stepper_control.cpp:56: multiple definition of `st_dwell(double)'

stepper_control.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/stepper_control.cpp:56: first defined here

grbl_Adafruit_motor_driverV2\stepper_control.cpp.o: In function `shield_begin()':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/stepper_control.cpp:56: multiple definition of `st_line(double*, double, double, double, double, unsigned char)'

stepper_control.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/stepper_control.cpp:56: first defined here

grbl_Adafruit_motor_driverV2\stepper_control.cpp.o: In function `shield_begin()':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/stepper_control.cpp:56: multiple definition of `axis'

stepper_control.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/stepper_control.cpp:56: first defined here

grbl_Adafruit_motor_driverV2\stepper_control.cpp.o: In function `shield_begin()':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/stepper_control.cpp:56: multiple definition of `st_go_home(double*)'

stepper_control.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/stepper_control.cpp:56: first defined here

grbl_Adafruit_motor_driverV2\stepper_control.cpp.o: In function `shield_begin()':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/stepper_control.cpp:56: multiple definition of `atan3(float, float)'

stepper_control.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/stepper_control.cpp:56: first defined here

grbl_Adafruit_motor_driverV2\stepper_control.cpp.o: In function `shield_begin()':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/stepper_control.cpp:56: multiple definition of `st_arc(double*, double*, double*, unsigned char, unsigned char, unsigned char, double, unsigned char, double, unsigned char)'

stepper_control.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/stepper_control.cpp:56: first defined here

grbl_Adafruit_motor_driverV2\stepper_control.cpp.o: In function `shield_begin()':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/stepper_control.cpp:56: multiple definition of `st_go_to_zero(bool)'

stepper_control.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/stepper_control.cpp:56: first defined here

grbl_Adafruit_motor_driverV2\stepper_control.cpp.o: In function `shield_begin()':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/stepper_control.cpp:56: multiple definition of `st_calibrate()'

stepper_control.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/stepper_control.cpp:56: first defined here

grbl_Adafruit_motor_driverV2\stepper_control.cpp.o: In function `shield_begin()':

C:\Program Files (x86)\Arduino\libraries\grbl_Adafruit_motor_driverV2/stepper_control.cpp:56: multiple definition of `st_machine_park()'

stepper_control.cpp.o:C:\Users\Gurpreet\AppData\Local\Temp\build8495686644004212036.tmp/stepper_control.cpp:56: first defined here

collect2.exe: error: ld returned 1 exit status

Error compiling.

This report would have more information with

"Show verbose output during compilation"

enabled in File > Preferences.

vasiliuc (author)GurpreetS212015-10-30

Please don't post stuff like this :) .Try to clear your temp(go to C:\Users\Gurpreet\AppData\Local\Temp\ and delete all the files that begin with buil ), as i see is an error on the firmware and a build that you done before and is saved in temp. I don't know why is this happening but I guess that you don't have genuine arduino

GurpreetS21 (author)2015-10-30

ie when i open grbl_Adafruit_motor_driverV2

chriskelly (author)2015-10-01

steppers still shudder

chriskelly (author)2015-09-30

tried on 5v on board and 12v

chriskelly (author)2015-09-30

dc motor works fine no shuddering just the stepper

chriskelly (author)2015-09-30

i remember testing it once with a dc motor and i think it still shuddered when it was turning will test today and get back to u

chriskelly (author)2015-09-28

even when I run the sample code by adafruit the nema 17 stepper motor still shudders I don't where the datasheet is as I took the motor from a 3d printer.

vasiliuc (author)chriskelly2015-09-29

Measure motor coils and check the connection to the shield, you can find infos here https://learn.adafruit.com/adafruit-motor-shield-v2-for-arduino/using-stepper-motors ... then coil 1 should connect to one motor port (say M1) and coil 2 should connect to the other motor port (M2). if is still not working try switching the wires on one coil ( M1 post have 2 wires say M1.1 and M1.2 change wire M1.1 with M1.2 and on the M2 port leave the wires as they are)

chriskelly (author)vasiliuc2015-09-29

I use the old trick where u touch the wires together to identify a coil so when stepper is harder to turn that is one coil the stepper turns but shudders while it is turning what should i measure?

vasiliuc (author)chriskelly2015-09-29

if the connection wasn't ok it should not turn in best case 1 step ff and 1 step rev...Have you try at lower voltage? The shield is ok? try it with one dc motor on both ports

chriskelly (author)2015-09-27

thanks for instructable just a quick question when i run one stepper to test it the motor shudders quite a bit when it is running i am powering the shield from an external 12v power supply the steppers i am using are nema 17 what do u think is wrong?

vasiliuc (author)chriskelly2015-09-27

If you are using my firmware make sure to set the motors steps/turn set to 200(as I know nema 17 have 200 in confih.h #define DEFAULT_X_STEPS_PER_TURN 200, also make the change for Y and Z axis or change it from settings , this might give you that shudder also i don't treat motor acceleration (it's a bit tricky with this shield) this can also give some shudder but not so much. Another reason may be the feed rate, if is too small, the software just put a delay between steps and you have that shudder

chriskelly (author)vasiliuc2015-09-28

i have changed the setting in config.h to
#define DEFAULT_X_STEPS_PER_TURN 200
#define DEFAULT_Y_STEPS_PER_TURN 200
#define DEFAULT_Z_STEPS_PER_TURN 200

is this all i need 2 do or do i need to change more setting what would u recommend for the feed rate

vasiliuc (author)chriskelly2015-09-28

have you try to move the motors with the shield with some test code(you have some examples in adafruit library) one of the problem might be a to high voltage supplied to motors...try some simple code and then try a 5 v power for the motors(you will need more amps) also a datasheet for your motors will be great...let me know what you did

chriskelly (author)vasiliuc2015-09-28

i made the changes but it still shudders

AdamJ15 (author)2015-09-26

thanks for the help

JimK8 (author)2015-09-22

I have been attempting to do the same with this motor shield with no success.

I tried to download your code but the link does not work for me. Some assistance would be great. thank you for your time.

vasiliuc (author)JimK82015-09-22

Hy, I tried the download and it works, you can leave a email address and i can send the files to you.

jasperg18 (author)2015-08-17

Thanks for the Instructable! Everything was clear but I do have one question. Do I have to load the GRBL g-code interpreter on the UNO first and after upload the .ino file you provided as a download? Or only upload the .ino and it also installs the GRBL?

vasiliuc (author)jasperg182015-08-17

just open the ino file with arduino ide, it will open al files and just upload and start using it...jush make shure in config.h to chage the pin of your limit swiches or comment the define if you don't have...if you have problems tell me

jasperg18 (author)vasiliuc2015-08-19

Super thanks! I'm able to jog the steppers by keyboard and feed it gcode I exported and it runs everything. I'm already very pleased with this so again mega thanks! Last thing though.. I'm not able to use the 'reset zero' and 'return to zero' functions of the UGS.

vasiliuc (author)jasperg182015-08-29

UGS...universal gcode sender? i use jcnc from jtronics and it work you can try it

http://www.jtronics.de/component/phocadownload/cat...

koadoa (author)2015-08-28

Hi Vasiluc

Thanks, this was just the thing i was looking for.

I just went out and godt the Adafruit Motor shield without knowing that running GRBL on it would be a problem, so big thumbs up, you made my day, and got me running again.

I just have one question, could you write just a little bit more in debth how you connected the limit switches, is it just groundpin with a resistor connected to com and then out of NC or NO to digital pins, and what pins goes to where?

Thanks again and very nice job done, you made it possible to get going with my project, without getting a new shield :)

About This Instructable

19,841views

52favorites

License:

More by vasiliuc:cnc Grbl with Adafruit Motot Shield v2Remote control
Add instructable to: