Hi Jaroslaw
Re-posting this in the group, so everbody can see it, hope you don't mind. I want this information to be open.
The ideal would be to implement the full 3rd order control inside the controller. Note, I made the planner code as "C++-like" as possible in Java, so I believe it could be ported quite easily, including the uncoordinated planning e.g. Motion Blending!!
https://github.com/openpnp/openpnp/blob/develop/src/main/java/org/openpnp/model/MotionProfile.java
With 3rd order control in the controller, the amount of commands sent are small, no need for interpolation.
You could still implement the M595 options, especially the grace period (R word) would make sense.
Note: if this is intended for OpenPnP use only, then you can even
avoid the need for a concurrent look-ahead-planner (which I think is
very difficult to get right in hard real time). You can instead simply
wait for M400 or the grace period timeout and then plan the whole motion
sequence once only.
To test motion, you can simply use a GcodeAsyncDriver and the set it to use the internal Gcode simulator:
You can also enable G-code logging in the driver. So you can extract the G-code as it is sent.
Note, some things would need to be defined for a true 3rd order motion controller. There is currently no standard G-code command to set the jerk for instance. I used M201.3 on the TinyG. But that is per-axis. It would be better to haven a tool-path relative jerk limit. If you commit to this, we can work new commands out.
_Mark
Hi,
As I have been making my own controller ( https://groups.google.com/g/openpnp/c/oRY0dIKeIDw ) I wanted to ask you about best way to support your implementation of motion control features in OpenPnp.
- Should I implement M595 for interpolated moves ? ( as my controller is ethernet based it can take fairly large amount of data - tens of gcode lines at once - so no need to send them one by one)
- Could you provide example of that gcode stream for such single
move ? ( is there a way to simulate it / see it with null driver -
I do not have smoothie to easilly see it)
I would go for direct 3rd order moves ( I have calcations ready, tested in simulations) - but then - how it would look like ? (especially in case of blended moves)
Best regards,
Jarosław karwik
For OpenPnP almost every move is 90° to the next (Z vs. X/Y vs.
Z). The machine needs to (almost*) stop in the corners. So if you
implement true 3rd order control (full 7 segments) even for
single moves only, it is already big progress. It would be
the first Open Source controller that I know that can do it.
The only thing that could change the 90° corners and allow speeding through would be Motion Blending:
https://github.com/openpnp/openpnp/wiki/Motion-Planner#motion-blending
So far I don't have high hopes that this can be done using
interpolation. Even the most powerful controller (Duet 3) takes
longer to receive the high volume of interpolated commands over
USB than what time can be saved by speeding through corners.
Unless USB bandwidth, command processing, look-ahead planning etc.
can be improved by at least an order of magnitude, this will not
be useful.
So the only hope is doing Motion Blending inside the
controller. But I agree this is a big thing to integrate into an
existing controller. The only "easy" way I see is starting from
scratch, use a very powerful MCU with double precision FPU and
port my code to C++.
Having said all that, there could be another way: I could
send you finished profile segments. Each segment describes
duration, start acceleration, end acceleration, start velocity,
end velocity, start location, end location (redundancies could be
optimized). Segments are per axis, and they can be uncoordinated
i.e. different axis segments can have different durations and
acceleration/velocity/displacement need not be proportional
between axes. Typically, after a certain sequence of profile
segments is complete, the durations will again add up to the same
sum, e.g. when the axes go through a coordinated way-point
("corner").
For safety your controller could validate that
This way OpenPnP would become the de-factor motion planner, but
the controller could still make sure everything is safe (a final
responsibility that I would never be willing to transfer to
OpenPnP). And of course the controller would still have to execute
the (uncoordinated) segments in guaranteed real time and dither
ramps to steps.
_Mark
*) You could allow a minimal speed through 90° corners, other controllers do it under the name of "Junction Deviation" or "Allowable Instant Velocity Change".
--
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/d50f903a-97aa-40b8-bcb5-f570071a360cn%40googlegroups.com.
Hi Jarosław
I don't see any problems for you to implement your own Motion
Blending idea. The "corner" points remain the same and the motion
can be sent as straight moves. Your controller must just know how
much overshoot is admissible (Safe Z Zone). That's all.
_Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/82f24686-17d8-4e03-86a9-e249e21c4689n%40googlegroups.com.
> do we need acceleration/jerk here as well or we use global settings ?
Acceleration should already be sent using M204, {Acceleration:
} variable.
Jerk can be sent when you use the {Jerk: } variable.
Like I said there is currently no established M-Command to send a
dynamic Jerk limit known to me. I would suggest M204.3 with
the same semantics as M204 but for 3rd order.
https://www.reprap.org/wiki/G-code#M204:_Set_default_acceleration
Something like this:
{Jerk:M204.3 S%.2f}
I guess this would need to be on a separate line to be G-code
conformant. I could probably optimize it so it will only be issued
if Jerk actually changed from the last move.
> Is there any way to know current SafeZ ? ( from G code
stream) This would allow me process blending internally.
No. I guess this should be a configuration on the controller that must match the configuration on OpenPnP. Like soft limits and other stuff too. This is a redundancy, yes, but I think it serves safety and is therefore OK as a kind of "double check".
_Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/8d4eb1ea-4896-4cfb-ab59-564cdbc8cd88n%40googlegroups.com.

