grbl related

903 views
Skip to first unread message

Raghavendra Talekar

unread,
Feb 25, 2017, 11:58:56 AM2/25/17
to OpenPnP
hi,
how to compile grbl for atmega328 using arduino ide??

Jason von Nieda

unread,
Feb 25, 2017, 12:24:01 PM2/25/17
to OpenPnP

On Sat, Feb 25, 2017 at 10:58 AM Raghavendra Talekar <rnta...@unicab.co.in> wrote:
hi,
how to compile grbl for atmega328 using arduino ide??

--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/11929a41-35ce-4218-9c12-5e8bedef85e9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raghavendra Talekar

unread,
Feb 26, 2017, 12:41:24 AM2/26/17
to OpenPnP
Hi Jason,

Thank you for the reply, i have following issues

1. downloaded .zip from https://github.com/openpnp/grbl
2. added .zip library to arduino
3. no examples to compile

please advice

Cri S

unread,
Feb 26, 2017, 7:26:29 AM2/26/17
to OpenPnP
Download actual grbl zip.
Copy the example directory from actual grbl inside openpnp grbl.zip .
Test if it works. If not try making the grbl directory inside zip and try again.
If both don't work ask again and report the used arduino version.

Raghavendra Talekar

unread,
Feb 26, 2017, 1:36:15 PM2/26/17
to OpenPnP
hi Cri S,

I followed what u suggested, now the error is something like this

1. downloaded master branch from grbl
2. downloaded branch from openpnp
3. unzipped both, and copied examples from grbl master to grbl openpnp
4. added library to arduino 1.6.12
5. tried compiling the example>grbl
6. error received ----> Arduino: 1.6.12 (Linux), Board: "Arduino/Genuino Uno"

/tmp/arduino_modified_sketch_232948/grblUpload.ino:27:18: fatal error: grbl.h: No such file or directory
 #include <grbl.h>
                  ^
compilation terminated.
exit status 1
Error compiling for board Arduino/Genuino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

7. even when iam trying to compile including all header files instead of grbl (pls refer attache image), the compile fails with following error(s)
Arduino: 1.6.12 (Linux), Board: "Arduino/Genuino Uno"

In file included from /home/raghavendra/Arduino/libraries/grbl-master/system.h:40:0,
                 from /home/raghavendra/Arduino/libraries/grbl-master/probe.c:21:
/home/raghavendra/Arduino/libraries/grbl-master/probe.c: In function 'probe_init':
/home/raghavendra/Arduino/libraries/grbl-master/cpu_map.h:454:27: error: 'DDRK' undeclared (first use in this function)
   #define PROBE_DDR       DDRK
                           ^
/home/raghavendra/Arduino/libraries/grbl-master/probe.c:32:3: note: in expansion of macro 'PROBE_DDR'
   PROBE_DDR &= ~(PROBE_MASK); // Configure as input pins
   ^
/home/raghavendra/Arduino/libraries/grbl-master/cpu_map.h:454:27: note: each undeclared identifier is reported only once for each function it appears in
   #define PROBE_DDR       DDRK
                           ^
/home/raghavendra/Arduino/libraries/grbl-master/probe.c:32:3: note: in expansion of macro 'PROBE_DDR'
   PROBE_DDR &= ~(PROBE_MASK); // Configure as input pins
   ^
/home/raghavendra/Arduino/libraries/grbl-master/cpu_map.h:456:27: error: 'PORTK' undeclared (first use in this function)
   #define PROBE_PORT      PORTK
                           ^
/home/raghavendra/Arduino/libraries/grbl-master/probe.c:34:5: note: in expansion of macro 'PROBE_PORT'
     PROBE_PORT &= ~(PROBE_MASK); // Normal low operation. Requires external pull-down.
     ^
/home/raghavendra/Arduino/libraries/grbl-master/probe.c: In function 'probe_get_state':
/home/raghavendra/Arduino/libraries/grbl-master/cpu_map.h:455:27: error: 'PINK' undeclared (first use in this function)
   #define PROBE_PIN       PINK
                           ^
