gcode conversion is getting wrong, is this a bug?

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
pegellinux
Posts: 10
Joined: Fri Apr 19, 2019 2:24 am

gcode conversion is getting wrong, is this a bug?

Post by pegellinux »

Hi I'm getting kind of bug here after update to latest FreeCAD daily.
Anything path that I'm save to gcode is not work as suppose to. it always add useless "fixture g54 Z- condition" at the begin of every each operation path. This make me wasted my stock. ("I'm doing milling on iron stock here") :cry:
This the sample useless line on gcode.

Code: Select all

(begin operation: Fixture)
(machine: not set, mm/min)
G54
G0 Z-1.776
(finish operation: Fixture)
And this the result
Image

That line not appear in freeCAD internal simulation mode (before save to gcode). I'm using linuxcnc for post processing. And today I must inspect all of my saved-gcode file and remove all of useless line above, to getting be working.

OS: Ubuntu 18.04.2 LTS (MATE/mate)
Word size of OS: 32-bit
Word size of FreeCAD: 32-bit
Version: 0.19.
Build type: Release
Candidate: 0.19~pre1~201905252151~ubuntu18.04.1
Python version: 2.7.15rc1
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Last edited by pegellinux on Sun May 26, 2019 7:35 am, edited 1 time in total.
User avatar
sliptonic
Veteran
Posts: 3457
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: gcode conversion is getting wrong, is this a bug?

Post by sliptonic »

You said you're using the linuxcnc post processor. Are you actually using a LinuxCNC as a control? LinuxCNC always has a coordinate system active and G54 is the default. So an extra G54 command is redundant but shouldn't cause a problem.

As far as I know, all controls assume a G54 coordinate system but that might not be true. If you're not using LinuxCNC, I'd like to know specifically what control you're using that has a problem.

I made an improvement to the work coordinate system a while ago but have not merged it yet. It's in this branch if you'd like to test it:
https://github.com/sliptonic/FreeCAD/tree/bug/wcs

It adds an option to the job setup to set 'none' for the WCS and then all WCS output is suppressed.
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: gcode conversion is getting wrong, is this a bug?

Post by mlampert »

It's not the G54 that's causing the problem, it's the G0 afterwards. I've seen that as well, not sure what causes it though.
herbk
Veteran
Posts: 2657
Joined: Mon Nov 03, 2014 3:45 pm
Location: Windsbach, Bavarya (Germany)

Re: gcode conversion is getting wrong, is this a bug?

Post by herbk »

Yes, i to have a G0 Z"startdepth" move at the current AppImage, but i dont know since which version it's like that.

"startdepht" dosn't make a real problem, i don't know where the "G0 Z-something" at pegellinux file comes from...

At
OS: openSUSE Leap 15.1 (KDE//usr/share/xsessions/plasma5)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.16822 (Git) AppImage
Build type: Release
Branch: master
Hash: 243aebf2dfbfe192b5bbd067020a5318a0fa8d0d
Python version: 3.7.1
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)

th first lines of the exported gcode are:

Code: Select all

(Exported by FreeCAD)
(Post Processor: linuxcnc_post)
(Output Time:2019-05-25 21:49:24.791752)
(begin preamble)
G17 G54 G40 G49 G80 G90
G21
(begin operation: Fixture)
(machine: not set, mm/min)
G54
G0 Z10.000
(finish operation: Fixture)
(begin operation: T3: 4mm)
(machine: not set, mm/min)
(T3: 4mm)
M6 T3
M3 S0
(finish operation: T3: 4mm)
(begin operation: Profile_Faces)
(machine: not set, mm/min)
(Profile_Faces)
(Compensated Tool Path. Diameter: 4.0)
G0 Z15.000
G0 X51.414 Y31.414
G0 Z13.000
G1 X51.414 Y31.414 Z10.000
Till line 8 it's like expected, but line 9 to 11 i don't understand why they are needed or good for. G54 is already set, the G0 to startdepth i don't know where it*s good for at this place, and the "(finish operation: Fixture)" - OK, it's just a comment - is... i don't know what it is...but why a finish op. a few lines after begining op...

The first lines of my actual "stable" FC fron the same part are looking like that:

Code: Select all

