-
-
Notifications
You must be signed in to change notification settings - Fork 540
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
Added possibility to disable ContactProbeNozzle actuator temporarily.. #1026
Conversation
avoid probing with every pick and place command by scripting.
@markmaker This looks okay to me, but I am not very familiar with the ContactProbeNozzle. Do you have any thoughts on this? |
Hey @gitchrisfr, @vonnieda My comment here is under the assumption that a merge should be for the benefit of more than one user, so I'm assuming other users will want to use this too and perhaps be less aware of problematic side effects than the author. From a design stand-point, this is obviously a bit of a dangerous pattern. If the second script isn't called due to an exception, due to misconfiguration etc. pp., the boolean may be left switched on and then spoil all further (normal) operation of the It would obviously be best to have this behavior change targeted at the real purpose i.e. at disabling probing on discard (I'm just assuming that's the underlying use case from the PR's description, correct me if I'm wrong). For instance, you could add a boolean to the probing GUI that says "Disable on discard" and then, inside the code, compare the place location with the discard location (perhaps with a few mm tolerance, to allow for any compensations applied, etc.) and then skip the probing. This would benefit all users, even those that might have trouble setting up scripts properly (or those that try to avoid scripting altogether, like me). I would find this a very useful addition! If there are additional use cases at any pick/place location intended, at the very least, the boolean should have "one-shot" logic, i.e. always disable it immediately after having skipped the probing for one time. _Mark |
Hi Mark, Regarding your first paragraph: Second: I agree with you it would be very useful. But unfortunately I have to admit that I can't. Due to Jason's "granulate code" recommandation I started with this small code modification to keep what I promised. One should have the comfort to probe PCB height, part height with every first feeder pick.. right, but it's not me to do this in one PR not just the change for discard - shame on me. |
Your response sounds offended, that was not my intention. It's hard to write diplomatically in a foreign language, Sorry.
I missed that one. Your first thought of comparing the locations was the right one! Instead of
Scripting per se is not dangerous, just slow. Storing the boolean on the nozzle with the risk of it remaining switched on is.
There are some differences:
I don't know. It seems you do :-) I must admit that I didn't think of discarding+probing as a problem, because I do probing on discard. My reasoning is this: Discard happens in different cases, one of them being a stuck part i.e. after the PartOff vacuum sensing test failed. A stuck part remains on the nozzle even though the vacuum was switched off. Switching the vacuum off again at the discard location will not help. So I thought, there must be some way to make sure the part comes off. Therefore, at my discard-location the nozzle does probe down onto an uneven/slanted ground to pivot/brush the part off for sure. At the moment I have a piece of foamy packaging material there that seems to do the job, but I plan to build a spring-suspended "seesaw" metal ramp (ESD safe) that will let parts slide down after discard, so I could recover the more expensive ones.
You mean you don't know how to do GUI code? Yeah, it took me a while too. Turned out to be easier than it looked in the code. Follow the video guide to add WindowBuilder: But you could leave the GUI out for now and just add the boolean to the Nozzle with the @Attribute marker to add it to machine.xml. Then, if the boolean is on, compute the discard location distance, skip the probing if it is within the tolerance distance.
I do intend to add the code to use the probed Z for adjusting part height one day. The problem there is mapped axes and the way position reports are handled now. It works on a single nozzle machine, but I want it to work on a multi-nozzle shared Z axis machine. I'm currently stuck in a PR on axis mapping etc. and one of the goals is making this ready for the said extension. _Mark |
Offended? No, not at all. I'm just trying to be polite - maybe the foreign language too. Why should I? I see all the postings and work you do for this project - there is only one Mark Maker for sure? ;-) |
Not using probing? I don't understand. Are you saying this PR is no longer actually useful to you? I'm also interested how you intend to handle stuck part discard i.e. whether you can follow my reasoning of wanting to probe down there too. _Mark |
Yeap. I thought it could be usefull for the community. I got to much problems with the implementation "as is" due to 0402 parts as descriped. But that's maybe only me. I never though about probing for stuck parts, so no suggestion to this. |
I don't see any harm in merging this. It doesn't affect anything outside allowing a runtime property so if it's useful for one person I think that's okay. Thanks @gitchrisfr! |
Thanks a lot! |
* develop: Added possibility to disable ContactProbeNozzle actuator temporarily. To (#1026) ReferenceDragFeeder works with 0402 parts with vision enabled and dis… (#1088) a feeder in feeder's list is grayed out if no active placement uses it. (#1068) Closes #1005: Replace actuator text field with combobox (#1080) Feature / Global Axes and Framework for Enhanced Motion Control (#1035) Fix for issue 755 "ReferenceStripFeeder Breaks When Part Pitch > Hole to Hole Distance" (#1083) Improved loop syntax, fixed code to update the part info whenever the combo box is changed. (#1077) MjpgCaptureCamera was missing image transform support. Added the missing code so the image trasnform settings now work correctly. (#1078) set list length of combo boxes to 20 items. (#1069) Implemented part count display on the ReferenceStripFeederConfigurationWizard (#1076) Mjpg camera feature (#1075) # Conflicts: # src/main/java/org/openpnp/machine/reference/ReferenceMachine.java
to avoid probing with every pick and place command by scripting.
Description
A ContactProbeNozzle probes with every pick an place command. If one will avoid these we can now set a flag by script. If not set the machine behaves as before.
Justification
Probing has an impact on speed and can cause errors. Probing with discard devices e.q. makes no sense.
Instructions for Use
Setup a ContactProbeNozzle for your machine as descriped here in detail #859.
After that the machine will probe with every pick and place command. To avoid these for certain action we can use https://github.com/openpnp/openpnp/wiki/Scripting. Job.BeforeDiscard.js to disable and Job.AfterDiscard.js to enable e.g. with discard devices action. The script could be similar to this example:
Job.BeforeDiscard.js:
The same code in a Job.AfterDiscard.js but with:
Implementation Details