Hi LB to grbl g code understanding for plasma cnc

Hi, im trying to learn and understand how G code commands make a machine do its tasks, my question is, my grbl (xpro v5) has a card in it and obviously has the final G code thats sent to the internal drivers. So does the lightburn G codes get sent to grbl and that card then translates it to true G code for the drivers to run? Why is there a card in the grbl?
Im trying to insert G codes to get the torch to touch off, go to pierce height, then to cut height and then cut… and repeat for next cut. So the commands go in lightburn settings and the hardware wiring is handled by the grbl as theres an input for probing/touchoff any help much appreciated and if i can offer my assistance as a welder/fabricator feelfree to msg :+1:t2:

G-code is a set of high-level commands that describe the operation that the CNC controller is meant to execute.

The g-code itself can be written by hand and interpreted immediately by the controller like if you want the machine to make a rapid move. Or alternatively you can have a program like LightBurn generate g-code based on a design that you create. The g-code itself can be streamed to the controller until complete, saved to a file for later retrieval and execution, or otherwise stored in a number of ways.

The controller can read g-code saved to a file on a card or other storage device. Once it reads the file it can execute the g-code commands listed. This would at that time be functionally equivalent to having had the g-code streamed to the controller.

Not quite. LightBurn can generate g-code and send the g-code to the grbl controller. Not sure what you mean by “card” in this case but once the controller receives the g-code it is then responsible for translating the g-code command to required mechanical movements and sends signals to the stepper drivers to achieve those movements. The drivers then convert the signals to electrical impulses that drive the motors.

If this is a static set of commands to do this for all cases then you can put this in the G-code tab of Edit->Device Settings. This won’t work if the commands are dynamic. In that case you will need to save the g-code and edit it before sending the g-code to the controller.

One of the issues with this type of equipment is every time the ‘torch’ or tool need to cut, it has to get close enough to start the stream then back off, very similar to a cnc arc welder.

This sequence is needed every time the machine starts a new cut…

:smile_cat:

Yes thats the sequence it needs to do with commands

Thanks mate, yes it makes sense, the static and dynamic send to controller i need to understand what you mean ? As in it reads the whole job in one go THEN executes it vs reads a bit, does a bit, reads some more, does a bit more?.. is that the understanding?.. anyway thankyou again much appreciated :+1:t2:

If you run the job from LightBurn it will send each g-code command in a stream line by line. The GRBL controller needs to parse and execute each line. The controller is responsible for complaining if the g-code command is not acceptable.

I was trying to understand if the set of commands are a literal copy/paste for every job… or will the coordinates or other aspects of the commands need to change on a per job basis? If they need to change on a per job basis then it’s not a good fit for the g-code tab.

The gcode that is ‘inserted’ is run at the start of the job?

This would require it’s use every time the machine started a cut. Five shapes to cut on the layer, then five invocations… Only when starting a cut.

:smile_cat:

Hmmm not getting this one…i draw a box, lightburn organises the commands(gcode) and sends it to controller… im trying to insert the commands for z axis touchoff in lightburn edit /device as i was told it would do these commands at the start and end of every job?or cut?.. then theres another screen to enter commands macro?.. i know i sound a beginner but i learn quick… and the other prob is the touch off switching is done in the grbl controller… so whats all the $ $ sign commands about?..

Yes, it says it does, commands at start and commands after if i put them in
I

I’m having a hard time parsing your last post in terms of what is a question and what is a statement. I’ll try to provide some context as best I can but let me know otherwise.

Something to understand about the Gcode tab in Device Settings. The Start GCode section and End Gcode section will run once at the start and end of each job. As far as I know, the code you enter there cannot have variables or anything dynamic. You put in code there and it will slavishly run those commands once at the start and once at the end of the entire job.

As @jkwilborn points out this is potentially problematic since with plasma torches you need a touchoff operation for every single cut, not just once at the start and end of a job.

You can define macro operations in the Console tab. A macro is a snippet of g-code that you define. Again, as far as I know there are no variables available. It’s just a static piece of code. They will run once every time you push the button.

Not sure if I understand the question. $$ itself is a grbl command to retrieve all GRBL settings. Configurations in GRBL are referenced by their $ name. For example $20 is the configuration used to store whether or not soft limits are to be used ($20=1 enables, $20=0 disables).

Yes sorry for my being all over the place with my writing, im trying to understand the way it all works and speak it out to see if im picking it up right…I appreciate your patience and time helping me…Ok so the $ commands are for the grbl to activate this and deactivate that feature , were as the G code is for what co orinates and steps/ direction the job plays out?.. ive been offered to hang with a guy for a day to learn from his info and setups of grbls and software etc. I will do it… im determined to get a good understanding of it to run my plasma and fix it if need be. I just am having trouble to see how the code operates and with a grbl it seems a little more complicated… anyway much appreciated again, i go back over peoples answeres for weeks as i learn more i can go back and understand something i couldnt days earlier cheers , Pete

So how does the grbl controller know that the g code commands from lightburn might not be right? Do they have to match the $ settings of the grbl?

Yes. For the most part. G-code is never specified in steps but in coordinates or distances. The number of steps to achieve those distances is interpreted by the GRBL code running on the controller.

There are a couple of folks on this forum that are running plasma cutters. One I’m thinking of I think has created custom scripts that post-process the generated G-code in order to handle the plasma specific requirements.

If the g-code command is legitimate GRBL won’t know it’s right or wrong from an intention perspective. It will simply process it. If the syntax is wrong or a command is not recognized it will let you know that the command is not recognized.

There are other situations like for max travel where GRBL can warn you if your movement goes beyond the max travel coordinates if you have soft limits on. Or if you have hard limits on with limit switches GRBL can alarm and shutdown the job if the switch is triggered.

Ok im getting it!, great stuff… i wont burn the workshop down just yet lol… and again a big thanks for your time, one last question, the grbl…xpro v5 has a memory card in it what will that have on it? Cheers again :+1:t2:

You can save an entire g-code job as a file. I assume the card is there to store these canned g-code files that you can then execute. This would work similarly to a 3d printer if you’ve used one of those before.

I can now see why its hard to get the touch offs and thc etc on z ,inserted into g code … these guys seem to run a whole seperate control system (touch off, thc) that takes over the z stepper at the correct time and it is controlled by the multiplied down voltage from the plasma cutter to keep the set voltage (torch height) going on the fly… i get that and it sounds like it works well but again to change g code and grbl $ so this new seperate controller can take it over from lightburn …cheers

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