Resent change adds fixture without possibility to disable

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
gauna
Posts: 49
Joined: Fri Dec 04, 2015 8:20 pm

Resent change adds fixture without possibility to disable

Post by gauna »

Hello together,

some time ago there seems to be a change in the dialog "Job edit -> output". You can now select different working coordinate systems. The problem is, it seems you have to select a working coordinate system. I'm not used to to this. I select my WCS manually. Further, this functionality seems to add this code:

Code: Select all

(begin operation: Fixture)
(Path: Fixture)
G54
G0 Z-1.0658
The G0 command results in a crash of milling tools with the stock. Is there any possibility to disable this feature?
User avatar
sliptonic
Veteran
Posts: 3460
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Resent change adds fixture without possibility to disable

Post by sliptonic »

There's two different things to talk about; the coordinate systems, and that G0 move that you say is crashing.

The WCS
You didn't say which postprocessor you're using. If it's linuxcnc, the preamble has always inserted a G54. After the change, the preamble G54 is still there but probably doesn't need to be because it will be inserted as needed. G54 is the linuxcnc default WCS.

The new logic is implemented in src/Mod/Path/PathScripts/PathPost.py around line 290. Basically, it looks at the 'order by' preference and rebuilds the list of all Path objects to be post-processed. If there are mutiple WCS, it duplicates objects as necessary. Any time it needs to switch between WCS, it builds a new object inserting the command and a command to move up to a safe height. Once the complete list is built, it hands it to the post processor just as before.

In theory, if you just accept the defaults (only G54 selected and order by 'fixture') and are using the stock linuxcnc post, you'll get the same gcode as before.
In fact, you'll actually get G54 in your gcode twice, once from the preamble and once for the WCS.

Are you saying you generate gcode without ANY WCS and then select it manually on the machine when running the job? That's a use-case I hadn't considered and nobody mentioned it when I did the devnote discussion a few months ago.

It shouldn't be too difficult to support though.

The Crashing G0 move

You'll see around line 290 that it moves to the StockTop before transiting between coordinate systems. Rather than the top of stock, I think this should be the Job clearance height which would be calculated as 'OpStockZMax+SetupSheet.ClearanceHeightOffset'

Even so, if you're touched off properly, I don't know why this would be a crash. It should just be moving to the top of the stock.
gauna
Posts: 49
Joined: Fri Dec 04, 2015 8:20 pm

Re: Resent change adds fixture without possibility to disable

Post by gauna »

Thank you for explanation. I'm using grbl as post-processor forgot to mention that. Also I don't need the fixture cmd I can work with this, also I would prefer the behavior before.

