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

Managing offsets and baby stepping #114

Open
synman opened this issue Mar 21, 2023 · 3 comments
Open

Managing offsets and baby stepping #114

synman opened this issue Mar 21, 2023 · 3 comments
Labels
enhancement New feature or request
Milestone

Comments

@synman
Copy link
Owner

synman commented Mar 21, 2023

We need a way to track work system offsets.

$# facilitates this by returning a list of the X/Y/Z offsets for each coordinate work system:

Send: $#
Recv: [G54:-484.000,-393.000,-46.300]
Recv: [G55:0.000,0.000,0.000]
Recv: [G56:0.000,0.000,0.000]
Recv: [G57:0.000,0.000,0.000]
Recv: [G58:0.000,0.000,0.000]
Recv: [G59:0.000,0.000,0.000]
Recv: [G28:0.000,0.000,0.000]
Recv: [G30:0.000,0.000,0.000]
Recv: [G92:0.000,0.000,0.000]
Recv: [TLO:0.000]
Recv: ok

Here's what I envision for it as dictionary list:

{   
    "G54": {
            "x": -484,
            "y": -393,
            "z": -46.3
    },
    "G55": {
            "x": 0,
            "y": 0,
            "z": 0
    }
}

and then an internal mechanism within BGS to allow for changing the X/Y/Z offsets dynamically, much like how Marlin provides for baby stepping.

@synman
Copy link
Owner Author

synman commented Mar 21, 2023

@paukstelis starting to build this up

@synman synman added this to the 2.3.1 milestone Mar 21, 2023
synman added a commit that referenced this issue Mar 21, 2023
@synman
Copy link
Owner Author

synman commented Mar 21, 2023

I've tested part of this thus far.... getting the offsets is working well via the tracked_commands method and I've also ensured whenever I change them using G10 that I update their values with those changes.

this leaves us with the actual baby stepping method I threw into _bgs to support this:

def babystep_offset(_plugin, program, axis, increment):
    pgm = int(program.replace("G", "")) - 53
    newvalue = _plugin.offsets[program][axis] + increment

    _plugin._printer.commands("G10 L2 P{} {}{}".format(pgm, axis, newvalue))

    # update our offsets
    _plugin.offsets[program][axis] = newvalue

calling it like so from the plugin:

_bgs.babystep_offset(self, self.grblCoordinateSystem, "z", .01    # increments z offset + .01 for active system
_bgs.babystep_offset(self, self.grblCoordinateSystem, "z", -.01    # increments z offset - .01 for active system

@synman
Copy link
Owner Author

synman commented Mar 21, 2023

so with the plumbing done, now to figure out how to integrate this into the UI. I'm half tempted to create another sidebar widget like the framing / bounding box one, but specific to (baby) stepping the offsets.

synman added a commit that referenced this issue Mar 22, 2023
@synman synman added the enhancement New feature or request label Oct 5, 2023
@synman synman modified the milestones: 2.3.1, 2.3.2 Nov 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant