Path job in metric generating G20 (imperial) G-code

Here's the place for discussion related to CAM/CNC and the development of the Path module.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
georgevt
Posts: 9
Joined: Wed Nov 29, 2017 6:05 am

Path job in metric generating G20 (imperial) G-code

Post by georgevt »

I have a part design project with four path jobs (different tools). One of the jobs exports the proper G21 code (0.001 mm increments). But, the three other jobs export G-code preambles containing the incorrect instruction, G20, which sets increments to 0.0001 inches (should be metric, G21).

The job exporting the correct G-code is the first job on the list.
I suspect that the order of jobs on the list is relevant.

The project file is attached.

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13344 (Git)
Build type: Release
Branch: master
Hash: 404452d6ee925b9c5504b58b65c7934e411bbe62
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: English/UnitedStates (en_US)
Attachments
cnc_wheel_01.FCStd
(81.11 KiB) Downloaded 39 times
chrisb
Veteran
Posts: 54201
Joined: Tue Mar 17, 2015 9:14 am

Re: Path job in metric generating G20 (imperial) G-code

Post by chrisb »

I will look at the G20/21 issue later, but is there a good reason why you have four jobs? You could well put this all in one job with different operations.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Veteran
Posts: 54201
Joined: Tue Mar 17, 2015 9:14 am

Re: Path job in metric generating G20 (imperial) G-code

Post by chrisb »

It turned out to be easier than expected and I'm glad there is no Path error involved: The first job uses grbl postprocessor, the other jobs use centroid.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
georgevt
Posts: 9
Joined: Wed Nov 29, 2017 6:05 am

Re: Path job in metric generating G20 (imperial) G-code

Post by georgevt »

Thanks for the "centroid" catch. My CNC machine was going "crazy" and retracting until the spindle hit the top and motor kept on running (no limit switches). I had to quickly kill the power to stop the CNC from burning out the motor. I didn't know which instruction was causing the problem (no single step debug instructions in Candle). So, I broke the code into separate export files. I narrowed the problem down to a G0 command that was supposed to retract the spindle 5 mm. The same command ran properly from the terminal window. I suspected there was a problem in the preamble somewhere that was causing the CNC to misinterpret the G0 command. Upon inspecting the preamble I noticed the incorrect G20 code. But the "centroid" output that you caught was probably the problem. Changing the format to "grbl" output also changed other preamble codes. Thanks.
chrisb
Veteran
Posts: 54201
Joined: Tue Mar 17, 2015 9:14 am

Re: Path job in metric generating G20 (imperial) G-code

Post by chrisb »

georgevt wrote: Thu Mar 01, 2018 1:12 pm Thanks.
You're welcome. I think the centroid postprocessor isn't widely used - although it was one of the first postprocessors dating back to v0.16.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Post Reply