First Post: Error 20

Ok. This is my first post to the forum.

A little back story. I purchased the Longmill 30X30 about a year ago and am only now getting it put together. The workshop for all my woodworking tools that was supposed to be built last fall got put on hold. Good news is that the foundation is finally finished and construction of the building will begin in a week or two.

I was holding off on assembling the Longmill as I really don’t have a place to use it in the house. Now that the shop is actually under construction I decided that it was time to get this thing together and get it working and learn the basics so it would be ready for move in day.

My first project is a wooden gear clock that I am building from plans out of an old issue of “Scroll Saw Woodworking and Crafts” magazine. I am using FreeCad 0.19 to design the gears and create the G-Code and gSender 1.0.7 to run the Longmill.

After importing the file into gSender I can see a wire frame outline of the gear I want to cut. (I’m not actually cutting the part just trying to send the file to the machine and watch it move around.)
When I click on ‘outline’ the machine moves in a roughly circular path making some cool SciFi sounds and then comes to rest at the zero point. The trouble starts when I attempt to do the test run. It runs for a second then two error boxes show up, Error 20 on line 24 - Unsupported Command and Error 20 on line 25 - Unsupported Command. There’s still a green box in the upper right corner stating ‘Checking G-Code file’ and a red box in the lower left corner stating ‘Stop Job’. The progress is stuck at 3% with 1045 lines remaining. Nothing happens after several minutes so I think gSender didn’t like my file. I can press the red box to stop and it does stop so gSender doesn’t seem to be locked up.

I have attempted to upload the file so maybe someone can give it a glance and see what might be hanging it up.

FreeCad doesn’t seem to want me to save the file as a .gcode. It looks like plane text without a file extension. I have added .gcode to the end of the file to get it to upload to the forum.

edit: can’t upload to the forum as a new user.

I don’t know if the ; headed lines are counted or not.
If they do count then these are the 24th and 25th lines:
G81 X0.0000 Y0.0000 Z0.0000 F381.0 R13.7000
G80
If not then these are the 24th and 25th lines:
G0 X44.9128 Y44.8823
G0 Z15.7000

Here’s the first 70 lines or so:

;Exported by FreeCAD
;Post Processor: centroid_post
;CAM file: C:/Users/stuar/Documents/FreeCAD Projects/Wooden Gear Clock/Great Wheel.FCStd
;Output Time: 2022-05-19 08:14:41.969711
G90 G80 G40 G49
;T2=TC__1_8_Carbide_Flat_End_MIll
;begin preamble
G53 G00 G17
G21
;begin operation
G54
;end operation: Fixture
;begin operation
;TC: 1-8 Carbide Flat End MIll
M6 T2
M3 S0
;end operation: TC: 1-8 Carbide Flat End MIll
;begin operation
;Drilling
;Begin Drilling
G0 Z17.7000
G90
G99
G81 X0.0000 Y0.0000 Z0.0000 F381.0 R13.7000
G80
G0 Z15.7000
G81 X1.6016 Y21.3713 Z0.0000 F381.0 R13.7000
G80
G0 Z15.7000
G81 X17.7073 Y-12.0727 Z0.0000 F381.0 R13.7000
G80
G0 Z15.7000
G81 X-19.3089 Y-9.2987 Z0.0000 F381.0 R13.7000
G80
G0 Z15.7000
G0 Z17.7000
;end operation: Drilling
;begin operation
;Profile
;Compensated Tool Path. Diameter: 3.175
G0 Z17.7000
G0 X44.9128 Y44.8823
G0 Z15.7000
G1 X44.9128 Y44.8823 Z9.5250 F381.0
G2 X55.9378 Y-30.0515 Z9.5250 I-44.8837 J-44.8817 F889.0
G2 X55.0618 Y-30.8261 Z9.5250 I-1.4357 J0.7411 F889.0
G2 X53.4892 Y-30.5472 Z9.5250 I-0.5442 J1.5049 F889.0
G1 X20.4304 Y-4.3773 Z9.5250 F889.0
G2 X17.4098 Y1.3429 Z9.5250 I4.9213 J6.2564 F889.0
G3 X11.9078 Y12.7711 Z9.5250 I-17.4063 J-1.3415 F889.0
G2 X9.3158 Y18.7024 Z9.5250 I5.3691 J5.8783 F889.0
G1 X9.4672 Y60.8654 Z9.5250 F889.0
G2 X11.1087 Y62.4999 Z9.5250 I1.5915 J0.0432 F889.0
G2 X44.9128 Y44.8823 Z9.5250 I-11.0796 J-62.4992 F889.0
G0 Z17.7000
G0 X-1.7390 Y51.7427 Z17.7000
G0 X-1.7390 Y51.7427 Z15.7000
G1 X-1.7390 Y51.7427 Z9.5250 F381.0
G1 X-6.4243 Y19.8820 Z9.5250 F889.0
G2 X-9.8679 Y14.4058 Z9.5250 I-7.8789 J1.1337 F889.0
G3 X-17.0140 Y3.9269 Z9.5250 I9.8650 J-14.4036 F889.0
G2 X-20.8547 Y-1.2834 Z9.5250 I-7.7752 J1.7106 F889.0
G1 X-57.4446 Y-22.2339 Z9.5250 F889.0
G2 X-57.9244 Y-22.4269 Z9.5250 I-0.8983 J1.5397 F889.0
G2 X-59.6808 Y-21.6296 Z9.5250 I-0.3592 J1.5420 F889.0
G2 X-1.9435 Y63.4693 Z9.5250 I59.6657 J21.6544 F889.0
G2 X-0.2899 Y61.5966 Z9.5250 I0.0831 J-1.5931 F889.0
G1 X-1.7390 Y51.7427 Z9.5250 F889.0
G0 Z17.7000
G0 X-10.0633 Y-14.9960 Z17.7000
G0 X-10.0633 Y-14.9960 Z15.7000

