will that get somewhere marked as a bug/something to improve in the future or will be forgotten in a week's time?
I'm interested, and despite my utter lack of programming knowledge I've been poking around on github looking for anything obvious.
My inexpert opinion is that a thread start point that varies with spindle speed is a bug - not expected behavior - at least according to the user manual:
G76:
Code:
The G76 canned cycle is based on the G33 Spindle Synchronized Motion. For more information see the G33 [url=https://linuxcnc.org/docs/devel/html/gcode/g-code.html#gcode:g33-tech-info]Technical Info[/url].
G33:
Code:
Technical InfoAt the beginning of each G33 pass, LinuxCNC uses the spindle speed and the machine acceleration limits to calculate how long it will take Z to accelerate after the index pulse, and determines how many degrees the spindle will rotate during that time. It then adds that angle to the index position and computes the Z position using the corrected spindle angle. That means that Z will reach the correct position just as it finishes accelerating to the proper speed, and can immediately begin cutting a good thread.
So according to the the user manual author(s)' expectation, the start point should be a calculated position with compensation for spindle speed and axis accel/maxvel values.
I did find that the section of trajectory planner file (tp.c) Chris posted earlier was edited a few times in 2009. I've no idea whether the change(s) have any affect on the situation at hand.
I see that there is an open Issue on GH - 8 years old? - that may have something to do with this, as well as some more recent (possible) resolutions:
github.com/LinuxCNC/linuxcnc/issues/167
github.com/LinuxCNC/linuxcnc/pull/479
github.com/LinuxCNC/linuxcnc/pull/581/commits
I can't tell if #581 fixed, broke, or had nothing to do with spindle synch/threading start point calcs.
I think more testing is in order.
First, I'd like to see if G33 behaves the same as G76 does.
Second, I'd like to see if the thread start point varies by a
predictable amount depending on
- spindle speed
- encoder resolution
- axis max accel
- thread pitch
If the offset is predictable, that suggests to me that position math is being done... but some programming is wrong. If the offset is not predictable, then my guess is that position is not being calculated per the G33 user manual section.
I'm sure some of the folks reading this can review files like tp.c and understand the behavior, but I can't. What I can do is poke around and see if something obvious crops us.
I've got a fairly high-res encoder on my project lathe, as well as fairly 'dynamic' Z-axis accel. I'll try to run some basic G76 and G33 tests this weekend and report back whatever I find. Maybe with a high enough encoder res and accel values, this is a non-issue... and below some set of values the underlying problem makes a (negatively) meaningful difference in threading results.