(Exported by FreeCAD)
(Post Processor: linuxcnc_post)
(Output Time:2019-05-25 22:01:40.499870)
(begin preamble)
G17 G54 G40 G49 G80 G90
G21
(begin operation: T3: 4mm)
(machine: not set, mm/min)
(T3: 4mm)
M6 T3
M3 S0
(finish operation: T3: 4mm)
(begin operation: Profile_Faces)
(machine: not set, mm/min)
(Profile_Faces)
(Compensated Tool Path. Diameter: 4.0)
G0 Z15.000
G0 X51.414 Y31.414
My stable is:

OS: openSUSE Leap 15.1
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.Unknown
Build type: Release
Python version: 3.6.5
Qt version: 5.9.7
Coin version: 3.1.3
OCC version: 7.3.0
Locale: German/Germany (de_DE)


Btw: Why dosn't the the devl release from the ppa show the whole version Nr? (i notced this a few times since a while). At OpenSuse it isn't shown to, but the OPenSuse release differs to the original...
Gruß Herbert
pegellinux
Posts: 10
Joined: Fri Apr 19, 2019 2:24 am

Re: gcode conversion is getting wrong, is this a bug?

Post by pegellinux »

sliptonic wrote: Sat May 25, 2019 4:20 pm You said you're using the linuxcnc post processor. Are you actually using a LinuxCNC as a control? LinuxCNC always has a coordinate system active and G54 is the default. So an extra G54 command is redundant but shouldn't cause a problem.

As far as I know, all controls assume a G54 coordinate system but that might not be true. If you're not using LinuxCNC, I'd like to know specifically what control you're using that has a problem. (...)
Thanks for your reply
I'm using A11 DSP controler, and was using freeCAD since 0.17 for generateing gcode file and never face this issue.
The problem is may not in G54, but may in "start depth" at G0 Z, actually G0 Z must be above the 0 (in my case usualy use Z5.000 for start depth). after that then execute the next operation, but with this new gcode, before applying the an "actual" "startdepth", it add unecesary line (example G0 Z-1.7000), so is going down below 0, before it execute the actuale "start depth"

I try to compare old and new gcode in same file design.
this my old gcode generate :

Code: Select all

Exported by FreeCAD)
(Post Processor: PathScripts.post.linuxcnc_post)
(Output Time:2019-05-08 21:00:22.779138)
(begin preamble)
G17 G54 G40 G49 G80 G90
G21
(begin operation: Profile_Faces001)
(machine: not set, mm/min)
(Profile_Faces001)
(Compensated Tool Path. Diameter: 0.28)
G0 Z5.000
G0 X-3.436 Y0.591

And this new generate gcode

Code: Select all

(Exported by FreeCAD)
(Post Processor: linuxcnc_post)
(Output Time:2019-05-25 13:38:13.831136)
(begin preamble)
G17 G54 G40 G49 G80 G90
G21
(begin operation: Fixture)
(machine: not set, mm/min)
G54
G0 Z-1.421
(finish operation: Fixture)
(begin operation: Profile_Faces001)
(machine: not set, mm/min)
(Profile_Faces001)
(Compensated Tool Path. Diameter: 0.28)
G0 Z5.000
G0 X-3.436 Y0.591
in code above, before profile operation, we can see it add "fixture operation"to set G0 Z-1.421. that line actually must be never exist.
Last edited by pegellinux on Sun May 26, 2019 6:44 am, edited 1 time in total.
pegellinux
Posts: 10
Joined: Fri Apr 19, 2019 2:24 am

Re: gcode conversion is getting wrong, is this a bug?

Post by pegellinux »

mlampert wrote: Sat May 25, 2019 6:39 pm It's not the G54 that's causing the problem, it's the G0 afterwards. I've seen that as well, not sure what causes it though.
Thank you for your correction, Yes that's exactly what I'm try to say.
herbk wrote: Sat May 25, 2019 8:45 pm Yes, i to have a G0 Z"startdepth" move at the current AppImage, but i dont know since which version it's like that.

"startdepht" dosn't make a real problem, i don't know where the "G0 Z-something" at pegellinux file comes from...
..(...)
th first lines of the exported gcode are:
..(...)
Till line 8 it's like expected, but line 9 to 11 i don't understand why they are needed or good for. G54 is already set, the G0 to startdepth i don't know where it*s good for at this place, and the "(finish operation: Fixture)" - OK, it's just a comment - is... i don't know what it is...but why a finish op. a few lines after begining op...
..(...)
Me too dude, I don't know were the "G0 Z-blabla" come from, it never appear in freecad toolpath simulation, but only appear after exporting to gcode file. this was only happen since last update. Hopely next update can fix this issue.
Post Reply