ScottA's Compensation Component for Uneven Table (was "Probekins"?)

  • clunc
  • clunc's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
03 Jan 2023 17:32 - 04 Jan 2023 12:46 #260856 by clunc
I've got a commission to carve in a piece of stock supplied by the client.

After all my careful design and layout, I find the 1-inch "flat" stock I am presented is actually bowed, left-to-right with the center line being a ridge 0.16" higher than the edges.

As I pondered the outcome of compensating for the bow, I recalled, I think, some time back having learned of a way to have LinuxCNC "compensate" for an uneven table surface by using a different "kinematics" than "trivkins."  (It might have been called "probekins," but I have not found much searching for "trivkins alternative", or "probekins" or "uneven table compensation."   One "probekins" reference mentioned a broken link.

As I recall, in use, one "designated" XYZ-points around the table from which LinuxCNC (or some other deeper magic) inferred a piecewise-connected collection of triangles the linear surfaces of which were then used to adjust the Z-component of later commanded motions to come closer to the actual surface than the otherwise-presumed flat ideal.

My table is reasonably flat, but I constantly run into pieces of wood stock that just don't sit flat on it.  For my purposes, and from a time-saving point of view, it would make more sense to "define" their top surfaces to LinuxCNC after clamping for run-time compensation than to machine the surfaces flat, losing that much material, and time.

Can someone enlighten me on just what the heck I might be talking about?  Is probekins what I think it is? Is it still around? Is there something else I should be looking at?

Thank you. Thank you.
Last edit: 04 Jan 2023 12:46 by clunc.

Please Log in or Create an account to join the conversation.

  • clunc
  • clunc's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
03 Jan 2023 17:46 #260858 by clunc
Searching the web-at-large, I finally found these links:
forum.linuxcnc.org/10-advanced-configura...d-3d-printing#167181
(particularly, Andy's comment:
www.forum.linuxcnc.org/10-advanced-confi...on-with-2-7-11#99808)
and Scott's approach
forum.linuxcnc.org/10-advanced-configura...d-3d-printing#167181

Reading Andy's example, I begin to wonder if, even, possibly, ~I~ could figure this out:
1. save a set of XYZ-points, say 3 rows of 3, to a CSV file[1],
2. write a function that would:
  a. figure out which triangle XY was in, and
  b. calculate the amount of Z-compensation on that triangle
3. return that Z

[1] I typ. look at those 9 points anyway (all the time), looking for the "lowest zero" on the surface, so as to avoid "cutting air."
 

Please Log in or Create an account to join the conversation.

  • clunc
  • clunc's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
03 Jan 2023 19:07 - 03 Jan 2023 19:21 #260865 by clunc
And have now found this on the wiki:
wiki.linuxcnc.org/cgi-bin/wiki.pl?ProbeKins

Looking it over, it's not as straightforward as I remembered.  The surface, from which Z-compensation is derived, is calculated from the probe data in a separate step with:
%  probe2stl <probe.txt >probe.stl

The trivkins module is replaced with the probekins one in the [appropriate] .hal file, and the latter apparently expects to find probe.stl to enable it to do the runtime calculations.

All of this seems to be handled "internally" in Scott Alford's "compensation" routine , but I say that without any experience with its workflow.
Last edit: 03 Jan 2023 19:21 by clunc.

Please Log in or Create an account to join the conversation.

  • clunc
  • clunc's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
03 Jan 2023 19:35 #260867 by clunc
And with all this, I think I'll abort and try Scott's solution.
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

More
03 Jan 2023 22:21 #260876 by scotta
Hi, I use my compensation component regularly with my 3d printers and have a bed probe as part of the standard hardware along with a tool height setter which is used to update the tool table for the probe and hot end.

If you have a touch probe then you are on your way.

Please Log in or Create an account to join the conversation.

  • clunc
  • clunc's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
03 Jan 2023 23:10 - 03 Jan 2023 23:18 #260882 by clunc
Scott, thanks for looking in. And thanks for developing Compensation.

I've been following along trying to get your compensation.py component working, but I'm not understanding the workflow.

1. I'm running LinuxCNC 2.8.2 in Debian Buster, and it works.
2. I duplicated a working 3-axis-mill configuration and made the edits to the copy so as to have machines with and without Z-comp.
3. I've copied the contents of
  /usr/share/doc/linuxcnc/examples/sample-configs/sim/axis/external_offsets/
  into the dupe's config folder.[2]
4. When the Z-comp version is launched from the command line, Compensation confirms that it has STARTed and that it has found probe-results.txt[1], and then reports entering the IDLE state.
5. There is no indication in my AXIS window of the presence or activity of Compensation.[4]
6. The AXIS GUI does not have any panels for Motor-pos-cmd, Axis-pos-cmd, or Eoffsets.

My sense is that I still don't have Compensation "enabled," and I note that there is a Zenable checkbox in the Eoffsets panel that my AXIS GUI is missing.  If you were telling your mother who was vacationing in Biarritz how to do this, in an email, step-by-step, what would you tell her? :^} (I watched your video[3], but I didn't get any audio with it.)

[1] The probe-results.txt file contains nine lines of nine numbers separated by spaces with only the first three positions in each line being non-zero, for X, Y, Z axes. I guessed the format of the file based on a glimpse of the file in your video and added points I probed manually by touching off the cutter at each location.  They points are not are uniformly spaced in X and Y, but deltaX DNE deltaY.
[2] which I doubt was necessary as they seem to be demos for external_offsets functionality generally and nothing to do with Compensation.
[3]

[4] For example, my probe-results.txt, attached, indicates that the central meridian of the table is quite a bit higher than the east or west edges, but the backplot of the default project, axis.ngc, indicates the cutter is tracking right on top of the logo, at Z=0, whereas your video indicates that, with compensation, the backplot will be above or below the commanded track.
Attachments:
Last edit: 03 Jan 2023 23:18 by clunc.

Please Log in or Create an account to join the conversation.

  • clunc
  • clunc's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
04 Jan 2023 13:04 #260927 by clunc
> My sense is that I still don't have Compensation "enabled,"

The command line indicates that AXIS has found and loaded the Compensation component and it has STARTed, and reached the IDLE state.

Indeed, as I look at the code ( compensation.py ) and search for "IDLE", I see that is exactly my problem: AXIS is sitting in the IDLE state, waiting for a signal, "enable-in" to proceed to the next state, "LOADMAP."  The documentation requires the definition of a set of new "configuration.*" pins in the .hal file, one of which is named "configuration.enable-in". 

The documentation goes on to mention that the "probe-results.txt" (used to compute compensation amount) can be modified whenever compensation is disabled "(Don't probe whilst compensation is enabled).", suggesting that compensation mode can be toggled.

Q. How does one go between Enabled and Disabled?

Please Log in or Create an account to join the conversation.

  • clunc
  • clunc's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
04 Jan 2023 15:14 #260931 by clunc
I believe I have found a way to do it from the command line, after looking at the Machine->HAL Configuration (halshow) window inside LinuxCNC, and seeing "compensation" entities under both "Pins" and "Signals."

Some poking around the LinuxCNC HAL Tutorial led me to believe I ought to be able to "set" the value of a pin from the command line (at least) with 'halcmd' and possibly even with halshow later inside LinuxCNC.

First attempt:
% halcmd getp compensation.enable-in
FALSE
Can I set the value of the pin to itself?
% halcmd setp compensation.enable-in FALSE
<commandline>:0: pin 'compensation.enable-in' is connected to a signal
No...

'halshow' reveals (as does the .hal file) that the connected signal is 'combination.on', and signals require 'gets, sets' instead of pins' 'getp, setp.' So:
% halcmd gets compensation-on
FALSE

That's good. Can I set-signal too? First try setting it to itself.
% halcmd sets compensation-on FALSE
% halcmd gets compensation-on
FALSE
Okay. Now try toggling.
% halcmd sets compensation-on TRUE
% halcmd gets compensation-on
TRUE
Okay. And does the tied-pin's value also change?
% halcmd getp compensation.enable-in
TRUE

So this appears to be one way to do it.

Inside of LinuxCNC (Machine->HAL Configuration), and even outside, the 'halshow' utility can also be used to set the value of a signal. Inside halshow's "TEST HAL command" box, 'sets compensation-on TRUE' enables compensation (or at least turns the signal on).

Please Log in or Create an account to join the conversation.

  • tommylight
  • tommylight's Avatar
  • Away
  • Moderator
  • Moderator
More
04 Jan 2023 18:40 #260946 by tommylight
@Clunc,
Reporting yourself to moderators???
That's new! :)
Chalking it to "mishaps".

Please Log in or Create an account to join the conversation.

  • clunc
  • clunc's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
04 Jan 2023 18:50 #260947 by clunc
Tommy,
I couldn't find an obvious way to contact "Any Moderator" with a request to change the title of this thread to something better matching the direction it went.

I didn't think about it very deeply or very long when I saw the "Report This" button...

I do think that a better name would be:
ScottA's Compensation Component for Uneven Table (was "Probekins"?)

I hope I didn't break the forum. :^(
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

Time to create page: 0.085 seconds
Powered by Kunena Forum