Solidcam/Solidprobe

More
27 Nov 2018 03:01 #121424 by biqut2
Solidcam/Solidprobe was created by biqut2
Just wanted to chime in to say I've been using ncgui macros for probing for a while now but on a whim decided to start adding LinuxCNC compatible probing routines into my Solidcam postprocessor. I've spent an afternoon tirelessly typing away at the keyboard. If anyone is interested I'm happy to share and give back to the community. Also, proofreading to correct what I am sure are numerous typos is always a good thing too. Last but not least, if anyone is knowledgeable and knows of a more efficient way to write/organize the code that can't hurt either.
More
27 Nov 2018 06:27 #121453 by tommylight
Replied by tommylight on topic Solidcam/Solidprobe
You should post it here, someone might find it useful and help with it.
Thank you.
More
27 Nov 2018 11:38 #121468 by biqut2
Replied by biqut2 on topic Solidcam/Solidprobe
I definitely will. It'll be this afternoon before I can get to my laptop again.wasnt sure if it'd be better to just copy and past the code or upload it to a repository for editing.
More
28 Nov 2018 00:42 - 29 Nov 2018 03:38 #121507 by biqut2
Replied by biqut2 on topic Solidcam/Solidprobe
Here is what I typed up yesterday. Got out to shop to test some of it tonight and the z touch, x touch, and y boss work as expected. They had a few typos that I had to correct so I fully expect there to be others as well.

EDIT: 2018/11/28 updated code
;------------------- LINUXCNC 2.7 - PROBE SECTION BEGIN

@start_probe
	;feed_rate defined in solidcam, change other values to suit
	probe_feed_rate = feed_rate
	search_feed_rate = 15
	rapid_feed_rate = 60
	latch_distance = 0.050

        if bTlchg
	    spin = 0
            call @usr_ct
            bTlchg = false
        endif
endp

;-------------------

@misc_act 
	;message
endp

;-------------------

@move_prb
	{nl,'(Move Probe)'}
	{nl,'G01 X'xpos' Y'ypos' Z'zpos' F'rapid_feed_rate}
	{nl,''}
endp

;-------------------

@line_prb 
	{nl,'(Line-up Probe)'}
	{nl,'G38.3 X'xpos' Y'ypos' Z'zpos' F'search_feed_rate}
	{nl,''}
endp

;-------------------

@prb_cyc_xyz_plan

if ProbeCycle eq 'PRB_X_PLANE' and ActionProbeType eq 1
	{nl,'(Probing X Plane)'}
	if PRB_Dir eq -1
		{nl,'G38.2 X'PRB_TP1_X' Y'PRB_TP1_Y' Z'PRB_TP1_Z' F'search_feed_rate' (Searching)'}
		{nl,'G01 X[#5420+'latch_distance'] Y'ypos' Z'zpos' F'rapid_feed_rate' (Retracting)'}
		{nl,'G38.2 X'PRB_TP1_X' Y'PRB_TP1_Y' Z'PRB_TP1_Z' F'probe_feed_rate' (Probing)'}
		{nl,'G10 L20 P['mac_number'-1] X[#5061+#4002] (Updating Postion)'}
	endif
	if PRB_Dir eq 1
		{nl,'G38.2 X'PRB_TP1_X' Y'PRB_TP1_Y' Z'PRB_TP1_Z' F'search_feed_rate' (Searching)'}
		{nl,'G01 X[#5420-'latch_distance'] Y'ypos' Z'zpos' F'rapid_feed_rate' (Retracting)'}
		{nl,'G38.2 X'PRB_TP1_X' Y'PRB_TP1_Y' Z'PRB_TP1_Z' F'probe_feed_rate' (Probing)'}
		{nl,'G10 L20 P['mac_number'-1] X[#5061-#4003] (Updating Postion)'}
	endif
endif

