|
Post by ibohan on Aug 14, 2018 5:20:55 GMT
I just finished assembling my CK and started testing somethings out with a marker. I read through the beginner CNC thread and read the short sentence on making sure the units matched. I modeled and created all my tool paths in inches, so I thought, OK, just set the machine to inches. I did a google search and quickly saw that Grbl $13 needed to be set to 1, so I did that, ran the program and everything seemed to run fine. Then I noticed the appendix... woah, there's a lot of mm in there.
So, what do I need to do to switch my machine to inches exactly? Do I need to convert all of those values to inches?
|
|
|
Post by Bruce on Aug 14, 2018 13:23:04 GMT
I found this info on the UGC Sender Github forum using inches in the G-Code.
--------------------------------
The $13 Grbl setting only determines the units Grbl sends back to the GUI for status reports (position, offsets, rate) and stored $# parameters. It does not effect how a gcode program is run. Only G20 and G21 alter how the g-code program is interpreted in inches or mm, respectively. These must be set at the start of the g-code program, every time. UGS should refer to G20/21 modal state to determine the units to send to Grbl. Grbl always defaults to G21 mm mode. So, after a power-cycle or reset, it's set back to G21. You can alter this default by programming a startup line by: $N0=G20. This will automatically run and set G20 after a reset or power cycle. Just beware that $N startup lines do not run after unlocking Grbl's alarm mode via $X. This is intentional to prevent startup lines from running after exiting an alarm. Primarily to prevent it from executing a motion if a user has one programmed in a startup line. Just soft-reset Grbl after an $X to get the startup lines to run. I know it's not ideal, but I intend to fix that soon.
-------------------------------
So make sure you have G20 somewhere at the start of your G-code and you should be good to go with inches.
I started working in mm. Really once you get the hang of it you'll be converting inches to mm in your head!
|
|
|
Post by polylawman on Aug 14, 2018 16:06:28 GMT
Grbl always defaults to G21 mm mode. So, after a power-cycle or reset, it's set back to G21. You can alter this default by programming a startup line by: $N0=G20. This will automatically run and set G20 after a reset or power cycle.
-------------------------------
So when you say “programming a startup line by: $N0=G20” do you mean typing that into the command line everytime I start or restart or is it possible to change that line somewhere else? Firmware maybe?
|
|
|
Post by Bruce on Aug 15, 2018 17:21:25 GMT
The $N0=G20 command would be in the Grbl settings startup file in the Arduino. I've not messed with this at all. I think It would be easier to just make sure you have G20 in the top of your G-Code file that you want to run in inches.
|
|
|
Post by Derek the Admin on Aug 15, 2018 18:24:41 GMT
I agree with berogers.
|
|
|
Post by polylawman on Aug 15, 2018 18:43:19 GMT
That makes perfectly good sense. Thanks
|
|
|
Post by polylawman on Aug 22, 2018 16:28:06 GMT
The $N0=G20 command would be in the Grbl settings startup file in the Arduino. I've not messed with this at all. I think It would be easier to just make sure you have G20 in the top of your G-Code file that you want to run in inches. Please correct me if the following is flawed, but what I think I learned today is that the $N0 and $N1 are startup blocks in GRBL. In the command line you can type $N to see if anything is set in the blocks and if so, their commands will execute each time you start or restart. For instance, even though the CNC Shield or GRBL, not sure which, is set by default to start and work in mm, you can easily change that by typing $N0=G20, which will set your machine to work in inches, each time you start or restart. To reset a default back to mm, type $N0=G21.
|
|
|
Post by Bruce on Aug 23, 2018 3:21:56 GMT
That looks to be correct. But I believe having G21 or G20 in the G-Code tool path will override the default. I think it would be safer in the long run to just have what you want at the top of your G-Code file. Also don't forget to set $13=1 to have the real-time positioning display in inches as well.
|
|
|
Post by Derek the Admin on Aug 23, 2018 12:37:48 GMT
Bruce is correct on both accounts.
|
|
|
Post by polylawman on Aug 23, 2018 13:37:29 GMT
That looks to be correct. But I believe having G21 or G20 in the G-Code tool path will override the default. I think it would be safer in the long run to just have what you want at the top of your G-Code file. Also don't forget to set $13=1 to have the real-time positioning display in inches as well. So to understand you correctly, the best way to go about running in inches is after generating the G Code file for inches, I open, insert $N0=G20 and $13=1 at or near the top of the file then obviously save to run and display in inches?
|
|
|
Post by Bruce on Aug 24, 2018 14:16:33 GMT
Sorry, I'm throwing a bunch of lingo at you. You know we're BOTH learning here at the same time! Please don't confuse me with an expert. All you need in the G-code file is just: G20 located somewhere at the top of the G-code file you are running for your project to be in inches. The $N0 is a GRBL command line only function. Personally, I would forget about using it. After I looked into it I don't think setting the default does much for you. The $13=1 is in the GRBL settings of the machine setup. They are explained here: github.com/gnea/grbl/wiki/Grbl-v1.1-ConfigurationThey will pop up in the console by typing $$ in the command line. You can then type $13=1 in the command line to set. Once this is entered you should see the real time position display change to inches. This only needs to be done once. It should not be in the project G-Code file.
|
|
|
Post by Derek the Admin on Aug 24, 2018 16:34:18 GMT
Bruce, you are rapidly becoming an expert.
I agree with everything you said.
|
|
|
Post by polylawman on Aug 25, 2018 12:15:10 GMT
Sorry, I'm throwing a bunch of lingo at you. You know we're BOTH learning here at the same time! Please don't confuse me with an expert. All you need in the G-code file is just: G20 located somewhere at the top of the G-code file you are running for your project to be in inches. The $N0 is a GRBL command line only function. Personally, I would forget about using it. After I looked into it I don't think setting the default does much for you. The $13=1 is in the GRBL settings of the machine setup. They are explained here: github.com/gnea/grbl/wiki/Grbl-v1.1-ConfigurationThey will pop up in the console by typing $$ in the command line. You can then type $13=1 in the command line to set. Once this is entered you should see the real time position display change to inches. This only needs to be done once. It should not be in the project G-Code file. Your knowledge seems to be of an expert, but thank you anyway for your guidance.
|
|