Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sub zero_z: Set Z0 is ignored when hover position (5mm above probe) is above max. Z height #1

Open
Schallbert opened this issue Dec 31, 2022 · 5 comments

Comments

@Schallbert
Copy link
Owner

Precondition:

  • High workpiece with Z0 + ToolLengthSensor.height + hoverOver (5mm default) > positiveZlimit

Action:

  • Execute sub zero_z

Expectation:

  • hoverOver cannot be reached but still new Z0 height is saved

Actual behavior:

  • measurement is ignored
@krizleebear
Copy link

I'm not sure whether this is a macro problem.
The instruction order in macro seems fine: first store z0, then move above

G92 Z[#4510] 				; Z-Nullpunkt übernehmen
G0 Z[#4510 + 5] 			; Taster 5mm Freifahren

https://github.com/Schallbert/macro_edingCNC_sorotec/blob/main/macro.cnc#237

@krizleebear
Copy link

Here's the extract from Eding log: EdingCNC even states: OFFSET AND PLANE SAVED TO INI FILE
I also see in log that I was forced to re-home all axes after the error. Maybe that's the point where things went sideways?
But somehow I still assume that this problem is closely related to your 'reset z after emergency stop' problem.

Maybe I'll reproduce the problem and add some more logging to the macro.

7-12 16:06:31->CNC_EC_INFO CNC_RC_OK RunLine:cnccommand.cpp(2684):Enter state =<READY>, line=<gosub xhc_probe_z>
17-12 16:06:31->CNC_EC_INFO CNC_RC_OK RunLine:cnccommand.cpp(2734):gosub xhc_probe_z
17-12 16:06:31->CNC_EC_INFO CNC_RC_OK RunGosub:cnccommand.cpp(2338):Enter state=<READY>
17-12 16:06:31->CNC_EC_INFO CNC_RC_OK RunGosub:cnccommand.cpp(2441):Leave state=<RUNNING_SUB>
17-12 16:06:31->CNC_EC_INFO CNC_RC_OK Msg:intdefcmd.cpp(35):taster wird angefahren
17-12 16:06:31->CNC_EC_INFO CNC_RC_OK MotSetCaptureMode:motion.cpp(7496):MOT_CAPTURE_PROBE
17-12 16:06:33->CNC_EC_INFO CNC_RC_OK Generate:motion.cpp(9963):Position Captured->stopping
17-12 16:06:33->CNC_EC_INFO CNC_RC_OK MotSetCaptureMode:motion.cpp(7561):MOT_CAPTURE_NONE
17-12 16:06:33->CNC_EC_INFO CNC_RC_OK MotSetCaptureMode:motion.cpp(7496):MOT_CAPTURE_PROBE
17-12 16:06:34->CNC_EC_INFO CNC_RC_OK Generate:motion.cpp(9963):Position Captured->stopping
17-12 16:06:34->CNC_EC_INFO CNC_RC_OK MotSetCaptureMode:motion.cpp(7561):MOT_CAPTURE_NONE
17-12 16:06:34->CNC_EC_INFO CNC_RC_OK BackupFile:cncmem.cpp(44):Path <C:\CNC4.03\backup> already existing

17-12 16:06:34->CNC_EC_INFO CNC_RC_USER_INFO SetOriginOffsets:intgcodecmd.cpp(2081):OFFSET AND PLANE SAVED TO INI FILE
17-12 16:06:34->CNC_EC_STOP CNC_RC_ERR_MOT UpdateCncStatus:motion.cpp(11301):Z SOFTWARE POSITION LIMIT CROSSED
17-12 16:06:34->CNC_EC_INFO CNC_RC_OK Generate:motion.cpp(9968):SW limit reached->stopping
17-12 16:06:35->CNC_EC_INFO CNC_RC_OK CncAbortJob:cnccommand.cpp(596):Enter state=<RUNNING_SUB>
17-12 16:06:35->CNC_EC_INFO CNC_RC_OK CncAbortJob:cnccommand.cpp(603):Leave state=<RUNNING_SUB>
17-12 16:06:46->CNC_EC_INFO CNC_RC_OK Tracking or Hand-wheel:cnccommand.cpp(4408):Enter state=<ABORTED>
17-12 16:06:46->CNC_EC_WARNING CNC_RC_ERR_STATE Tracking or Hand-wheel:cnccommand.cpp(4570):Tracking or Hand-wheel Not allowed in state ABORTED
17-12 16:06:46->CNC_EC_INFO CNC_RC_OK Tracking or Hand-wheel:cnccommand.cpp(4574):Leave state=<ABORTED>
17-12 16:06:46->CNC_EC_INFO CNC_RC_OK Tracking or Hand-wheel:cnccommand.cpp(4408):Enter state=<ABORTED>
17-12 16:06:46->CNC_EC_WARNING CNC_RC_ERR_STATE Tracking or Hand-wheel:cnccommand.cpp(4570):Tracking or Hand-wheel Not allowed in state ABORTED
17-12 16:06:46->CNC_EC_INFO CNC_RC_OK Tracking or Hand-wheel:cnccommand.cpp(4574):Leave state=<ABORTED>
17-12 16:06:47->CNC_EC_INFO CNC_RC_OK Tracking or Hand-wheel:cnccommand.cpp(4408):Enter state=<ABORTED>
17-12 16:06:47->CNC_EC_WARNING CNC_RC_ERR_STATE Tracking or Hand-wheel:cnccommand.cpp(4570):Tracking or Hand-wheel Not allowed in state ABORTED
17-12 16:06:47->CNC_EC_INFO CNC_RC_OK Tracking or Hand-wheel:cnccommand.cpp(4574):Leave state=<ABORTED>
17-12 16:06:53->CNC_EC_INFO CNC_RC_OK RunLine:cnccommand.cpp(2684):Enter state =<ABORTED>, line=<gosub xhc_macro_5>
17-12 16:06:53->CNC_EC_WARNING CNC_RC_ERR_STATE RunLine:cnccommand.cpp(2949):Not allowed in state ABORTED
17-12 16:06:53->CNC_EC_INFO CNC_RC_OK RunLine:cnccommand.cpp(2953):Leave state=<ABORTED>
17-12 16:06:58->CNC_EC_INFO CNC_RC_OK Reset:cnccommand.cpp(1441):Enter state=<ABORTED>
17-12 16:06:58->CNC_EC_STOP CNC_RC_ERR_MOT UpdateCncStatus:motion.cpp(11301):Z SOFTWARE POSITION LIMIT CROSSED
17-12 16:06:58->CNC_EC_INFO CNC_RC_OK SetMCAGuardON:CCncKins.cpp(1313):MCAGuard switched ON
17-12 16:06:58->CNC_EC_INFO CNC_RC_OK SetTCAGuardON:CCncKins.cpp(1290):TCAGuard switched ON
17-12 16:06:58->CNC_EC_INFO CNC_RC_ERR ParseExecute:intline.cpp(1410):5->SpindleOff
17-12 16:06:58->CNC_EC_INFO CNC_RC_ERR ParseExecute:intline.cpp(1410):4->MistOff
17-12 16:06:58->CNC_EC_INFO CNC_RC_ERR ParseExecute:intline.cpp(1410):3->FloodOff
17-12 16:06:58->CNC_EC_INFO CNC_RC_USER_INFO feedov:intgcodecmd.cpp(4020):Feed OV enabled
17-12 16:06:58->CNC_EC_INFO CNC_RC_ERR ParseExecute:intline.cpp(1410):2->feedov
17-12 16:06:58->CNC_EC_INFO CNC_RC_USER_INFO speedov:intgcodecmd.cpp(4134):Speed OV enabled
17-12 16:06:58->CNC_EC_INFO CNC_RC_ERR ParseExecute:intline.cpp(1410):1->speedov
17-12 16:06:58->CNC_EC_INFO CNC_RC_OK Reset:cnccommand.cpp(1711):Ready for operation
17-12 16:06:58->CNC_EC_INFO CNC_RC_OK InitHandwheelFeedOV:fsovrunpausetask.cpp(740):curFeedOv = 1.000, m_handwheelCounterFOV = 0 m_virtualHandwheelCounterFOV = 200
17-12 16:06:58->CNC_EC_INFO CNC_RC_OK Reset:cnccommand.cpp(1732):Leave state=<READY>
17-12 16:06:58->CNC_EC_INFO CNC_RC_OK RunLine:cnccommand.cpp(2684):Enter state =<READY>, line=<gosub home_all>

@krizleebear
Copy link

I tried, but couldn't reproduce the problem. Also my additional logs show the right values for G92 z offset.
I guess it's still a good idea to adapt the macro to not drive into a position limit.

@Schallbert
Copy link
Owner Author

OK, thanks for the update.
The macro file looks pretty distinct here, as you wrote above:
G0 Z[#4510 + 5] ; Taster 5mm Freifahren
This command is executed after setting the non-volatile variable. But of course there could be a race condition: Imagine the save-to-ini is done in another thread that doesn't join but detach before running that line. Imagine further that saving to .ini takes a couple of seconds for whatever reason, and you'll run into the issue the title states.

This would also explain that reproducability is bad.

Nonetheless, a safe way would be to check if we have that 5mm headroom so we can ignore this line if we are above limit.

@krizleebear
Copy link

I like both your theory and the possible solution.
Maybe a possible implementation is to store the absolute z-height (machine coords) when entering the sub-macro and returning to this height after probing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants