Overflow in cycle time estimation for helix toolpath

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
rafl
Posts: 2
Joined: Mon Aug 24, 2020 9:09 pm

Overflow in cycle time estimation for helix toolpath

Post by rafl »

Using FreeCAD_0.19-23964-Linux-Conda_glibc2.12-x86_64.AppImage, I'm able to create the following error using the attached document.

Code: Select all

13:05:09  Traceback (most recent call last):
  File "/tmp/.mount_FreeCAQjeHRJ/usr/Mod/Path/PathScripts/PathUtils.py", line 60, in new_function
    res = function(*args, **kwargs)
  File "/tmp/.mount_FreeCAQjeHRJ/usr/Mod/Path/PathScripts/PathOp.py", line 537, in execute
    obj.CycleTime = self.getCycleTimeEstimate(obj)
  File "/tmp/.mount_FreeCAQjeHRJ/usr/Mod/Path/PathScripts/PathOp.py", line 568, in getCycleTimeEstimate
    cycleTime = time.strftime("%H:%M:%S", time.gmtime(seconds))
<class 'OverflowError'>: timestamp out of range for platform time_
Changing either of the feed rates to zero will allow the helix operation to recompute without errors. So far I've only been able to produce the error using the helix tool path.

From what I can tell, this issue isn't tracked on https://tracker.freecadweb.org/ yet.
Attachments
helix-cycle-time.FCStd
(21.44 KiB) Downloaded 54 times
misterwalrus
Posts: 14
Joined: Sun Dec 06, 2020 10:29 am

Re: Overflow in cycle time estimation for helix toolpath

Post by misterwalrus »

Just to confirm that your solution of setting one of the feed speed to 0 make the error goes away.
chrisb
Veteran
Posts: 54273
Joined: Tue Mar 17, 2015 9:14 am

Re: Overflow in cycle time estimation for helix toolpath

Post by chrisb »

rafl wrote: Fri Feb 19, 2021 9:15 pm From what I can tell, this issue isn't tracked on https://tracker.freecadweb.org/ yet.
Please create a ticket with links in both directions between the ticket and this topic.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
spanner888
Posts: 328
Joined: Tue May 28, 2019 10:51 am

Re: Overflow in cycle time estimation for helix toolpath

Post by spanner888 »

I have also seen this issue on several occasions over last nine months+, both with profile & helix ops and on Windows and Linux.

Code: Select all

OS: Debian GNU/Linux 10 (buster) (XFCE/xfce)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.21775 (Git) AppImage
Build type: Release
Branch: master
Hash: 1f741aa511e898849e46ed14515fce416fe32acb
Python version: 3.8.2
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/Australia (en_AU)

OS: Debian GNU/Linux 10 (buster) (XFCE/xfce)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.21775 (Git) AppImage
Build type: Release
Branch: master
Hash: 1f741aa511e898849e46ed14515fce416fe32acb
Python version: 3.8.2
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/Australia (en_AU)

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.21775 (Git)
Build type: Release
Branch: master
Hash: 1f741aa511e898849e46ed14515fce416fe32acb
Python version: 3.8.2
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/Australia (en_AU)
OS: Windows 10 (10.0)
Word size of FreeCAD: 64-bit
Version: 0.20.25645 (Git)
Build type: Release
Branch: master
Hash: 37d9757399b4c2ec30318eb88d7cd7c508246345
Python version: 3.8.10
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.2
Locale: English/Australia (en_AU)

OS: Windows 10 Version 2009
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24291 (Git)
Build type: Release
Branch: releases/FreeCAD-0-19
Hash: 7b5e18a0759de778b74d3a5c17eba9cb815035ac
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.0
Locale: English/Australia (en_AU)

In attached file, and change to Tools vertical or hor feed triggers issue. I have not been able to work out what the underlying issue is, nor a way to trigger with a simpler use case.

Have added some prints to PathOp.py and as shown below, with sample output when issue has occurred:

Code: Select all

        print (seconds)
        print (time.gmtime(seconds))
        
        ......
        15:00:44  183.08147964073046
        15:00:44  time.struct_time(tm_year=1970, tm_mon=1, tm_mday=1, tm_hour=0, tm_min=3, tm_sec=3, tm_wday=3, tm_yday=1, tm_isdst=0)
        15:00:44  Recompute failed! Please check report view.
        ...
        another one
        ....
        15:16:17  2.1200303574215943e+307
        15:16:17  Traceback (most recent call last):
          File "C:\Program Files\FreeCAD 0.19\Mod\Path\PathScripts\PathUtils.py", line 60, in new_function
            res = function(*args, **kwargs)
          File "C:\Program Files\FreeCAD 0.19\Mod\Path\PathScripts\PathOp.py", line 560, in execute
            obj.CycleTime = self.getCycleTimeEstimate(obj)
          File "C:\Program Files\FreeCAD 0.19\Mod\Path\PathScripts\PathOp.py", line 589, in getCycleTimeEstimate
            print (time.gmtime(seconds))
        <class 'OverflowError'>: timestamp out of range for platform time_t
        15:16:17  Recompute failed! Please check report view.
        15:25:29  PathToolBit(87).findToolShape(C:/Users/spanner888/AppData/Roaming/FreeCAD/Macro/newTools/Shape/endmill.fcstd, None)
        15:25:29  PathToolBit(54)._findToolFile(C:/Users/spanner888/AppData/Roaming/FreeCAD/Macro/newTools/Shape/endmill.fcstd)
        
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Overflow in cycle time estimation for helix toolpath

Post by GeneFC »

I have never seen this error in my own work, and I could not duplicate the error using the "corner bracket" file. However, I do see the error (100%) when trying the "helix" file in the OP.

I know very little about python, but it appears that the use of time.gmtime(seconds) in the line

Code: Select all

cycleTime = time.strftime("%H:%M:%S", time.gmtime(seconds))
is unnecessary. I removed that extra argument and the time function worked correctly in both cases posted in this topic.

OS: Windows 7 Version 6.1 (Build 7601: SP 1)
Word size of FreeCAD: 64-bit
Version: 0.20.25645 (Git)
Build type: Release
Branch: master
Hash: 37d9757399b4c2ec30318eb88d7cd7c508246345
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.0
Locale: English/United States (en_US)

Gene
Post Reply