Hello, fellow robot enthusiasts. I have been reading this forum for the last 3 months and it has helped me a lot, so I would like to give something back to the community.
I installed a probe on the robot to measure the tool length.
All the tools that I use differ only in length and measuring them with the built-in KUKA functions is tedious in my opinion, so I came up with the idea of a probe.
You will need: the cheapest measuring probe from AliExpress and about 2 meters of wire.
Step 1: Ask a coworker to drill holes and screw probe to the robot in some rigid place.
Step 2: Connect the wires as shown in the attached diagram, I used out[16] as the source of 24v and in[16].
Step 3: I attach a simple program for measurement, I note that I absolutely do not know how to write in KRL and I did as I could. There is definitely room for improvement.
Maybe someone will find it useful, because it is only an hour of work and it makes life easier in my opinion.
; TOOL NUMBER - Change here
TOOL_TO_MEASURE = 5
; Additional lenght value
LENGHT_ADD = 0
;FOLD MEASURE_CYCLE
; Probe turn on
$OUT[16] = TRUE
;FOLD BASE_AND_TOOL_UPDATE
; Load base
$BASE = BASE_DATA[32]
; Make sure Tool data is correct
TOOL_DATA[TOOL_TO_MEASURE].X = 0 ;value to be measured
TOOL_DATA[TOOL_TO_MEASURE].Y = -0.3 ;constant
TOOL_DATA[TOOL_TO_MEASURE].Z = 106.6 ;constant
TOOL_DATA[TOOL_TO_MEASURE].A = 0 ;constant
TOOL_DATA[TOOL_TO_MEASURE].B = -90 ;constant
TOOL_DATA[TOOL_TO_MEASURE].C = 0 ;constant
BAS(#TOOL,TOOL_TO_MEASURE)
$TOOL = TOOL_DATA[TOOL_TO_MEASURE]
BAS(#BASE,32)
; To set 'Tool On Robot' Mode
$IPO_MODE = #BASE
;ENDFOLD (BASE_AND_TOOL_UPDATE)
; Pre-position tool near the probe
PTP {X 500, Y 0, Z 0, A 0, B 90, C 0, E1 0, E2 -3081 ,S'B110',T'B111011'}
;Declare interrupt with priority 20
GLOBAL INTERRUPT DECL 20 WHEN $IN[16]==FALSE DO SUB() ;
;Start measurement
INTERRUPT ON 20
$VEL.CP = 0.012 ;most likely you will need to change this
LIN_REL {X -200} ;move in direction of the probe
INTERRUPT OFF 20
END
DEF SUB()
;brake
BRAKE
; save current position in x axis, add compenstation
TOOL_DATA[TOOL_TO_MEASURE].X = $POS_ACT.X + LENGHT_ADD
;Update tool data
$TOOL = TOOL_DATA[TOOL_TO_MEASURE]
;Move away from probe
$VEL.CP = 0.15
LIN_REL {X 50}
;Turn off the probe
$OUT[16] = FALSE
;ENDFOLD (MEASURE_CYCLE)
END
Display More
To make the whole program work, I set base[32] y,z by eye in the middle of the probe and x0 exactly where the tool breaks the circuit in the probe.
The attached program zeros the tool axis that I want to measure, so if we stop the tool in the place where the probe circuit is broken, the coordinate (in my case X) will be exactly the value that I want to enter in the tool table.
I checked several times and the repeatability of the measurements is about 0.03 mm with $VEL.CP = 0.004
EDIT: Im too stupid to attach images, sorry