Navigating Between Weed Positions: Controlling CNC Movement with Arduino and Grbl Firmware

Hello everyone,

I'm currently working on a project involving a CNC system controlled by an Arduino running Grbl firmware. In my project, the CNC machine needs to navigate to multiple weed positions for targeted spraying. However, I'm unsure how to handle the movement between weed detections. Should I calculate the relative movement between the current position and the new weed position, or is there a different approach I should consider? For example, if the current position is (X=9, Y=3) and the new weed position is (X=7, Y=5), how do I accurately control the CNC machine to navigate between these points? Any insights or guidance would be greatly appreciated knowing that i use stepper motors .

Thank you!

Doesn't all movements depend on how you have set up GRBL to measure distances? Just using some numbers does not seem to be associated with G-CODE.

Hint: how did you move the sprayer from its starting position to (X=9, Y=3)?

1 Like

There's not any room in an Arduino running Grbl for anything else, so I think you might be asking about how to move a GRBL device. If you happen to be at X=9,Y=3, (or anywhere else,) and want to go directly to X=7,Y=5, you might issue a "G1 X7 Y5 F1000" to move there 1000mm/minute.

See Grbl v1.1 Commands · gnea/grbl Wiki · GitHub for more details.

More clarification please

Using cnc

Continue to use cnc to move somewhere else.

1 Like

I did not understand u can u clarify what did u say please

The problem is when i extract bboc weed coordinates and send it to arduino to control stepper motors those ones move the sprayer with x y steps i wiil confirm if it put it in position x y or moves it with x y realtive to its last position

Look at g90 vs g91

Thats what i need exactlyyy !! Thank you
But i have question if i used g90 how does the cnc or steppermotors inow the coord for example x4 y8 position ?!

You have to tell it.

In some cases you manually adjust it to a known location and send a g92

This has little to do with Arduino.

You’ll get better help in a grbl forum.

In my case should use g90 not g91

Because every time detecting weed there will be a new coord I have to send iy to arduino then the box spraynig should put in that coord position

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.