Regarding G0 move towards Zmax: This is a very bad behavior. It implies that the tool is touched well to the surface. There are always tolerances. The stock may be higher at another position than touching position. Of course, stock configuration should include this, but mistakes happen. Heading to the surface at rapid speed is a no go. It seems to be the very first move cmd being transferred to the milling machine even before moving to the position of the stock. First time I discovered this behavior the tool was just located over my tool length sensor. Even if "only" clearance or safe height would have been addressed, I would have been unable to save my sensor from being killed by a reaching tool at rapid speed. (I didn't liked my tool length sensor. The loss is acceptable)

Thank you for focusing the line of code. I will remove this code in my copy.
User avatar
sliptonic
Veteran
Posts: 3460
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Resent change adds fixture without possibility to disable

Post by sliptonic »

GRBL uses work coordinate systems as well. It defaults to G54 like linuxcnc

Just because you don't need the feature now doesn't mean you won't in the future so it's important that we get it right.

I've started a branch called bug/wcs here: https://github.com/sliptonic/FreeCAD/tree/bug/wcs

It adds another option to the WCS list 'Disabled' that if selected ignores all the other WCS. This should make it possible to generate gcode with no explicit coordinate system.

I also changed the height of the G0 move to be the top of the stock plus the setupsheet clearance offset.

The branch could use some testing.
gauna
Posts: 49
Joined: Fri Dec 04, 2015 8:20 pm

Re: Resent change adds fixture without possibility to disable

Post by gauna »

All right. I will try to test.
User avatar
Wsk8
Posts: 182
Joined: Fri Dec 07, 2018 6:24 pm

Re: Resent change adds fixture without possibility to disable

Post by Wsk8 »

Hello,
currently i'm testing 0.19 and i encountered the same problem

Code: Select all

(Exported by FreeCAD)
(Post Processor: grbl_post)
(Output Time:2019-08-10 21:36:28.357000)
(begin preamble)
G17 G90
G21
(begin operation: Fixture)
(Path: Fixture)
G54
G0 Z-2.132
(finish operation: Fixture)
(begin operation: T7: Mill 10mm)
(Path: T7: Mill 10mm)
(T7: Mill 10mm)
(begin toolchange)
M6 T7.0
M3 S10.0
(finish operation: T7: Mill 10mm)
(begin operation: MillFace)
(Path: MillFace)
(MillFace)
G0 Z5.000
G0 X189.000 Y5.000
G0 Z3.000
G1 X189.000 Y5.000 Z0.000 F110.000
G1 X189.000 Y14.899 Z0.000 F100.000
G1 X179.101 Y5.000 Z0.000 F100.000
There's this strange move to G0 Z-2.132. But my workpiece is at 0 (see Mill face OP).
I have no idea there this move comes from.

Code: Select all

OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17352 (Git)
Build type: Release
Branch: master
Hash: ec0049921b813ee78c1fd4ea304e70904a3208f7
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: German/Germany (de_DE)
mfg
User avatar
dubstar-04
Posts: 698
Joined: Mon Mar 04, 2013 8:41 pm
Location: Chester, UK
Contact:

Re: Resent change adds fixture without possibility to disable

Post by dubstar-04 »

I'm getting the fixture positioning moves too.

you can see below that the tool moves to G0 Z21.800 -> G0 Z26.800 -> G0 Z24.800 and then starts cutting at Z20.800

I think that the fixture moves should be at OpStockZMax+SetupSheet.ClearanceHeightOffset as @Sliptonic suggests above.

Is there any use case where this wouldn't work?

My setup is a little different as the origin is at the bottom of the stock, on softjaws, this allows me to use the same origin and fixture for 2 ops.

Code: Select all

(Exported by FreeCAD)
(Post Processor: linuxcnc_post)
(Output Time:2019-08-14 08:16:05.736606)
(begin preamble)
G17 G54 G40 G49 G80 G90
G21
(begin operation: Fixture)
(machine: not set, mm/min)
G54
G0 Z21.800
(finish operation: Fixture)
(begin operation: T5: Facemill)
(machine: not set, mm/min)
(T5: Facemill)
M6 T5
M3 S0
(finish operation: T5: Facemill)
(begin operation: MillFace)
(machine: not set, mm/min)
(MillFace)
G0 Z26.800
G0 X61.000 Y91.432
G0 Z24.800
G1 X61.000 Y91.432 Z20.800
G1 X0.000 Y91.432 Z20.800
G0 X0.000 Y91.432 Z26.800
G0 X0.000 Y71.432 Z26.800
G1 X0.000 Y71.432 Z20.800
G1 X61.000 Y71.432 Z20.800
G0 X61.000 Y71.432 Z26.800
G0 X61.000 Y51.432 Z26.800
G1 X61.000 Y51.432 Z20.800
G1 X0.000 Y51.432 Z20.800
G0 X0.000 Y51.432 Z26.800
G0 X0.000 Y31.432 Z26.800
G1 X0.000 Y31.432 Z20.800
G1 X61.000 Y31.432 Z20.800
G0 X61.000 Y31.432 Z26.800
G0 X61.000 Y11.432 Z26.800
G1 X61.000 Y11.432 Z20.800
G1 X0.000 Y11.432 Z20.800
G0 Z26.800
(finish operation: MillFace)
(begin postamble)
M05
G17 G54 G90 G80 G40
M2
photo_2019-08-14_08-31-09.jpg
photo_2019-08-14_08-31-09.jpg (157.03 KiB) Viewed 1726 times
OS: Ubuntu 19.04 (ubuntu:GNOME/ubuntu)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release
Python version: 3.7.3
Qt version: 5.12.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United Kingdom (en_GB)
Attachments
DizzyBlank3-CAM.fcstd
(87.23 KiB) Downloaded 42 times
Last edited by dubstar-04 on Wed Aug 14, 2019 8:46 am, edited 2 times in total.
User avatar
dubstar-04
Posts: 698
Joined: Mon Mar 04, 2013 8:41 pm
Location: Chester, UK
Contact:

Re: Resent change adds fixture without possibility to disable

Post by dubstar-04 »

Proposed fix for the traverse height here:

https://github.com/dubstar-04/FreeCAD/c ... vel-Height

EDIT: now PR #2426

Z moves with the proposed fixes: G0 Z26.8 -> G0 Z24.8 -> G0 Z20.8

Code: Select all

(Exported by FreeCAD)
(Post Processor: linuxcnc_post)
(Output Time:2019-08-14 09:28:22.441772)
(begin preamble)
G17 G54 G40 G49 G80 G90
G21
(begin operation: Fixture)
(machine: not set, mm/min)
G54
G0 Z26.800
(finish operation: Fixture)
(begin operation: T5: Facemill)
(machine: not set, mm/min)
(T5: Facemill)
M6 T5
M3 S0
(finish operation: T5: Facemill)
(begin operation: MillFace)
(machine: not set, mm/min)
(MillFace)
G0 Z26.800
G0 X61.000 Y91.432
G0 Z24.800
G1 X61.000 Y91.432 Z20.800
G1 X0.000 Y91.432 Z20.800
G0 X0.000 Y91.432 Z26.800
G0 X0.000 Y71.432 Z26.800
G1 X0.000 Y71.432 Z20.800
G1 X61.000 Y71.432 Z20.800
G0 X61.000 Y71.432 Z26.800
G0 X61.000 Y51.432 Z26.800
G1 X61.000 Y51.432 Z20.800
G1 X0.000 Y51.432 Z20.800
G0 X0.000 Y51.432 Z26.800
G0 X0.000 Y31.432 Z26.800
G1 X0.000 Y31.432 Z20.800
G1 X61.000 Y31.432 Z20.800
G0 X61.000 Y31.432 Z26.800
G0 X61.000 Y11.432 Z26.800
G1 X61.000 Y11.432 Z20.800
G1 X0.000 Y11.432 Z20.800
G0 Z26.800
(finish operation: MillFace)
(begin postamble)
M05
G17 G54 G90 G80 G40
M2

This isn't a complete solution to the OP, it simply address' the traverse height to remove the G0 to stock top. IMO there is no need to insert the fixture moves before the first tool path or if only a single WCS is selected, but that can be addressed separately.

Comments please.
User avatar
dubstar-04
Posts: 698
Joined: Mon Mar 04, 2013 8:41 pm
Location: Chester, UK
Contact:

Re: Resent change adds fixture without possibility to disable

Post by dubstar-04 »

dubstar-04 wrote: Wed Aug 14, 2019 8:34 am

This isn't a complete solution to the OP, it simply address' the traverse height to remove the G0 to stock top. IMO there is no need to insert the fixture moves before the first tool path or if only a single WCS is selected, but that can be addressed separately.

Comments please.
Proposed fix for supressing the initial fixture moves here:

https://github.com/FreeCAD/FreeCAD/pull/3117
Post Reply