First rotary test, getting error:20 and says error on line 4

hey guys, just tried my hm v2 rotary for the first time. did a rotary set up and hit start but it only starts scanning for a second then i get error:20 and it says error on or near line 4. here is the gcodes first few lines:

; LightBurn Beta 0.9.04
; GRBL-LPC device profile, current position
G00 G17 G40 G21 G54
; Scan @ 200 mm/sec, 50% power

*i am using grbl on the c3d mini

Error 20 is “Unsupported command Unsupported or invalid g-code command found in block.”

The 4th valid line, counting from 0, would be the G0 command that includes the A axis. Are you running the 4-axis version of GRBL? You might need to download that specifically.

i was pretty sure when i switched from smoothie to grbl that i had the 4 axis version. i guess i can try to reflash the sd card with it i just deleted the firmware off the sd card and downloaded and dropped this firmware in but it didnt do anything

file name was “firmware_grbl-lpc_c3dmini_4axis.bin”. i removed all but firmware.bin and then it worked. got passed the error:20, now i just need to get the rotary to spin.

You’ll probably need to monkey with the steps/mm value for the A axis (it’s actually steps per degree). It’s probably easier to do this on the console:

Type $103=100 (press enter, and 100 is a placeholder here - you’ll be playing with this number)

Then type:
G1 A360 F1000 (press enter)

At this point, the rotary should turn 360 degrees (that’s what the A360 means). If it doesn’t, then the steps/degree number isn’t correct. If the rotary turns more than 360, you’ll need to lower the number, and if it turned less than 360 you’d raise the number.

Type G1 A0 F100 (press enter) to move the rotary back to the zero point.

Then pick a different number for the “100” above, and try again. Change the $103 setting, do the first G1 command, see how far it turns, and keep doing that to dial it in.

The G1 command has a couple parts:
G1 = move, with a controlled feed rate
A360 = A axis, 360 degrees
F1000 = feed rate, 1000 degrees / min. I’m intentionally using a low number, so it doesn’t skip the steppers if you have things wrong, but you can go faster as you get dialed in.

You will also likely need to set the $113 (maximum speed), $123 (acceleration), and $133 (max distance) values too.

got it spinning. i found out that i needed an A4988 Stepper Driver on my A axis. i have the early c3d mini and i remember it only came with one on X and Y but you could buy ones for Z and A but i didnt have any plans for z table or rotary at the time if it was even suppported yet. luckily i have 2 k40s with the same c3d mini so i snagged one from one and got the rotary spinning with the other. on to testing now

First test went fine. Just text across a piece. Next test was to wrap an image and it didnt wrap. Went maybe 1/3 way around. Next same image vector engrave and it turned a little then stopped and kept burning. Any idea what to change?

When you say “didn’t wrap” - Did you set the Y size of the image to be the full circumference of the dowel?

For the pause / burn, I’ve seen that in the past, but I thought I had fixed that. Can you generate the GCode for the vector engrave and post it here so I can have a look?

no i did not try making the y to be the same size as the circumference. i thought about trying it but was thinking it would wrap but be short the other way then. is that what youre supposed to do for each image you want to wrap? so its a 2 inch or 50.8mm rod and i have the width of my object at 2 inches and set the height to be 159.593mm? (rotary set up comes up in mm even though i have inches selected, but this is the number i got from that window)

here is the gcode for the cut:

; LightBurn Beta 0.9.04
; GRBL-LPC device profile, current position
G00 G17 G40 G20 G54
; Cut @ 25 mm/sec, 30% power

; return to starting pos
G0 X-.9021A-.004

i removed a bunch of lines in the middle because this was too long

I tried entering the circumference and engraving and it went like 2/3 of the way now. You can see where I marked with sharpie is side to side

Rotary use, in LightBurn or anything else, is just treating the cylinder as though it was a flat sheet of paper wrapped around your cylinder. If you want something to go all the way around, you would need to make sure the design is large enough to do that. If the dowel you’re using is 2" in diameter, then that’s 50.8mm, meaning 159.593mm around. You’ll need a design that’s 159.593mm tall for it to go all the way around the dowel.

If the design is an image, and the image has white space or a border around it, you’d need to account for the border too if you want the design to ‘touch itself’ on the other side.

For the vector cut, just email the gcode - I actually need to see all of it to see if it’s the problem I fixed before. It’s sneaky, and will only happen on a line or two.

i just sent the gcode. i did try the exact circumference and it still didnt wrap all the way around. i do see what you mean by treating it as a flat piece, that is a good way to put it. just weird that entering the exact number it still came up about 2 inches short.

You might not have the steps/degree value on the rotary correct yet. Have you changed / set that up yet? (this post above talks about the process, and you do need to do this for it to work: First rotary test, getting error:20 and says error on line 4)

i just tried both of these. i checked my $103 and it was at 8.889 or something close. having no idea what 103 does i entered 100 and did the g1 a360 and it just spun the rotary like 20 miles an hour and kept spinning for about a half a minute. so defintely way past just 360 degrees on that

"Type $103=100 (press enter, and 100 is a placeholder here - you’ll be playing with this number)

Then type:
G1 A360 F1000 (press enter)"

The number means “how many steps does the stepper need to move to go 1 degree of rotation”. If it was 8.889, start with that again, and do the G1 A0 then G1 A360 thing to see how far it spins. If it spins exactly one rotation, and the start lines up with the end, you have it right. If it’s short, you make the number larger, and if it’s over, you go smaller.

Did you have a chance to check my gcode I sent? I just tried doing a vector engrave of a square I just drew and it did it fine. Then I drew a circle and it starts spinning and then stays in one spot and keeps burning. The console says 99% but after 20 seconds or so I shut if off. The gcode I sent was from an image trace of a logo. Thought maybe a circle I drew would work but did not.

Right before I typed this I did the G1 A 0 and it went to a spot. I did a test burn dot then did G1 A360 and it’s been spinning but hasnt stopped. Has done like 6 revolutions already. I had to turn off laser for it to stop now

Before I did the G1 move I drew a 1x1 inch square. I played with the roller diameter and got it to measure 1x1 after I lowered the R.D. to 16.3

Try running the job with the system set to mm, instead of inches. I suspect it’s a precision tracking bug that only happens in inch mode, because I basically never run in inches unless I’m testing it.

Just tried in mm and same result with a circle

ok i finally got the rotary working with my thunder laser with a ruida board. i can vector engrave a circle , though mine is an oval. adjusting roller diameter isnt changing anything now. is changing steps per rotation for a ruida what i need to do?

so either something weird with the c3d or something in the gcode that the non-dsp version of lightburn doesnt like