Why would I get a following error only while homing (latest Linuxcnc 2.7.9)?  I 
recently added home switches to my machine.  My machine has encoders on the 
steppers on each of the 3 axes so I want to use the index pulse for home.  I 
set up the homing sequence each axis  and when I do "Home All" I get a 
following error on my Z axis (first one to home).  I played with all the 
settings and can’t get it to complete unless I set ferror and min_ferror very 
high  Also, once there is a following error I can only clear it by exiting 
Linuxcnc and restarting it.  If I just turn it back on, it immediately faults 
again with the same following error.  If I don’t home, after restarting 
Linuxcnc, I can run the Z axis (and X and Y) all day at any speed without a 
following error. 

I have tried setting the ferror and min_ferror settings to various reasonable 
values but it didn’t work.   Before adding the switches I had error=0.001 and 
min_ferror=0.0005 and never had a following error appear.  I set ferror to 2 
and min_ferror to 1 (I think those were the values) and it worked but then got 
the following error on the Y axis (the second axis homed).  The values for 
ferror and min_ferror that “worked” seem completely unreasonable given I am not 
even moving anywhere near my max velocity during homing.

I have tried changing the sign on the HOME_LATCH_VEL to make it search for 
index in the other direction but the same thing happens.  Below are my 
(current) machine hal and ini.

-Tom


———————————— ini ———————————
# Generated by PNCconf at Thu Apr  8 11:40:39 2010

[EMC]
MACHINE = EMCO
DEBUG = 0

[DISPLAY]
DISPLAY = axis
#EMBED_TAB_NAME = Camera
#EMBED_TAB_COMMAND = camview-emc -w {XID}
EDITOR = gedit
PYVCP = custom_pyvcp.xml
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
MAX_FEED_OVERRIDE = 2.0
MAX_SPINDLE_OVERRIDE = 1.5
MIN_SPINDLE_OVERRIDE = 0.500000
INTRO_GRAPHIC = linuxcnc.gif
INTRO_TIME = 2
PROGRAM_PREFIX = /home/tom/linuxcnc/nc_files
INCREMENTS = .1in .05in .01in .005in .001in .0005in .0001in
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
DEFAULT_LINEAR_VELOCITY = 0.250000
MAX_LINEAR_VELOCITY = 1.000000
MIN_LINEAR_VELOCITY = 0.010000
DEFAULT_ANGULAR_VELOCITY = 0.250000
MAX_ANGULAR_VELOCITY = 1.000000
MIN_ANGULAR_VELOCITY = 0.010000
GEOMETRY = xyz
#GEOMETRY = xyza

[FILTER]
PROGRAM_EXTENSION = .png,.gif,.jpg Greyscale Depth Image
PROGRAM_EXTENSION = .py Python Script
png = image-to-gcode
gif = image-to-gcode
jpg = image-to-gcode
py = python

[TASK]
TASK = milltask
CYCLE_TIME = 0.010

[RS274NGC]
PARAMETER_FILE = emc.var

[EMCMOT]
EMCMOT = motmod
COMM_TIMEOUT = 1.0
COMM_WAIT = 0.010
#BASE_PERIOD = 50000
SERVO_PERIOD = 1000000

# [HOSTMOT2]
# This is for info only - config line is in the .hal file
# DRIVER0=hm2_7i43 
# BOARD0=7i43
# CONFIG0="firmware=hm2/7i43/SVST2_4_7I47B.BIT num_encoders=3 num_pwmgens=0 
num_stepgens=4" 

[HAL]
HALUI = halui
HALFILE = EMCO.hal
HALFILE = custom.hal
POSTGUI_HALFILE = custom_postgui.hal

[HALUI]
MDI_COMMAND = G53 G0 X0 Y0 Z0

