Trouble with Z axis/touch plate calibration

More
20 Sep 2023 04:26 #281205 by Sray69
So I am trying to calibrate my Z axis and touch plate but am struggling with the numbers. I seem to have two issues that may be separate or may be the same, I am not sure. 

My first issue is the touch plate offset setting. Lets say my touch plate is .5" thick. I input .5" into the 100.ngc file. I then calibrate the Z axis by clicking the Touch Off button. If  I then input the command G90 G1 Z0.0 F10 and hit enter the end mill does not quite touch the spoilboard. Lets say that it is .005" from the spoil board. What is the correct way to fix this? Do I change the Z offset in the 100.ngc file by adding the .005" to the .5"? Or is this a Z axis calibration issue?

If it is Z axis calibration, then this brings me to my second issue. Lets say I have some plywood that is .713" thick (measured from the spoilboard to the top of the board). After I touch off the Z axis, if I input the command G90 G1 Z0.713 F10 and hit enter the end mill ends up .012 higher than the top of the board. If I run G90 G1 Z0.701 F10 the end mill will just touch the board. I understand the calibration formula ((distance commanded / distance moved) * old step scale = new step scale), but the touch plate issue is stumping me. I feel like I need to correct that first so that Z0 is Z0. But if the touch plate issue is the same issue as this then I am not sure what numbers I need to use in my calibration formula.

I hope this makes some sense. I would appreciate any help here. 

 

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

More
20 Sep 2023 18:36 #281247 by Todd Zuercher
Replied by Todd Zuercher on topic Trouble with Z axis/touch plate calibration
It is difficult to say exactly where your problem might be. The first step is to rule out that you don't have any lost motion issues do to backlash or missing steps. 2nd you need to confirm your axis calibration so your movement distances are correct. Then and only then are you ready to calibrate your probe touch plate. (This is the way I would approach it.)
The following user(s) said Thank You: Sray69

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

More
20 Sep 2023 22:55 - 20 Sep 2023 22:55 #281257 by Sray69
Replied by Sray69 on topic Trouble with Z axis/touch plate calibration
 
Thanks Todd for the help.

Lets assume that I do not have any lost motion or missed steps (although I would like to know exactly how to check this). I am fairly positive that it is calibration issue as I did a quick and not so accurate calibration when I first set the machine up. I was expecting/planning to do a more accurate calibration once I worked out most of the bugs and got the machine broke-in. 

I just finished calibrating the Z-axis. I am within about .0005"-.001" tolerance. I think for wood applications that is acceptable. Now I need to figure out the touch plate. Once I get the touch plate thickness working correctly, then Z0.0 should be just touching the spoilboard (provided I have the calibration correct)?

I decided this morning to swap out my touch plate for a more accurate piece of aluminum because the touch plate I was using is a cheap one that has too much variance for me. After changing the touch plate and the offset (thickness) in the 100.ngc file I did a touch off and then ran Z0.0 and it stopped .8035" (which is the difference between the old touch plate and the new) above the spoilboard. So from what I can tell, changing the offset in 100.ngc file does not appear to do anything. So where do I actually put the offset (touch plate thickness) value for the touch plate?