Longmill 30X30
FreeCad 0.19 design Software
gSender 1.0.7
acer Intel(R) Core™ i7-3630QM CPU @ 2.40GHz 2.40 GHz
16 GB ram

Thanks for your help

Stuart

@StuartG Welcome to the group, Stuart.

A very quick look at the code that you posted shows that you are using a centroid post processor. I suggest that a first step in your working this out would be to select grbl as your post. I just looked on the freecad site and it appears that grbl is an option. I don’t know if you can then choose inch or mm. If you can, either one will work.

gwilki

Thanks for that. There are so many variables in FreeCad it’s hard to keep track of them as a new user.

I changed to grbl and the most noticeable thing is all the ; changed to (). Still quits on line 24 and 25 with the same error. :frowning:

Here’s the updated first several lines:

(Exported by FreeCAD)
(Post Processor: grbl_post)
(Output Time:2022-05-19 11:51:14.259515)
(Begin preamble)
G17 G90
G21
(Begin operation: Fixture)
(Path: Fixture)
G54
(Finish operation: Fixture)
(Begin operation: TC: 1-8 Carbide Flat End MIll)
(Path: TC: 1-8 Carbide Flat End MIll)
(TC: 1-8 Carbide Flat End MIll)
(Begin toolchange)
( M6 T2.0 )
M3 S0.0
(Finish operation: TC: 1-8 Carbide Flat End MIll)
(Begin operation: Drilling)
(Path: Drilling)
(Drilling)
(Begin Drilling)
G0 Z17.700
G90
G99
G81 X0.000 Y0.000 Z0.000 F381.000 R13.700
G80
G0 Z15.700
G81 X1.602 Y21.371 Z0.000 F381.000 R13.700
G80
G0 Z15.700
G81 X17.707 Y-12.073 Z0.000 F381.000 R13.700
G80
G0 Z15.700
G81 X-19.309 Y-9.299 Z0.000 F381.000 R13.700
G80
G0 Z15.700
G0 Z17.700
(Finish operation: Drilling)
(Begin operation: Profile)
(Path: Profile)
(Profile)
(Compensated Tool Path. Diameter: 3.175)
G0 Z17.700
G0 X44.913 Y44.882
G0 Z15.700
G1 X44.913 Y44.882 Z9.525 F381.000
G2 X55.938 Y-30.051 Z9.525 I-44.884 J-44.882 K0.000 F889.000
G2 X55.062 Y-30.826 Z9.525 I-1.436 J0.741 K0.000 F889.000
G2 X53.489 Y-30.547 Z9.525 I-0.544 J1.505 K0.000 F889.000
G1 X20.430 Y-4.377 Z9.525 F889.000
G2 X17.410 Y1.343 Z9.525 I4.921 J6.256 K0.000 F889.000
G3 X11.908 Y12.771 Z9.525 I-17.406 J-1.342 K0.000 F889.000
G2 X9.316 Y18.702 Z9.525 I5.369 J5.878 K0.000 F889.000
G1 X9.467 Y60.865 Z9.525 F889.000
G2 X11.109 Y62.500 Z9.525 I1.592 J0.043 K0.000 F889.000
G2 X44.913 Y44.882 Z9.525 I-11.080 J-62.499 K0.000 F889.000
G0 Z17.700
G0 X-1.739 Y51.743 Z17.700
G0 X-1.739 Y51.743 Z15.700
G1 X-1.739 Y51.743 Z9.525 F381.000
G1 X-6.424 Y19.882 Z9.525 F889.000
G2 X-9.868 Y14.406 Z9.525 I-7.879 J1.134 K0.000 F889.000
G3 X-17.014 Y3.927 Z9.525 I9.865 J-14.404 K0.000 F889.000
G2 X-20.855 Y-1.283 Z9.525 I-7.775 J1.711 K0.000 F889.000
G1 X-57.445 Y-22.234 Z9.525 F889.000
G2 X-57.924 Y-22.427 Z9.525 I-0.898 J1.540 K0.000 F889.000
G2 X-59.681 Y-21.630 Z9.525 I-0.359 J1.542 K0.000 F889.000
G2 X-1.944 Y63.469 Z9.525 I59.666 J21.654 K0.000 F889.000
G2 X-0.290 Y61.597 Z9.525 I0.083 J-1.593 K0.000 F889.000
G1 X-1.739 Y51.743 Z9.525 F889.000
G0 Z17.700

