Modifiying start up gcode

Learning curve is still very steep. I need to insert $32=1 in my start up g-code but get “error invalid statement” every time. $30=1000 also generates same. When current g-code commands load, it generates an “error” when “HOME” is sent, saying “setting disabled”.
Tried all the grbl’s and a few of the others but can’t get it to work. So, how does one fix the g-code to work for me? Is there a way to edit the start up g-code? Currently can’t burn anything until $32=1 is fixed.
$X
$32=1
generates error:
Starting stream
error: Invalid statement
On or near line 1:
Stream completed in 0:00

Have you done the Lightburn grbl setup? Your machine is mentioned there.

Are you entering the $32=1 in the ‘Console’ of Lightburn (Right top, tab left of Camera)?

$32 and the $30 are firmware settings and will stay with the controller once you set them. You don’t need to ‘send them every time.’ You should enter “$$” and copy the controller firmware settings to a file for safe keeping. If you want to modify them, you’ll have a backup of the original settings. I would think those values would have been set for you by the manufacturer.

The error statement, stating you have an error is not very helpful. Grbl will tell you what line and what the error code is. There is a block of output from your controller we’d like to see. It will also tell us other information. Copy and past here or do a screen shot so we can help you dissect it.

Good luck. :slight_smile:

Which version of GRBL firmware is on your controller? If it’s older than 1.1, it likely doesn’t have a $32 setting, or a $30 setting. This is common on Eleks devices - they often ship with GRBL 0.9, sometimes older.

1 Like

Is the only fix an upgrade? I replaced my version of grbl as soon as I could find a new one, so never used it on the laser platform.

You can use the GRBL-M3 driver in LightBurn, and that will work, but it’s not ideal, as we use G1 moves for everything, and changing the power level will cause the machine to pause a moment while it waits for the “rotary cutting tool” to get to the requested speed (laser / rotating cutter both use the S parameter)

1 Like

OK gang, obviously, my controller board is the issue. I will try to use GRBL-M3 but I guess I should get a better board. Do any of you have a suggestion of a good up to date controller board for me to purchase?

Found a compatible controller that says it has GRBL 1.1 that is pin for pin replacement for what I have on AliExpress and ordered it. This should solve my control issues.

1 Like

Don’t for get to come back and tell us about it :smile_cat:

All righty - was able to use lasergrbl to install latest 1.1h grbl into my board. After figuring out that I can’t use HOMING because I do not have limit switches, and setting some of the G code values. It seems to be working. However, no matter what settings I put in, the origin is ALWAYS in the right rear. It does not matter what I change, it always runs away to the right rear and I need it to be at the left front because that is where I have my mechanical stop for positioning the materials. I have reversed the setup settings and it still goes to the right rear. Can anyone give me some guidance as to setup and G-code settings to make it always go the left front? Anyway it now takes $32=1 and at least that is off to a good start.
thanks

Are you running in user origin or absolute in the laser window?

Also, the coordinate system on your controller assumes some place is 0, 0. By the use of limit switches you can do this, without switches, it takes a few minutes longer…

There are a number of configuration data item the machine needs to run correctly. They are in the $$ list. These tell the machine how to handle things, so to speak. They are also probably incorrect.

Here’s a link to a grbl cheat sheet from a while back. Doesn’t have some of them, but handy.

Did you go through the Lightburn grbl setup? At the end it addresses machines without limit switches.

Good luck :slight_smile:

thanks for the very quick reply. I have the grbl cheat sheet - that is how I got as far as I did. I just copied and printed out the lightburn grbl setup and will start through that. I do have a probable stupid question though - If the grbl code is set in mm and the LightBurn software is set in inches, does that create a problem? I see in the cheat sheet that you can use $13 to change from inches to mm for reporting purpose and it comes set to mm.

If your machine doesn’t have homing switches, turn it off, move the head manually to the front-left of the machine, then turn it back on again. Wherever the laser powers up is what it will treat as the machine origin.

LightBurn assumes all reports coming from the machine are in mm.