/home/raghavendra/Arduino/libraries/grbl-master/probe.c:44:37: note: in expansion of macro 'PROBE_PIN'
 uint8_t probe_get_state() { return((PROBE_PIN & PROBE_MASK) ^ probe_invert_mask); }
                                     ^
exit status 1
Error compiling for board Arduino/Genuino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

PLEASE SUGGEST WHAT To DO!!!!!!!!!!!!!!!!!!!
grbl-all.png

Matt Brocklehurst

unread,
Feb 26, 2017, 2:01:14 PM2/26/17
to ope...@googlegroups.com
The open pnp grbl is very old, I doubt what your trying (new examples old open pnp grbl is going to work)



Sent from my iPhone
--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
<grbl-all.png>

Cri S

unread,
Feb 26, 2017, 2:22:45 PM2/26/17
to OpenPnP
It is possible that during coping files to arduino library path arduino was running?
From manual:

Unzip the library and copy the main folder into the “Libraries” folder in the folder you installed your Arduino software. Eg. C:\arduino-1.0.3\libraries\
Rename the folder to “GRBL”. (This will stop the Arduino IDE from complaining about the long folder name)
Open up the Arduino IDE.
Click on the following menu : File -> Examples – > GRBL (or what ever you renamed the folder to) -> ArduinoUno
Upload the sketch to you Arduino UNO board.

Open up arduino ide means start it. If it was already running you have to close it again.
On arduino ide library are scanned only at startup.

Usually this is the problem for this type of error.

Cri S

unread,
Feb 26, 2017, 2:41:36 PM2/26/17
to OpenPnP
You need to use github/grbl and not github/gnea
Copy grbl.h too, i have seen its removed.
Try with that, eventually adjust it, or ask with errors, but the template should probably work as is.

Raghavendra Talekar

unread,
Feb 26, 2017, 9:37:14 PM2/26/17
to OpenPnP
Hi Cri S,

Thank you, i will try and post queries if any

Daniel

unread,
Feb 27, 2017, 12:01:43 AM2/27/17
to OpenPnP
Guys,
I am really interested on this subject. 
I am about to fix head on my machine and I see a lot of complaints against TinyG  (not to mention that my custom board has some issues).

But regarding GRBL . From documentation :
"Grbl is for three axis machines. No rotation axes (yet) – just X, Y, and Z."

I really think that part rotation and uplooking camera are a real benefit . 
Otherwise this can be the cheapest option ever since I see aduino clones for 2-3$.

I see that many people it's using Smoothie  (Again I have a custom board but I am really in the hurry).

Kind regards,
DAniel




"Grbl is for three axis machines. No rotation axes (yet) – just X, Y, and Z."

Raghavendra Talekar

unread,
Feb 27, 2017, 12:04:05 AM2/27/17
to ope...@googlegroups.com
Hi Daniel,

GRBLs master implementation is for 3axis only but the OpenPnP-Grbl is a modified one for 4th axis i.e. C axis


--
You received this message because you are subscribed to a topic in the Google Groups "OpenPnP" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openpnp/vrv7Rry0RsY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openpnp+unsubscribe@googlegroups.com.

To post to this group, send email to ope...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Thanking You,

Best Regards,

Raghavendra N Talekar
Head Research & Engineering, Managing Partner





Unicab Systems & Controls (Instrumentation & Electronics Division)

No. 147 & 148, 3rd Road, KIADB, Belur Industrial Area,
Belur, Dharwad, Karnataka - 580011. India.



PLEASE DO NOT PRINT THIS EMAIL !!
ITS MORE SAFE IN YOUR MAILBOX THAN YOUR OFFICE FILE
YOUR DECISION WILL HELP SAVING TREES FROM EXTINCTION....

DISCLAIMER:

Breach of confidentiality & accidental breach of confidentiality
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.

Transmission of viruses
WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission.

Raghavendra Talekar

unread,
Feb 27, 2017, 5:43:46 AM2/27/17
to OpenPnP
Hi Cri S

I figured out the problem, actually the CPU MAP is for ATMEGA2560, i need the openpnp compatible cpu map for atmega328p, can u suggest how to achieve that

Cri S