[TRAJ]
AXES = 3
COORDINATES = X Y Z
LINEAR_UNITS = inch
ANGULAR_UNITS = degree
CYCLE_TIME = 0.010
DEFAULT_VELOCITY = 0.5
MAX_LINEAR_VELOCITY = 2
#Joypad Test stuff below:
DEFAULT_ANGULAR_VELOCITY = 0.25
MAX_ANGULAR_VELOCITY = 1.0

#ARC_BLEND_ENABLE = 1
#ARC_BLEND_RAMP_FREQ = 1000


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

#********************
# Axis X
#********************
[AXIS_0]
TYPE = LINEAR
# HOME = 0.0 -- see below
FERROR = 0.005
MIN_FERROR = 0.001
MAX_VELOCITY = 2.2
MAX_ACCELERATION = 20
# these are in nanoseconds
DIRSETUP   = 200
DIRHOLD    = 200
STEPLEN    = 2000
STEPSPACE  = 1200
STEPGEN_MAXACCEL = 40
STEPGEN_MAXVEL = 2.75
#BACKLASH = 0.0005
INPUT_SCALE = -208076.8
SCALE = -50800
MIN_LIMIT = -0.001
MAX_LIMIT = 7.8
# homing
# move here after home switch found:
HOME = 4.0
# home switch is located here:
HOME_OFFSET = 7.8
# initial search velocity in/sec
HOME_SEARCH_VEL = 0.75
# 2nd pass search velocity
HOME_LATCH_VEL = 0.1
# speed to HOME
HOME_FINAL_VEL = 0.5
# yes use index
HOME_USE_INDEX = YES
HOME_IGNORE_LIMITS = NO
HOME_IS_SHARED = NO
# do this after Z and Y is homed
HOME_SEQUENCE = 2
# should unhome if estop or power off? no
VOLATILE_HOME = 0

#********************
# Axis Y
#********************
[AXIS_1]
TYPE = LINEAR
# HOME = 0.0 -- see below
FERROR = 0.005
MIN_FERROR = 0.001
MAX_VELOCITY = 2.2
MAX_ACCELERATION = 20.0
# these are in nanoseconds
DIRSETUP   = 200
DIRHOLD    = 200
STEPLEN    = 2000
STEPSPACE  = 1200
STEPGEN_MAXACCEL = 40
STEPGEN_MAXVEL = 2.75
BACKLASH = 0.0005
SCALE = 50800
MIN_LIMIT = -0.001
MAX_LIMIT = 3.8
INPUT_SCALE = 208076.8
# homing
# move here after home switch found:
HOME = 2.0
# home switch is located here:
HOME_OFFSET = 0
# initial search velocity in/sec
HOME_SEARCH_VEL = -0.4
# 2nd pass search velocity
HOME_LATCH_VEL = -0.1
# speed to HOME
HOME_FINAL_VEL = 0.5
# yes use index
HOME_USE_INDEX = YES
HOME_IGNORE_LIMITS = NO
HOME_IS_SHARED = NO
# do this after Z is homed
HOME_SEQUENCE = 1
# should unhome if estop or power off? no
VOLATILE_HOME = 0

#********************
# Axis Z
#********************
[AXIS_2]
TYPE = LINEAR
# HOME = 0.0 -- see below
FERROR = 0.005
MIN_FERROR = 0.001
MAX_VELOCITY = 2.2
MAX_ACCELERATION = 20.0
# these are in nanoseconds
DIRSETUP   = 200
DIRHOLD    = 200
STEPLEN    = 2000
STEPSPACE  = 1200
STEPGEN_MAXACCEL = 40
STEPGEN_MAXVEL = 2.75
#BACKLASH = 0.0005
SCALE = -50800
MIN_LIMIT = -7.8
MAX_LIMIT = 0.001
INPUT_SCALE = -208076.8
# homing
# move here after home switch found:
HOME = 0.0
# home switch is located here:
HOME_OFFSET = 0
# initial search velocity in/sec
HOME_SEARCH_VEL = 0.4
# 2nd pass search velocity
HOME_LATCH_VEL = -0.1
# speed to HOME
HOME_FINAL_VEL = 0.5
# yes use index
HOME_USE_INDEX = YES
HOME_IGNORE_LIMITS = NO
HOME_IS_SHARED = NO
# do this before X/Y are homed
HOME_SEQUENCE = 0
# should unhome if estop or power off? no
VOLATILE_HOME = 0