if ProbeCycle eq 'PRB_Y_PLANE' and ActionProbeType eq 1
	{nl,'(Probing Y Plane)'}
	if PRB_Dir eq -1
		{nl,'G38.2 X'PRB_TP1_X' Y'PRB_TP1_Y' Z'PRB_TP1_Z' F'search_feed_rate' (Searching)'}
		{nl,'G01 X'xpos' Y[#5421+'latch_distance'] Z'zpos' F'rapid_feed_rate' (Retracting)'}
		{nl,'G38.2 X'PRB_TP1_X' Y'PRB_TP1_Y' Z'PRB_TP1_Z' F'probe_feed_rate' (Probing)'}
		{nl,'G10 L20 P['mac_number'-1] Y[#5062+#4004] (Updating Postion)'}
	endif
	if PRB_Dir eq 1
		{nl,'G38.2 X'PRB_TP1_X' Y'PRB_TP1_Y' Z'PRB_TP1_Z' F'search_feed_rate' (Searching)'}
		{nl,'G01 X'xpos' Y[#5421-'latch_distance'] Z'zpos' F'rapid_feed_rate' (Retracting)'}
		{nl,'G38.2 X'PRB_TP1_X' Y'PRB_TP1_Y' Z'PRB_TP1_Z' F'probe_feed_rate' (Probing)'}
		{nl,'G10 L20 P['mac_number'-1] Y[#5062-#4005] (Updating Postion)'}
	endif
endif

if ProbeCycle eq 'PRB_Z_PLANE' and ActionProbeType eq 1
	{nl,'(Probing Z Plane)'}
	{nl,'G38.2 X'PRB_TP1_X' Y'PRB_TP1_Y' Z'PRB_TP1_Z' F'search_feed_rate' (Searching)'}
	{nl,'G01 X'xpos' Y'ypos' Z[#5422+'latch_distance'] F'rapid_feed_rate' (Retracting)'}
	{nl,'G38.2 X'PRB_TP1_X' Y'PRB_TP1_Y' Z'PRB_TP1_Z' F'probe_feed_rate' (Probing)'}
	{nl,'G10 L20 P['mac_number'-1] Z#5063 (Updating Postion)'}
endif

{nl,'G01 Z'clearance_plane' F'rapid_feed_rate' (Clearance Move)'}
{nl,''}

endp

;-------------------

@prb_cyc_bos_pckt

if ProbeCycle eq 'PRB_BOSS' and ActionProbeType eq 1 and PRB_AlongAxis eq 'X'
	{nl,'(Probing Boss Along X)'}
	{nl,'G38.3 X['PRB_TP1_X'-'PRB_RetractDist'] F'rapid_feed_rate' (Move Probe)'}
	{nl,'G38.3 Z'PRB_TP1_Z' F'search_feed_rate' (Line-up Probe)'}
	{nl,'G38.2 X'PRB_TP1_X' F'search_feed_rate' (Searching)'}
	{nl,'G01 X[#5420-'latch_distance'] F'rapid_feed_rate' (Retracting)'}
	{nl,'G38.2 X'PRB_TP1_X' F'probe_feed_rate' (Probing)'}
	{nl,'#<x_negative> = [#5061+#4003]'}
	{nl,'G01 X[#5420-'latch_distance'] F'rapid_feed_rate' (Retracting)'}
	{nl,'G01 Z'clearance_plane' F'rapid_feed_rate' (Clearance Move)'}
	{nl, ''}
	{nl,'G38.3 X['PRB_TPX1_X'+'PRB_RetractDist'] F'rapid_feed_rate' (Move Probe)'}
	{nl,'G38.3 Z'PRB_TP1_Z' F'search_feed_rate' (Line-up Probe)'}
	{nl,'G38.2 X'PRB_TPX1_X' F'search_feed_rate' (Searching)'}
	{nl,'G01 X[#5420+'latch_distance'] F'rapid_feed_rate' (Retracting)'}
	{nl,'G38.2 X'PRB_TPX1_X' F'probe_feed_rate' (Probing)'}
	{nl,'#<x_positive> = [#5061-#4002]'}
	{nl,'G01 X[#5420+'latch_distance'] F'rapid_feed_rate' (Retracting)'}
	{nl,'G01 Z'clearance_plane' F'rapid_feed_rate' (Clearance Move)'}
	{nl, ''}
	{nl,'G38.3 X[[#<x_negative>+#<x_positive>]/2] F'rapid_feed_rate' (Move Probe)'}
	{nl,'G10 L20 P['mac_number'-1] X'xhpos' (Updating Position)'}
	{nl, ''}
