Resend?
Hi vespaman
please send the whole log. The G4 delay depends on what came before. I might be able to study this evening (CET).
On question: do you include a tension relieve move? I.e. after dragging forward, do you retract the pin back to +/- the center of the sprocket hole?
_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 view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/d8224b21-fc68-499a-b918-af7be9687952n%40googlegroups.com.
Counting "ok"s, it seems the M817 itself takes some ~460ms to respond with ok. The G4 dwell itself is accurate to within one millisecond. This happens multiple times in the log, but not always. Strange.
Sorry, I don't find anything that would give me an idea.
Could be Smoothie STM32 port specific. If I'm not mistaken, the port was done in very short time and some simplifications were made. Maybe there are some fixed sleep times in there, e.g. when changing PWM duty cycles?
_Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/8d162cc1-a3bc-406f-a05a-2a09cde06893n%40googlegroups.com.
Tried to refind where M817 takes less than ~460ms and haven't found it. So maybe I was mistaken and it is simply always the case.
Could be that Matt hardcoded the wait into the Smoothie
STM32/CHMT port for safety, so nobody forgets to wait (G4) before
moving.
At the time we did not yet have the Axis Interlock in OpenPnP, so
forgetting the G4 was not caught!
https://github.com/openpnp/openpnp/wiki/Axis-Interlock-Actuator
_Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/898d7eec-689a-f6b7-ab1f-03dbbbee7ee3%40makr.zone.
> But even so, would it be possible to poll for the "drag pin up" condition, much like waiting for the vacuum on pick?
Yep that would likely be an easy addition to the interlock logic. You would have to specify the timeout on the Interlock Actuator.
https://github.com/openpnp/openpnp/wiki/Axis-Interlock-Actuator
I'm a bit confused about how/when the peeler should work. It would perhaps help if you could video the whole pin/peeling/dragging sequence on your machine, ideally so one sees everything happening (probably hard to frame in one view) 😛
_Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/b01ba3d5-98d3-4cbe-b78c-b804178314c9n%40googlegroups.com.
I have configured the dragpin as actuator and I do have "Before
Actuation" coordination configured. Thats required because the dragpin
state shall not change while the machine is moving. In the driver I've
configured a 100ms delay

axis interlock errors. I agree that polling would be better. However, it
would be even better to have a separate G-Code to let the controller do
the polling and return either with success or timeout.
Then you might add G-Code commands that a) delay/wait until the dragpin
is up (with timeout) and b) delay/wait until the dragpin is down and
automatically switch the pwm to a lower value.
In addition you might add some kind of spiral move to release a stuck
dragpin automatically...
To clarify, the coordination checkbox being OFF does two things:
_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 view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/660a3930-cbc9-45fc-8bbe-be7753eb7be6n%40googlegroups.com.
I'd keep the coodination for the drag pin: we have to make sure the drag
pin is at its target location before it gets actuated. Therefore the
move to the drag location has to be finished before continuing.
Cool! Can I merge the change back into my CHM-T smoothy firmware?
done by the controller. The controller will always drive a streight
light between the locations you specified. So, if the peeler is operated
as part of the drag move, the peeling starts and ends exactely with the
drag move. The controller will also make sure, that both axis are
operated at their respectiv limits.
If you wont to operate the peeler as axis, you should make sure to
removed all peeler related actuators (from the feeder setup). If you