unread,
Feb 27, 2017, 6:04:22 AM2/27/17
to OpenPnP
Inside CPU_map.h copy CPU_MAP_ATMEGA328P section to CPU_MAP_ATMEGA328P_4AXIS and inside config.h change from mega2560 to the new created. You should update the defaults.h file too.

Daniel Dumitru

unread,
Feb 27, 2017, 6:27:14 AM2/27/17
to ope...@googlegroups.com
By curiosity I have compiled it as well.
However, I cannot find on config.h refrences to 4'th axis.
I will check again.
Br,
Daniel

On Mon, Feb 27, 2017 at 1:04 PM, Cri S <phon...@gmail.com> wrote:
Inside CPU_map.h copy CPU_MAP_ATMEGA328P section to CPU_MAP_ATMEGA328P_4AXIS and inside config.h change from mega2560 to the new created. You should update the defaults.h file too.
--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+unsubscribe@googlegroups.com.

To post to this group, send email to ope...@googlegroups.com.

Daniel Dumitru

unread,
Feb 27, 2017, 9:39:48 AM2/27/17
to ope...@googlegroups.com
I had on computer another folder of GRBL.
Looking trough code , my opinion it's to use a MEGA board. Those are pretty cheap and will fix a lot of your issues.

DAniel

Raghavendra Talekar

unread,
Feb 27, 2017, 10:08:45 AM2/27/17
to OpenPnP
Cri S,

The cpu.map file from openpnp-grbl does not have any 4th axis mapping for atmega328, im attaching the config.h and cpu_map.h  for your reference, please note that these have been retrieved two days ago from the openpnp/grbl github
config.h
cpu_map.h

Cri S

unread,
Feb 28, 2017, 1:33:27 AM2/28/17
to ope...@googlegroups.com
Yes, you must define it.
However output inside stepper.c is not updated, it work only on 8pin wide ports. Just discovered.

What IO do you need.
Tell me what you want, a lot is possible, forget the grbl pinout.
--
You received this message because you are subscribed to a topic in the Google Groups "OpenPnP" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openpnp/vrv7Rry0RsY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openpnp+unsubscribe@googlegroups.com.

To post to this group, send email to ope...@googlegroups.com.

Raghavendra Talekar

unread,
Feb 28, 2017, 1:55:23 AM2/28/17
to ope...@googlegroups.com
Cri S,

The grbl specific pinout is not a restriction for me as we are into electronics design and development we are equipped with PCB design and fabrication processes and can re-design the required hardware, the stepper drivers can be mapped over port c of atmega328, and other inputs can be re-mapped to port b etc as i do not need any pwm spindle output. further the requirements would be

1. 4 axis step and direction outputs
2. 3 axis limit switch inputs
3. 1 actuator output for vaccum on/off
4. 1 vaccum sensor input (analog/digital we can add an analog comparator to pressure sensor output and provide digital output)
5. 1 led control output for bottom vision camera (optional as we can keep it continous on)
6. stepper enable output ( i believe its only 1 common output for all drivers)

so summing up we have

1. 8-pins for step/dir
2. 3-pins for limits
3. 1-pin for stepper enable
4. 1-pin for vaccum on/off
5. 1-pin for vaccum sense

please if possible provide me config.h and cpu_map for above requirements in leu i will design a customized mega328 controller board with drv8825 for openpnp and post the schematics and pcb layout (kicad) for open use, we can also support small and large quantities of these pcbs.



For more options, visit https://groups.google.com/d/optout.

Raghavendra Talekar

unread,
Feb 28, 2017, 3:12:43 AM2/28/17
to ope...@googlegroups.com
Cri S,

is it required that the step and direction pins must be mapped on the same (8bit) port???

On Tue, Feb 28, 2017 at 12:03 PM, Cri S <phon...@gmail.com> wrote:

For more options, visit https://groups.google.com/d/optout.

mojalovaa1

unread,
Feb 28, 2017, 3:24:33 AM2/28/17
to OpenPnP
All step pin need use same  port , for sample if X step is B then all step need be on B , same is with direction , if X direction use H port then all direction need use H port .

Raghavendra Talekar

unread,
Feb 28, 2017, 3:25:59 AM2/28/17
to ope...@googlegroups.com
so you mean to say that 


