-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
annexed_probe: Support for probes that don't live on the toolhead #4328
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
Conversation
… work-annex-probe
…ng-internal/klipper into work-annex-probe
|
Awesome work Mental, with the probe, and with cleaning up my config from the macro’s. Thank you 😊 |
|
If anyone is going to try this branch, I suggest reading the documentation and making sure you understand it as well as keeping a hand on the estop when first trying things. |
… allow_delayed_detach parameter
|
First off: awesome thing But it's not clear from doc what state of pins(probe_sense_pin and dock_sense_pin) is expected, for exception of check_open_attach - it's self describing i've tried to enable manual_verify but detach_probe and attach_probe commands always raises errors twice, for some reason, btw: i'm testing it on Voron V2.4 with annex probe UPD: called detach_probe when toolhead was above probe dock and script didn't move toolhead out, instead it decided to drop toolhead right on it |
I think I can probably clarify that a bit in the docs. Basically you want the pins to be configured in printer.cfgso they report the correct states when GET_PROBE_STATUS is called.
I will look at how those exceptions are being raised... what frontend are you using?
If the tool is within the minimum safe distance it will not move away from the dock as that could potentially yank the probe out of the dock. Instead it calculates an intercept vector perpendicular to the approach angle and moves along that and then moves to the dock coordinates. If the tool is already over top of the dock coordinates, the calculations for that probably net to zero tool movement. |
i'm running fluidd
at some point i've inverted dock and it's started to work properly, so when probe is docked expected state is TRIGGERED - that's kind of counter-intuitive, at least for me
Well if i'd call attach_probe this sounds reasonable, but i've called detach_probe and as a result - dock has been destroyed :) |
|
i'm running fluidd I have noticed that fluidd duplicates error messages being raised in certain cases. I don't know for sure the cause of it, but the exceptions I am raising in the probe module are
Internally, I am treating the If only When when The TRUE/FALSE part is where the confusion is probably occurring. The pin definition determines how TRUE/FALSE/HIGH/LOW is being reported from the sense pins. So if the pin is defined with Therefor when the probe is not in the dock, the pin reads high, when the pin is in the dock, the pin reads LOW. I probably said that backwards somewhere and my answer is totally wrong because I get confused by this stuff too most of the time. The reason I included the Do you think it would be helpful to include additional information in the output? Presently it outputs I could have it include (if the pins are configured
If you are using a bed mounted dock, the Z axis should always be homed before attempting to do anything with the probe and the module should be throwing an error if it isn't. It is possible it is trying to Z hop or something because the probe is registering that it is I am thinking I need to try to replicate this behavior on my own and add an additional boundary check so that it will not move the Z axis unless it is outside of the minimum safe distance in a sphere around the dock instead of just a radius. |
let me clarify:
As i said, i've got it after some time :) Yet it would be good to have this clarification in docs, something like: if your dock pin is closed when probe is docked, than you need to invert pin
Unfortunately get_probe_status does not give clear visibility what exactly happens to pins, with clarify of pins states in doc it should not be a problem ofc w/o it it's kinda not clear is it hardware failure or wrong configuration(i could move probe by hands so it's become 'detected' with wrongly configured pin, but i didn't actually seen is it shorted dock pins or not) As additional suggestion: it would be good to have an option to disable 'return to previous position' after attach/detach action(at least as command argument) since in a lot of cases it's just makes unnecessary movements |
|
Ok. I think it would be overall beneficial for me to add individual pin states in for the |
|
Thanks. This does seem like useful functionality. Alas, I haven't gotten a chance to fully review it and I think it will be weeks before I can review it. Some comments from my limited review:
Thanks again, |
It is not at all ready for merge so no rush. I opened the PR primarily so people could test it and to elicit feedback from the community.
It's a bit of both actually. The dictionary definition for annexed is
The "default" configuration requires the following values be set
The two distinct positions for approach and departure must be used in most cases so a single rendezvous point would not be ideal. In most cases lifting the toolhead away from the probe can, over time, pull the magnets out of their pockets and this results in probe accuracy degrading. To properly remove the probe from the toolhead, the probe is "slid" off the magnets in a side to side motion. If a single rendezvous point is used, the probe would never actually detach.
It would also be possible to remove
I can look into further scaling back the supported conditions. I initially did a survey of users to find out what and how they were using the probe. 68% of respondents said their dock was mounted to a moving gantry or to the frame with the remainder having bed mounted docks. I felt that limiting it only to moving gantries, however, limited it to "cube" printers so I included bed mounted docks as well. By my count there are 3 popular designs floating around, the Annex Quickdraw, the Voron Users Klicky-Probe, and the Euclid. These all use a variation of the same basic dock and probe design using magnets and a "fork", so the built in default toolhead movements were intended to handle those. The biggest difference between the 3 is the length of the forks on the dock which translates to the The mounting locations of these varies and I have limited support for them to positive Z positions. It is not feasible to "dip" the toolhead into negative space to pick up the probe. Outside of the dock, the only other common condition that affects operation is whether or not the probe is being used as an endstop or if a physical endstop is in use. So without doing any custom gcode options the "default" common dock configurations (
The 6 optional gcode sections that can be supplied exist for users with edge cases. There are a few printers with odd pathing issues that cannot be solved with straight lines so they need to be moved to a position prior to moving to the approach so fan ducts don't get ripped off etc... The other use case is to have the dock on a servo that flips it into position. I have heard that there are people wanting to build this type of dock for Switchwire printers but I have not seen it yet. I figured I would go ahead and add something so they can deploy the servo at the appropriate time. They are in there as config options but should not cause. I use these sections to change the color of the LEDs on the toolhead to reflect the current probe action.
As for the auto attach part. The goal was to have it behave like any other probe in that you command 'probe' from the gcode console and a complete probing action occurs without having to write macros around it. I have not noticed any adverse behavior with the automatic attach part, only the auto detach part. The adverse behavior reported so far is typically due to false positives with probe detection or user configuration. Even if it were made to only attach and detach when commanded, I believe it would still exhibit the same behavior since it would read the probe state incorrectly. In the case of probe calibration for instance, I believe it would cause out if DETATCH_PROBE was called from the terminal after the initial point was probed. At the present time, when I am likely removing the I also waffled around for days about whether or not I wanted to support scenarios where there was no internal means of probe detection and the user supplies the probe state via the gcode command. I think this is just going to cause more trouble that it is worth as well so it is probably going away as well. I think in order to use the module, there must be some way configured to determine the probe state. |
Okay, that makes sense.
Okay, FWIW, I think it may be easier to target the main use case first, get the code merged, get lots of feedback, and then look to extend to other probes (if necessary).
I'm a little confused on what
So, as high-level feedback, we tried to do something similar in Klipper with the toolchange commands (eg, FWIW, I expect users of a "docked probes" to introduce macros for their calibration routines (eg,
That makes sense to me. Again, it's always possible to add additional features at a later time. Thanks, |
Well, if code is smart enough it will dock probe whatever happens, at the same time if user does not have proper error handling in gcode(let’s be honest-it’s quite complex question) than he will face issues with probe attached in situations where it not expected to be on toolhead |
|
Indeed, I have my dock at Xmax and Ymax position. Currently I gave up and wrote hard-coded macro, that work flawlessly along with tricky home procedure, preventing probe to be dropped off the head. Looiking forward for this awesome work to be completed and merged into mail klipper code already :) |
|
It has also come to my attention that running this in Python 3 has some issues. So far I have identified an incompatibility on line 187 where it is trying to parse the coordinates out from the config file. In python 3 the map function needs to be converted to a list first. I am told this is not particularly efficient but it only has to execute once when the config is loaded. |
- map() returns a iterable which is not sliceable. - Fix a bug where the coordinate vector could be resized. - Better error reporting. Signed-off-by: Maël Kerbiriou <m431.kerbiriou@gmail.com>
Python3 compatibility and misc fixes in parseCoord
|
What's the status on this PR and its level of completion? I am willing to help if needed. This has been something I feel that a TON of klipper users have been using for a long time, and having to keep pulling in main/master to their local clones of this fork. I guess TL;DR -- what's holding up the PR merge and can I assist at all? |
|
Read the comments, make the changes, submit a PR to my repo and I will merge. |
|
@mental405 this might have already been addressed, but what's the behavior when a probing fails? (samples exceed tolerance, etc) -- will this dock the probe afterwards? |
|
Hello! I'm just wondering why this hasn't been merged yet. I'm looking at Mental's PR and the files changed, and everything seems to be in order. Is there something I'm not seeing? Having to have a separate "BED_MESH_CALIBRATE" macro just to define more macros to move to the dock area is giving me a lot of headaches right now, and I feel like now a module for stuff like this is a requirement. |
* A number of code changes were requested by PR reviewers (PR Klipper3d#4328), those have been applied. All of the changes applied were cosmetic, mostly adding early returns. * The last remnants of the original module name 'annexed_probe' have been replaced by 'dockable_probe', including doc references.
|
This still needs to be merged. Any updates? |
|
To everybody having: |
* A number of code changes were requested by PR reviewers (PR Klipper3d#4328), those have been applied. All of the changes applied were cosmetic, mostly adding early returns. * The last remnants of the original module name 'annexed_probe' have been replaced by 'dockable_probe', including doc references. dockable_probe: Edit docs for brevity and consistency Most importantly I tried to clarify the dock_fixed_z functionality. There should be no changes to the meaning or understanding in these docs but hopefully they're easier to ingest. Strip out dock_fixed_z, infer it, and add explicit z_hop This greatly simplifies the logic and reduces config/docs complexity. Add auto-attach-detach feature with gcode to set option at runtime While trying to debug why the probe couldn't be used as a virtual endstop, I simplified the code further to more closely resemble that of bltouch.py. This makes it easier to reason about and less brittle as there are fewer unique processes to accommodate this type of probe. As a result of less bespoke handling and only hooking into the default probe functionality to inject attaching/detaching, it's possible now to use the standard safe_z_home config section. The Euclid probe requires opposite attach/detach routines. See docs/Dockable_Probe.md for more info.
* A number of code changes were requested by PR reviewers (PR Klipper3d#4328), those have been applied. All of the changes applied were cosmetic, mostly adding early returns. * The last remnants of the original module name 'annexed_probe' have been replaced by 'dockable_probe', including doc references. dockable_probe: Edit docs for brevity and consistency Most importantly I tried to clarify the dock_fixed_z functionality. There should be no changes to the meaning or understanding in these docs but hopefully they're easier to ingest. Strip out dock_fixed_z, infer it, and add explicit z_hop This greatly simplifies the logic and reduces config/docs complexity. Add auto-attach-detach feature with gcode to set option at runtime While trying to debug why the probe couldn't be used as a virtual endstop, I simplified the code further to more closely resemble that of bltouch.py. This makes it easier to reason about and less brittle as there are fewer unique processes to accommodate this type of probe. As a result of less bespoke handling and only hooking into the default probe functionality to inject attaching/detaching, it's possible now to use the standard safe_z_home config section. The Euclid probe requires opposite attach/detach routines. See docs/Dockable_Probe.md for more info. Signed-off-by: Alan Smith <alan@airpost.net>
|
It error'ed because couldn't find the method, so I checked def _handle_mcu_identify(self):
kin = self.printer.lookup_object('toolhead').get_kinematics()
for stepper in kin.get_steppers():
if stepper.is_active_axis('z'):
self.add_stepper(stepper)Probably not the best approach, but it works now. |
|
This PR was inadvertently closed due to a regression introduced by #6293. -Kevin |
|
What is the status of this PR? I wonder if we should track this on Klipper Discourse instead of on github? -Kevin |
|
It looks like this GitHub Pull Request has become inactive. If there are any further updates, you can add a comment here or open a new ticket. Best regards, PS: I'm just an automated script, not a human being. |
There are many new probe designs utilizing microswitches that attach to the
toolhead via magnets or some other mechanical coupling. When they are not in
use, these probes are stowed in a dock located somewhere in the printer. Due
to the ever growing complexity required for homing macros, it was determined
that these types of probes would be ultimately better suited to a module.
I have attempted to handle as many different scenarios as I have seen, but
people still continue to surprise me with what they have created. While this
module won't handle all configurations, it should handle most
configurations with a large degree of flexibility and customization.
Signed-off-by: Paul McGowan mental405@gmail.com