- Posts: 203
- Thank you received: 19
Extending existing G38.2/G38.3/G38.4/G38.5 codes
- DaBit
- Offline
- Elite Member
-
Less
More
10 years 11 months ago - 10 years 11 months ago #65870
by DaBit
Exactly. I once read about a method using rtapi_xx calls to accomplish that, but one would want a simpler interface for that to define errors and corresponding reactions.
How do the guys retrofitting 'real' machines do this? These have sensors on just about everything.
Well, that is only valid if the sensitivity of the probe is a perfect circle (or half sphere).
Which it is not in case of the regular 6-point-contact Renishaw lookalikes like mine. Although I must admit that the inaccuracies caused by that seem to be far lower than the positioning accuracy.
But I wanted to see the deviations anyway, so I had to write code for that. Normally one needs to compensate for probe tip diameter also and do the probe_point=probe_point - tip_radius anyway. Writing a component that takes in the file with N calibrations points and do the math is not that much harder than considering 4 special X+/X-/Y+/Y- cases.
Probe tip diameter is 4mm, Radius turns out quite accurate.
The same with combining probes. I wrote a component that can combine N probes into one output:
Maybe it is overkill, maybe not. The worst that can happen is that it does not provide any benefits.
Replied by DaBit on topic Extending existing G38.2/G38.3/G38.4/G38.5 codes
cmorley wrote: He means there is no status feedback in linuxcnc for these requests.
Exactly. I once read about a method using rtapi_xx calls to accomplish that, but one would want a simpler interface for that to define errors and corresponding reactions.
How do the guys retrofitting 'real' machines do this? These have sensors on just about everything.
andypugh wrote: I think you are making this too hard.
LinuxCNC supports tool offsets in all 9 axes.
Well, that is only valid if the sensitivity of the probe is a perfect circle (or half sphere).
Which it is not in case of the regular 6-point-contact Renishaw lookalikes like mine. Although I must admit that the inaccuracies caused by that seem to be far lower than the positioning accuracy.
But I wanted to see the deviations anyway, so I had to write code for that. Normally one needs to compensate for probe tip diameter also and do the probe_point=probe_point - tip_radius anyway. Writing a component that takes in the file with N calibrations points and do the math is not that much harder than considering 4 special X+/X-/Y+/Y- cases.
Probe tip diameter is 4mm, Radius turns out quite accurate.
The same with combining probes. I wrote a component that can combine N probes into one output:
Code:
PROBECOMBINE(9) HAL Component PROBECOMBINE(9)
NAME
probecombine - Combine multiple probes into one output
SYNOPSIS
loadrt probecombine [count=N|names=name1[,name2...]] [personal‐
ity=P,P,...]
DESCRIPTION
Component to combine multiple probe signals into a single out‐
put. Use the 'personality' value to determine the number of
probe inputs; range is 1-32.
The component functions as a selector switch which is actuated
by an edge on one of the probe inputs. The probe that generates
an edge is the one being sent to the output after debouncing.
If more than one probe input changes in a cycle, the result is
the logical OR of the changing probe inputs. Thus, if one is
active the output goes to '1'.
When a probe state goes from enabled to disabled, the internal
probe output is pulled to '1'. This is a valid edge, and is
reflected on the probe-out pin. This is done to notify LinuxCNC
when communications fail or another error occurs; LinuxCNC will
complain about the unexpected edge.
To prevent the situation where a failed probe that pulls the
output to '1' blocks further motion, an optional auto-deactivate
timeout can be used. The probe output will be deactivated the
timeout number of seconds after the last edge.
USAGE EXAMPLE
Say we have a toolsetter switch that is always attached and a
touchprobe that is removable. Then, a valid setup could be:
loadrt probecombine personality=2
addf probecombine.0 servo-thread
net toolsetter_sw probecombine.0.probein-00
net touchprobe_sw probecombine.0.probein-01
net touchprobe_enabled probecombine.0.probe-ready-01
net pi probecombine.0.probe-out motion.probe-input
setp probecombine.0.enable 1
FUNCTIONS
probecombine.N (requires a floating-point thread)
PINS
probecombine.N.probein-MM bit in (MM=00..personality & 0x1f)
Probe input
probecombine.N.probe-activelevel-MM bit in (MM=00..personality &
0x1f) (default: 1)
Probe active level. Usually '1' for high active
probecombine.N.probe-ready-MM bit in (MM=00..personality & 0x1f)
(default: 1)
Probe ready signal. '1' when the probe is ready, '0' when
not
probecombine.N.enable bit in (default: 0)
Enable module. Set to '1' after everything is configured
to prevent false edges
probecombine.N.probe-out bit out
Combined probe output, connect to motion.probe-input
PARAMETERS
probecombine.N.debounce-cycles u32 rw (default: 3)
Number of cycles used for debouncing
probecombine.N.auto-deactivate float rw (default: 10.0)
Auto-deactivate probe output this amount of seconds after
the last edge. This is used to prevent a deacti‐
vated/removed probe from tying the probe output to high
and generate errors downstream in LinuxCNC. Set to a neg‐
ative number to deactivate
probecombine.N.dbg-probestate u32 r
For debugging: combined probe state
AUTHOR
DaBit (dabitATicecoldcomputingDOTcom)
LICENSE
GPL
LinuxCNC Documentation 2015-11-27 PROBECOMBINE(9)
Maybe it is overkill, maybe not. The worst that can happen is that it does not provide any benefits.
Last edit: 10 years 11 months ago by DaBit.
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
-
Less
More
- Posts: 19899
- Thank you received: 4655
10 years 11 months ago #65872
by andypugh
How about:
linuxcnc.org/docs/2.7/html/man/man9/message.9.html
Replied by andypugh on topic Extending existing G38.2/G38.3/G38.4/G38.5 codes
DaBit wrote: Exactly. I once read about a method using rtapi_xx calls to accomplish that, but one would want a simpler interface for that to define errors and corresponding reactions.
How about:
linuxcnc.org/docs/2.7/html/man/man9/message.9.html
The following user(s) said Thank You: DaBit
Please Log in or Create an account to join the conversation.
- DaBit
- Offline
- Elite Member
-
Less
More
- Posts: 203
- Thank you received: 19
10 years 11 months ago #65879
by DaBit
Replied by DaBit on topic Extending existing G38.2/G38.3/G38.4/G38.5 codes
Nice, thanks!
BTW: results of probing the ring and producing calibration data. Graph shows the deviation of the measured diameter of 12.0027mm vs angle
This is fairly repeatable, also at different locations on the table. The probe seems far more accurate than the positioning since I cannot detect the lobing so all this is less useful than I initially thought it would be, but compensating still doesn't hurt.
BTW: results of probing the ring and producing calibration data. Graph shows the deviation of the measured diameter of 12.0027mm vs angle
This is fairly repeatable, also at different locations on the table. The probe seems far more accurate than the positioning since I cannot detect the lobing so all this is less useful than I initially thought it would be, but compensating still doesn't hurt.
Please Log in or Create an account to join the conversation.
Time to create page: 0.135 seconds