-
Notifications
You must be signed in to change notification settings - Fork 33
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
Saved Z axis value wrong when Pause button clicked whilst Z axis in motion #96
Comments
Wow.. yeah, didn't think about that. I think the only way to handle this is to parse the gcode that is being sent and keep track of the target Z height. Then, when the pause button is pressed, set that as the pausedzval. Inserting a function in sendNextLine of serialPortThread, maybe after manageToolChange(), seems to make sense. This function (stolen from gcodeFile.py) should provide the target z-axis..
|
Keep in mind all Gcode that can provide Z like G2 & G3. Does the Malsow always pause operation after last gcode has completed? |
I think all gcode movement commands specify the target coordinates so we should good just parsing out the data of the gcode line. Of course, you need to account for absolute and relative positioning... The controller doesn't actually 'pause' when you hit the pause button. Webcontrol (and ground control) just stops sending gcode when the user hits pause. If buffering is disabled, the controller will stop after the current gcode line is completed.. but if buffering is enabled, the controller will stop whenever its buffer is empty.. but the correct target Z location will still be the last line Webcontrol sent the controller. |
I been reading the firmware code and see that it has Pause and Stop states. I found sending serial ! tells it to stop. Does ~ make it pause? If not do you know what does? |
The controller can pause on its own when there's a tool change..(maybe something else as well?) and that pause indicator can let webcontrol/ground control know its paused. The '~' releases it from pause state. But webcontrol/ground control watches for the "tool change" in the data stream to notify the user. Webcontrol just recently started parsing the pause/idle states just to throw it up on the UI because its there. MPos and WPos are Machine Space Pos and Work Space Pos.. they mimic grbl messages.. but the controller doesn't support work spaces so WPos is meaningless. I think they put it in with an eye on the future. I think a lot could be done better if the firmware was reporting things back differently.. but I've avoided trying to change the firmware since it can impact ground control. Case in point, holey calibration is still not brought into the main branch. I think, however, if changes are made to the holey calibration branch on my repo (or whosoever) then it can be incorporated into webcontrol.. just might not be compatible with ground control. |
Thanks for the info. Will look into it further. |
Thanks for looking into it! |
I went ahead and put it in.. in process I discovered another bug, so fixed it. |
I also noticed that if the gcode doesn't include an initial z-axis move before an xy move, then the z-target during the xy move will be 0 (because the value is uninitialized). I added a line to set the current z-target to equal the current zpos at the beginning of startRun(). |
When the Pause button is clicked whilst Z axis is in motion, it saves the current Z axis position, which is then wrong when Resume button is clicked as the Z axis continues to move until gcode command has completed. The resumeRun() action restores the wrong Z position which can cause big problems if the next gcode line does not set the correct Z height.
Right now the only way I see to fix this is to:
Unfortunately I don't know how to do point 2. If anyone can point me it the right direction I can work on a fix.
The text was updated successfully, but these errors were encountered: