Probe Calibration Renishaw MP12

More
17 Jul 2017 10:09 - 24 Jul 2017 20:17 #95875 by plopes9000
plopes9000 created the topic: Probe Calibration Renishaw MP12
Motivation
Having had a Renishaw MP12 proble for a while, I decided it was time to write some gcode to properly calibrate it after having searched the web without success. The closest thing I could find was a post from eneias_eringer on the topic 18775-probe-for-center-of-hole here on the forum, calibracao.ngc, Buying Renishaw's calibration cycles was of course not an option for me. Running a probe without calibration does not make justice to a probe, much less to a Renishaw.

Concept
With the spindle manually aligned with the centre of the ring and with a precise ring with known diameter any measured radius deviation while touching off at a particular angle represents the trigger error of the probe plus probe run-out plus machine tolerances. When this deviation per angle is stored as calibration values and used when actually probing a part at an equal angle, accurate readings are possible. Probing should then always be carried out with the probe orientation used during calibration. Without this basic calibration any 3D probe is inaccurate, even a Renishaw.

Calibration Procedure - see video
1) A precision ring is placed perpendicular to the spindle axis on the mill table - goes without saying.
2) The spindle is manually aligned to the centre of the ring using a preferred method - I use a dial indicator mounted on the spindle.
3) MDI T99 M6 - in my tool table, 99 is the probe tool
4) The probe is jogged down in Z so that the probe tip is below the ring top surface
5) The NGCGUI routine p-calibrate.ngc is run with the precision ring's exact diameter as input parameter

Calibration Implementation
For the calibration, two routines are used, p-calibrate.ngc and aux-calibrate-probe-at-angle.ngc.

p-calibrate.ngc will probe the ring at 45 degrees steps (calling aux-calibrate-probe-at-angle.ngc for each angle) storing the results in the linuxcnc variables #621-#628. Note that for linuxcnc to persist #621-#628 one must manually add these variables to the linuxcnc.var file. p-calibrate.ngc reads ini parameters as below and it will validate that the probe tool is loaded..
[PROBE]
  BALL_DIAMETER  - precise value, eg, 5.99
  BACKOFF             - same as latch, e.g 1.5 (mm)
  COARSE_FEED    - eg. 700 (mm/s)
  FINE_FEED          - eg. 10 (mm/s)
  TOOL_NUMBER    - tool table probe tool number, eg. 99

aux-calibrate-probe-at-angle.ngc will do the actual probing based on input parameters, using some simple trig. Measured values are truncated to 3 digits of precision - should be changed to 4 for machines in imperial mode.

