Path Helix - 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
nahshon
Posts: 225
Joined: Wed Jul 24, 2013 8:06 pm

Path Helix - bug?

Post by nahshon »

I tried path Helix today and this almost caused damage.
My point is that no operation should cause a G0 below the safe height.

Especially true true for LinuxCNC, where the first G0 moves do not wait for the spindle to rotate at the desired speed.

Part of the generated G-Code (Safe height is 13mm):

Code: Select all

M3 S24000 
(finish operation: TC: 3.175mm_EndMill)
(begin operation: Helix)
(machine units: mm/min)
(Helix) 
(helix cut operation) 
G0 Z15.000 
G0 Z15.000 
G0 X0.000 Y7.500 Z15.000 
G0 X0.000 Y7.500 Z10.000 
G0 X1.163 Y7.500 
G1 Z10.000 F300.000 
G2 X-1.163 Y7.500 Z9.286 I-1.163 J0.000 F380.000 
I consider the last two GO lines dangerous (and there is also one redundant line to move to Z15).

Image taken from FreeCAD:
Helix.png
Helix.png (8.54 KiB) Viewed 1563 times
Thanks!
-- Itai

FreeCAD version. I also tried the latest weekly build with similar results,

Code: Select all

OS: Fedora Linux 37 (KDE Plasma) (KDE/plasmax11)
Word size of FreeCAD: 64-bit
Version: 0.21.0.31508 (Git)
Build type: Release
Branch: master
Hash: ed8e45ac9b9196ec42572b6746b27cdd6183c903
Python 3.11.1, Qt 5.15.7, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: English/United States (en_US)
Installed mods: 
  * lattice2 1.0.0
  * kicadStepUpMod 10.16.5
  * fasteners 0.4.51
  * freecad.gears 1.0.0
Attachments
Helix.FCStd
(32.27 KiB) Downloaded 37 times
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: Path Helix - bug?

Post by mlampert »

nahshon wrote: Tue Jan 03, 2023 9:13 pm Especially true true for LinuxCNC, where the first G0 moves do not wait for the spindle to rotate at the desired speed.
You might want to look into setting up LinuxCNC so it _does_ wait for the spindle to come up to speed.

Arguably the G0Z10 move should be a G1. However, the helix movement must always start before the tool enters the stock, otherwise it's not a Helix operation, it's a plunge move. I'm not saying the G0Z10 move isn't a bug, I'm just saying in practice it shouldn't matter. Please file an issue it should get fixed.
nahshon
Posts: 225
Joined: Wed Jul 24, 2013 8:06 pm

Re: Path Helix - bug?

Post by nahshon »

mlampert wrote: Tue Jan 03, 2023 10:25 pm You might want to look into setting up LinuxCNC so it _does_ wait for the spindle to come up to speed.
Actually I like this feature. I use HYVFD driver so LinuxCNC gets feedback from the spindle. There is no problem with G0 move to XY location at Clearance Height while the spindle is getting to required RPM.

I'm looking at the python code and I believe I can fix it myself. Hope to do that in the weekend. When ready I will create a branch for review.

I also want to add an option to do only the first (outer most) radius. It would be useful for circular through holes and in some cases faster than a profile op.

-- Itai
nahshon
Posts: 225
Joined: Wed Jul 24, 2013 8:06 pm

Re: Path Helix - bug?

Post by nahshon »

Please look at https://github.com/itain/FreeCAD.git branch path_helix_fix or see the attached file to see changes.

Changes:
  1. Never use G0 below safe height, except retracting.
  2. Add option "Profile" to enforce only single helix. This is useful for large circular through holes. Since the hole goes all the way to the bottom there is no need to clear the center.
    • I'm not sure about name selection. Better ideas?
    • It's working for new helix operations. I cannot use this option on older projects. Is there a way to update the enum for older projects? Otherwise is there a way to disable this option from the UI?
HelixTest.png
HelixTest.png (39.9 KiB) Viewed 1336 times
-- Itai
Attachments
path_helix_fix.txt
(6.42 KiB) Downloaded 31 times
User avatar
sliptonic
Veteran
Posts: 3457
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Path Helix - bug?

Post by sliptonic »

mlampert wrote: Tue Jan 03, 2023 10:25 pm Please file an issue it should get fixed.
Once an issue is identified, we should be creating it in the github tracker and subsequent discussion should happen there. Please read the contributing policy for more details

https://github.com/FreeCAD/FreeCAD/issues/8140
nahshon wrote: Sat Jan 07, 2023 11:47 am Please look at https://github.com/itain/FreeCAD.git branch path_helix_fix
Please create a draft PR and reference the associated issue. I'll review and comment on your solution there. Thanks for working on this!
nahshon
Posts: 225
Joined: Wed Jul 24, 2013 8:06 pm

Re: Path Helix - bug?

Post by nahshon »

Thanks!

I created a new branch and draft PR with just the bug fixed.
https://github.com/FreeCAD/FreeCAD/pull/8147

Once it's complete I will post a new PR with the new feature that I suggest: https://github.com/FreeCAD/FreeCAD/issues/8149

-- Itai
nahshon
Posts: 225
Joined: Wed Jul 24, 2013 8:06 pm

Re: Path Helix - bug?

Post by nahshon »

PR is there for long time. Is there anything else I should do to make it happen?
https://github.com/FreeCAD/FreeCAD/pull/8147

Thanks,
-- Itai
Post Reply