endif

if ProbeCycle eq 'PRB_BOSS' and ActionProbeType eq 1 and PRB_AlongAxis eq 'Y'
	{nl,'(Probing Boss Along Y)'}
	{nl,'G38.3 Y['PRB_TPY2_Y'+'PRB_RetractDist'] F'rapid_feed_rate' (Move Probe)'}
	{nl,'G38.3 Z'PRB_TP2_Z' F'search_feed_rate' (Line-up Probe)'}
	{nl,'G38.2 Y'PRB_TPY2_Y' F'search_feed_rate' (Searching)'}
	{nl,'G01 Y[#5421+'latch_distance'] F'rapid_feed_rate' (Retracting)'}
	{nl,'G38.2 Y'PRB_TPY2_Y' F'probe_feed_rate' (Probing)'}
	{nl,'#<y_positive> = [#5062-#4004]'}
	{nl,'G01 Y[#5421+'latch_distance'] F'rapid_feed_rate' (Retracting)'}
	{nl,'G01 Z'clearance_plane' F'rapid_feed_rate' (Clearance Move)'}
	{nl, ''}
	{nl,'G38.3 Y['PRB_TP2_Y'-'PRB_RetractDist'] F'rapid_feed_rate' (Move Probe)'}
	{nl,'G38.3 Z'PRB_TP2_Z' F'search_feed_rate' (Line-up Probe)'}
	{nl,'G38.2 Y'PRB_TP2_Y' F'search_feed_rate' (Searching)'}
	{nl,'G01 Y[#5421-'latch_distance'] F'rapid_feed_rate' (Retracting)'}
	{nl,'G38.2 Y'PRB_TP2_Y' F'probe_feed_rate' (Probing)'}
	{nl,'#<y_negative> = [#5062+#4005]'}
	{nl,'G01 Y[#5421-'latch_distance'] F'rapid_feed_rate' (Retracting)'}
	{nl,'G01 Z'clearance_plane' F'rapid_feed_rate' (Clearance Move)'}
	{nl, ''}
	{nl,'G38.3 Y[[#<y_negative>+#<y_positive>]/2] F'rapid_feed_rate' (Move Probe)'}
	{nl,'G10 L20 P['mac_number'-1] Y'yhpos' (Updating Position)'}
	{nl, ''}
endif