Here is my 100.ngc file. My new touch plate is 1.572" thick. See the bolded section.
<pre>
o100 sub
G20
( Set current Z position to 0 so that we will always be moving down )
G10 L20 P0 Z0
( Probe to Z-.5 at F2 [Uses machine units, I work in inch, this is meant to be slow!] )
G38.2 Z-.25 f2
[b]( Set Z0 at point where probe triggers with offset of +1.004 [this is the thickness of my touch plate. You must adjust this for your plate / setup] )
(G10 L20 = Set Coordinate System // P - coordinate system 0-9 0 = Not active)
G10 L20 P1 Z1.572[/b]
( Rapid up to Z.5 above the material )
(G10 L20 P1)
(Use machine coordinates)
G90
G53 G0
(Incremental mode)
G91
(Rapid Z up 1 inches)
G0 Z1
o100 endsub
</pre>

Here is the Z axis section of my INI file.
# Generated by PNCconf at Fri Mar  3 16:12:30 2023
# Using LinuxCNC version:  Master (2.9)
# If you make changes to this file, they will be
# overwritten when you run PNCconf again

[EMC]
MACHINE = lcnc
DEBUG = 0
VERSION = 1.1

[DISPLAY]
DISPLAY = gmoccapy
EMBED_TAB_NAME = Center_panel
EMBED_TAB_LOCATION = ntb_preview
EMBED_TAB_COMMAND = gladevcp -c gladevcp  -H gvcp_call_list.hal -x {XID} gvcp-panel.ui
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
MAX_FEED_OVERRIDE = 2.000000
MAX_SPINDLE_OVERRIDE = 1.000000
MIN_SPINDLE_OVERRIDE = 0.500000
INTRO_GRAPHIC = linuxcnc.gif
INTRO_TIME = 5
PROGRAM_PREFIX = /home/shawn/linuxcnc/nc_files
INCREMENTS = 20in 10in 1in .5in .1in .05in .01in .005in .001in .0005in .0001in
POSITION_FEEDBACK = ACTUAL
# Jog Speed - Also sets Jog Speed in LCNC Axis Manual Control Screen only if lower than MAX_LINEAR_VELOCITY. Otherwise MAX_LINEAR_VELOCITY sets this value. #
DEFAULT_LINEAR_VELOCITY = 2.00000
# Sets the Jog Speed/Max Velocity in LCNC Axis Manual Control Screen #
MAX_LINEAR_VELOCITY = 2.00000
MIN_LINEAR_VELOCITY = 0.016670
DEFAULT_ANGULAR_VELOCITY = 12.000000
MAX_ANGULAR_VELOCITY = 180.000000
MIN_ANGULAR_VELOCITY = 1.6666671
EDITOR = gedit
GEOMETRY = xyz
CYCLE_TIME = 100

[FILTER]
PROGRAM_EXTENSION = .png,.gif,.jpg Greyscale Depth Image
PROGRAM_EXTENSION = .py Python Script
PROGRAM_EXTENSION = .ngc,.NGC,.nc,.NC,.txt,.tap Gcode file
png = image-to-gcode
gif = image-to-gcode
jpg = image-to-gcode
py = python

[TASK]
TASK = milltask
CYCLE_TIME = 0.010

[RS274NGC]
PARAMETER_FILE = linuxcnc.var
SUBROUTINE_PATH = macros

[EMCMOT]
EMCMOT = motmod
COMM_TIMEOUT = 1.0
SERVO_PERIOD = 2000000

[HMOT]
# **** This is for info only ****
CARD0=hm2_7i76e.0

[HAL]
HALUI = halui
HALFILE = lcnc.hal
HALFILE = custom.hal
POSTGUI_HALFILE = custom_postgui.hal
SHUTDOWN = shutdown.hal

[HALUI]
# MDI_COMMAND=o100 call

[KINS]
JOINTS = 4
KINEMATICS = trivkins coordinates=XYYZ kinstype=BOTH

[TRAJ]
COORDINATES =  XYYZ
LINEAR_UNITS = inch
ANGULAR_UNITS = degree
DEFAULT_LINEAR_VELOCITY = 0.33
MAX_LINEAR_VELOCITY = 3.33

[EMCIO]
EMCIO = io
CYCLE_TIME = 0.100
TOOL_TABLE = tool.tbl
TOOL_CHANGE_QUILL_UP = 1

[MACROS]
MACRO = touch_plate_z

#******************************************
[AXIS_X]
MAX_VELOCITY = 3.3333333333333335
MAX_ACCELERATION = 90.0
MIN_LIMIT = -0.001
MAX_LIMIT = 44.761

[JOINT_0]
TYPE = LINEAR
HOME = 0.2
FERROR = 0.5
MIN_FERROR = 0.05
MAX_VELOCITY = 3.3333333333333335
MAX_ACCELERATION = 90
# The values below should be 25% larger than MAX_VELOCITY and MAX_ACCELERATION
# If using BACKLASH compensation STEPGEN_MAXACCEL should be 100% larger.
STEPGEN_MAXVEL = 4.17
STEPGEN_MAXACCEL = 112.5
P = 500
I = 0
D = 0
FF0 = 0
FF1 = 1
FF2 = 0
BIAS = 0
DEADBAND = 0
MAX_OUTPUT = 0
# these are in nanoseconds
DIRSETUP   = 8000
DIRHOLD    = 5000
STEPLEN    = 5000
STEPSPACE  = 5000
STEP_SCALE = 10170.17
MIN_LIMIT = -0.001
MAX_LIMIT = 44.761
# Distance traveled off limit switch once switch is triggered
HOME_OFFSET = -0.100000
HOME_SEARCH_VEL = -0.833333
HOME_LATCH_VEL = 0.033333
# Speed from HOME_OFFSET to final HOME location
HOME_FINAL_VEL = 0.000000
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = YES
HOME_SEQUENCE = 1
#******************************************

#******************************************
[AXIS_Y]
MAX_VELOCITY = 3.3333333333333335
MAX_ACCELERATION = 90.0
MIN_LIMIT = -0.001
MAX_LIMIT = 49.851

[JOINT_1]
TYPE = LINEAR
HOME = 2.703
FERROR = 0.5
MIN_FERROR = 0.05
MAX_VELOCITY = 3.3333333333333335
MAX_ACCELERATION = 90
# The values below should be 25% larger than MAX_VELOCITY and MAX_ACCELERATION
# If using BACKLASH compensation STEPGEN_MAXACCEL should be 100% larger.
STEPGEN_MAXVEL = 4.17
STEPGEN_MAXACCEL = 112.5
P = 500
I = 0
D = 0
FF0 = 0
FF1 = 1
FF2 = 0
BIAS = 0
DEADBAND = 0
MAX_OUTPUT = 0
# these are in nanoseconds
DIRSETUP   = 8000
DIRHOLD    = 5000
STEPLEN    = 5000
STEPSPACE  = 5000
STEP_SCALE = -10159.9564
MIN_LIMIT = -0.001
MAX_LIMIT = 49.851
HOME_OFFSET = 0.100000
HOME_SEARCH_VEL = -0.933333
HOME_LATCH_VEL = 0.333333
HOME_FINAL_VEL = 0.900000
HOME_IGNORE_LIMITS = YES
HOME_USE_INDEX = NO
HOME_SEQUENCE = -2

[JOINT_2]
TYPE = LINEAR
HOME = 2.703
FERROR = 0.5
MIN_FERROR = 0.05
MAX_VELOCITY = 3.3333333333333335
MAX_ACCELERATION = 90
# The values below should be 25% larger than MAX_VELOCITY and MAX_ACCELERATION
# If using BACKLASH compensation STEPGEN_MAXACCEL should be 100% larger.
STEPGEN_MAXVEL = 4.17
STEPGEN_MAXACCEL = 112.5
P = 500
I = 0
D = 0
FF0 = 0
FF1 = 1
FF2 = 0
BIAS = 0
DEADBAND = 0
MAX_OUTPUT = 0
# these are in nanoseconds
DIRSETUP   = 8000
DIRHOLD    = 5000
STEPLEN    = 5000
STEPSPACE  = 5000
STEP_SCALE = -10159.9564
MIN_LIMIT = -0.001
MAX_LIMIT = 49.851
HOME_OFFSET = 0.100000
HOME_SEARCH_VEL = -0.933333
HOME_LATCH_VEL = 0.333333
HOME_FINAL_VEL = 0.900000
HOME_IGNORE_LIMITS = YES
HOME_USE_INDEX = NO
HOME_SEQUENCE = -2
#******************************************

#******************************************
[AXIS_Z]
MAX_VELOCITY = 0.5
MAX_ACCELERATION = 50.0
MIN_LIMIT = -5.251
MAX_LIMIT = 0.001

[JOINT_3]
TYPE = LINEAR
HOME = -0.2
FERROR = 0.5
MIN_FERROR = 0.05
MAX_VELOCITY = 0.5
MAX_ACCELERATION = 50.0
# The values below should be 25% larger than MAX_VELOCITY and MAX_ACCELERATION
# If using BACKLASH compensation STEPGEN_MAXACCEL should be 100% larger.
STEPGEN_MAXVEL = 0.62
STEPGEN_MAXACCEL = 62.5
P = 500
I = 0
D = 0
FF0 = 0
FF1 = 1
FF2 = 0
BIAS = 0
DEADBAND = 0
MAX_OUTPUT = 0
# these are in nanoseconds
DIRSETUP   = 8000
DIRHOLD    = 5000
STEPLEN    = 2500
STEPSPACE  = 2500
STEP_SCALE = 10304.26
MIN_LIMIT = -5.251
MAX_LIMIT = 0.001
HOME_OFFSET = -0.100000
HOME_SEARCH_VEL = 0.500000
HOME_LATCH_VEL = -0.033333
HOME_FINAL_VEL = 0.000000
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = YES
HOME_SEQUENCE = 0
#******************************************

Here is my HAL file in case it helps.
# Generated by PNCconf at Fri Mar  3 16:12:30 2023
# Using LinuxCNC version:  Master (2.9)
# If you make changes to this file, they will be
# overwritten when you run PNCconf again

loadrt [KINS]KINEMATICS
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS
loadrt hostmot2
loadrt hm2_eth board_ip="10.10.10.10" config="num_encoders=1 num_pwmgens=0 num_stepgens=4 sserial_port_0=00xxxx" 
setp    hm2_7i76e.0.watchdog.timeout_ns 5000000
loadusr -W hal_input -KRAL Logitech Gamepad F310
loadrt pid names=pid.x,pid.y1,pid.y2,pid.z,pid.s
loadrt mux16 names=jogspeed

addf hm2_7i76e.0.read          servo-thread
addf motion-command-handler   servo-thread
addf motion-controller        servo-thread
addf pid.x.do-pid-calcs       servo-thread
addf pid.y1.do-pid-calcs       servo-thread
addf pid.y2.do-pid-calcs       servo-thread
addf pid.z.do-pid-calcs       servo-thread
addf pid.s.do-pid-calcs       servo-thread
addf jogspeed                 servo-thread
addf hm2_7i76e.0.write         servo-thread
setp hm2_7i76e.0.dpll.01.timer-us -50
setp hm2_7i76e.0.stepgen.timer-number 1

# external output signals


# --- ESTOP-OUT ---
net estop-out  =>     hm2_7i76e.0.7i76.0.0.output-00

# --- ROUTER-ON ---
net coolant-mist   =>     hm2_7i76e.0.7i76.0.0.output-08

# --- DUST-COLLECTOR-ON
net coolant-flood   =>  hm2_7i76e.0.7i76.0.0.output-01

# external input signals

# --- ESTOP-EXT ---
net estop-ext     <=  hm2_7i76e.0.7i76.0.0.input-04

# --- BOTH-HOME-X ---
net both-home-x     <=  hm2_7i76e.0.7i76.0.0.input-05-not

# --- HOME-Y1 ---
net home-y1     <=  hm2_7i76e.0.7i76.0.0.input-06-not

# --- BOTH-HOME-Y2 ---
net both-home-y2     <=  hm2_7i76e.0.7i76.0.0.input-07-not

# --- BOTH-HOME-Z ---
net both-home-z     <=  hm2_7i76e.0.7i76.0.0.input-08-not

#*******************
#  AXIS X JOINT 0
#*******************

setp   pid.x.Pgain     [JOINT_0]P
setp   pid.x.Igain     [JOINT_0]I
setp   pid.x.Dgain     [JOINT_0]D
setp   pid.x.bias      [JOINT_0]BIAS
setp   pid.x.FF0       [JOINT_0]FF0
setp   pid.x.FF1       [JOINT_0]FF1
setp   pid.x.FF2       [JOINT_0]FF2
setp   pid.x.deadband  [JOINT_0]DEADBAND
setp   pid.x.maxoutput [JOINT_0]MAX_OUTPUT
setp   pid.x.error-previous-target true
# This setting is to limit bogus stepgen
# velocity corrections caused by position
# feedback sample time jitter.
setp   pid.x.maxerror 0.000500

net x-index-enable  <=> pid.x.index-enable
net x-enable        =>  pid.x.enable
net x-pos-cmd       =>  pid.x.command
net x-pos-fb        =>  pid.x.feedback
net x-output        <=  pid.x.output

# Step Gen signals/setup

setp   hm2_7i76e.0.stepgen.00.dirsetup        [JOINT_0]DIRSETUP
setp   hm2_7i76e.0.stepgen.00.dirhold         [JOINT_0]DIRHOLD
setp   hm2_7i76e.0.stepgen.00.steplen         [JOINT_0]STEPLEN
setp   hm2_7i76e.0.stepgen.00.stepspace       [JOINT_0]STEPSPACE
setp   hm2_7i76e.0.stepgen.00.position-scale  [JOINT_0]STEP_SCALE
setp   hm2_7i76e.0.stepgen.00.step_type        0
setp   hm2_7i76e.0.stepgen.00.control-type     1
setp   hm2_7i76e.0.stepgen.00.maxaccel         [JOINT_0]STEPGEN_MAXACCEL
setp   hm2_7i76e.0.stepgen.00.maxvel           [JOINT_0]STEPGEN_MAXVEL

# ---closedloop stepper signals---

net x-pos-cmd    <= joint.0.motor-pos-cmd
net x-vel-cmd    <= joint.0.vel-cmd
net x-output     => hm2_7i76e.0.stepgen.00.velocity-cmd
net x-pos-fb     <= hm2_7i76e.0.stepgen.00.position-fb
net x-pos-fb     => joint.0.motor-pos-fb
net x-enable     <= joint.0.amp-enable-out
net x-enable     => hm2_7i76e.0.stepgen.00.enable

# ---setup home / limit switch signals---

net both-home-x     =>  joint.0.home-sw-in
net both-home-x     =>  joint.0.neg-lim-sw-in
net both-home-x     =>  joint.0.pos-lim-sw-in

#*******************
#  AXIS Y1 JOINT 1
#*******************

setp   pid.y1.Pgain     [JOINT_1]P
setp   pid.y1.Igain     [JOINT_1]I
setp   pid.y1.Dgain     [JOINT_1]D
setp   pid.y1.bias      [JOINT_1]BIAS
setp   pid.y1.FF0       [JOINT_1]FF0
setp   pid.y1.FF1       [JOINT_1]FF1
setp   pid.y1.FF2       [JOINT_1]FF2
setp   pid.y1.deadband  [JOINT_1]DEADBAND
setp   pid.y1.maxoutput [JOINT_1]MAX_OUTPUT
setp   pid.y1.error-previous-target true
# This setting is to limit bogus stepgen
# velocity corrections caused by position
# feedback sample time jitter.
setp   pid.y1.maxerror 0.000500

net y1-index-enable  <=> pid.y1.index-enable
net y1-enable        =>  pid.y1.enable
net y1-pos-cmd       =>  pid.y1.command
net y1-pos-fb        =>  pid.y1.feedback
net y1-output        <=  pid.y1.output

# Step Gen signals/setup

setp   hm2_7i76e.0.stepgen.01.dirsetup        [JOINT_1]DIRSETUP
setp   hm2_7i76e.0.stepgen.01.dirhold         [JOINT_1]DIRHOLD
setp   hm2_7i76e.0.stepgen.01.steplen         [JOINT_1]STEPLEN
setp   hm2_7i76e.0.stepgen.01.stepspace       [JOINT_1]STEPSPACE
setp   hm2_7i76e.0.stepgen.01.position-scale  [JOINT_1]STEP_SCALE
setp   hm2_7i76e.0.stepgen.01.step_type        0
setp   hm2_7i76e.0.stepgen.01.control-type     1
setp   hm2_7i76e.0.stepgen.01.maxaccel         [JOINT_1]STEPGEN_MAXACCEL
setp   hm2_7i76e.0.stepgen.01.maxvel           [JOINT_1]STEPGEN_MAXVEL

# ---closedloop stepper signals---

net y1-pos-cmd    <= joint.1.motor-pos-cmd
net y1-vel-cmd    <= joint.1.vel-cmd
net y1-output     => hm2_7i76e.0.stepgen.01.velocity-cmd
net y1-pos-fb     <= hm2_7i76e.0.stepgen.01.position-fb
net y1-pos-fb     => joint.1.motor-pos-fb
net y1-enable     <= joint.1.amp-enable-out
net y1-enable     => hm2_7i76e.0.stepgen.01.enable

# ---setup home / limit switch signals---

net home-y1     =>  joint.1.home-sw-in
net home-y1     =>  joint.1.neg-lim-sw-in
# net home-y1     =>  joint.2.pos-lim-sw-in

#*******************
#  Tandem AXIS Y2 JOINT 2
#*******************

setp   pid.y2.Pgain     [JOINT_2]P
setp   pid.y2.Igain     [JOINT_2]I
setp   pid.y2.Dgain     [JOINT_2]D
setp   pid.y2.bias      [JOINT_2]BIAS
setp   pid.y2.FF0       [JOINT_2]FF0
setp   pid.y2.FF1       [JOINT_2]FF1
setp   pid.y2.FF2       [JOINT_2]FF2
setp   pid.y2.deadband  [JOINT_2]DEADBAND
setp   pid.y2.maxoutput [JOINT_2]MAX_OUTPUT
setp   pid.y2.error-previous-target true
# This setting is to limit bogus stepgen
# velocity corrections caused by position
# feedback sample time jitter.
setp   pid.y2.maxerror 0.000500

net y2-index-enable  <=> pid.y2.index-enable
net y2-enable        =>  pid.y2.enable
net y2-pos-cmd       =>  pid.y2.command
net y2-pos-fb        =>  pid.y2.feedback
net y2-output        <=  pid.y2.output

# Step Gen signals/setup for tandem axis

setp   hm2_7i76e.0.stepgen.02.dirsetup        [JOINT_2]DIRSETUP
setp   hm2_7i76e.0.stepgen.02.dirhold         [JOINT_2]DIRHOLD
setp   hm2_7i76e.0.stepgen.02.steplen         [JOINT_2]STEPLEN
setp   hm2_7i76e.0.stepgen.02.stepspace       [JOINT_2]STEPSPACE
setp   hm2_7i76e.0.stepgen.02.position-scale  [JOINT_2]STEP_SCALE
setp   hm2_7i76e.0.stepgen.02.step_type        0
setp   hm2_7i76e.0.stepgen.02.control-type     1
setp   hm2_7i76e.0.stepgen.02.maxaccel         [JOINT_2]STEPGEN_MAXACCEL
setp   hm2_7i76e.0.stepgen.02.maxvel           [JOINT_2]STEPGEN_MAXVEL

# ---closedloop stepper signals---

net y2-pos-cmd    <= joint.2.motor-pos-cmd
net y2-vel-cmd    <= joint.2.vel-cmd
net y2-output     => hm2_7i76e.0.stepgen.02.velocity-cmd
net y2-pos-fb     <= hm2_7i76e.0.stepgen.02.position-fb
net y2-pos-fb     => joint.2.motor-pos-fb
net y2-enable     <= joint.2.amp-enable-out
net y2-enable     => hm2_7i76e.0.stepgen.02.enable

# ---setup home / limit switch signals---

net both-home-y2     =>  joint.2.home-sw-in
net both-home-y2     =>  joint.2.neg-lim-sw-in
net both-home-y2     =>  joint.2.pos-lim-sw-in

#*******************
#  AXIS Z JOINT 3
#*******************

setp   pid.z.Pgain     [JOINT_3]P
setp   pid.z.Igain     [JOINT_3]I
setp   pid.z.Dgain     [JOINT_3]D
setp   pid.z.bias      [JOINT_3]BIAS
setp   pid.z.FF0       [JOINT_3]FF0
setp   pid.z.FF1       [JOINT_3]FF1
setp   pid.z.FF2       [JOINT_3]FF2
setp   pid.z.deadband  [JOINT_3]DEADBAND
setp   pid.z.maxoutput [JOINT_3]MAX_OUTPUT
setp   pid.z.error-previous-target true
# This setting is to limit bogus stepgen
# velocity corrections caused by position
# feedback sample time jitter.
setp   pid.z.maxerror 0.000500

net z-index-enable  <=> pid.z.index-enable
net z-enable        =>  pid.z.enable
net z-pos-cmd       =>  pid.z.command
net z-pos-fb        =>  pid.z.feedback
net z-output        <=  pid.z.output

# Step Gen signals/setup

setp   hm2_7i76e.0.stepgen.03.dirsetup        [JOINT_3]DIRSETUP
setp   hm2_7i76e.0.stepgen.03.dirhold         [JOINT_3]DIRHOLD
setp   hm2_7i76e.0.stepgen.03.steplen         [JOINT_3]STEPLEN
setp   hm2_7i76e.0.stepgen.03.stepspace       [JOINT_3]STEPSPACE
setp   hm2_7i76e.0.stepgen.03.position-scale  [JOINT_3]STEP_SCALE
setp   hm2_7i76e.0.stepgen.03.step_type        0
setp   hm2_7i76e.0.stepgen.03.control-type     1
setp   hm2_7i76e.0.stepgen.03.maxaccel         [JOINT_3]STEPGEN_MAXACCEL
setp   hm2_7i76e.0.stepgen.03.maxvel           [JOINT_3]STEPGEN_MAXVEL

# ---closedloop stepper signals---

net z-pos-cmd    <= joint.3.motor-pos-cmd
net z-vel-cmd    <= joint.3.vel-cmd
net z-output     => hm2_7i76e.0.stepgen.03.velocity-cmd
net z-pos-fb     <= hm2_7i76e.0.stepgen.03.position-fb
net z-pos-fb     => joint.3.motor-pos-fb
net z-enable     <= joint.3.amp-enable-out
net z-enable     => hm2_7i76e.0.stepgen.03.enable

# ---setup home / limit switch signals---

net both-home-z     =>  joint.3.home-sw-in
net both-home-z     =>  joint.3.neg-lim-sw-in
net both-home-z     =>  joint.3.pos-lim-sw-in


#******************************
# connect miscellaneous signals
#******************************

#  ---coolant signals---

net coolant-mist      <=  iocontrol.0.coolant-mist
net coolant-flood     <=  iocontrol.0.coolant-flood

#  ---probe signal---

net probe-in     =>  motion.probe-input

#limits debounce to stop false triggers
loadrt debounce cfg=1 #change to the number you want
setp debounce.0.delay 100 #this sets the delay 100 iterations of the servo-thread
addf debounce.0 servo-thread
net deb-probe-in debounce.0.0.in <= hm2_7i76e.0.7i76.0.0.input-09-not
net probe-in debounce.0.0.out
net probe-in => motion.probe-input

#  ---motion control signals---

net in-position               <=  motion.in-position
net machine-is-enabled        <=  motion.motion-enabled

#  ---digital in / out signals---

#  ---estop signals---

net estop-out     <=  iocontrol.0.user-enable-out
net estop-ext     =>  iocontrol.0.emc-enable-in

#  ---toolchange signals for custom tool changer---

net tool-number             <=  iocontrol.0.tool-prep-number
net tool-change-request     <=  iocontrol.0.tool-change
net tool-change-confirmed   =>  iocontrol.0.tool-changed
net tool-prepare-request    <=  iocontrol.0.tool-prepare
net tool-prepare-confirmed  =>  iocontrol.0.tool-prepared

Thanks

 
Last edit: 20 Sep 2023 22:55 by Sray69.

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

  • tommylight
  • tommylight's Avatar
  • Away
  • Moderator
  • Moderator
More
20 Sep 2023 23:04 #281259 by tommylight
Replied by tommylight on topic Trouble with Z axis/touch plate calibration
Todd is back ! :)
The following user(s) said Thank You: Todd Zuercher

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