> OK, I followed the docs,
which indicates you should still use actuators, but maybe the
docs are for machines without the real extra axes? That would
explain why I did not see much of a change..
An actuator can be actuated or moved or both.
You still need the Feed actuator for motion, and it is
this motion actuator, that is show in the docs you linked.
For coordinated peeling, you need to use the Feed
actuator and you need to give it the peeling axis. In your two
sided feeder setup, you probably need two different Feed
actuators and two different peeler axes, and assign them properly.
All peeling is then done thought the feed motion, fully
coordinated with the feeding. Therefore, no actuator coordination
is needed for peeling, and the controller can also queue, and
seamlessly, and autonomously execute the peeling/feeding, i.e. a
few milliseconds are saved on M400/M114 hand-shaking.
Conversely, you need to unassign (and to avoid future confusion,
delete) your Auxiliary peeler actuators:
_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 view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/301d4d40-928e-443f-82dd-f1f2c49ac729n%40googlegroups.com.
> Of course! I have yet to commit it to my git, but I'll try do a clean
> commit. (Not using git very often, so I tend to forget how to work it)
>
That's not so difficult either, just Git operations are not that
clear/predicable as with other version systems (I eg. always have
problems with remote branches)...
- just "commit", review your code changes and add a comment to create a
new (local) commit.
- use "push" to synchronize your local commits with github. (you need
to make sure the author of each commit matches the one github expects
otherwise they will be rejected) (That's something I'm fighting with as
well...)
That's what I meant with remove all actuators: the auxiliary actuator is
set true when the drag move starts and false when finished. You can use
any gcode you like and machine coordination as required. However, this
is the traditional way. If you wont to use the peeler as axis, you have
to remove the auxiliary actuator and assign the (new) peeler axis as
drag pin rotation
(https://user-images.githubusercontent.com/9963310/158563736-3c94a813-d7ef-43c6-bf0e-9a9ce76aa34d.png).
If I understand the logic correctly, the rotation you specified on the
feeders "Push-Pull Motion" tab is now executed by the "Feed Actuator"
you configured, which is set to your drag pin. So actually the drag pin
is rotated as part of the drag move. The rotation is send to the
controller using the axis letter you configured for the peeler axis. So
on a drag move, the location for x and y together with the rotation
value is send to the controller. The controller will then create a move
sequence by joining all this locations using straight lines. That means,
that the x/y and rotation will be exactly reached before it continues to
the next x/y and rotation. This guarantees, that the drag motion and the
peeling are exactly synchronized.
Yesterday I noticed, that the drag pin has a single rotation axis only.
On your machine you have a single drag pin but two peelers. So in order
to operate both peelers as axes, I see two possibilities: a) operate
both peelers as one using bridges in the controller and as single axis
or b) create two drag pins with exactly the same properties except the
rotation/peeler axis. Then you can use one drag pin together with one
peeler.

Hi Jan, Micael,
yes, the drag pin interlock is an issue.
There is a way around it:
_Mark
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/2f4a7e5f-3d73-4800-9eeb-6ba0f5a6c141n%40googlegroups.com.




This checkbox should be OFF:

To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/9c00cf51-9714-462f-a9ad-7cbed6124e73n%40googlegroups.com.
It seems your interlock logic is reversed. You are pushing the
pin down, then when the drag is made it complains. But the drag
must be allowed with the pin down.
You wrote:
> and conditions on drag pin actuator set to DRAGPIN / SWITCHED ON again
I guess that's wrong. The condition is for the interlock to be
effective, not for the dragging.
_Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/8d09f600-2fae-4442-b6b2-6dc7f1d88f7en%40googlegroups.com.
_Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/c8f75398-9146-4db7-8339-3273f055db0en%40googlegroups.com.
Hi Jan,
I hope I understand the actual question right.
The two Peel rotation axes, as well as the other axes are on the two (west and east) Feed actuators, not the (one and only) Dragpin actuator.
There is no "inheritance of the coordinate system". Only the Feed
actuators have the axes assigned, and these are directly
assigned to the feeders, i.e., only the two (west and east) Feed
actuators are logically moved by the feeder.
The Dragpin actuator is now merely controlling the drag pin itself, i.e., logically it has no motion. A bit like the light or valve actuators, of course those move with their respective camera/nozzles, physically, but not logically.
The ReferencePushPullFeeder now has a short-coming that is on
my radar. When you clone a feeder (Auto-Setup), it does not
logically know whether it is a west or east feeder, so
theoretically, it could clone the wrong Feed actuator and
therefore the wrong Peel axis. I'll keep that in mind and
add orientation (which is know by means of sprocket hole
vs. pick location orientation) as a more dominant criteria for
finding the cloning template.
_Mark
Hmmm... are you sure these are mm?
The way I understand this, it should be degrees, being a rotation
axis. The amount of protective film actually gobbled up will
depend on the filling-up of the spool, right? There is slip in the
coupling with the spool, right?
So you should specify the degrees of rotation needed to gobble up
enough film, even when the spool is empty/smallest. This will then
gradually be too much when it becomes fuller, but the slip
coupling should take care of that. Right?
_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 view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/326a55c8-ae51-499f-8263-e19c11d13bean%40googlegroups.com.
> FYI: It also clones the wrong position of the component
OCR area, at least on my machine (I guess it might depends on
machine geometry).
Are you sure? This should really, really not be the case.
_Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/4c55cac8-296c-4515-8141-81f30ac22cban%40googlegroups.com.
Hi Micael!