Probing Procedure
1) MDI T99 M6 - Load probe tool
2) Call aux-probe-at-angle-args [#<angle>] [#<distance>] [#<backoff>] [#<fine_feed>] [#<search_feed>] [#<rapid_feed>]
or
Call aux-probe-at-angle [#<angle>] [#<distance>]
3) The measured probed distance available as a return value, hence #5001

Probing Implementation
There are two base routines to probe using the calibration data.
aux-probe-at-angle-args [#<angle>] [#<distance>] [#<backoff>] [#<fine_feed>] [#<search_feed>] [#<rapid_feed>]
aux-probe-at-angle [#<angle>] [#<distance>]

While aux-probe-at-angle-args takes all values as args, aux-probe-at-angle will read most values from the ini parameters same as p-calibrate.ngc.

Integration with Probe Screen
the files xminus, xplus, yminus, yplus would look like this just changing the first argument, the angle:
o<xminus> sub
o<aux-probe-at-angle-args> call [180] [#<_hal[probe.ps_probe_max]>] [#<_hal[probe.ps_probe_latch]>] [#<_hal[probe.ps_probevel]>] [#<_hal[probe.ps_searchvel]>] [#<_ini[TOOLSENSOR]RAPID_SPEED>]
(print, probe X=#5001 )
o<xminus> endsub
M2


p-calibrate.ngc
O<p-calibrate> sub (calibrate probe)
#<diam_hole>=#1 (known hole diameter)

#<diam_ball>=#<_ini[PROBE]BALL_DIAMETER>
#<backoff>=#<_ini[PROBE]BACKOFF>
#<coarse_feed>=#<_ini[PROBE]COARSE_FEED>
#<fine_feed>=#<_ini[PROBE]FINE_FEED>
#<probe_tool_number>=#<_ini[PROBE]TOOL_NUMBER>

(info: MP12 3D probe calibration - known probe, known ring hole)

M5 (Stop spindle)
o<pcheck1> if [ #5400 NE #<probe_tool_number> ]
  (debug, Please load probe - T#<probe_tool_number> M6)
  M2
o<pcheck1> endif
M65 P0 (activate probe input)


(debug, Ensure the diameters for ball and hole are precise and that the machine is in the exact center of the hole)

; capture current position
#<initial_x>=#5420
#<initial_y>=#5421
#<initial_z>=#5422
g21 g17 g40 g80 g94 g90 g49 g92.1
G0 x#<initial_x> y#<initial_y>
g91 g38.5 z-0.00001 f#<fine_feed> (check that probe is active)


;#####################################################################################
;## Measure and store trigger points in 5021..28 for 0,45, 90,135, ... 315 degrees  ##
;#####################################################################################
#<angle-step>=45
#<curr-angle>=0
#<curr-step>=0
o<base-angle-touches> do
	o<aux-calibrate-probe-at-angle> call [#<curr-angle>] [#<diam_hole>] [#<diam_ball>] [#<coarse_feed>] [#<fine_feed>]
	#[621+#<curr-step>]=#<_value>
	g90 g0 x#<initial_x> y#<initial_y>
        #<curr-step>=[#<curr-step>+1]
	#<curr-angle>=[#<curr-angle>+#<angle-step>]
o<base-angle-touches> while [ #<curr-angle> LT 360 ]

g90 (absolute distance mode)
g0 x#<initial_x> y#<initial_y>

O<p-calibrate> endsub 

M2

aux-calibrate-probe-at-angle.ngc
;#############################
; probe x,y pos and an angle
o<aux-calibrate-probe-at-angle> sub
;input params
#<angle>=#1
#<diam_hole>=#2
#<diam_ball>=#3
#<feednorm>=#4
#<feedslow>=#5
; setup vars
#<radius> = [#<diam_hole>/2]
#<radius_b> = [[#<diam_hole>/2]-8+[#<diam_ball>/2]]
#<sin_a>=sin[#<angle>]
#<cos_a>=cos[#<angle>]
#<y-pos_b> =[#<sin_a>*#<radius_b>]
#<y-pos_ok> =[#<sin_a>*#<radius>]
#<x-pos_b> =[#<cos_a>*#<radius_b>]
#<x-pos_ok> =[#<cos_a>*#<radius>]
g90 g1 x#<x-pos_b> y#<y-pos_b> f#<feednorm>
g90 g38.2 F#<feednorm> X#<x-pos_ok> Y#<y-pos_ok>
g90 g1 X#<x-pos_b> Y#<y-pos_b> f#<feednorm>
g90 g38.2 F#<feedslow> X#<x-pos_ok> Y#<y-pos_ok>
#<x-touch>=#5420
#<y-touch>=#5421
#<radius_measured>=sqrt[[#<x-touch>*#<x-touch>]+[#<y-touch>*#<y-touch>]]
o<probe-off-300-if>if[#<radius_measured> lt 0]
  #<radius_measured>=[#<radius_measured>*-1]
o<probe-off-300-if>endif
#<probe-off-angle>=[#<radius_measured>-[#<diam_hole>/2]+[#<diam_ball>/2]]
#<probe-off-angle>=[fix[#<probe-off-angle>*1000]/1000]
g90 g1 X#<x-pos_b> Y#<y-pos_b> f#<feednorm>
(debug, probe-at-angle #<angle>= #<probe-off-angle>)
o<aux-calibrate-probe-at-angle> endsub [#<probe-off-angle>]

aux-probe-at-angle.ngc
;#############################
; probe x,y pos and an angle
o<aux-probe-at-angle> sub
#<angle>=#1
#<distance>=#2
#<backoff>=#<_ini[PROBE]BACKOFF>
#<rapid_feed>=#<_ini[PROBE]RAPID_FEED>
#<search_feed>=#<_ini[PROBE]COARSE_FEED>
#<fine_feed>=#<_ini[PROBE]FINE_FEED>

call o<aux-probe-at-angle-args> [#1] [#2] [#<backoff>] [#<fine_feed>] [#<search_feed>] [#<rapid_feed>]

o<aux-probe-at-angle> endsub [#<_value>]


aux-probe-at-angle-args.ngc
;#############################
; probe x,y pos and an angle
o<aux-probe-at-angle-args> sub
#<angle>=#1
#<distance>=#2
#<backoff>=#3
#<fine_feed>=#4
#<search_feed>=#5
#<rapid_feed>=#6

#<diam_ball>=#<_ini[PROBE]BALL_DIAMETER>
#<probe_tool_number>=#<_ini[PROBE]TOOL_NUMBER>

M5 (Stop spindle)
o<pcheck1> if [ #5400 NE #<probe_tool_number> ]
  (debug, Please load probe - T#<probe_tool_number> M6)
  M2
o<pcheck1> endif
M65 P0 (activate probe input)

#<initial_x>=#5420
#<initial_y>=#5421
#<initial_z>=#5422


M65 P0 (activate probe input)
g90 g0 x#<initial_x> y#<initial_y>
g91 g38.5 z-0.001 f#<fine_feed> (check that probe is active)

o<probe-off-301-if> if [#<distance> LT #<backoff> ]
  (debug, distance smaller than backoff value, can not make move)
  (debug, distance #<distance>, backoff #<backoff>)
  M2
o<probe-off-301-if> endif

#<offset_variable>=[fix[#<angle>/45]]
o<probe-off-302-if> if [ [#<offset_variable> NE [#<angle>/45]] or [#<offset_variable> LT 0 or #<offset_variable> GT 8] ]
  (debug, angle not in calibration #<angle>)
  M2
o<probe-off-302-if> endif

#<probe_offset>=#[621+#<offset_variable>]
o<probe-off-303-if> if [[#<probe_offset> EQ 0] or [#<probe_offset> GT [1] ] or [#<probe_offset> LT [-1] ]  ]
  (debug, probe has not been calibrated for the angle #<angle>, off number #<offset_variable> )
  M2
o<probe-off-303-if> endif

;(debug, offset_variable=#<offset_variable>, offset=#<probe_offset>)

#<sin_a>=sin[#<angle>]
#<cos_a>=cos[#<angle>]
#<y-pos_b> =[#<sin_a>*#<distance>]
#<x-pos_b> =[#<cos_a>*#<distance>]
#<y-backoff> =[#<sin_a>*#<backoff>]
#<x-backoff> =[#<cos_a>*#<backoff>]
#<y-backoff2> =[#<sin_a>*[#<backoff>+0.3]]
#<x-backoff2> =[#<cos_a>*[#<backoff>+0.3]]
#<y-comp> =[#<sin_a>*[#<probe_offset>+[#<diam_ball>/2]]]
#<x-comp> =[#<cos_a>*[#<probe_offset>+[#<diam_ball>/2]]]
g91 g38.2 x[#<x-pos_b>] y[#<y-pos_b>] f#<search_feed>
g91 g1 X[-#<x-backoff>] Y[-#<y-backoff>] f#<rapid_feed>
g91 g38.2 X[#<x-backoff2>] Y[#<y-backoff2>] f#<fine_feed>
#<x-touch>=#5420
#<y-touch>=#5421
#5001=[#<x-touch>-#<x-comp>]
#5002=[#<y-touch>-#<y-comp>]
;(debug, x=#<x-touch>, x-comp=#<x-comp> y=#<y-touch> y-comp=#<y-comp> )

g90 g0 x#<initial_x> y#<initial_y> f#<rapid_feed>

;(debug, probe-at-angle #<angle> with offset #<probe_offset>)


o<aux-probe-at-angle-args> endsub [#<probe_offset>]
Last Edit: 24 Jul 2017 20:17 by plopes9000. Reason: simplification of aux-probe-at-angle
The following user(s) said Thank You: andypugh, robh, pommen
More
17 Jul 2017 16:39 #95923 by andypugh
andypugh replied the topic: Probe Calibration Renishaw MP12
Do you have a feel for how much more accurate this is than my approach? I centred the probe tip using a DTI with the spindle turning.
More
17 Jul 2017 16:57 #95927 by plopes9000
plopes9000 replied the topic: Probe Calibration Renishaw MP12
I see variations of up to 0.06mm depending on the approach angle. The issue is not probe runout, I have my probe tip well centered using a DTI as well and in the end I rotate the probe by hand to verify. That probe runout will be cancelled by nature of the calibration is just a bonus. What really can't be compensated for without calibration is the various trigger forces required depending on the angle of approach due to the three point design of most probes. I suppose on strain gauge probes calibration won't be as required. Does 0.06mm matter? That depends on machine tolerances and required precision.
More
17 Jul 2017 18:17 #95935 by plopes9000
plopes9000 replied the topic: Probe Calibration Renishaw MP12
Check out resources.renishaw.com/en/Renishaw+touch...gy(6854)?direct=true
It goes through all aspects of touch probe accuracy.
More
18 Jul 2017 14:00 - 18 Jul 2017 14:09 #95980 by eneias_eringer
eneias_eringer replied the topic: Probe Calibration Renishaw MP12
Yes , without a calibration the error can be 0.03 to 0.06mm !!

PLopes, are you familiarized with the Renishaw Inspection Plus Cycles??? 9800 9814 9802 ??
Last Edit: 18 Jul 2017 14:09 by eneias_eringer.
More
18 Jul 2017 14:52 #95983 by plopes9000
plopes9000 replied the topic: Probe Calibration Renishaw MP12
Eneias, I'm afraid I am not. I wish I could get a look at the g-code renishaw uses in their probe cycles.
More
18 Jul 2017 16:13 #95988 by eneias_eringer
eneias_eringer replied the topic: Probe Calibration Renishaw MP12
Ok, i have a Inspection Plus convertion for linux CNC, but my Renishaw converted code is so hard to understand, becouse Linux cnc dont have a Simple GOTO , just a conditional GOTO..

But the use is identical to the Siemens Inspection plus routines
More
19 Jul 2017 21:27 #96104 by robh
robh replied the topic: Probe Calibration Renishaw MP12
hi
thanks for sharing i did see your youtube videos
this saves me abit of work to rewrite the renishaw ones.

does this do the Z also? as i have a MP700 which is true 3D probe

for Z in the renishaw all i have todo is set a datum as a known true zero reff.
then set the probe as a rougth tool length and the cycle will calibrate the length, and then the probe travel

just need the same for the tool probe now :)

and yes this does make a huge differnce on probe errors. as you dont have to clock the probe up as much just make sure you put it in the same way around all the time.. or store it in the ATC :)

thanks for the sharing your hard work
More
20 Jul 2017 07:53 #96125 by plopes9000
plopes9000 replied the topic: Probe Calibration Renishaw MP12
Hi Rob,

I haven't done the z calibration yet, XY plane probing was more critical to me, since it matters when flipping a part over - but yes z height calibration is on the todo list.

You know how it is, there are always 10 jobs being done in parallel, the one most needed or most liked gets immediate attention, the others wait ...

I'm more than happy to share, the linuxcnc community is great, a big thank you from me to everybody here at linuxcnc forum !

btw will be sharing as well the TS27r cycles soon - need some time/priority to iron out some details - atm busy with classicladder for the impact wrench power drawbar and in-between distracted with setting up ethercat.

Cheers
Moderators: Rick G
Time to create page: 0.084 seconds
Powered by Kunena Forum