--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+unsubscribe@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/CA%2BQw0jw_ntX1P%3DwDU2PUUpy9L08nkkh-77CkxFonRreiCuh1uw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Here is an issue that was filed when the Shared C Pre-Rotate bug was first found: https://github.com/openpnp/openpnp/issues/599
So, there are two problems:1. Shared C Movement: This is specific to GcodeDriver in that if you have > 1 nozzles sharing one motor GcodeDriver will ignore movements if it thinks the nozzle is already at that position. For example: N1.moveTo(0, 0, 0, 10) followed by N2.moveTo(0, 0, 0, 10) will not result in C10 being sent to the controller.
2. Shared C Pre-Rotate: This issue, as I understand it, is that OpenPnP performs the vision operation on each nozzle but it expects the nozzle to stay at the angle it was after the vision operation. When it places the part, it places it without sending further coordinates to the C axis. The problem is that if you have a shared C the "finished" nozzles have rotated during the vision operation for the "other" nozzles. So we need to have a way to store the final rotation and then rotate back to the before placing.
I believe this second one has to be a JobProcessor change. If I understand correctly, Marek's modification stores this rotation in the Z of the returned value since he doesn't need Z for placement, but that won't work, of course, for other machines. So we'll need to modify how that data is returned and find a place for the rotation value.
--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/d0cd4bad-ed65-46cd-aee7-f8aa1baf0473%40googlegroups.com.
> Are you sure it's me who alluded it as issue? Not Paul a year ago, not Mark a day ago?
It could have been me!
I was under the impression that shared physical axes still have separate “virtual” axes (i.e. machine.xml <axis> elements / Java “Axis” objects). So I consequently assumed each axis keeps track of the current coordinate separately and the coordinate change through another Axis that shares the physical actuator would be missed.
I said as much, here:
https://groups.google.com/d/msg/openpnp/ejIunan54N8/10-AF0JiCQAJ
I’m very sorry if this has caused a wild goose chase. :(
On the other hand, I’m quite convinced that my “mistaken” conception would actually be a cleaner solution and might fix shared axes J.
Make Axes into separate “virtual” axes inside OpenPNP so they separately keep track of the “virtual” axis coordinate (i.e. separately for each Nozzle).
Example:
Before:
<axis name="z" type="Z" home-coordinate="0.0">
<head-mountable-ids class="java.util.HashSet">
<string>N1</string>
<string>N2</string>
</head-mountable-ids>
<transform class="org.openpnp.machine.reference.driver.GcodeDriver$CamTransform" cam-radius="24.0" cam-wheel-radius="9.5" cam-wheel-gap="2.0">
<negated-head-mountable-id>N2</negated-head-mountable-id>
</transform>
</axis>
After:
<axis name="z1" type="Z" home-coordinate="0.0">
<head-mountable-ids class="java.util.HashSet">
<string>N1</string>
</head-mountable-ids>
</axis>
<axis name="z2" type="Z" home-coordinate="0.0">
<head-mountable-ids class="java.util.HashSet">
<string>N2</string>
</head-mountable-ids>
<transform class="org.openpnp.machine.reference.driver.GcodeDriver$CamTransform" cam-radius="24.0" cam-wheel-radius="9.5" cam-wheel-gap="2.0">
<negated-head-mountable-id>N2</negated-head-mountable-id>
</transform>
</axis>
Then add my PR to tolerate any missed “behind-the-back” shared actuator coordinate changes. As soon as the JobProcessor (or any caller) switches to a different Nozzle (or any HeadMountable), the correct virtual coordinate would be restored physically.
This should resolve any issues with pre-rotate and any other code that assumes axes (i.e. Nozzles) to retain their coordinates. I’ve seen it many times in the code that it does a selective moveTo() in some coordinates but not all (NaN semantics). This would then work reliably.
_Mark
--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/056b01d44ea4%24b6bd9d70%242438d850%24%40makr.zone.
Hi Jason,
> In this configuration, with your "After" configuration, how does N1 know it's coordinate, or transform it's outbound coordinate?
I’ll distinguish physical axes and virtual axes.
Physical axes are associated with the physical actuator/motor. The controller has a designator for it, i.e. “C”.
Virtual axes are the conceptual axes of the nozzles, as if they were separate. I.e. “c1”, “c2”
Now these virtual axes “time-share” the physical axis. Whenever a moveTo() is called on a Nozzle (or any HeadMountable), the AxisMapping will assign the correct virtual axis to it. Because each virtual axis stores its own “current” coordinate, a the moveTo() is always implicitely restoring the previous position, even if it has not changed from the viewpoint of the virtual axis (assuming forced coordinate output, using my PR).
Transforms work as before. As today, the coordinate is always saved on the axis object in transformed form (“raw coordinate”).
Because we’re using the same axis designator (i.e. “C”) in the Gcode fragment, the actuator is actually shared without OpenPNP knowing or caring.
It’s a bit like multi-processing on a CPU: each process has its own set of CPU/FPU registers. If the multitasking scheduler switches to another process, it first has to reload the previous register contents. For the process this looks and feels as if it has the CPU alone.
The same would be achieved here. For the Nozzle it looks and feels as if it has the axis alone…
Writing this, I also have to think about the NaN semantics one more time. The forced output variables would probably have to be issued too, even if NaN is given (axis resolved to null). If you give the green-light I’ll change that in the PR.
What do you think?
_Mark
Von: ope...@googlegroups.com [mailto:ope...@googlegroups.com] Im Auftrag von Jason von Nieda
Gesendet: Montag, 17. September 2018 18:45
An: ope...@googlegroups.com
Betreff: Re: [OpenPnP] Re: Fixing Shared C and Pre-Rotate
Hi Mark,
I'm afraid I don't understand how this proposed solution works for shared axes. Let's first make sure we're on the same page WRT machine configuration. Since we're talking about shared C, let's consider the following machine configuration:
* 2 nozzles: N1 and N2.
* 1 motor on Z, see-saw configuration. Z- lowers N1, Z+ lowers N2.
* 1 motor on C, gear or belt turns both nozzles when the motor turns.
Thanks,
Jason
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/CA%2BQw0jym46j_Gd%3DdypCf694q4v3LtWPyG%2BOk9F8OEEwJVr-_Hw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/058301d44eb1%24e75d0d00%24b6172700%24%40makr.zone.
Jason, if it's out of discussion that restore of C before the placement is necessary to apply, then maybe fix it and I'll test the pure release if there exists the problem you're talking about. You can even prepare some simple 2-3 parts job that I could to run and give you 100% clear feedback if it's pnp well or not at all.
--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/0945af4c-912d-4544-8c34-92319cc2c01c%40googlegroups.com.
> I think we need to take a step back here and determine if there is actually a problem to be solved or if we're just wasting our time.
…
> I agree 100% that #2 (restore C) is a real issue
I’m talking about this “#2 (restore C)” issue and nothing else. My proposal would address exactly that.
> In your suggested method, when Z1 changes, Z2 doesn't know about the change and vice-versa so OpenPnP will show invalid coordinates for that object …
I think you have to take one more step backwards. One needs to embrace the virtualization, otherwise it won’t make sense.
When a machine really has two physical axes, only one will be actuated when you move one Nozzle, right? Reading back the coordinate of the other axis will show it unchanged, right?
With the virtual axes this behavior is emulated.
Like with other forms of multitasking, there has to be a context-switch. If you switch to the other Nozzle by moveTo() and tell it to move only in X, its C will implicitly be restored (à “#2 restore C”) with my PR. Note that a moveTo() must always be issued before the nozzle position is in some way “used” physically, but that’s the same assumption as before (with shared axes) and it also comes “naturally”.
The subject of a virtualization need not know that it is virtualized. OpenPNP need not know, that one Z is see-sawing up when the other is lowered. It must just tell the controller what to do and let it worry about zero deltas.
> … and processes reading those values will get incorrect coordinates.
Not incorrect. The pre-rotate case is exactly the “model case” of why this behavior is the desired one! You want the Nozzle to reflect the last position explicitly commanded to moveTo() by the OpenPNP business logic. The physical position however is a “side effect” of machine “economics” and reading (transforming) it back is incorrect in terms of the business logic.
Different way to explain – as a thinking experiment:
Do you agree that a machine with two physically separate axes would behave exactly the same way given the same sequence of moveTo() commands and the same sequence of read-backs?
Yes? Then how can this behavior be incorrect? J
_Mark
P.S. Of course all this only works with “benign” axis sharing such as harmlessly rotation other axes without a chance of it knocking down stuff or moving one Z out of harm’s way when the other is lowered below safe Z. Same as before!
--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/05a001d44ec4%2429d46950%247d7d3bf0%24%40makr.zone.
--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/aa6b1bf9-9904-4d95-8a1e-1384244fedf4%40googlegroups.com.
Alright folks, I think I've got a solution in mind and I'd like to ask everyone interested to check my logic. Here are my notes as I worked through the code, and below that is my suggestion:---------There are three styles of alignment supported:1. Basic Bottom Vision: The bottom vision system determines an X, Y, C offset.The offset is then applied before placement. This suffers from inaccuracy dueto nozzle
Hi Jason,
> That being said, I think your PR for being able to force moves is still useful and I'm intending to merge it.
Thanks!
> I understand you now, but this is a major departure from how OpenPnP has always worked…
I see. The beauty of it is that after merging the PR, both ways will work thanks to the flexible architecture of OpenPNP. It just depends on how the machine.xml <axis> elements are structured (remember the “before” and “after”).
> It breaks the contract that Locatable.getLocation() is always correct, which will break the DROs, at least.
Well that’s again a question of whether you embrace the virtualization or not. When a user wants to specifically track one nozzle then he might as well be interested in the virtual, not the physical coordinates, especially when tracking the effective pre-rotated part angle.
Personally I don’t find the DRO to be very important. It’s the capture buttons that must work reliably. And again I think these should reliably capture the virtual coordinates of the nozzle in question, as adjusted at some time before capturing. If it ever matters in practice, i.e. if a user ever were to switch back and forth between nozzles before capturing, it would then again emulate a behavior like on a machine with real multiple axes.
But like I said you don’t need to be “convinced”, as both ways will work, as users wish. J
_Mark
Von: ope...@googlegroups.com [mailto:ope...@googlegroups.com] Im Auftrag von Jason von Nieda
Gesendet: Montag, 17. September 2018 23:41
An: ope...@googlegroups.com
Betreff: Re: [OpenPnP] Re: Fixing Shared C and Pre-Rotate
Hi Mark,
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/CA%2BQw0jy9qJQy-1Xtr0noPD0L7O9c6DF4m6LRECm0SEcC6-ZB_w%40mail.gmail.com.
> Alright folks, I think I've got a solution in mind and I'd like to ask everyone interested to check my logic. Here are my notes as I worked through the code, and below that is my suggestion
Sounds good.
Not sure I understand case #3 … or more specifically why there remains a conflict once everything is universally handled inside the new getFinalPlacementLocation().
Assuming I understand the “jaws that center and rotate it to the correct placement rotation” scenario correctly, couldn’t getFinalPlacementLocation() just equally return the proper final Location, in this case with C set to zero?
Perhaps rename it into “finalAppliedLocation” to make it clear that the “applied” location is just what remains to be done now that the part has already been centered and rotated by the jaws.
If I misunderstood the scenario, just dismiss this E-Mail as I don’t need an explanation. I just wanted you to quickly consider this.
_Mark
--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/00b001d44f52%2406603d30%241320b790%24%40makr.zone.
--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/a74bd9f4-c1b3-41b8-b31c-330bfb8c78f5%40googlegroups.com.
> Prerotate eliminates the problem of runouts only if you don't need to change the nozzles.
I don’t think that’s right, Marek. Prerotate uses vision on each individual part and will compensate any runout of any nozzle tip.
Nozzle calibration would be very useful if you want to avoid bottom vision altogether for speed reasons. Nozzle calibration would have to be run after each nozzle tip change (I think this is already the case in current dormant code).
_Mark
Von: ope...@googlegroups.com [mailto:ope...@googlegroups.com] Im Auftrag von Marek T.
Gesendet: Dienstag, 18. September 2018 17:18
An: OpenPnP
Betreff: Re: [OpenPnP] Re: Fixing Shared C and Pre-Rotate
Hi Jason,
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/3a5aa6a8-19e4-474f-8bf5-931fcefae0a6%40googlegroups.com.
> Mark, you probably didn't understand me.
I see…
If the runout is very large, i.e. the nozzle tip is so far off that the part is not “sucked up” properly, then yes I agree the picking is not helped by the pre-rotate and it would be helped by the nozzle tip calibration.
If the runout is smaller, so the part is still “sucked up” properly, but off-center, then pre-rotate will help.
However with the example 0.01-0.1mm runout, do you already have mispicks on 0402 parts? Or do you use even smaller parts?
_Mark
> Sorry, Maybe 'Specific' would be the word your looking for
Brynn, just out of curiosity (as a non-native English speaker), when you read “concrete” you understand the mineral cement building stuff, right?
https://en.wikipedia.org/wiki/Concrete
But at least in theory there is also the “specific” meaning:
https://en.oxforddictionaries.com/definition/concrete
In German there’s the same false friend: “konkret” means “specific”.
_Mark
() just not the best english ()
> Sorry, Maybe 'Specific' would be the word your looking for
Brynn, just out of curiosity (as a non-native English speaker), when you read “concrete” you understand the mineral cement building stuff, right?
But at least in theory there is also the “specific” meaning:
In German there’s the same false friend: “konkret” means “specific”.
_Mark
Hi Jason,Just to clarify, the only reason most people opt to use prerotate is because normal bottom doesn't work with nozzles that have runout!If you have perfect holders and perfect nozzles then we don't need nozzle calibration, but they are rarer than hens teeth :D
While you are working on how the machine calculates its coordinates, it might be worth revisiting nozzle cal as the machine really needs to base its position in x and y for the current nozzle rotation xy offsets. If this was done, the nozzle would always go to the correct pick location for small parts, the passives could all be placed with out vision at all, and then you can opt to just do bottom vision on just some parts, which if nozzle cal is working, we only need to do bottom vision, not prerotate.
Really there isn't much to map out with nozzle cal. There is no special shape that the nozzle will run. Just a circle with n radius, it should still be centered in C axis. Once the runout offset is known and the "0" point of that offset, the actual position can just be calculated.
Mick
--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/125ad7e9-6b62-4b83-b703-7ae917a32194%40googlegroups.com.
> Plus I obviously mixed up Marek and Mark.
No the “concrete” comes from Marek alright. I was just asking out of curiosity.
> Is German your native tongue then?
Swiss German actually (which is quite different). We learn German at school as our principle “official” language. That is in the mid&eastern part of Switzerland. We’ve got a French, an Italian plus a small Rhaeto-Romanic speaking part too.
Marek speaks Polish which seems to have similarities with German.
Yep, tower of Babel it is J
_m
Von: ope...@googlegroups.com [mailto:ope...@googlegroups.com] Im Auftrag von Brynn Rogers
Gesendet: Dienstag, 18. September 2018 22:12
An: OpenPnP
Betreff: Re: [OpenPnP] Re: Fixing Shared C and Pre-Rotate
--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/f5b87553-163a-40db-b5d2-16ec239de9f5%40googlegroups.com.
Hi Marek
In my view it should work without modification if you use the „forced“ Variables. Including pre-rotation and the upcoming nozzle runout compensation!
But you need to modify the machine XML to have two Z and C Axes and then use Axis Mapping to map each Z/C axis to the respective nozzle. Plus force the MOVE_TO_COMMAND variables.
Depending on how the two C axes are coupled you may need an Axis Transform to negate the rotation (if e.g. the axis are coupled by pinion) or leave it out if they rotate the same way (e.g. coupled by belt). Which of the two C axes needs the transform (if any), also depends how the axes are mechanically coupled to the motor or how the motor phases are wired (i.e. which of the axes rotates the right way and which in reverse). The fragment below is just an example when the second axis needs to be negated
I leave the AxisTransform for the Z axis to you, assuming it is shared too and you already have the right transform. Just split that up into two axes. The fragment below is just an example:
<axes class="java.util.ArrayList">
<axis name="x" type="X" home-coordinate="210.0">
<head-mountable-ids class="java.util.HashSet">
<string>*</string>
</head-mountable-ids>
</axis>
<axis name="y" type="Y" home-coordinate="600.0">
<head-mountable-ids class="java.util.HashSet">
<string>*</string>
</head-mountable-ids>
</axis>
<axis name="z1" type="Z" home-coordinate="0.0">
<head-mountable-ids class="java.util.HashSet">
<string>N1</string>
</head-mountable-ids>
</axis>
<axis name="z2" type="Z" home-coordinate="0.0">
<head-mountable-ids class="java.util.HashSet">
<string>N2</string>
</head-mountable-ids>
<transform class="org.openpnp.machine.reference.driver.GcodeDriver$NegatingTransform">
<negated-head-mountable-id>N2</negated-head-mountable-id>
</transform>
</axis>
<axis name="c1" type="Rotation" home-coordinate="0.0">
<head-mountable-ids class="java.util.HashSet">
<string>N1</string>
</head-mountable-ids>
</axis>
<axis name="c2" type="Rotation" home-coordinate="0.0">
<head-mountable-ids class="java.util.HashSet">
<string>N2</string>
</head-mountable-ids>
<transform class="org.openpnp.machine.reference.driver.GcodeDriver$NegatingTransform">
<negated-head-mountable-id>N2</negated-head-mountable-id>
</transform>
</axis>
</axes>
Now you need to use the “forced variables” as you already have:
G0 {X:X%.4f}{Y:Y%.4f}{RotationF:C%.4f}F{FeedRate:%.0f} ; MOVE_TO_COMMAND
I see no reason to force the X, Y variables here.
Where is Z in this statement? Do you have a sub-driver for that?
You need to force Z too! This way you get asserted independent Z moves regardless of the sequence of nozzle Z moves inside OpenPNP (or what OpenPNP thinks their current position is). This was (or still is) an issue with pre-rotate, I think.
Disclaimer. All the above is just derived from theory. So I’m very thankful for you to do some real testing (my machine has just one nozzle). If all this turns out to work, we could finally document it on the Wiki.
_Mark
Von: ope...@googlegroups.com [mailto:ope...@googlegroups.com] Im Auftrag von Marek T.
Gesendet: Mittwoch, 23. Januar 2019 02:27
An: OpenPnP
Betreff: Re: [OpenPnP] Re: Fixing Shared C and Pre-Rotate
And move_to_command how should look if only C is shared but the rest "normal".
1. Sorry for my ignorance, but what do home-coordinates 210 and 600 in your x/y and is this regarding C?! Or just it's the part of your setup regardless C?
2. I have 3 nozzle rotated with one motor into one direction. So understand I don't need transform section in C maping, right? What means ending s> in line
<<axis name="c1" type="Rotation" <s>> ? Just shortcut meaning "put the rest of maping"?
3. You have underlighted "two Z". Why just two? Again, because your setup and you have them two and Unrelated onto C driving?
4. Can you write me how should look gcode of rotation in move_to_comand? (RotationF...) ot (Rotation...), I'm asking about this F...
Tell me mainly about this F, how gcode variable should really look in case of Rotation.
And do I need anyhow touch to Z thinking about sharedC? Because you written about c negative transforms while in your sample there are transforms for z... Understand it's just because in your setup you need transforms for z not appointment to me regarding c, right?
Hi Marek
> Sorry for my ignorance, but what do home-coordinates 210 and 600 in your x/y and is this regarding C?! Or just it's the part of your setup regardless C?
Just ignore that. It's just copied from my machine.xml
I just wanted to show an example in the context. It's not final code, you can copy&paste, it's just to explain.
> I have 3 nozzle rotated with one motor into one direction. So understand I don't need transform section in C maping, right?
Correct.
> 3. You have underlighted "two Z". Why just two?
If you have 3 (any number of) nozzles then everywhere I said "2" just substitute with "3". And add z3 and c3 axes to the xml.
> What means ending s> in line <<axis name="c1" type="Rotation" <s>> ?
I don't know why but Google groups has deleted the rest of my email online. By email it was relayed correctly back to me.
I sent it to your PM and attached it as a file here for
reference. EDIT: But that down't work either.
I'll try to put my full answer online here. I think it also explains the rest of your questions.
_Mark
Hi Marek
In my view it should work without modification if you use the „forced“ Variables. Including pre-rotation and the upcoming nozzle runout compensation!
But you need to modify the machine XML to have two or three or any number of Z and C Axes and then use Axis Mapping to map each Z/C axis to the respective nozzle. Plus force the MOVE_TO_COMMAND variables.
Depending on how the C axes are
coupled you may need an Axis
Transform to negate the rotation (if e.g. the axis are coupled by pinion)
or leave it out if they rotate the same way (e.g. coupled by belt). Which of
the C axes needs the transform (if any), also depends how the axes are
mechanically coupled to the motor or how the motor phases are wired (i.e. which
of the axes rotates the right way and which in reverse). The fragment below is
just an example with two Z and C axes, when the second of two axis needs to be negated. Just adapt this example for three ore more axes.
I leave the AxisTransform for the Z axis to you, assuming it is shared too and you already have the right transform. Just split that up into two axes. The fragment below is just an example:
<axes class="java.util.ArrayList">
<axis name="x" type="X" home-coordinate="0.0">
<head-mountable-ids class="java.util.HashSet">
<string>*</string>
</head-mountable-ids>
</axis>
<axis name="y" type="Y" home-coordinate="0.0">
--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/f42ca23d-f5fb-410e-809b-3383b6db45f6%40googlegroups.com.
Hi Marek
I fear the moveToSafeZ() on the head is the culprit for the unnecessary moves. It enumerates all HeadMountables attached to itself and moves them to safe Z. Now because the rotation axes are forced, even if Rotation is given as NaN (i.e. “do not change”), they are each output in sequence, in turn restoring their separately stored C resulting in these unnecessary rotations.
@Override
public void moveToSafeZ(double speed) throws Exception {
for (Nozzle nozzle : nozzles) {
nozzle.moveToSafeZ(speed);
}
for (Camera camera : cameras) {
camera.moveToSafeZ(speed);
}
for (Actuator actuator : actuators) {
actuator.moveToSafeZ(speed);
}
for (PasteDispenser dispenser : pasteDispensers) {
dispenser.moveToSafeZ(speed);
}
}
Unfortunately OpenPNP does not make a difference between
a) “do not change because it doesn’t matter” such as in moveToSafeZ()
b) “do not change to preserve the correct angle set before” such as with pre-rotate.
To work correctly with shared C axes we need to force-move the rotation axis in case of b) for pre-rotate and other situations where a nozzle has been rotated before.
Sorry, this enumeration is a problem I did not anticipate. It works, yes, but it is slow. :-(
Somehow we need to be able to distinguish between a) and b).
@Jason, if I understand correctly then a moveToSafeZ() can be safely detected inside moveTo() when X, Y, C all are NaN and Z == hm.safeZ. I don’t see any other situation when a call to moveTo() has this signature.
Would it be an awful hack to deactivate the forced variables (except “ZF” of course) when this signature is detected?
The change would only affect machines that use forced variables in the first place so it would be benign for all the other machines. I would need to add a getSafeZ()to the HeadMountable interface, though. Is that a problem?
@Marek, regardless of the above I don’t fully understand your machine…
1. How do you move the three Z axes individually?
2. In the log I don’t see how the X and Y (and Z) is actually moved with COM5. How?
_Mark
Von: ope...@googlegroups.com [mailto:ope...@googlegroups.com] Im Auftrag von Marek T.
Gesendet: Mittwoch, 23. Januar 2019 12:46
An: OpenPnP
Betreff: Re: [OpenPnP] Re: Fixing Shared C and Pre-Rotate
Mark,
--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/ba1a7857-ae48-4605-b08a-78a5626e9819%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/00a301d4b344%24da4b4120%248ee1c360%24%40makr.zone.
--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/1df4c442-c973-4175-b365-f7415dec2813%40googlegroups.com.
Hi Jason
I don’t want to question your judgment just to present my reasoning, here. Also English is a foreign language so if some of this doesn’t always sound very diplomatic, please bear with me. :-)
I agree that properly solving pre-rotate would certainly be a good thing. However I’ve looked at it some weeks ago and found no straight-forward solution. I guess it would have been solved a long time ago if it was very easy. :-]
But aside from pre-rotate are you sure this is the only issue here?
I for one use Z probing which will stop the probe at an unknown position. Unless Z-probing is implemented in OpenPNP (reading back current coordinates, including reverse transformations), this creates a situation where OpenPNP doesn’t know where the Machine is. The same is true for relative moves that I use for vacuum sensing, because a) I used Z-probing before so I don’t know where Z is at the moment and b) I need to retract the tip a tiny bit for a meaningful vacuum level reading (if the tip is still pressing down on the part it is not very meaningful, neither in the pick nor in the place). OpenPNP does not (to my knowledge) currently support that natively.
On the other hand the possibility to define custom Gcode (including through scripts) opens up these and many other possibilities and I strongly believe this is one of the features that make OpenPNP so great and so universal!
These examples are only for my machine. I can imagine there are many similar realistic demands that will create situations when a machine is not where OpenPNP thinks it is. I would argue that as long as OpenPNP does not implement and enforce safety features such as no-go areas, soft limits etc. there is no valid reason for OpenPNP to restrict or forbid these possibilities and artificially shackle itself by adhering to such a contract.
The important part here is that nobody is forced to use these possibilities. If you don’t use the “F” variables, nothing changes.
With https://github.com/openpnp/openpnp/issues/255 already open for two years, and so many places where NaN and/or getLocation() are used I fear the underlying issue is not going away soon.
Frankly I’m not even sure if it is really a good idea to get rid of the NaNs. Im my opinion it is a good thing to be able communicate if you don’t care about a coordinate. If you think about motion path blending in the future, partial-NaN waypoints could be very valuable for blending.
So I humbly ask for you to still consider merging the PR after Marek T. has tested it successfully.
:-D
_Mark
Von: ope...@googlegroups.com [mailto:ope...@googlegroups.com] Im Auftrag von Jason von Nieda
Gesendet: Donnerstag, 24. Januar 2019 17:01
An: ope...@googlegroups.com
Betreff: Re: [OpenPnP] Re: Fixing Shared C and Pre-Rotate
Hi Mark and Marek,
Hi Jason
I don’t want to question your judgment just to present my reasoning, here. Also English is a foreign language so if some of this doesn’t always sound very diplomatic, please bear with me. :-)
I agree that properly solving pre-rotate would certainly be a good thing. However I’ve looked at it some weeks ago and found no straight-forward solution. I guess it would have been solved a long time ago if it was very easy. :-]
But aside from pre-rotate are you sure this is the only issue here?
I for one use Z probing which will stop the probe at an unknown position. Unless Z-probing is implemented in OpenPNP (reading back current coordinates, including reverse transformations), this creates a situation where OpenPNP doesn’t know where the Machine is. The same is true for relative moves that I use for vacuum sensing, because a) I used Z-probing before so I don’t know where Z is at the moment and b) I need to retract the tip a tiny bit for a meaningful vacuum level reading (if the tip is still pressing down on the part it is not very meaningful, neither in the pick nor in the place). OpenPNP does not (to my knowledge) currently support that natively.
On the other hand the possibility to define custom Gcode (including through scripts) opens up these and many other possibilities and I strongly believe this is one of the features that make OpenPNP so great and so universal!
These examples are only for my machine. I can imagine there are many similar realistic demands that will create situations when a machine is not where OpenPNP thinks it is. I would argue that as long as OpenPNP does not implement and enforce safety features such as no-go areas, soft limits etc. there is no valid reason for OpenPNP to restrict or forbid these possibilities and artificially shackle itself by adhering to such a contract.
The important part here is that nobody is forced to use these possibilities. If you don’t use the “F” variables, nothing changes.
With https://github.com/openpnp/openpnp/issues/255 already open for two years, and so many places where NaN and/or getLocation() are used I fear the underlying issue is not going away soon.
Frankly I’m not even sure if it is really a good idea to get rid of the NaNs. Im my opinion it is a good thing to be able communicate if you don’t care about a coordinate. If you think about motion path blending in the future, partial-NaN waypoints could be very valuable for blending.
So I humbly ask for you to still consider merging the PR after Marek T. has tested it successfully.
:-D
--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/CA%2BQw0jz9XQ5eUmVeAYyeKWH_q9%2B3BfY3z%3Diki-i5dksJXX7zrw%40mail.gmail.com.
Thanks Jason for these insights. They explain a lot. I will certainly follow up on the M114.
I just disagree with one statement:
> There's effectively no difference between sending G0 X10 Y10, G0 X10 Y20 and G0 X10 Y10, G0 Y20 and the driver can choose not to send the additional coordinate if it knows it's already there.
Artificially over-defining the waypoints does hurt possible path blending. You can then not distinguish between waypoints where you really want e.g. C to be at 0° and those where you actually don’t care.
I think the problem becomes painfully clear when watching this video:
https://www.youtube.com/watch?v=nBnfRhdnPks
Yes the rotation speed could probably be increased for that machine, but still OpenPNP wastes precious time not rotating the nozzle while travelling to the feeder pickup location.
The simplest form of motion path blending (queuing motion path waypoints and optimizing them before actually sending them to the machine) could automatically improve that in the future if – and only if – the waypoint on top of the feeder, before rotation is applied, has a NaN for C.
And that’s just one example. It would work on all path segments in all combinations of multiple nozzles, shared axes, nozzle change needed or not, top/bottom vision or not, pre-rotation or not, etc. including future extensions and customizations. Rotation is the simplest to blend as it hardly has potential for collisions but there is also room for the other axes.
If you wanted to achieve the same level of optimization by hand-tuning fully deterministic motion (i.e. no NaNs) you would constantly have to anticipate the next N steps in advance! IMHO you will likely fail and make the code unreadable/unmaintainable while trying.
If you doubt such motion path blending can be achieved, I’d like to point to the heuristics I drafted to do exactly that:
https://groups.google.com/d/msg/openpnp/JfxgCxR2rGc/QFM1afHQEAAJ
It could even be improved by the
waitForMovesToComplete()
method you then suggested in reply to that.
It may take a while but I haven’t given up on all that yet :-)
_Mark
Von: ope...@googlegroups.com [mailto:ope...@googlegroups.com] Im Auftrag von Jason von Nieda
Gesendet: Freitag, 25. Januar 2019 04:49
An: ope...@googlegroups.com
Betreff: Re: [OpenPnP] Re: Fixing Shared C and Pre-Rotate
Hi Mark,
--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/CA%2BQw0jz9XQ5eUmVeAYyeKWH_q9%2B3BfY3z%3Diki-i5dksJXX7zrw%40mail.gmail.com.
> There's effectively no difference between sending G0 X10 Y10, G0 X10 Y20 and G0 X10 Y10, G0 Y20 and the driver can choose not to send the additional coordinate if
Artificially over-defining the waypoints does hurt possible path blending. You can then not distinguish between waypoints where you really want e.g. C to be at 0° and those where you actually don’t care.
I think the problem becomes painfully clear when watching this video:
https://www.youtube.com/watch?v=nBnfRhdnPks
Yes the rotation speed could probably be increased for that machine, but still OpenPNP wastes precious time not rotating the nozzle while travelling to the feeder pickup location.
Is this rotation not just driven from motor being extruder which is not synchronized by motion controller with axes XYZ but after them?
--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/4c46dc9a-97a0-42e5-948f-f230049b01db%40googlegroups.com.
I think it's quite typical setup that people use XY as synchronized axes and every C motors connected to extruders outputs which number in Smoothie is unlimited (this I'm not sure but think so).
So in your opinion (I'm not saying you're not right), by default Smoothie calculates distances for PAXIX axes group AND for all extruder outputs?
Hi Marek
the distance is only of concern in relation to how feedrates are calculated. You know the F parameter in a G0 / G1 command.
If you tell it to use a F100 feedrate, it means 100mm/minute along the distance travelled in X, Y, Z.
https://en.wikipedia.org/wiki/Euclidean_distance
In this so-called Euclidean Distance the E (extrusion) should of course not be counted in the federate and that is the default for Smoothieare.
The same is true for the rotational axes we use for PNP and other machines use for rotating tools and/or the workpiece.
See NIST RS274NGC Interpreter - Version 3, Section 2.1.2.5 rule A:
A. For motion involving one or more of the X, Y, and Z axes (with or without simultaneous
rotational axis motion), the feed rate means length units per minute along the
programmed XYZ path, as if the rotational axes were not moving.
B. For motion of one rotational axis with X, Y, and Z axes not moving, the feed rate means
degrees per minute rotation of the rotational axis.
C. For motion of two or three rotational axes with X, Y, and Z axes not moving, the rate is
applied as follows. Let dA, dB, and dC be the angles in degrees through which the A, B,
and C axes, respectively, must move. Let D = . Conceptually, D is a
measure of total angular motion, using the usual Euclidean metric. Let T be the amount
of time required to move through D degrees at the current feed rate in degrees per
minute. The rotational axes should be moved in coordinated linear motion so that the
elapsed time from the start to the end of the motion is T plus any time required for
acceleration or deceleration.
https://www.nist.gov/publications/nist-rs274ngc-interpreter-version-3
Now if for instance you have two physical axes Z1 and Z2 on your PNP machine, you must recompile the Smoothieware firmware with PAXIS=4 in order to have both Z axes counted in the Euclidean Distance. Otherwise feedrates might not be properly limited in moves where Z2 is moved together with X and/or Y. If you have only a small move in X together with a large move in Z2, the Z2 stepper might actually stall, because acceleration is then only calculated for the very small X move, not for the Z2 move, resulting in a very small motion time in which Z2 is overwhelmed. Actually a bug in Smoothieware, that I tried to fix without success.
Even without all the theory it is obvious that the extrusion rate and the nozzle speed in 3D space (federate) must be carefully coordinated. The extrusion controls how fast the material is extruded from the nozzle, i.e. how fast the molten plastic worm is pushed out of the nozzle. In order to have nice constant buildup of the layers, extrusion must be closely matched to the federate otherwise the worm would sometimes be blobbed together and sometime be stretched too thin.
_Mark
-----Ursprüngliche Nachricht-----
Von: ope...@googlegroups.com [mailto:ope...@googlegroups.com] Im Auftrag von Marek T.
Gesendet: Samstag, 26. Januar 2019 12:06
An: OpenPnP
Betreff: AW: [OpenPnP] Re: Fixing Shared C and Pre-Rotate