Stuart

OK. So I tried to just run the job and it stopped at line 23 and 24 again but I was able to press ‘Resume job’ and it then went on and crashed at line 27, then again at 30 then for the last time at 38. I think it has something to do with the drilling operation. I am attempting to drill 1/8" holes with a 1/8" bit. Once the gcode gets past the drilling the machine runs the rest of the job with no problem. It is a 3 spoked gear with a hole in the center and one hole in each spoke. It doesn’t do the holes but after it actually starts to run it cuts the 3 large holes in between each of the spokes (4 passes) and then it cuts the perimeter of the gear (also 3 passes) and then stops.

Stuart

@StuartG I am/was unfamiliar with the G80 and G81 codes. I did some searching and found this:

G81 is a canned drill cycle.
The memory in the chip that runs GRBL is too small to do canned cycles internally.
That is why only bCNC will run the G81, it converts it to a series of commands that GRBL does support.
and that is why all the other GUI’s will give an error on G81, they don’t translate it and GRBL considers it an error.

Again, I plead ignorance, but I’m thinking that this may be the cause of your errors. That said, there was no context in this thread for the statement that the chip that runs grbl is too small to do canned cycle internally. I have idea what “chip” this is a reference to.

Then, I found this video, which seems to bear out the previous statement that grbl cannot run freecad drilling code. However, there is a work around.

I am now officially way beyond my level of competence, so if this video does not address your problem, with luck someone much more knowledgeable than me will jump in.

OK. I seem to recall something about FreeCad having an issue drilling, but I thought it was drilling a hole with a bit the same size as the hole. It seemed to work OK in the preview in FreeCad so I thought it was fixed. Anyway, thanks for the video, I’ll watch it and see if we can get it going.

It’s fun to watch the machine move around and the sounds it makes are pretty cool. Seriously, like something out of a Science Fiction movie.

Stuart

@StuartG Notice in his console view that there are no G80 or G81 codes and he makes a point of saying that you must remove the G99 codes so that grbl can run this. Your files has G99 codes, too.

Watched the video and now have success!!!

It’s a pretty simple fix. Only took about 20 minutes to solve. I added the ‘–translate_drill’ under the job edit-output section and removed the G99, also changed the drilling operation to peck.

A quick recalculation of gcode, upload to gSender and clicked on test run and it worked perfectly.

gwilki, thanks so much for your help. I’m sure I’ll be back for more help.

Can’t wait to actually cut something!

Stuart

@StuartG I’m glad that it worked out and we both get to learn something - bonus.

As the original issue has been addressed, I’m closing this topic. If anyone else has a similar concern, feel free to start a new topic, which will ensure that it is addressed promptly.