#********************
# Spindle 
#********************
[SPINDLE_9]
# these are in nanoseconds
DIRSETUP   = 0
DIRHOLD    = 0
STEPLEN    = 20000
STEPSPACE  = 20000
SCALE = 8.7
———————————— end ini ———————————





———————————— hal ———————————

# Generated by PNCconf at Thu Apr  8 11:40:39 2010

loadrt trivkins
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD 
num_joints=[TRAJ]AXES
loadrt hostmot2
loadrt hm2_7i43  config="firmware=hm2/7i43/SVST2_4_7I47B.BIT num_encoders=3 
num_pwmgens=0 num_stepgens=4"

addf hm2_7i43.0.read servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf hm2_7i43.0.write         servo-thread

# external output signals
#
# --- SPINDLE-BRAKE ---
    setp hm2_7i43.0.gpio.022.is_output true
    setp hm2_7i43.0.gpio.022.invert_output true
    net spindle-brake     =>  hm2_7i43.0.gpio.022.out
# --- COOLANT-FLOOD ---
#    setp hm2_7i43.0.gpio.025.is_output true
#    setp hm2_7i43.0.gpio.025.is_opendrain true
#    setp hm2_7i43.0.gpio.025.invert_output true
#    net coolant-flood     =>  hm2_7i43.0.gpio.025.out
# --- COOLANT-MIST ---
    setp hm2_7i43.0.gpio.025.is_output true
    setp hm2_7i43.0.gpio.025.is_opendrain true
    setp hm2_7i43.0.gpio.025.invert_output true
    net coolant-mist     =>  hm2_7i43.0.gpio.025.out
# --- Work Light (Or Air Vice)Control ---
    setp hm2_7i43.0.gpio.027.is_output true
    setp hm2_7i43.0.gpio.027.is_opendrain true
    setp hm2_7i43.0.gpio.027.invert_output true
    net worklight-ctl     <=  hm2_7i43.0.gpio.027.out
# --- E-Stop Indication ---
    setp hm2_7i43.0.gpio.029.is_output false
    net epo-signal     <=  hm2_7i43.0.gpio.029.in_not


#*******************
#  AXIS X
#*******************
# axis enable chain
newsig emcmot.00.enable bit
sets emcmot.00.enable FALSE

net emcmot.00.enable <= axis.0.amp-enable-out 
net emcmot.00.enable => hm2_7i43.0.stepgen.00.enable

# position command and feedback
net emcmot.00.pos-cmd <= axis.0.motor-pos-cmd
net emcmot.00.pos-cmd => hm2_7i43.0.stepgen.00.position-cmd

# Step Gen signals/setup
setp hm2_7i43.0.stepgen.00.dirsetup        [AXIS_0]DIRSETUP
setp hm2_7i43.0.stepgen.00.dirhold         [AXIS_0]DIRHOLD
setp hm2_7i43.0.stepgen.00.steplen         [AXIS_0]STEPLEN
setp hm2_7i43.0.stepgen.00.stepspace       [AXIS_0]STEPSPACE
setp hm2_7i43.0.stepgen.00.position-scale  [AXIS_0]SCALE
setp hm2_7i43.0.stepgen.00.maxaccel        [AXIS_0]STEPGEN_MAXACCEL
setp hm2_7i43.0.stepgen.00.maxvel          [AXIS_0]STEPGEN_MAXVEL
setp hm2_7i43.0.stepgen.00.step_type    0
setp hm2_7i43.0.stepgen.00.control-type 0

