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

Plugin sends G10 L2 P1 even if probe was initiated by other process #11

Open
kolontsov opened this issue May 14, 2023 · 0 comments
Open

Comments

@kolontsov
Copy link

The gcode-grbl.ts code sends G10 L2 P1 after every successful probe, even if probe was initiated outside of cncjs-pendant-gamepad -- for example, in cncjs web interface; and since cncjs also sends G10 L20 Pn and G0 Z.. after probe is done, adding another G10 L2 P1 (and a retract) makes Z value incorrect.

this.connector.subscribeMessage('serialport:read', (data:string) => {
if (this.zProbeRecord.isValidString(data)) {
this.zProbeRecord.updateFromString(data);
if (this.zProbeRecord.success) {
// The actual Z position is the detected position, but additionally
// the thickness of the plate. This assumes Z is negative, and makes
// it more so. This works for me; is this a safe assumption?
const dz = this.zProbeRecord.z - Number(this.options.zProbeThickness);
this.sendMessage('command', 'gcode', 'G91'); // relative coordinates
this.sendMessage('command', 'gcode', `G10 L2 P1 Z${dz}`); // set the offset

And many thanks for plugin, it works excellent with PS3-like controller!

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

1 participant