Oz, I figured that out. Making progress! I now have the machine zeroing at the left front. Almost ready to start burning again. Set up a project that I have successfully done before, selected the frame “LINE” that goes around the art work, hit START. The head moved to the correct starting point, moved along the X axis - and never stopped. Did not make the turn on the Y axis. It is not following the art work. Just took off across the X axis. As soon as I figure that out, I think I will be smoking again. My mistake I think is I should have made a copy of the old g-code set up data before burning the new GRBL update. It was working correctly - just couldn’t do the $32=1 to eliminate the streaks with my new higher power laser. I hadn’t planned on becoming a g-code expert at age 74, but I’m always up for a new challenge. Just wanted to do this for hobby. It is fun and look forward to being able to do some great art work. A few examples of actual set up data with remarks out to the side would be delightfully helpful, even though it would be different for each setup but actual examples with comments always help. Thanks for your patience.

1 Like

I think I heard that before… Don’t feel bad, we see that over and over… We’ve all done it.

I’m guessing you have a coordinate issue. If you ‘picked’ the wrong ‘home’ corner it might be thinking differently than you do about where it’s going.

Did you go through the Lightburn grbl setup? I think it’s a coordinate system problem and the setup goes over that. Might want to review it…

Good luck :slight_smile:

Went through the GRBL setup and determined that you are right that it is a coordinate issue. I have changed so many things now, trying to get it to work, I can’t tell if my machine uses negative coordinates or not. It is a EleksMaker kit that I put together. Here is what is currently set up.
$$
$0=10
$1=25
$2=0
$3=1
$4=0
$5=0
$6=0
$10=3
$11=0.010
$12=0.002
$13=0
$20=0
$21=0
$22=0
$23=0
$24=25.000
$25=500.000
$26=10
$27=1.000
$30=1000
$31=0
$32=1
$100=250.000
$101=250.000
$102=250.000
$110=635.000
$111=635.000
$112=500.000
$120=50.000
$121=50.000
$122=10.000
$130=381.000
$131=279.400
$132=0.000
ok
$I
[VER:1.1h.20190830:]
[OPT:VZ,15,128]
Target buffer size found

Using the set up paper, I have the zero set up correctly. I goes to origin correctly every time now. The issue is now that the laser does not follow the art work. It seems to move to where the frame line starts, then it moves along the X axis but does not make the turn, it just keeps going until I STOP it or it hits the end of travel. I thought that the picture might be rotated 90 degrees but if that were the case, it would make the turn before it hit the mechanical stop. It appears that the program is not being followed. Will turn the picture 90 degrees in the program and see what it does. I did change $10 to 0 per set up page.
Just determined that the art work is being flip up side down - instead of starting from the right front it is being drawn up side down on the right side of the machine. It should be right side up being drawn on the left side of the machine. Can you tell me how to fix that? What code do I put in to set the controller back to the beginning so I can determine where the actual machine origin is. Then I can figure out how to correctly set the origin. Thanks for everyone’s help and patience!

First, can you connect to the controller with Lightburn? If so, can you ‘jog’ the head around correctly?

Something I don’t remember or forgot, but how did you pick where it homes? I noticed it originally homed in the right rear, now it’s the front … How did you determine what and where 0, 0 is?

You changed controllers so the brains are now with the new controller, it may think 0, 0 is elsewhere.

If you can get it in the middle of the table, turn it on. That should be 0, 0, since you don’t have switches.

If you can connect with lightburn, just draw a 10 mm or so line and send it. See which way it likes to go…

Ensure you know which way it’s supposed to go. Use the preview screen, slowed down if need be.

Should tip you off to the coordinate system. :slight_smile:

I have been playing with the G10 position command and I have determined that the art is correct (not upside down) and in the back right quadrant and needs to be moved to the left front quadrant of the frame. I think you are right and the middle of the frame is the zero. Using G10, If I put in the X and Y using the actual width and length if the work area, I get minus outside of work area errors. I will put in half the dimensions and see what I get. Yes, moving the laser head 10mm right and back from my manually set origin does move it 10mm correctly.

If I set G10 to 0,0 with the head manually set to origin 0,0 in the left front of the frame, the art “box” will be drawn in correctly on “the page” located in the right rear quadrant. If I put in half the work area in G10 I get minus errors. For some reason I am having a hard time visualizing how to do this. If I put in minus numbers, I get positive numbers in the location for origin zero. If I put in positive numbers I get minus numbers in the location for origin zero. No matter, it continues to draw the box in the right back quadrant. I am completely stymied on this issue and unable to make sense of it.

No matter what I set in G10, the 1" X 1.5" box is put in the right rear quadrant of the frame. I went ahead and let it burn the box and now I have another “interesting” problem. The box burned four times the size of the box in the drawing! This just keeps getting stranger by the minute. Is this even fixable? Have I made a huge mistake in trying to upgrade the GRBL version?