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

Status report with wrong stat #367

Closed
breiler opened this issue Jul 2, 2018 · 7 comments
Closed

Status report with wrong stat #367

breiler opened this issue Jul 2, 2018 · 7 comments
Assignees
Labels

Comments

@breiler
Copy link

breiler commented Jul 2, 2018

I'm using {sv:1} and {si:250}to receive status reports during and after a command has been sent to the controller and in version 101.03 it sometimes ends up with the wrong sr:stat.

So for instance if I issue the following command I get a sr:stat saying that it's running. I would expect it to be 3 (program stop) or 4 (program end).

>>> {"gc":"G20"}
{"r":{},"f":[1,0,14]}
{"sr":{"posx":10,"unit":0,"stat":5}}

If I run a G0-command it works as expected:

>>> {"gc":"G0 X11"}
{"r":{},"f":[1,0,17]}
{"sr":{"posx":10.09847,"vel":39.37,"stat":5}}
{"sr":{"posx":10.26381}}
{"sr":{"posx":10.42914}}
{"sr":{"posx":10.59448}}
{"sr":{"posx":10.75883}}
{"sr":{"posx":10.92416}}
{"sr":{"posx":11,"vel":0,"stat":3}}

I don't experience the same problem in version 100.26 but that's probably because it doesn't report the stat for the G20-command:

>>> {"gc":"G20"}
{"r":{},"f":[1,0,14]}
{"sr":{"unit":0}}

The G0-command works as expected:

>>> {"gc":"G0 X11"}
{"r":{},"f":[1,0,17]}
{"sr":{"posx":2.501,"vel":1000,"momo":0,"stat":5}}
{"sr":{"posx":6.7}}
{"sr":{"posx":10.752,"vel":595.97}}
{"sr":{"posx":11,"vel":0,"stat":3}}
@justinclift
Copy link
Member

Interesting. Could indeed be a bug.

As a general thought, I think it's recommended to send G-Code as plain text, instead of using the json format. Changing variable settings and the various control things are recommended for json though. 😄

@justinclift
Copy link
Member

Ahhh, here's the wiki page I was thinking of:

Under the Notes section:

Note that {"gc":"...} Gcode line are considered control lines and bypasses motion planner buffer tests and are acknowledged immediately. Consider sending GCode as unwrapped text, while observing linemode protocol. See issue 287 for more detail.

@breiler
Copy link
Author

breiler commented Jul 2, 2018

Thanks for the quick reply @justinclift, I didn't bother looking into the existing code for sending GCode commands. It's now fixed so that GCode commands are sent without wrapping with {"gc":..}.
(this made no difference with the wrong stat in version 101.03)

@justinclift
Copy link
Member

Cool. Good point, as that really does sound like a bug. 😉

@justinclift
Copy link
Member

Testing here now... agreed. This is happening for me now too. Reverting my Due back to 100.26, and this bug isn't showing up.

@giseburt
Copy link
Member

giseburt commented Aug 19, 2018 via email

@MitchBradley
Copy link
Contributor

I'm having the same problem, but with G10.

G10 just sets the offsets, without causing any motion. cm_cycle_start() is called early in _execute_gcode_block(), regardless of what is in the block. It looks as if, when no motion is involved, there are cases where cm_cycle_end() never gets called.

The addition of the blanket cm_cycle_start() came in commit ae0145c , described as "Some comments and naming changes to offsets for clarity". It seems that a semantic change came along for the ride.

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

No branches or pull requests

4 participants