# ---Encoder feedback signals/setup---
setp hm2_7i43.0.encoder.00.counter-mode 0
setp hm2_7i43.0.encoder.00.filter 1
setp hm2_7i43.0.encoder.00.index-invert 0
setp hm2_7i43.0.encoder.00.index-mask 0
setp hm2_7i43.0.encoder.00.index-mask-invert 0
setp hm2_7i43.0.encoder.00.scale  [AXIS_0]INPUT_SCALE
net xindex-enable hm2_7i43.0.encoder.00.index-enable <=> axis.0.index-enable
#Line below causes AXIS to display the ENCODER position in the DRO (and Preview)
net xpos-fb => axis.0.motor-pos-fb <= hm2_7i43.0.encoder.00.position
#net xpos-fb => axis.0.motor-pos-fb <= hm2_7i43.0.stepgen.00.position-fb

# ---setup home / limit switch signals---
net x-home-sw     =>  axis.0.home-sw-in
net x-neg-limit     =>  axis.0.neg-lim-sw-in
net x-pos-limit     =>  axis.0.pos-lim-sw-in

#*******************
#  AXIS Y
#*******************
# axis enable chain
newsig emcmot.01.enable bit
sets emcmot.01.enable FALSE

net emcmot.01.enable <= axis.1.amp-enable-out 
net emcmot.01.enable => hm2_7i43.0.stepgen.01.enable

# position command and feedback
net emcmot.01.pos-cmd <= axis.1.motor-pos-cmd
net emcmot.01.pos-cmd => hm2_7i43.0.stepgen.01.position-cmd

# Step Gen signals/setup
setp hm2_7i43.0.stepgen.01.dirsetup        [AXIS_1]DIRSETUP
setp hm2_7i43.0.stepgen.01.dirhold         [AXIS_1]DIRHOLD
setp hm2_7i43.0.stepgen.01.steplen         [AXIS_1]STEPLEN
setp hm2_7i43.0.stepgen.01.stepspace       [AXIS_1]STEPSPACE
setp hm2_7i43.0.stepgen.01.position-scale  [AXIS_1]SCALE
setp hm2_7i43.0.stepgen.01.maxaccel        [AXIS_0]STEPGEN_MAXACCEL
setp hm2_7i43.0.stepgen.01.maxvel          [AXIS_0]STEPGEN_MAXVEL
setp hm2_7i43.0.stepgen.01.step_type        0

# ---Encoder feedback signals/setup---
setp hm2_7i43.0.encoder.01.counter-mode 0
setp hm2_7i43.0.encoder.01.filter 1
setp hm2_7i43.0.encoder.01.index-invert 0
setp hm2_7i43.0.encoder.01.index-mask 0
setp hm2_7i43.0.encoder.01.index-mask-invert 0
setp hm2_7i43.0.encoder.01.scale  [AXIS_1]INPUT_SCALE
net yindex-enable hm2_7i43.0.encoder.01.index-enable <=> axis.1.index-enable
#Line below causes AXIS to disply the ENCODER position in the DRO (and Preview)
net ypos-fb => axis.1.motor-pos-fb <= hm2_7i43.0.encoder.01.position

# ---setup home / limit switch signals---
net y-home-sw     =>  axis.1.home-sw-in
net y-neg-limit     =>  axis.1.neg-lim-sw-in
net y-pos-limit     =>  axis.1.pos-lim-sw-in

#*******************
#  AXIS Z
#*******************
# axis enable chain
newsig emcmot.02.enable bit
sets emcmot.02.enable FALSE

net emcmot.02.enable <= axis.2.amp-enable-out 
net emcmot.02.enable => hm2_7i43.0.stepgen.02.enable

# position command and feedback
net emcmot.02.pos-cmd <= axis.2.motor-pos-cmd
net emcmot.02.pos-cmd => hm2_7i43.0.stepgen.02.position-cmd