More
21 Sep 2023 02:57 #281274 by Sray69
Replied by Sray69 on topic Trouble with Z axis/touch plate calibration
Alright I think I may have found my answer to my touch plate problem. I could not figure out why changing the touch plate offset in the 100.ngc file made no difference. I realized I may have been changing the wrong file. In my INI file the following section points to a different file.  
[MACROS]
MACRO = touch_plate_z

I found that file in the Macros folder. Here is the file.
o<touch_plate_z> sub

#<PlateThickness> =      .739   ( Subtract .018 from actual plate thickness! Thickness of your touch plate when proving in the Z orientation, this is used to re-calculate your new zero after touching off )
#<FastProbe> =            5     ( This is the probe speed used for your initial search, this should be a slow value to avoid damaging your tool, but doesn not need to "crawl"  )
#<SlowProbe> =             2     ( This is the probe speed for the final search, this should be a very slow value to improve the accuracy of the probing )
#<ZProbeRange> =          -.50   ( This is the distance the probe will travel on its initial search before erroring out, should be a negative value )
#<ProbeLift> =             0.10  ( This is the distance the probe will lift off the touch plate prior to starting the second search )
#<ProbeRetract> =         1.00   ( This is the distance the probe will lift from the touch plate after succesful probing to allow for removal of the plate )