Hi Jan, Micael,
if I remember correctly, the CHMT boards usually lack serial hardware flow control, therefore you need to enable so-called "Confirmation Flow Control" in OpenPnP, which takes care of it, but also costs some time, especially since the transmission baudrate is also not so high on CHMT serial (vis-a-vis true USB serial on other controllers). Some users modified their boards and/or the firmware to improve this situation, but I don't recall if you guys are among them.
So if you really want to go down that rabbit hole, you would have
to fix that issue too.
Then the next thing would probably be the Actuator machine coordination. Some Actuators can be actuated in uncoordinated fashion without harm. For instance a light can be switched on, before the camera (or its subject, the nozzle) actually arrived at the location to take a shot. But be careful, other actuator such as drag pins, must of course wait! Make sure these are all carefully evaluated and optimized.
Other than that you have to realize that coordination is needed,
between controller/machine and computer. You can't do proper
computer vision without waiting for the camera or its subject to
be at the right location. And conversely, you cannot command the
next machine move, before you have the compensatory result of the
computer vision.
More "primitive" sensing can be implemented on the controller,
vacuum sensing, drag pin confirmation, contact probing etc. some
of which you already discussed earlier. To be clear, coordination
per se is still needed, but it is much faster/"real time", when on
the controller.
As far as I know, the CHMT also has some form of closed loop to
detect lost steps on the stepper motors, and compensate for them.
This allows it to work right at the limit of the steppers. The
Smoothie port does not support that yet, AFAIK, so that would be
another venue for improvement. OpenPnP cannot help you there.
It is these "closed loop" / "real time" advantages that make the
factory software and firmware faster, as far as I know. Plus an
amount of tuning they can really only afford as the manufacturer.
Other than that, I don't see why OpenPnP should be any slower to
operate the hardware,
However, to be completely frank: OpenPnP has other shortcomings that may make it slower than factory software (now I'm talking all such software, not only CHMT). As I said numerous times, OpenPnP's JobProcessor does not optimize multi-nozzle placements. It will only optimize the number of needed nozzle tip changes, but not the co-location of feeders/pick locations. So it will needlessly scoot all over the machine to pick parts, instead of choosing feeders that are close together.
Needless to say, it will also never trade in an extra nozzle tip
change in order to facilitate such co-located feeder picks, even
if that were much more efficient in the end. Or leave one nozzle
empty, if the detour is more expensive than doing the placement
first.
Though, I don't know if the CHMT factory software does it any
better that way... ?
Will look at that log and the underlying code as soon as I have
time. Very interesting!
One question: when it says "new start" at the beginning, does this mean new start of OpenPnP or just of a new job, and there was one before?
I'm asking because this is a Java program and it will be slow, in-deed
surprisingly slow, the first few times it executes a certain
portion of the code. But it will be okay after about three or
four iterations (at least in my humble experience), and for
jobs with 100+ placements per panel, this initial slowness becomes
irrelevant.
The reason is Just In Time (JIT) compilation. The virtual Java code is only loaded and compiled into machine language when it is first called. And even the first compilation is only a rough one, the code paths are further analyzed and "hot" (=often used) code is then further optimized. In the end it can even be faster than normal compiled languages (such as C++)*, because it can optimize the code taking the specific sub-flavor of processor model into consideration, and by employing so-called profile guided optimization.
So in order to benchmark this, you need to "warm up" OpenPnP with at least four placements, and only analyze the log after that, or simply take the second-to-last placement from a larger job.
_Mark
*) C++ and other such languages can be optimized much the same way with considerable extra effort.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/04083ebd-a95b-4170-add3-b7ef93d7c518n%40googlegroups.com.
Hi vespaman
I can't explain the various delays (marked by you with "??") happening when nothing is logged (except in cases where there are dwells for vacuum establishment, as you correctly state).
I have specifically analyzed each occurrence of Thread.sleep() in the whole of OpenPnP,
to exclude having missed something.
If this is really a warmed-up Java VM, I can only guess the computer is not powerful enough, has not enough RAM, i.e. the Garabage Collector would frequently have to run, which could explain the delays. But that's admittedly a wild guess. Please tell us the PC specs.
The other delays, I think, are what you can expect. What you seem to forget in your analysis (your last message) is the nozzle rotation axis A. It goes from +67° to -90°, so a -157° turn, which I guess could be limiting.Check out the A axis acceleration and feedrate limit, both in
OpenPnP but also in the controller config. Remember it is degrees
not millimeters, so larger numbers are normally appropriate.
Then also check out the nozzle Rotation Mode in OpenPnP, e.g. consider MinimalRotation. Caution: This optimization only works if your articulation is free (free-running tubes etc.).
https://github.com/openpnp/openpnp/wiki/Nozzle-Rotation-Mode
I see two optimizations that could be done in OpenPnP:
Plus OpenPnP should do more logging especially log each Thread.sleep() it does.
_Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/2a91d11d-9d8d-4cbf-b6a7-7b12b5aa808an%40googlegroups.com.
That PC is more than enough.
> The thing is that the delays are always there, at the same exact same lines of the log, and exactly the same amount of time.
That's really mysterious. I mean, yes, OpenPnP needs some crunching time too, but surely not 40ms!?
Can you please send the machine.xml?
_Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/7c60407e-bb58-4ecb-9cbb-e9435de436ean%40googlegroups.com.
Hmmm... not sure it would actually run the advanced Motion Blending code when you don't have 3rd order control on any driver, but please switch off the Allow uncoordinated? in the Motion Planner tab on the machine. If it does compute Motion Blending it might actually take some time.