steps x,y,z,c can be on port b
and dir x,y,z,c can be on port c/d

right??

On Tue, Feb 28, 2017 at 1:54 PM, mojalovaa1 <moja...@gmail.com> wrote:
All step pin need use same  port , for sample if X step is B then all step need be on B , same is with direction , if X direction use H port then all direction need use H port .

--
You received this message because you are subscribed to a topic in the Google Groups "OpenPnP" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openpnp/vrv7Rry0RsY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openpnp+unsubscribe@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Cri S

unread,
Feb 28, 2017, 3:28:41 AM2/28/17
to OpenPnP
On this source code yes, on my source code i have the requirement for two ports and xy steps on the same port, steps and dirs different.
As you design a new board that don't need to be compatible with grbl shields, i would propose to retain the limit of single port indipendently of dirs/steps.
Annother option is hardcoding the output to the i2c pins, A4-5 on arduino , C on AVR. That allows  keeping the layout compatible with recent 4axis shields.
Usually on small avr i use combined xy homing line and probing, Z separated. If xy is activated before homing, the controller goes into alarm and one have to drive it out, issuing $X
and then move it out, led on XY homing helps too.
Tell me what you prefer.


Am Dienstag, 28. Februar 2017 09:12:43 UTC+1 schrieb Raghavendra Talekar:
Cri S,

is it required that the step and direction pins must be mapped on the same (8bit) port???
On Tue, Feb 28, 2017 at 12:03 PM, Cri S <phon...@gmail.com> wrote:
Yes, you must define it.
However output inside stepper.c is not updated, it work only on 8pin wide ports. Just discovered.

What IO do you need.
Tell me what you want, a lot is possible, forget the grbl pinout.


Il lunedì 27 febbraio 2017, Raghavendra Talekar <rnta...@unicab.co.in> ha scritto:
Cri S,

The cpu.map file from openpnp-grbl does not have any 4th axis mapping for atmega328, im attaching the config.h and cpu_map.h  for your reference, please note that these have been retrieved two days ago from the openpnp/grbl github

On Monday, February 27, 2017 at 4:34:22 PM UTC+5:30, Cri S wrote:
Inside CPU_map.h copy CPU_MAP_ATMEGA328P section to CPU_MAP_ATMEGA328P_4AXIS and inside config.h change from mega2560 to the new created. You should update the defaults.h file too.

--
You received this message because you are subscribed to a topic in the Google Groups "OpenPnP" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openpnp/vrv7Rry0RsY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openpnp+unsubscribe@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/d735080d-2c3e-4106-b233-c829386ce996%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "OpenPnP" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openpnp/vrv7Rry0RsY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openpnp+u...@googlegroups.com.

To post to this group, send email to ope...@googlegroups.com.

Raghavendra Talekar

unread,
Feb 28, 2017, 3:45:29 AM2/28/17
to ope...@googlegroups.com
Cris,

you mean to say

1. X&Y axis limit switches in series connected to 1 single pin as limit input is ok
2. putting xyzc step outputs to any 1 port is ok
3. putting all dir signals on another port is ok
4. step enable on any pin
5. peripheral outputs(vaccum, led control) and inputs(vaccum sense) can be attached to any left out pins

here iam planning to use auto feeder activated by a trigger shaft mounted on z axis controlled by x and y axis movement so the feeder control outputs are not required 

the idea is to make a low cost control board and machine with autofeeder (both strip and tube) and auto nozzle changer, i have  a xcarve clone 500mm already fabricated and working perfectly with grbl, only need to add 4th axis.
And iam designing another precision type using LM guideways and blocks. i will definitely make the new machine designs available as open source hardware so that other users can benefit from it and make a low cost high precision pnp machine.


For more options, visit https://groups.google.com/d/optout.

mojalovaa1

unread,
Feb 28, 2017, 4:46:31 AM2/28/17
to OpenPnP
Yes

AJ Tuckwood

unread,
Mar 1, 2019, 10:34:49 AM3/1/19
to OpenPnP
Hello there, I use Xloader, very simple but info here on Arduino IDE...

Reply all
Reply to author
Forward
0 new messages