( Set current Z position to 0 so that we will always be moving down )
G10 L20 P0 Z0

( Probe quickly for initial contact )
G91
F[#<FastProbe>]
G38.2 Z[#<ZProbeRange>]

( Move off plate for slow search )
F[#<SlowProbe>]
G1 Z[#<Probelift>]

( Pause for 0.5 Sec )
G4 P0.5

( Slow probe search )
g38.2 Z[-2 * #<ProbeLift>]

( Move up to set new zero )
G1 Z[#<ProbeRetract>] F[#<FastProbe>]

( Set Z0 at point where probe triggers with offset of plate thickness)
G10 L20 P0 Z[#<ProbeRetract> + #<PlateThickness>]

o<touch_plate_z> endsub

M2

I have a question about the first section "#<PlateThickness>". In the comments on that line it says "Subtract .018 from actual plate thickness!". I am wondering if that is why I always had to add .015-.020 to the thickness of the board in order for it to cut all the way through? 

Will not know until tomorrow if this will fix my touch plate issue but it is looking promising. 
 

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

More
21 Sep 2023 18:37 #281327 by Todd Zuercher
Replied by Todd Zuercher on topic Trouble with Z axis/touch plate calibration
I do not know where the "Subtract .018 from actual plate thickness!" comment comes from. I've never used these probing routines. The only Linuxcnc machines I have using a tool touch off system, I wrote the routines myself and it has been a long time since I've revisited them. I do know that I only used the measured thickness of my touch off plate as a rough starting point, then fine tuned the value until I got consistent good results. I do not know what the difference between my measured and probed plate thickness was, but I am very doubtful it was as much as 0.018", probably closer to a tenth of that.
The following user(s) said Thank You: Sray69

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

More
22 Sep 2023 14:57 #281387 by Sray69
Replied by Sray69 on topic Trouble with Z axis/touch plate calibration
I am not sure where it came from either. When I input the actual thickness and I go to Z0.0 it goes .007" into the spoilboard. If I subtract .007" from the actual thickness and input that then everything is good. I ran a few jobs after and it was dead on. I have no idea why the discrepancy. The calibration seems to be good.

You had mentioned lost steps/motion. How do I go about checking for that?

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

More
23 Sep 2023 18:13 - 23 Sep 2023 19:11 #281495 by Sray69
Replied by Sray69 on topic Trouble with Z axis/touch plate calibration
Since calibrating and setting up the touch plate as mentioned earlier, I have had one instance where when I ran Z0.0 the tip of the end mill stopped just below the spoilboard. I did not measure the distance but by the looks of it it looked like about .007" which is what I had adjusted for in a previous step. This happened after I HOMED the machine and restarted LCNC.

After I touched off the Z axis again, everything was fine. I am still doing research trying to see if I can find a cause or a way to reproduce. I wanted to check to see if there are any missed steps/motion. I found in my research to check some settings in the INI file. Not exactly sure what looks good or bad or suspect. Was hoping maybe someone can look over my Z-axis settings (below) to see if anything is questionable?

My setup:
  • Nema23 on a leadscrew/linear rail Z-axis.
  • DM860T drivers
    • Current: 
      • REF: 3.14A
      • Peak: 3.77A
    • Pulse:
      • Pulse/rev: 2000

The gantry and Z-axis is solid with no slop/movement. The Z-axis seems to run very smooth with no grinding or odd sounds. There is no visible signs of missed steps in its movement either. The one thing I have always noticed since I got this thing running is that the Z-axis seems to run slower than I would expect (same max speed both up and down). The MAX_ACCEL is set to 50 but it does not seem to move anywhere near that. I would guess that it maxes out at about 20 or so. Not sure if this is an issue or not.

[AXIS_Z]
MAX_VELOCITY = 0.5
MAX_ACCELERATION = 50.0
MIN_LIMIT = -5.251
MAX_LIMIT = 0.001

[JOINT_3]
TYPE = LINEAR
HOME = -0.2
FERROR = 0.5
MIN_FERROR = 0.05
MAX_VELOCITY = 0.5
MAX_ACCELERATION = 50.0
# The values below should be 25% larger than MAX_VELOCITY and MAX_ACCELERATION
# If using BACKLASH compensation STEPGEN_MAXACCEL should be 100% larger.
STEPGEN_MAXVEL = 0.62
STEPGEN_MAXACCEL = 62.5
P = 500
I = 0
D = 0
FF0 = 0
FF1 = 1
FF2 = 0
BIAS = 0
DEADBAND = 0
MAX_OUTPUT = 0
# these are in nanoseconds
DIRSETUP   = 8000
DIRHOLD    = 5000
STEPLEN    = 2500
STEPSPACE  = 2500
STEP_SCALE = 10178.175
MIN_LIMIT = -5.251
MAX_LIMIT = 0.001
HOME_OFFSET = -0.100000
HOME_SEARCH_VEL = 0.500000
HOME_LATCH_VEL = -0.033333
HOME_FINAL_VEL = 0.000000
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = YES
HOME_SEQUENCE = 0
#******************************************
Last edit: 23 Sep 2023 19:11 by Sray69. Reason: Had to fix because the formatting gets screwed up every time you try to edit a post

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

More
24 Sep 2023 04:51 #281534 by Sray69
Replied by Sray69 on topic Trouble with Z axis/touch plate calibration
So I spent quite a bit of time today trying to figure out a pattern to my Z-axis issue. I thought I had something but it is inconsistent. So far every time that it seems to lose its settings is after a complete restart of the CNC and LCNC. But not every time. Here are a couple examples of what I observed today.

I had touched off the Z-axis and everything was spot on. I did a complete restart of everything. I immediately ran Z0.0 in the MDI and the end mill stopped .01" from the spoilboard. I did a Z touch off again and everything was spot on again. 

I then tried different things like just restarting just LCNC (multiple times) but nothing changed. I did a bunch of complete restarts but nothing changed. Also in between every restart I moved all axes around at different speeds as well as at the same time just in case it had something to do with too much power being drawn from the PS. None of these things made any difference. Then out of nowhere I did a complete restart and ran Z0.0 again and the endmill dove into the spoilboard .018". I then did a touch off again and everything was good again. 

I am not sure what to do at this point. I was hoping I could find a pattern. 

Any thoughts?

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

Time to create page: 0.087 seconds
Powered by Kunena Forum