Hi Eric,
Automatic backlash compensation calibration is only available, if
the controller can control the acceleration dynamically,
typically through a M204 command.
Why is this needed?
In previous versions of OpenPnP, Backlash Compensation worked
with the OneSided method. This method is still available
and it works as follows: It always moves to a target position from
the same side. If a move comes from the wrong side, it goes beyond
the target by a certain so-called backlash offset and then
retracts from there. With this method, any slack (e.g. in a belt)
will always be on the same side and the positioning
therefore more consistent. You can configure the backlash offset
to be significantly larger than the worst case slack, so you're
always on the safe side. This also means you can estimate it
manually, there is no need for a sophisticated (automatic)
calibration. You can still configure it manually, and this is what
you probably need for the moment with Grbl, until it has M204.
Note, AFAIK @Ravi is
going to implementing M204 for Grbl.
The OneSided method is simple and effective, but this
also means that it needs extra moves and direction changes, which
makes the motion discontinuous (unfit for good motion planning),
i.e. it is less fluid and slower. Furthermore, by going beyond
the target, you might collide with something, so you might
need to be aware of that e.g. with the nozzle tip changer motion,
or for mechanically actuated feeders. It is not normally a problem
for pick & place per se, because the X/Y backlash compensation
moves happen at Safe Z, i.e. "in the air" where it does not
matter. To pick and place, only Z moves.
Because of these Cons I created other methods. The Directional
methods try to compensate the backlash (e.g. slack in a belt) by
going exactly as much further in the original direction i.e.
without a direction change. The problem with these methods is that
the backlash offset now needs to be accurate, you can no longer
just take the worst case, or even more. It soon turned out that
this offset is not consistent! It matters how far and therefore
how fast the machine moved, before the offset is applied. It seems
the differences in peak feed-rate, friction, duration of
deceleration (momentum) create differences in the tensions of the
machine, e.g. most obviously in the belt. When the gantry or head
is heavy, it might even overshoot into the belt (etc.) through
momentum, i.e. cancel the backlash on energetic moves (but not
others). At least that was observable on my machine (and many
others later in testing). Therefore a so-called "sneak-up offset"
was introduced. The last bit of a move is performed at a much
slower speed, the machine kind of sneaks up to the target
position. The idea is that the machine will "relax itself"
consistently over that stretch, regardless of whether short/slow
or long/fast moves came before.
And that's where the acceleration control is key. When I
say "slower speed" I actually mean less deceleration (i.e.
less negative acceleration), because physically it is the acceleration
that is creating the most obvious differences in tension (the
formula is F = ma).
The feed-rate is mostly irrelevant as we are speaking of a very
short sub-millimeter "sneak-up offset", i.e. very very low
feed-rates and therefore negligible friction.
https://github.com/openpnp/openpnp/wiki/Backlash-Compensation#backlash-compensation-methods
The calibration algorithm needs to be able to control the acceleration, to test the various methods against each other. It will determine, how large and how slow the sneak-up offset needs to be to get consistent backlash. On mechanically superb machines it can even decide against using backlash compensation at all (method: None). Or it can decide that backlash is present but always consistent, so it can skip any sneak-up offset (method: DirectionalCompensation). If consistent enough backlash is achieved with sneak-up, it can configure its offset and speed (method: DirectionalSneakUp). Or it will fall back to the one-sided method, if even the slowest and longest sneak-up does not exhibit consistent enough backlash, it will then configure it for the observed worst case backlash and sneak-up, as a "best effort" (method: OneSidedPositioning).
I hope this explains it, and how important acceleration control
is for both the auto calibration, and possibly for the
backlash compensation itself.
It is also btw. very important for motion that needs to be
gentle: e.g. picking large heavy parts, nozzle tip changing,
actuating mechanical feeders with tiny parts.
_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/CAEfPpXzk7ttd%3DPTCy-aQSOobCzKJYnM-EqmcLAvzJAXSgo8RzQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/cfb166a2-4ae9-b77f-3261-47934fc37741%40makr.zone.
Hi Eric
There are several initiatives around Grbl+OpenPnP active to my
knowledge. There is a "native" Grbl fork for openpnp. @Ravi already has implemented
most commands needed for OpenPnP and he is going to implementing M204.
https://github.com/openpnp/grbl/pull/2
(he will need to re-create the PR, so the upstream will be pulled
in right)
https://www.grbl.org/what-is-grblhal
https://github.com/grblHAL/Plugin_OpenPNP
I don't know the status of that.
> Can you provide me a list of the commands and the
responses Open PnP expects to see and I can add them relatively
quickly and then let you know how they work out?
See here. Note the end of that section, for a way to simulate expected behavior:
https://github.com/openpnp/openpnp/wiki/Motion-Controller-Firmwares#key-features
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/CAEfPpXx97-Jv1JTv9N-2LEJ2gVUzZF92%2BYuXYv7KaPmM71jRtQ%40mail.gmail.com.
https://www.grbl.org/what-is-grblhal
https://github.com/grblHAL/Plugin_OpenPNP
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/d7122b78-18f8-d95b-f89f-37e7de53f2cb%40makr.zone.
Like I said, please work together with Ravi on this. He has already defined the M115 string for Grbl:
https://github.com/openpnp/grbl/blob/9d70549ab533c98941662abb037ede146bf42142/report.c#L702
And I have already added support in the testing version.
https://github.com/openpnp/openpnp/pull/1334
The string needs to contain Grbl (case sensitive).
I'm not sure you should be overwriting the settings. These seem to be per axis limits (an array). The M204 command we use in OpenPnP is a toolpath related acceleration limit. The controller should always enforce both the axis and the toolpath limits. So define a new variable e.g. toolpath_acceleration, set it in the M204 command and use it in the planner, to initialize the nominal block acceleration. From just a quick look, probably here:
https://github.com/grbl/grbl/blob/9180094b72821ce68e33fdd779278a533a7bf40c/grbl/planner.c#L266
block->acceleration = SOME_LARGE_VALUE; // Scaled down to maximum acceleration later
should now be
block->acceleration = toolpath_acceleration; // From M204 S, scaled down to axis maximum acceleration later
But like I said: Ravi is already on it, so you two should
coordinate.
> How does Open PnP send the string to the controller?
When your controller responds with Grbl in M115, OpenPnP testing version will
recognize it and Issues & Solutions will propose the right MOVE_TO_COMMAND for you, including the M204. So no guesswork.
For Grbl M204 is sent with the S word.
The other words mentioned in the Marlin source code you cite (P R T) are clearly for 3D printing,
Marlin deprecating S seems a bit
narrow-minded, I guess it will stay for other NC applications
after all.
_Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/CAEfPpXykewvJHxz-aF%3D%2Br4rVNvxzQaVZjb7AM10kP7sA9r3U6A%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/e952abb7-68bb-e3b5-1768-8d00cc3f23b1%40makr.zone.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/e952abb7-68bb-e3b5-1768-8d00cc3f23b1%40makr.zone.
> How do I get a hold of Ravi?
The link of Ravi I gave you before is all I have.
> Now as far as the M204 with S command will this value need to be saved to eeprom or is this just for calibration purposes?
No, it is permanently used for OpenPnP. It is used as a
transient setting, like the F word
for feed-rate in G0/G1. So do not save it in the eeprom.
It would burn it out and AFAIK it would also not work on the fly
i.e. the stepper signal driver interrupts must be disabled during
eeprom writing.
_Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/CAEfPpXx6sVa_3GeYP0XUwa1kw0qxXv%2Bubo2oaz4qzWd3v0RHxA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/fd8924a8-204f-2fb7-834d-116a647fd3db%40makr.zone.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/e952abb7-68bb-e3b5-1768-8d00cc3f23b1%40makr.zone.
It is in the testing version.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/CAEfPpXydqdgGx7GF8gBGGQte1UPhxDsMFp5zhCXk4vZ83btVGw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/66e88809-36a6-3f3f-9361-4cde6666f861%40makr.zone.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/66e88809-36a6-3f3f-9361-4cde6666f861%40makr.zone.