# Step Gen signals/setup
setp hm2_7i43.0.stepgen.02.dirsetup        [AXIS_2]DIRSETUP
setp hm2_7i43.0.stepgen.02.dirhold         [AXIS_2]DIRHOLD
setp hm2_7i43.0.stepgen.02.steplen         [AXIS_2]STEPLEN
setp hm2_7i43.0.stepgen.02.stepspace       [AXIS_2]STEPSPACE
setp hm2_7i43.0.stepgen.02.position-scale  [AXIS_2]SCALE
setp hm2_7i43.0.stepgen.02.maxaccel        [AXIS_0]STEPGEN_MAXACCEL
setp hm2_7i43.0.stepgen.02.maxvel          [AXIS_0]STEPGEN_MAXVEL
setp hm2_7i43.0.stepgen.02.step_type        0

# ---Encoder feedback signals/setup---
setp hm2_7i43.0.encoder.02.counter-mode 0
setp hm2_7i43.0.encoder.02.filter 1
setp hm2_7i43.0.encoder.02.index-invert 0
setp hm2_7i43.0.encoder.02.index-mask 0
setp hm2_7i43.0.encoder.02.index-mask-invert 0
setp hm2_7i43.0.encoder.02.scale  [AXIS_2]INPUT_SCALE
net zindex-enable hm2_7i43.0.encoder.02.index-enable <=> axis.2.index-enable
#Line below causes AXIS to disply the ENCODER position in the DRO (and Preview)
net zpos-fb => axis.2.motor-pos-fb <= hm2_7i43.0.encoder.02.position

# ---setup home / limit switch signals---
net z-home-sw     =>  axis.2.home-sw-in
net z-neg-limit     =>  axis.2.neg-lim-sw-in
net z-pos-limit     =>  axis.2.pos-lim-sw-in

#*******************
#  SPINDLE S
#*******************

# Step Gen signals/setup
setp hm2_7i43.0.stepgen.03.dirsetup        [SPINDLE_9]DIRSETUP
setp hm2_7i43.0.stepgen.03.dirhold         [SPINDLE_9]DIRHOLD
setp hm2_7i43.0.stepgen.03.steplen         [SPINDLE_9]STEPLEN
setp hm2_7i43.0.stepgen.03.stepspace       [SPINDLE_9]STEPSPACE
setp hm2_7i43.0.stepgen.03.position-scale  [SPINDLE_9]SCALE
setp hm2_7i43.0.stepgen.03.maxaccel         0
setp hm2_7i43.0.stepgen.03.maxvel           0
setp hm2_7i43.0.stepgen.03.step_type        0
setp hm2_7i43.0.stepgen.03.control-type    1

net spindle-enable          =>  hm2_7i43.0.stepgen.03.enable
net spindle-vel-cmd     =>  hm2_7i43.0.stepgen.03.velocity-cmd


# ---setup spindle control signals---
net spindle-vel-cmd        <=  motion.spindle-speed-out
net spindle-enable         <=  motion.spindle-on
net spindle-ccw            <=  motion.spindle-reverse
net spindle-brake          <=  motion.spindle-brake


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

#  ---home signals ---
setp hm2_7i43.0.gpio.033.is_output false
net x-home-sw <= hm2_7i43.0.gpio.033.in_not
setp hm2_7i43.0.gpio.035.is_output false
net y-home-sw <= hm2_7i43.0.gpio.035.in_not
setp hm2_7i43.0.gpio.037.is_output false
net z-home-sw <= hm2_7i43.0.gpio.037.in_not

#  ---coolant signals---
net coolant-mist      <=  iocontrol.0.coolant-mist


#  ---estop signals---
net estop-out     <=  iocontrol.0.user-enable-out
net epo-signal     =>  iocontrol.0.emc-enable-in

#  ---manual tool change signals---
loadusr -W hal_manualtoolchange
net tool-change iocontrol.0.tool-change => hal_manualtoolchange.change
net tool-changed iocontrol.0.tool-changed <= hal_manualtoolchange.changed
net tool-number iocontrol.0.tool-prep-number => hal_manualtoolchange.number
net tool-prepare-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared

————————————end hal ———————————


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to