Problems homing at higher speed
04 Feb 2016 19:58 #69608
by 10K
Replied by 10K on topic Problems homing at higher speed
Ini file:
Hal file:
# Monarch_10EE.ini
# Do not run configuration wizards; must edit by hand
# February 4, 2016
# Uses Mesa 7i92 FPGA board driving Chinese BOB.
# 7i92 configuration file 7i92_G540x2D.bit
# 7i92 on IP 10.10.10.10
[EMC]
MACHINE = Monarch_10EE
DEBUG = 0
[DISPLAY]
DISPLAY = gmoccapy
PREFERENCE_FILE_PATH = gmoccapy_preferences
#DISPLAY = axis
#DISPLAY = gscreen
#DISPLAY = tkemc
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
MAX_FEED_OVERRIDE = 2.50
MAX_SPINDLE_OVERRIDE = 2.50
MIN_SPINDLE_OVERRIDE = 0.25
INTRO_GRAPHIC = linuxcnc.gif
INTRO_TIME = 3
#PROGRAM_PREFIX = /home/martin/linuxcnc/nc_files
PROGRAM_PREFIX = ../../nc_files/
INCREMENTS = .1in .05in .01in .005in .001in .0005in .0001in
PYVCP = custompanel.xmlPREFERENCE_FILE_PATH = gmoccapy_preferences
LATHE = 1
POSITION_FEEDBACK = ACTUAL
DEFAULT_LINEAR_VELOCITY = 0.250000
MAX_LINEAR_VELOCITY = 3.000000
MIN_LINEAR_VELOCITY = 0.010000
DEFAULT_ANGULAR_VELOCITY = 0.250000
MAX_ANGULAR_VELOCITY = 1.000000
MIN_ANGULAR_VELOCITY = 0.010000
EDITOR = gedit
GEOMETRY = xz
[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 = linuxPYVCP = custompanel.xmlcnc.var
SUBROUTINE_PATH = macros
[EMCMOT]
EMCMOT = motmod
COMM_TIMEOUT = 1.0
COMM_WAIT = 0.010
SERVO_PERIOD = 1000000
[HOSTMOT2]
DRIVER = hm2_eth board_ip="10.10.10.10"
#DRIVER = hm2_eth board_ip="192.168.1.121"
BOARD0 = 7i92
CONFIG = "num_stepgens=4 num_encoders=0 num_pwmgens=0"
[HAL]
HALUI = halui
HALFILE = Monarch_10EE.hal
POSTGUI_HALFILE = custom_postgui.hal
[TRAJ]
AXES = 3
COORDINATES = X Z
LINEAR_UNITS = inch
ANGULAR_UNITS = degree
CYCLE_TIME = 0.010
DEFAULT_VELOCITY = 0.10
MAX_VELOCITY = 2.40
[EMCIO]
EMCIO = io
CYCLE_TIME = 0.100
TOOL_TABLE = tool.tbl
#[PYTHON]
# The path to start a search for user modules
#PATH_PREPEND = python
# The start point for all.
#TOPLEVEL = python/toplevel.py
#********************
# Axis X
#********************
[AXIS_0]
TYPE = LINEAR
HOME_SEARCH_VEL = 0.9
HOME_LATCH_VEL = 0.1
#HOME_FINAL_VEL = 1.0
HOME_IGNORE_LIMITS = YES
HOME_USE_INDEX = NO
HOME_OFFSET = 7.8
HOME = 6.0
HOME_IS_SHARED = 1
HOME_SEQUENCE = 0
VOLATILE_HOME = 1
FERROR = 0.001
MIN_FERROR = 0.0002
MAX_VELOCITY = 1.8
MAX_ACCELERATION = 12.75
# 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 = 2.4
STEPGEN_MAXACCEL = 17
P = 1000.0
I = 0.0
D = 0.0
FF0 = 0.0
FF1 = 1.0
FF2 = 0.0
BIAS = 0.0
DEADBAND = 0.0
MAX_OUTPUT = 0
# these are in nanoseconds
DIRSETUP = 50000
DIRHOLD = 50000
STEPLEN = 2000
STEPSPACE = 2000
STEP_SCALE = 12800.0
MIN_LIMIT = -0.001
MAX_LIMIT = 7.8
#BACKLASH = 0.0135
#********************
# Axis Z
#********************
[AXIS_2]
TYPE = LINEAR
HOME_SEARCH_VEL = 0.9
HOME_LATCH_VEL = 0.1
#HOME_FINAL_VEL = 1.0
HOME_IGNORE_LIMITS = YES
HOME_USE_INDEX = NO
HOME_OFFSET = 19.5
HOME = 12
HOME_IS_SHARED = 1
HOME_SEQUENCE = 1
VOLATILE_HOME = 1
FERROR = 0.001
MIN_FERROR = 0.0002
MAX_VELOCITY = 1.25
MAX_ACCELERATION = 4.5
# 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 = 1.65
STEPGEN_MAXACCEL = 6.0
P = 1000.0
I = 0.0
D = 0.0
FF0 = 0.0
FF1 = 1.0
FF2 = 0.0
BIAS = 0.0
DEADBAND = 0.0
MAX_OUTPUT = 0
# these are in nanoseconds
DIRSETUP = 50000
DIRHOLD = 50000
STEPLEN = 2000
STEPSPACE = 2000
STEP_SCALE = 12800.0
MIN_LIMIT = 0.001
MAX_LIMIT = 19.5
BACKLASH = 0.015
#********************
# Spindle
#********************
#[SPINDLE_14]
#P = 0.0
#I = 0.0
#D = 0.0
#FF0 = 1.0
#FF1 = 0.0
#FF2 = 0.0
#BIAS = 0.0
#DEADBAND = 0.0
#MAX_OUTPUT = 2000.0
#ENCODER_SCALE = 1.0
Hal file:
# Monarch_10EE.hal/
# Do not run configuration wizards; must edit by hand
# February 4, 2016
# Uses Mesa 7i92 FPGA board driving Chinese BOB.
# 7i92 configuration file 7i92_G540x2D.bit
# 7i92 on IP 10.10.10.10
loadrt trivkins
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
loadrt pid names=pid.x,pid.z,pid.s
#loadrt pid num_chan=4
loadrt hostmot2
loadrt [HOSTMOT2]DRIVER config=[HOSTMOT2]CONFIG
setp hm2_7i92.0.watchdog.timeout_ns 25000000
loadrt encoder num_chan=1
loadrt abs count=1
loadrt scale count=1
loadrt lowpass count=1
addf hm2_7i92.0.read servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf encoder.update-counters servo-thread
#addf encoder.capture-position servo-thread
addf pid.x.do-pid-calcs servo-thread
addf pid.z.do-pid-calcs servo-thread
addf pid.s.do-pid-calcs servo-thread
addf hm2_7i92.0.write servo-thread
addf encoder.capture-position servo-thread
addf abs.0 servo-thread
addf scale.0 servo-thread
addf lowpass.0 servo-thread
# latch all stepgen position counts 50 usec before nominal read time (add per PCW):
setp hm2_7i92.0.dpll.01.timer-us -50
setp hm2_7i92.0.stepgen.timer-number 1
# ---setup spindle---
setp encoder.0.position-scale 10
setp encoder.0.counter-mode 1
net spindle-position encoder.0.position => motion.spindle-revs
net spindle-at-speed => motion.spindle-at-speed
net spindle-velocity-feedback-rps encoder.0.velocity => motion.spindle-speed-in
net spindle-index-enable encoder.0.index-enable <=> motion.spindle-index-enable
net spindle-phase-a encoder.0.phase-A
net spindle-phase-b encoder.0.phase-B
net spindle-index encoder.0.phase-Z
#net spindle-phase-a <= hm2_7i92.0.gpio.016.in
net spindle-phase-a <= hm2_7i92.0.gpio.015.in
net spindle-index <= hm2_7i92.0.gpio.014.in
# external output signals
# external input signals
# --- ESTOP-EXT ---
net estop-ext <= hm2_7i92.0.gpio.013.in_not
# --- BOTH-HOME ---
net both-home-x <= hm2_7i92.0.gpio.016.in
#net both-home-x <= hm2_7i92.0.gpio.015.in
net both-home-z <= hm2_7i92.0.gpio.003.in_not
#*******************
# AXIS X
#*******************
setp pid.x.Pgain [AXIS_0]P
setp pid.x.Igain [AXIS_0]I
setp pid.x.Dgain [AXIS_0]D
setp pid.x.bias [AXIS_0]BIAS
setp pid.x.FF0 [AXIS_0]FF0
setp pid.x.FF1 [AXIS_0]FF1
setp pid.x.FF2 [AXIS_0]FF2
setp pid.x.deadband [AXIS_0]DEADBAND
setp pid.x.maxoutput [AXIS_0]MAX_OUTPUT
setp pid.x.error-previous-target true
setp pid.x.maxerror .0005
net x-index-enable <=> pid.x.index-enable
net x-enable => pid.x.enable
net x-pos-cmd => pid.x.command
net x-vel-cmd => pid.x.command-deriv
net x-pos-fb => pid.x.feedback
net x-output => pid.x.output
# Step Gen signals/setup
setp hm2_7i92.0.stepgen.00.dirsetup [AXIS_0]DIRSETUP
setp hm2_7i92.0.stepgen.00.dirhold [AXIS_0]DIRHOLD
setp hm2_7i92.0.stepgen.00.steplen [AXIS_0]STEPLEN
setp hm2_7i92.0.stepgen.00.stepspace [AXIS_0]STEPSPACE
setp hm2_7i92.0.stepgen.00.position-scale [AXIS_0]STEP_SCALE
setp hm2_7i92.0.stepgen.00.step_type 0
setp hm2_7i92.0.stepgen.00.control-type 1
setp hm2_7i92.0.stepgen.00.maxaccel [AXIS_0]STEPGEN_MAXACCEL
setp hm2_7i92.0.stepgen.00.maxvel [AXIS_0]STEPGEN_MAXVEL
# ---closedloop stepper signals---
net x-pos-cmd <= axis.0.motor-pos-cmd
net x-vel-cmd <= axis.0.joint-vel-cmd
net x-output <= hm2_7i92.0.stepgen.00.velocity-cmd
net x-pos-fb <= hm2_7i92.0.stepgen.00.position-fb
net x-pos-fb => axis.0.motor-pos-fb
net x-enable <= axis.0.amp-enable-out
net x-enable => hm2_7i92.0.stepgen.00.enable
# ---setup home / limit switch signals---
net both-home-x => axis.0.home-sw-in
net both-home-x => axis.0.neg-lim-sw-in
net both-home-x => axis.0.pos-lim-sw-in
#*******************
# AXIS Z
#*******************
setp pid.z.Pgain [AXIS_2]P
setp pid.z.Igain [AXIS_2]I
setp pid.z.Dgain [AXIS_2]D
setp pid.z.bias [AXIS_2]BIAS
setp pid.z.FF0 [AXIS_2]FF0
setp pid.z.FF1 [AXIS_2]FF1
setp pid.z.FF2 [AXIS_2]FF2
setp pid.z.deadband [AXIS_2]DEADBAND
setp pid.z.maxoutput [AXIS_2]MAX_OUTPUT
setp pid.z.error-previous-target true
setp pid.z.maxerror .0005
net z-index-enable <=> pid.z.index-enable
net z-enable => pid.z.enable
net z-pos-cmd => pid.z.command
net z-vel-cmd => pid.z.command-deriv
net z-pos-fb => pid.z.feedback
net z-output => pid.z.output
# Step Gen signals/setup
setp hm2_7i92.0.stepgen.02.dirsetup [AXIS_2]DIRSETUP
setp hm2_7i92.0.stepgen.02.dirhold [AXIS_2]DIRHOLD
setp hm2_7i92.0.stepgen.02.steplen [AXIS_2]STEPLEN
setp hm2_7i92.0.stepgen.02.stepspace [AXIS_2]STEPSPACE
setp hm2_7i92.0.stepgen.02.position-scale [AXIS_2]STEP_SCALE
setp hm2_7i92.0.stepgen.02.step_type 0
setp hm2_7i92.0.stepgen.02.control-type 1
setp hm2_7i92.0.stepgen.02.maxaccel [AXIS_2]STEPGEN_MAXACCEL
setp hm2_7i92.0.stepgen.02.maxvel [AXIS_2]STEPGEN_MAXVEL
# ---closedloop stepper signals---
net z-pos-cmd <= axis.2.motor-pos-cmd
net z-vel-cmd <= axis.2.joint-vel-cmd
net z-output <= hm2_7i92.0.stepgen.02.velocity-cmd
net z-pos-fb <= hm2_7i92.0.stepgen.02.position-fb
net z-pos-fb => axis.2.motor-pos-fb
net z-enable <= axis.2.amp-enable-out
net z-enable => hm2_7i92.0.stepgen.02.enable
# ---setup home / limit switch signals---
net both-home-z => axis.2.home-sw-in
net both-home-z => axis.2.neg-lim-sw-in
net both-home-z => axis.2.pos-lim-sw-in
#******************************
# connect miscellaneous signals
#******************************
# ---HALUI signals---
net joint-select-a halui.joint.0.select
net x-is-homed halui.joint.0.is-homed
net jog-x-pos halui.jog.0.plus
net jog-x-neg halui.jog.0.minus
net jog-x-analog halui.jog.0.analog
net joint-select-c halui.joint.2.select
net z-is-homed halui.joint.2.is-homed
net jog-z-pos halui.jog.2.plus
net jog-z-neg halui.jog.2.minus
net jog-z-analog halui.jog.2.analog
net jog-selected-pos halui.jog.selected.plus
net jog-selected-neg halui.jog.selected.minus
#net spindle-manual-cw halui.spindle.forward
#net spindle-manual-ccw halui.spindle.reverse
#net spindle-manual-stop halui.spindle.stop
net machine-is-on halui.machine.is-on
net jog-speed halui.jog-speed
net MDI-mode halui.mode.is-mdi
# ---motion control signals---
net in-position <= motion.in-position
net machine-is-enabled <= motion.motion-enabled
# ---estop signals---
net estop-out <= iocontrol.0.user-enable-out
net estop-ext => iocontrol.0.emc-enable-in
# ---coolant signals---
#net coolant-mist <= iocontrol.0.coolant-mist
#net coolant-flood <= iocontrol.0.coolant-flood
# ---probe signal---
#net probe-in => motion.probe-input
#manual tool change
#net tool-change gmoccapy.toolchange-change <= iocontrol.0.tool-change
#net tool-changed gmoccapy.toolchange-changed <= iocontrol.0.tool-changed
#net tool-prep-number gmoccapy.toolchange-number <= iocontrol.0.tool-prep-number
#net tool-prep-loop iocontrol.0.tool-prepare <= iocontrol.0.tool-prepared
#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
Please Log in or Create an account to join the conversation.
04 Feb 2016 20:08 #69609
by PCW
Replied by PCW on topic Problems homing at higher speed
I suspect this is the reason for trouble in Z
# If using BACKLASH compensation STEPGEN_MAXACCEL should be 100% larger.
# If using BACKLASH compensation STEPGEN_MAXACCEL should be 100% larger.
The following user(s) said Thank You: 10K
Please Log in or Create an account to join the conversation.
04 Feb 2016 20:24 #69611
by 10K
Replied by 10K on topic Problems homing at higher speed
I gave it a shot, and it seems to work!
I commented out the BACKLASH line, and that worked.
I un-commented the line, and doubled the STEPGEN_MAXACCEL, and that works, also.
When I was doing my experiments to set the rates, backlash was the last thing I calculated. That's why I didn't see the problem before. I didn't know they were related.
Just to clarify, should the STEPGEN_MAXACCEL be double the MAX_ACCELERATION, or the 25% larger number I already had in there?
And since I know that the STEPGEN_MAXACCEL number is really the largest my steppers can handle, should I worry that they'll eventually stall if this rate is reached?
I commented out the BACKLASH line, and that worked.
I un-commented the line, and doubled the STEPGEN_MAXACCEL, and that works, also.
When I was doing my experiments to set the rates, backlash was the last thing I calculated. That's why I didn't see the problem before. I didn't know they were related.
Just to clarify, should the STEPGEN_MAXACCEL be double the MAX_ACCELERATION, or the 25% larger number I already had in there?
And since I know that the STEPGEN_MAXACCEL number is really the largest my steppers can handle, should I worry that they'll eventually stall if this rate is reached?
Please Log in or Create an account to join the conversation.
04 Feb 2016 20:29 #69612
by PCW
Replied by PCW on topic Problems homing at higher speed
If you have backlash compensation, I'm pretty sure stepgen maxaccel should be 2.5X maxaccel
There is actually less of a stalling problem than you might think because this acceleration value
is only reached during reversals when the step motor is near 0 speed and has maximum torque
There is actually less of a stalling problem than you might think because this acceleration value
is only reached during reversals when the step motor is near 0 speed and has maximum torque
Please Log in or Create an account to join the conversation.
04 Feb 2016 23:27 #69622
by 10K
Replied by 10K on topic Problems homing at higher speed
Thanks. Looking back, I was not clear on my second question.
Let's say in experimenting with the BACKLASH turned off, my machine stalls at an acceleration of 100.
Would I then configure the [AXIS_0] part of the .ini file like this?
Or, is the acceleration limit never actually generated for the steppers, and is only internel to the controller / ferror calculations, and I should configure the [AXIS_0] part of the .ini file like this?
My confusion is because I don't exactly understand how the program calculates an error when there's no actual feedback loop.
Let's say in experimenting with the BACKLASH turned off, my machine stalls at an acceleration of 100.
Would I then configure the [AXIS_0] part of the .ini file like this?
- BACKLASH = (whatever)
- MAX_ACCELERATION = 40
- STEPGEN_MAXACCEL = 100
Or, is the acceleration limit never actually generated for the steppers, and is only internel to the controller / ferror calculations, and I should configure the [AXIS_0] part of the .ini file like this?
- BACKLASH = (whatever)
- MAX_ACCELERATION = 80
- STEPGEN_MAXACCEL = 200
My confusion is because I don't exactly understand how the program calculates an error when there's no actual feedback loop.
Please Log in or Create an account to join the conversation.
04 Feb 2016 23:38 - 04 Feb 2016 23:44 #69623
by PCW
Replied by PCW on topic Problems homing at higher speed
The following error you got was because the trajectory requested during backlash compensation
exceeded the stepgens limits (imposed by stepgen_maxaccel )
There _is_ feedback from the stepgenerator to linuxcnc and that's why you got a following error
Note that your measured stall acceleration will be at some high velocity,
The maximum acceleration needed to stall near 0 speed
( when the backlash compensation and its 2X acceleration are needed ) will be _MUCH_ higher
so doubling the rapids stall acceleration (that you tested) is likely to be fine
( That is I dont think there is any need to lower the machines max acceleration to accomodate backlash compensation )
exceeded the stepgens limits (imposed by stepgen_maxaccel )
There _is_ feedback from the stepgenerator to linuxcnc and that's why you got a following error
Note that your measured stall acceleration will be at some high velocity,
The maximum acceleration needed to stall near 0 speed
( when the backlash compensation and its 2X acceleration are needed ) will be _MUCH_ higher
so doubling the rapids stall acceleration (that you tested) is likely to be fine
( That is I dont think there is any need to lower the machines max acceleration to accomodate backlash compensation )
Last edit: 04 Feb 2016 23:44 by PCW.
Please Log in or Create an account to join the conversation.
07 Feb 2016 21:55 #69751
by 10K
Replied by 10K on topic Problems homing at higher speed
Based on your comment, here's what I did:
It's working fine now. Of course, the best thing to do would be to get rid of the excessive backlash! But that's another project, and I'll have to round up one of those tandem acme taps to do it.
Another common along the lines of your earlier post is that when the system is taking up the backlash, there's little load on the steppers since nothing other than the lead screw is actually moving.
# Experimental maximums: Velocity = 2.4, Acceleration = 16
# STEPGEN_MAXVEL = experimental maximum. MAX_VELOCITY = STEPGEN_MAXVEL / 1.25.
# MAX_ACCELERATION = experimental maximum acceleration / 1.25.
# If BACKLASH is not set: STEPGEN_MAXACCEL = MAX_ACCELERATION * 1.25
# If BACKLASH is set: STEPGEN_MAXACCEL = MAX_ACCELERATION * 2.5
MAX_VELOCITY = 1.8
MAX_ACCELERATION = 12.75
STEPGEN_MAXVEL = 2.4
STEPGEN_MAXACCEL = 31.875
BACKLASH = 0.0135
It's working fine now. Of course, the best thing to do would be to get rid of the excessive backlash! But that's another project, and I'll have to round up one of those tandem acme taps to do it.
Another common along the lines of your earlier post is that when the system is taking up the backlash, there's little load on the steppers since nothing other than the lead screw is actually moving.
Please Log in or Create an account to join the conversation.
Time to create page: 0.181 seconds