if ProbeCycle eq 'PRB_BOSS' and ActionProbeType eq 1 and PRB_AlongAxis eq 'XY'
	{nl,'(Probing Boss Along X)'}
	{nl,'G38.3 X['PRB_TP1_X'-'PRB_RetractDist'] F'rapid_feed_rate' (Move Probe)'}
	{nl,'G38.3 Z'PRB_TP1_Z' F'search_feed_rate' (Line-up Probe)'}
	{nl,'G38.2 X'PRB_TP1_X' F'search_feed_rate' (Searching)'}
	{nl,'G01 X[#5420-'latch_distance'] F'rapid_feed_rate' (Retracting)'}
	{nl,'G38.2 X'PRB_TP1_X' F'probe_feed_rate' (Probing)'}
	{nl,'#<x_negative> = [#5061+#4003]'}
	{nl,'G01 X[#5420-'latch_distance'] F'rapid_feed_rate' (Retracting)'}
	{nl,'G01 Z'clearance_plane' F'rapid_feed_rate' (Clearance Move)'}
	{nl, ''}
	{nl,'G38.3 X['PRB_TPX1_X'+'PRB_RetractDist'] F'rapid_feed_rate' (Move Probe)'}
	{nl,'G38.3 Z'PRB_TP1_Z' F'search_feed_rate' (Line-up Probe)'}
	{nl,'G38.2 X'PRB_TPX1_X' F'search_feed_rate' (Searching)'}
	{nl,'G01 X[#5420+'latch_distance'] F'rapid_feed_rate' (Retracting)'}
	{nl,'G38.2 X'PRB_TPX1_X' F'probe_feed_rate' (Probing)'}
	{nl,'#<x_positive> = [#5061-#4002]'}
	{nl,'G01 X[#5420+'latch_distance'] F'rapid_feed_rate' (Retracting)'}
	{nl,'G01 Z'clearance_plane' F'rapid_feed_rate' (Clearance Move)'}
	{nl, ''}
	{nl,'G38.3 X[[#<x_negative>+#<x_positive>]/2] F'rapid_feed_rate' (Move Probe)'}
	{nl,'G10 L20 P['mac_number'-1] X'xhpos' (Updating Position)'}
	{nl, ''}
	{nl,'(Probing Boss Along Y)'}
	{nl,'G38.3 Y['PRB_TPY2_Y'+'PRB_RetractDist'] F'rapid_feed_rate' (Move Probe)'}
	{nl,'G38.3 Z'PRB_TP2_Z' F'search_feed_rate' (Line-up Probe)'}
	{nl,'G38.2 Y'PRB_TPY2_Y' F'search_feed_rate' (Searching)'}
	{nl,'G01 Y[#5421+'latch_distance'] F'rapid_feed_rate' (Retracting)'}
	{nl,'G38.2 Y'PRB_TPY2_Y' F'probe_feed_rate' (Probing)'}
	{nl,'#<y_positive> = [#5062-#4004]'}
	{nl,'G01 Y[#5421+'latch_distance'] F'rapid_feed_rate' (Retracting)'}
	{nl,'G01 Z'clearance_plane' F'rapid_feed_rate' (Clearance Move)'}
	{nl, ''}
	{nl,'G38.3 Y['PRB_TP2_Y'-'PRB_RetractDist'] F'rapid_feed_rate' (Move Probe)'}
	{nl,'G38.3 Z'PRB_TP2_Z' F'search_feed_rate' (Line-up Probe)'}
	{nl,'G38.2 Y'PRB_TP2_Y' F'search_feed_rate' (Searching)'}
	{nl,'G01 Y[#5421-'latch_distance'] F'rapid_feed_rate' (Retracting)'}
	{nl,'G38.2 Y'PRB_TP2_Y' F'probe_feed_rate' (Probing)'}
	{nl,'#<y_negative> = [#5062+#4005]'}
	{nl,'G01 Y[#5421-'latch_distance'] F'rapid_feed_rate' (Retracting)'}
	{nl,'G01 Z'clearance_plane' F'rapid_feed_rate' (Clearance Move)'}
	{nl, ''}
	{nl,'G38.3 Y[[#<y_negative>+#<y_positive>]/2] F'rapid_feed_rate' (Move Probe)'}
	{nl,'G10 L20 P['mac_number'-1] Y'yhpos' (Updating Position)'}
	{nl, ''}
endif

