tp: keep the G33 sync origin on the spindle index - #4453
Conversation
|
@spumco1234 want to give it a try? |
|
@Sigma1912 probably up your alley as well :-) |
697740a to
f203413
Compare
|
So, is the ban on spindle override for G33 and G76 still necessary with this fix? |
|
Yes, but for different reasons than what I stated in the docs, I will send an additional PR once both fixes land to revise what having both of these working mean for the docs. |
|
That is a better result than I expected on real hardware, thanks. Worth pointing out what your master numbers show on their own. Taking 41.12 as the true anchor, the 1000 rpm lag of 1.73 mm implies an axis acceleration of about 720 mm/s². That same figure predicts 0.62 mm at 600 rpm, and you measured 0.66. Two independent speeds agreeing within 6% is the Could you post One thing I want to be honest about: normalizing your two readings to the same revolution count, the residual between speeds is about 0.04 mm rather than the 0.01 the raw table suggests. I predicted half a servo cycle of travel, which for these speeds is nearer 0.01. So either there is a bit more left than I claimed, or it is cursor reading precision. Not something I can tell from here. |
|
800 fits. My 722 assumed the whole lag was quadratic. Fitting both your speeds to 748 against a configured 800 is 6.5% low, in the expected direction since it is a gantry and joint or traj limits can bind below the axis figure. And On measuring it, there is a better way than matching cursors across two traces. Compute the error in HAL and scope that directly:
|
When the axis reached synchronized velocity the position-sync loop moved the sync origin to wherever the axis had got to, folding the lead-in ramp lag into the thread's phase. That lag grows with the square of the spindle speed, so the same thread cut at a different RPM landed at a different Z (issue LinuxCNC#3455). Leave the origin at the index and let the tracking loop close the error instead, and warn when the segment is too short for it to do so. The Technical Info block in the G33 docs described a start point worked out from the spindle speed and the acceleration limits, which the planner never did. It now describes what the planner does, and what lead-in the move needs. Measured on a sim lathe, K0.1 in/rev, three G33 passes at 240/960/240 rpm in one program. Z offset from the ideal thread was 0.039/0.405/0.039 mm before and is 0.005/0.020/0.005 mm after, so the shift between the two speeds drops from 0.366 mm to 0.015 mm. The residual is half a servo cycle of travel and is linear in speed.
f203413 to
89921f6
Compare


Fixes #3455.
When the axis reaches synchronized velocity,
tpSyncPositionModemoved the sync origin to wherever the axis had got to:That folds the lead-in ramp lag into the thread's phase. The lag is roughly
omega^2 * K^2 / (2a), so it grows with the square of the spindle speed and the same thread cut at a different RPM lands at a different Z. No amount of lead-in fixes it, because the lag is absorbed rather than recovered.This leaves the origin on the index so the target stays
revs * pitch, and hands the lag to the tracking loop that already runs one line below.tpCheckSyncLeadInwarns when the segment is too short for the loop to close the error, which is the case the old code was silently hiding.Siemens documents the same rule for G33 on the 840D: at the end of the acceleration ramp the coupling is established so that the axis position relative to the spindle zero mark is as if the axis had accelerated abruptly at the thread start position, with alarm 22280 "Programmed run-in path too short" when the run-in cannot be traversed. Fanuc does no such compensation and instead relies on the operator programming a lead-in of roughly feed x RPM / 500, which is why threading under G97 at one constant RPM is the standing advice there.
The G33 "Technical Info" block in the docs described a start point worked out from the spindle speed and the acceleration limits. The planner never did that. #3455 quotes that paragraph as the spec the code did not meet, so it is rewritten here to describe what the planner does and what lead-in the move needs.
Measured on a sim lathe, K0.1 in/rev, three G33 passes at 240/960/240 rpm in one program, Z offset from the ideal thread:
The shift between the two speeds drops from 0.366 mm to 0.015 mm. What is left is half a servo cycle of travel and is linear in speed, not quadratic.
Rigid tap depth and the servo-rate sync jitter of #164 are unchanged.
runtests testspasses.Note that #581 does not fix this. It rewrites
tpSyncPositionModebut keeps the same re-anchor, renamed totp->spindle.origin.position = spindle_pos; tc->progress_at_sync = tc->progress;.