>There is also one small special case when Z does not have enough time to go full up ( for short XY moves) - not sure if we have to worry about it -
In my simulations it is significant. I made it adaptive to the
X/Y distance. Note, for dual nozzle machines you also need the
"snake" line, i.e. Z is overshooting, then reverting and then
going further "up" which is "down" for the negated nozzle (shown
in the two back rows):

> what if we have large component and risk banging already assembled ones ?
_Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/a183ed07-1441-4cc9-a677-64cfd8b7f9e6n%40googlegroups.com.
Oh, and don't forget C can also be mixed in with X/Y.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/db2e7e1e-327f-778c-6fd9-9169efaff386%40makr.zone.
Answers inline>>
How safe is safe Z ?Is it safe "enough" that it guarantees that the nozzle with longest component will safely fly over PCB with largest component assembled ?
It must be.
That was my understanding, although at some point I started having my doubts.
Why?
The snake move means checking range of Z values instead of single threshold - have to have it in mind when blending moves.
Yes that's the "Safe Z Zone".
https://github.com/openpnp/openpnp/wiki/Machine-Axes#kinematic-settings--axis-limits
About C - I guess that this one usually also goes in safe Z area as well ?
Yes, it is handled exactly like X, Y.
When making XY move of 3rd order - have you been able to calculate it in such way that get straight line ( so the X and Y move ends the same moment) ? I have some idea how it supposed to be calculated, but the algorithms seems pretty complicated and full of special cases.
If you want that, it's easy: Just project all axis
jerk/acceleration/feed-rate limits onto the tool-path (the
"diagonal"). That is done by dividing the axis limits by
the unit vector axis component. Take the minimum of the projected
limits.
Then solve the profile for the tool-path and the projected minimum limits.
Then multiply everything by unit vector axis component to get the axis profiles.
But for the movement in the Safe Z Zone I do not use
coordinated moves. It can be bit faster, if the axes have quite
different limits i.e. if the ratio between acceleration and
feed-rate limits varies (which can be the case in a Cartesian
Machine, as the Y axis is typically much heavier than X and
especially C).
_Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/d34e2d98-0e3e-4a04-96d4-71410d4856a4n%40googlegroups.com.
It is as simple as that for any order due to how
derivatives of power functions work (i.e. simply with a fixed
factor of the exponent):
https://simple.wikipedia.org/wiki/Derivative_(mathematics)#Power_functions
_Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/d0701b40-ad42-4241-9a6f-c550499baae5n%40googlegroups.com.
> But then - is there any valid case when coordinated moves are being used ? Hard to imagine XY move in non-safe zone ( with exception of some unique machines using nozzle to advance tape in feeder)
Yes, for nozzle tip changing or feeder actuation. There can be diagonal moves in space.

Source: https://wiki.apertus.org/index.php/Liteplacer_PnP_Machine_Notes

_Mark
You received this message because you are subscribed to a topic in the Google Groups "OpenPnP" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openpnp/Y--rrV9e3AQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openpnp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/d0701b40-ad42-4241-9a6f-c550499baae5n%40googlegroups.com.
> Does OpenPnp use G0 / G1 to distinguish between linear
and rapid moves ?
Not yet. That is on my list.
It will probably never be introduced by default because some controllers have very "strong" ideas about G0 (like not applying/allowing any rate limits). Also, it is very important that there is no deceleration when switching from G0 to G1 and vice versa.
But I will make it available as an optional Gcode variable in some upcoming version.
_Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/1026177c-2657-4264-94ec-a377caf023cdn%40googlegroups.com.
Do you mean this?

No, this is only a Java test unit that tests the motion solver.
If you want G-code, best create a test motion:
https://github.com/openpnp/openpnp/wiki/Motion-Planner#settings
Then connect to the simulation GcodeServer:

Then enabled G-code logging (starts as soon you press Apply):

Then test:
https://github.com/openpnp/openpnp/wiki/Motion-Planner#test-motion
Then disable G-code logging (stops as soon as you press Apply).
_Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/8ff67f94-ddc7-46a9-a197-7e372a5460c8n%40googlegroups.com.
Unit Test is here:
It compares the scenario with/without jerk control (at two jerk
rates), with/without motion blending.
_Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/7424707d-e0de-404c-8a65-f65e53d17813n%40googlegroups.com.
This sequence is just to test that nothing bad happens, if unusual motion is planned. A PushPullFeeder or a nozzle tip changer could create motion like that.
My planner can handle coordinated->coordinate (endless,
straight lines), and coordinated->uncoordinated->coordinated
(with motion blending).
But if unccordinated->uncoodinated happens, it will stop at
the junction i.e. this is not (yet) implemented. This is very hard
to optimize.
_Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/ceebed27-dc06-41aa-ac2a-381718215290n%40googlegroups.com.
> I still need to solve rotation commands added to XY moves
In my code there is no difference between X, Y, and C. It is just one axis more.
_Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/22e1bf87-32f6-4d70-98f6-f88a47287689n%40googlegroups.com.