https://github.com/openpnp/openpnp/wiki/Motion-Planner#settings
Any change?
_Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/71945528-6548-4276-a2dc-c22f94144609n%40googlegroups.com.
Hi all,
I've made a new test version of OpenPnP which adds some timing related logging. Whenever OpenPnP deliberately sleeps, it is traced to the log, so these obvious cases can be excluded.
https://github.com/openpnp/openpnp/pull/1593
I still don't see how this would explain the pauses in the log, but in the absence of any other ideas, this should at least exclude the possibility that I somehow missed one of these.
Allow some minutes to deploy.
_Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/d0dc987f-f00e-4a0c-8082-324f031ba17dn%40googlegroups.com.
Unfortunately it doesn't build the installer at the moment... 😭 ... hope Jason will be able to help. Need to go now.
_Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/632d716a-a88f-4cd2-9a59-c9d8549cf1b9%40makr.zone.
Hi Micael,
> Waking up today, my brain gave me a present; a pattern of the delays! :-)
I had the same train of thought, but after analyzing the code yesterday, I don't see how this can manifest in OpenPnP. The serial writer and reader threads are completely decoupled from the main task thread. They both communicate through queues, and I don't see how or why the task thread should wait on the queue in that instance.
For instance:
The main task is logging this
2023-10-28 17:36:11.859 GcodeAsyncDriver DEBUG: GcodeDriver:ttyUSB0 empty command after pre process
Then the reader and writer threads are talking.
2023-10-28 17:36:11.859 GcodeAsyncDriver$WriterThread TRACE: [GcodeDriver:ttyUSB0] >> M816S100
2023-10-28 17:36:11.859 GcodeAsyncDriver$WriterThread TRACE: [GcodeDriver:ttyUSB0] >> G4P10
2023-10-28 17:36:11.859 GcodeDriver$ReaderThread TRACE: [GcodeDriver:ttyUSB0] << ok
2023-10-28 17:36:11.859 GcodeAsyncDriver$WriterThread TRACE: [GcodeDriver:ttyUSB0] >> M816S10
2023-10-28 17:36:11.869 GcodeDriver$ReaderThread TRACE: [GcodeDriver:ttyUSB0] << ok
2023-10-28 17:36:11.869 GcodeDriver$ReaderThread TRACE: [GcodeDriver:ttyUSB0] << ok
But actually, the next thing in the main task should not be
delayed, it should come immediately, i.e., the logging should
actually appear intertwined:
2023-10-28 17:36:11.909 AbstractHeadMountable DEBUG: Feed (Left side peel).moveTo((74.661476, 144.397624, 0.000000, 4.000000 mm), 1.0)
I really don't understand.
I must be missing something, so please, if possible, do another run with the new test version that has added logging.
Thankfully Jason fixed the deploy overnight, and I made a new PR with yet more logging on the read queue, that is successfully deployed.https://github.com/openpnp/openpnp/pull/1595
Afterwards, please send me the full log.
_Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/5d8e7810-c604-4e96-b174-7b92d8c84c57n%40googlegroups.com.


Ouch! Bad mistake by me. 😭 So sorry!
@other users: I am sorry to say this
affects all users. Please read.
The culprit was now made visible by the new logging:
2023-11-02 13:16:25.007
SimulationModeMachine TRACE: BLOW-OFF simulate actuation, sleep
5ms
This sleep should actually only happen for simulated machines. It was even 50ms before, and I now reduced it to 5ms which already helps a lot, as you reported, Micael.
The code doesn't disable the sleep when not in simulation mode (a curly brackets nesting mistake). Fixed here:
https://github.com/openpnp/openpnp/pull/1596
All users, please upgrade, you will get 50ms faster per
actuation in the newest test version (or the
remaining 5ms compared to yesterday's version).
Thank you Micael for relentlessly insisting
on this, and then having the patience to follow it through,
always ready to test one more thing. I hope more users follow
your shining example! 😎 🥇
_Mark
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/59d56ca5-0699-41e2-be7f-45d88a97b54dn%40googlegroups.com.
Thanks back, and btw. veeery nice CHMT+OpenPnP demo video. This sets the new benchmark, I guess! 😛
https://drive.google.com/file/d/1DfZY4dLoCS5wJ1iTXK9bT644_vKga-4_/view?usp=drive_link
Hope you leave it there for posterity, or upload it to YT or the likes.
_Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/d7c538fb-6d9c-4aa8-8d6b-d95ca43faa55n%40googlegroups.com.
Then you might add [..] delay/wait until the dragpin is down and
automatically switch the pwm to a lower value.
Jan