if ProbeCycle eq 'PRB_POCKET' and ActionProbeType eq 1 and PRB_AlongAxis eq 'X'
	{nl,'G38.2 X'PRB_TPX1_X' F'search_feed_rate' (Searching)'}
	{nl,'G01 X[#5420-'latch_distance'] F'rapid_feed_rate' (Retracting)'}
	{nl,'G38.2 X'PRB_TPX1_X' F'probe_feed_rate' (Probing)'}
	{nl,'#<x_positive> = [#5061+#4003]'}
	{nl,'G01 X[#5420-'latch_distance'] F'rapid_feed_rate' (Retracting)'}
	{nl, ''}
	{nl,'G38.2 X'PRB_TP1_X' F'search_feed_rate' (Searching)'}
	{nl,'G01 X[#5420+'latch_distance'] F'rapid_feed_rate' (Retracting)'}
	{nl,'G38.2 X'PRB_TP1_X' F'probe_feed_rate' (Probing)'}
	{nl,'#<x_negative> = [#5061-#4002]'}
	{nl,'G01 X[#5420+'latch_distance'] F'rapid_feed_rate' (Retracting)'}
	{nl, ''}
	{nl,'G38.3 X[[#<x_negative>+#<x_positive>]/2] F'rapid_feed_rate' (Move Probe)'}
	{nl,'G10 L20 P['mac_number'-1] X'xhpos' (Updating Position)'}
	{nl, ''}
endif

if ProbeCycle eq 'PRB_POCKET' and ActionProbeType eq 1 and PRB_AlongAxis eq 'Y'
	{nl,'(Probing Pocket Along Y)'}
	{nl,'G38.2 Y'PRB_TPY2_Y' F'search_feed_rate' (Searching)'}
	{nl,'G01 Y[#5421-'latch_distance'] F'rapid_feed_rate' (Retracting)'}
	{nl,'G38.2 Y'PRB_TPY2_Y' F'probe_feed_rate' (Probing)'}
	{nl,'#<y_positive> = [#5062+#4005]'}
	{nl,'G01 Y[#5421-'latch_distance'] F'rapid_feed_rate' (Retracting)'}
	{nl, ''}
	{nl,'G38.2 Y'PRB_TP2_Y' F'search_feed_rate' (Searching)'}
	{nl,'G01 Y[#5421+'latch_distance'] F'rapid_feed_rate' (Retracting)'}
	{nl,'G38.2 Y'PRB_TP2_Y' F'probe_feed_rate' (Probing)'}
	{nl,'#<y_negative> = [#5062-#4004]'}
	{nl,'G01 Y[#5421+'latch_distance'] F'rapid_feed_rate' (Retracting)'}
	{nl, ''}
	{nl,'G38.3 Y[[#<y_negative>+#<y_positive>]/2] F'rapid_feed_rate' (Protected Move)'}
	{nl,'G10 L20 P['mac_number'-1] Y'yhpos' (Updating Position)'}
	{nl, ''}
endif

if ProbeCycle eq 'PRB_POCKET' and ActionProbeType eq 1 and PRB_AlongAxis eq 'XY'
	{nl,'(Probing Pocket Along X)'}
	{nl,'G38.2 X'PRB_TPX1_X' F'search_feed_rate' (Searching)'}
	{nl,'G01 X[#5420-'latch_distance'] F'rapid_feed_rate' (Retracting)'}
	{nl,'G38.2 X'PRB_TPX1_X' F'probe_feed_rate' (Probing)'}
	{nl,'#<x_positive> = [#5061+#4003]'}
	{nl,'G01 X[#5420-'latch_distance'] F'rapid_feed_rate' (Retracting)'}
	{nl, ''}
	{nl,'G38.2 X'PRB_TP1_X' F'search_feed_rate' (Searching)'}
	{nl,'G01 X[#5420+'latch_distance'] F'rapid_feed_rate' (Retracting)'}
	{nl,'G38.2 X'PRB_TP1_X' F'probe_feed_rate' (Probing)'}
	{nl,'#<x_negative> = [#5061-#4002]'}
	{nl,'G01 X[#5420+'latch_distance'] F'rapid_feed_rate' (Retracting)'}
	{nl, ''}
	{nl,'G38.3 X[[#<x_negative>+#<x_positive>]/2] F'rapid_feed_rate' (Move Probe)'}
	{nl,'G10 L20 P['mac_number'-1] X'xhpos' (Updating Position)'}
	{nl, ''}
	{nl,'(Probing Pocket Along Y)'}
	{nl,'G38.2 Y'PRB_TPY2_Y' F'search_feed_rate' (Searching)'}
	{nl,'G01 Y[#5421-'latch_distance'] F'rapid_feed_rate' (Retracting)'}
	{nl,'G38.2 Y'PRB_TPY2_Y' F'probe_feed_rate' (Probing)'}
	{nl,'#<y_positive> = [#5062+#4005]'}
	{nl,'G01 Y[#5421-'latch_distance'] F'rapid_feed_rate' (Retracting)'}
	{nl, ''}
	{nl,'G38.2 Y'PRB_TP2_Y' F'search_feed_rate' (Searching)'}
	{nl,'G01 Y[#5421+'latch_distance'] F'rapid_feed_rate' (Retracting)'}
	{nl,'G38.2 Y'PRB_TP2_Y' F'probe_feed_rate' (Probing)'}
	{nl,'#<y_negative> = [#5062-#4004]'}
	{nl,'G01 Y[#5421+'latch_distance'] F'rapid_feed_rate' (Retracting)'}
	{nl, ''}
	{nl,'G38.3 Y[[#<y_negative>+#<y_positive>]/2] F'rapid_feed_rate' (Protected Move)'}
	{nl,'G10 L20 P['mac_number'-1] Y'yhpos' (Updating Position)'}
	{nl, ''}
endif

endp
;-------------------

@prb_cyc_cor
	;WORKING
	{nl,'(Probing Corner)'}
	{nl,'G38.3 X[[#5420+'PRB_RetractDist_X'+'PRB_DX1']*'PRB_Dir_X'] F'search_feed_rate' (Protected Move)'}
	{nl,'G38.2 Y[#5421+['PRB_RetractDist_Y'*'PRB_Dir_Y']] F'search_feed_rate' (Searching)'}
	{nl,'G01 Y[#5421-['latch_distance'*'PRB_Dir_Y']] F'rapid_feed_rate' (Retracting)'}
	{nl,'G38.2 Y[#5421+['PRB_RetractDist_Y'*'PRB_Dir_Y']] F'probe_feed_rate' (Probing)'}
	{nl,'G10 L20 P['mac_number'-1] Y[#5062-#4005] (Updating Postion)'}
	{nl,'G01 X'xpos' Y'ypos' Z'zpos' F'search_feed_rate}
	{nl,''}
	{nl,'G38.3 Y[[#5421+'PRB_RetractDist_Y'+'PRB_DY1']*'PRB_Dir_Y'] F'search_feed_rate' (Protected Move)'}
	{nl,'G38.2 X[#5420+['PRB_RetractDist_X'*'PRB_Dir_X']] F'search_feed_rate' (Searching)'}
	{nl,'G01 X[#5420-['latch_distance'*'PRB_Dir_X']] F'rapid_feed_rate' (Retracting)'}
	{nl,'G38.2 X[#5420+['PRB_RetractDist_X'*'PRB_Dir_X']] F'probe_feed_rate' (Probing)'}
	{nl,'G10 L20 P['mac_number'-1] X[#5061-#4003] (Updating Postion)'}
	{nl,'G01 X'xpos' Y'ypos' Z'zpos' F'search_feed_rate}
	{nl,''}
endp

;-------------------

@prb_cyc_hol_cyl
	;TODO
endp

;-------------------

@prb_cyc_angle
	;TODO
endp

;-------------------

@end_probe
	{nl,'(End Probing)'}
endp

;------------------- LINUXCNC 2.7 - PROBE SECTION END
Last edit: 29 Nov 2018 03:38 by biqut2.
Moderators: Skullworks
Time to create page: 0.130 seconds
Powered by Kunena Forum