Spindle encoder setup
12 Jul 2015 19:22 #60582
by Duc
Spindle encoder setup was created by Duc
Picked up a 1000 P/R encoder from automation direct with a 200 kHz response. The encoder is installed and seems to be working perfect. More curious to see if I modified the .hal file correct and the ini file to take full advantage of the encoder. Lots of google reading and playing with PNCconfig to get a start. The plan is to monitor the RPM and to use the spindle for rigid tapping. I will be adding some displays to axis tomorrow.
Is there anything else I need to add to the files to use the encoder properly? Index, differential settings
.hal file additons
.ini file additons
I do believe my scaling is wrong for my VFD. With a M3 S4200 I get a spindle-vel-fb of 58.1 so the rpm is 5810.
Full Hal
INI file
Is there anything else I need to add to the files to use the encoder properly? Index, differential settings
.hal file additons
loadrt pid names=pid.s
loadrt near
addf pid.s.do-pid-calcs servo-thread
addf near.0 servo-thread
# ---Encoder feedback signals/setup---
setp hm2_5i25.0.encoder.00.counter-mode 0
setp hm2_5i25.0.encoder.00.filter 1
setp hm2_5i25.0.encoder.00.index-invert 0
setp hm2_5i25.0.encoder.00.index-mask 0
setp hm2_5i25.0.encoder.00.index-mask-invert 0
setp hm2_5i25.0.encoder.00.scale [SPINDLE_9]ENCODER_SCALE
net spindle-revs <= hm2_5i25.0.encoder.00.position
net spindle-vel-fb <= hm2_5i25.0.encoder.00.velocity
net spindle-index-enable <=> hm2_5i25.0.encoder.00.index-enable
# ---Setup spindle at speed signals---
#sets spindle-at-speed true
net spindle-vel-cmd-rps => near.0.in1
net spindle-vel-fb => near.0.in2
net spindle-at-speed <= near.0.out
setp near.0.scale 1.000000
setp near.0.difference 3.333333
.ini file additons
[SPINDLE_9]
ENCODER_SCALE = 1000.0
OUTPUT_SCALE = 4200
OUTPUT_MIN_LIMIT = 0.0
OUTPUT_MAX_LIMIT = 4200
I do believe my scaling is wrong for my VFD. With a M3 S4200 I get a spindle-vel-fb of 58.1 so the rpm is 5810.
Full Hal
# Generated by PNCconf at Sun Jan 6 10:34:22 2002
# If you make changes to this file, they will be
# overwritten when you run PNCconf again
loadrt timedelay count=1
loadrt abs count=1
loadrt trivkins
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
loadrt probe_parport
loadrt hostmot2
loadrt hm2_pci config=" num_encoders=1 num_pwmgens=0 num_3pwmgens=0 num_stepgens=5 sserial_port_0=0200 "
setp hm2_5i25.0.watchdog.timeout_ns 10000000
loadrt mux16 count=4
loadrt mux_generic config="ss32,ss32"
loadrt ilowpass
loadrt comp count=1
addf timedelay.0 servo-thread
addf ilowpass.0 servo-thread
addf hm2_5i25.0.read servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf mux16.0 servo-thread #jogincr
addf mux16.1 servo-thread #Feedrate overide
addf mux16.2 servo-thread
addf mux16.3 servo-thread
addf mux-gen.00 servo-thread
addf mux-gen.01 servo-thread
addf abs.0 servo-thread
addf comp.0 servo-thread
loadrt pid names=pid.s
loadrt near
addf pid.s.do-pid-calcs servo-thread
addf near.0 servo-thread
addf hm2_5i25.0.write servo-thread
addf hm2_5i25.0.pet_watchdog servo-thread
# external output signals
# external input signals
# ---COOLANT CONROL ---
net coolant-flood hm2_5i25.0.7i76.0.0.output-01
# ---LUBRICATION SYSTEM ---
# The first input to the comparator is zero.
setp comp.0.in0 0.01
# The other input to the comparator is the current axis movement velocity
net moving comp.0.in1 <= motion.current-vel
# It needs to be connected to an output bit
net pump comp.0.out => hm2_5i25.0.7i76.0.0.output-02
# --- SPINDLE-BRAKE ---
#net spindle-brake hm2_5i25.0.7i76.0.0.output-00
net spindle-brake => timedelay.0.in
net spindle-delayed timedelay.0.out => hm2_5i25.0.7i76.0.0.output-00
setp timedelay.0.on-delay 8
setp timedelay.0.off-delay 0
# --- BOTH-HOME-X ---
net both-home-x <= hm2_5i25.0.7i76.0.0.input-00
# --- BOTH-HOME-Y ---
net both-home-y <= hm2_5i25.0.7i76.0.0.input-01
# --- MAX-HOME-Z ---
net max-home-z <= hm2_5i25.0.7i76.0.0.input-03
# --- MIN-Z ---
net min-z <= hm2_5i25.0.7i76.0.0.input-04
# --- JOINT-SELECT-a-X ---
net joint-select-a <= hm2_5i25.0.7i84.0.1.input-00
# --- JOINT-SELECT-b-Y ---
net joint-select-b <= hm2_5i25.0.7i84.0.1.input-01
# --- JOINT-SELECT-c-Z ---
net joint-select-c <= hm2_5i25.0.7i84.0.1.input-02
# --- JOINT-SELECT-d-A ---
net joint-select-d <= hm2_5i25.0.7i84.0.1.input-03
# --- JOG-INCR-A ---
net jog-incr-a <= hm2_5i25.0.7i84.0.1.input-11
# --- JOG-INCR-B ---
net jog-incr-b <= hm2_5i25.0.7i84.0.1.input-10
# --- JOG-INCR-C ---
net jog-incr-c <= hm2_5i25.0.7i84.0.1.input-09
# --- Feedrate overide - FO-INCR-A ---
net fo-incr-a <= hm2_5i25.0.7i84.0.1.input-08
# --- FO-INCR-B ---
net fo-incr-b <= hm2_5i25.0.7i84.0.1.input-07
# --- FO-INCR-C ---
net fo-incr-c <= hm2_5i25.0.7i84.0.1.input-06
# --- FO-INCR-D ---
net fo-incr-d <= hm2_5i25.0.7i84.0.1.input-05
# --- FO-INCR-E ---
net fo-incr-e <= hm2_5i25.0.7i84.0.1.input-04
# --- Spindle override - SO-INCR-A ---
net so-incr-a <= hm2_5i25.0.7i84.0.1.input-25
# --- SO-INCR-B ---
net so-incr-b <= hm2_5i25.0.7i84.0.1.input-26
# --- SO-INCR-C ---
net so-incr-c <= hm2_5i25.0.7i84.0.1.input-27
# --- Max velocity override - MVO-INCR-A ---
net mvo-incr-a <= hm2_5i25.0.7i84.0.1.input-20
# --- MVO-INCR-B ---
net mvo-incr-b <= hm2_5i25.0.7i84.0.1.input-21
# --- MVO-INCR-C ---
net mvo-incr-c <= hm2_5i25.0.7i84.0.1.input-22
# --- MVO-INCR-D ---
net mvo-incr-d <= hm2_5i25.0.7i84.0.1.input-23
# --- MVO-INCR-E ---
net mvo-incr-e <= hm2_5i25.0.7i84.0.1.input-24
# --- FO-ENABLE ---
net fo-enable <= hm2_5i25.0.7i84.0.1.input-14
#*******************
# AXIS X
#*******************
# Step Gen signals/setup
setp hm2_5i25.0.stepgen.00.dirsetup [AXIS_0]DIRSETUP
setp hm2_5i25.0.stepgen.00.dirhold [AXIS_0]DIRHOLD
setp hm2_5i25.0.stepgen.00.steplen [AXIS_0]STEPLEN
setp hm2_5i25.0.stepgen.00.stepspace [AXIS_0]STEPSPACE
setp hm2_5i25.0.stepgen.00.position-scale [AXIS_0]STEP_SCALE
setp hm2_5i25.0.stepgen.00.step_type 0
setp hm2_5i25.0.stepgen.00.control-type 0
setp hm2_5i25.0.stepgen.00.maxaccel 3
setp hm2_5i25.0.stepgen.00.maxvel 1
net x-pos-fb axis.0.motor-pos-fb <= hm2_5i25.0.stepgen.00.position-fb
net x-pos-cmd axis.0.motor-pos-cmd => hm2_5i25.0.stepgen.00.position-cmd
net x-enable axis.0.amp-enable-out => hm2_5i25.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 Y
#*******************
# Step Gen signals/setup
setp hm2_5i25.0.stepgen.01.dirsetup [AXIS_1]DIRSETUP
setp hm2_5i25.0.stepgen.01.dirhold [AXIS_1]DIRHOLD
setp hm2_5i25.0.stepgen.01.steplen [AXIS_1]STEPLEN
setp hm2_5i25.0.stepgen.01.stepspace [AXIS_1]STEPSPACE
setp hm2_5i25.0.stepgen.01.position-scale [AXIS_1]STEP_SCALE
setp hm2_5i25.0.stepgen.01.step_type 0
setp hm2_5i25.0.stepgen.01.control-type 0
setp hm2_5i25.0.stepgen.01.maxaccel 3
setp hm2_5i25.0.stepgen.01.maxvel 1
net y-pos-fb axis.1.motor-pos-fb <= hm2_5i25.0.stepgen.01.position-fb
net y-pos-cmd axis.1.motor-pos-cmd => hm2_5i25.0.stepgen.01.position-cmd
net y-enable axis.1.amp-enable-out => hm2_5i25.0.stepgen.01.enable
# ---setup home / limit switch signals---
net both-home-y => axis.1.home-sw-in
net both-home-y => axis.1.neg-lim-sw-in
net both-home-y => axis.1.pos-lim-sw-in
#*******************
# AXIS Z
#*******************
# Step Gen signals/setup
setp hm2_5i25.0.stepgen.02.dirsetup [AXIS_2]DIRSETUP
setp hm2_5i25.0.stepgen.02.dirhold [AXIS_2]DIRHOLD
setp hm2_5i25.0.stepgen.02.steplen [AXIS_2]STEPLEN
setp hm2_5i25.0.stepgen.02.stepspace [AXIS_2]STEPSPACE
setp hm2_5i25.0.stepgen.02.position-scale [AXIS_2]STEP_SCALE
setp hm2_5i25.0.stepgen.02.step_type 0
setp hm2_5i25.0.stepgen.02.control-type 0
setp hm2_5i25.0.stepgen.02.maxaccel 3
setp hm2_5i25.0.stepgen.02.maxvel 1
net z-pos-fb axis.2.motor-pos-fb <= hm2_5i25.0.stepgen.02.position-fb
net z-pos-cmd axis.2.motor-pos-cmd => hm2_5i25.0.stepgen.02.position-cmd
net z-enable axis.2.amp-enable-out => hm2_5i25.0.stepgen.02.enable
# ---setup home / limit switch signals---
net max-home-z => axis.2.home-sw-in
net min-z => axis.2.neg-lim-sw-in
net max-home-z => axis.2.pos-lim-sw-in
#*******************
# SPINDLE S
#*******************
# ---Encoder feedback signals/setup---
setp hm2_5i25.0.encoder.00.counter-mode 0
setp hm2_5i25.0.encoder.00.filter 1
setp hm2_5i25.0.encoder.00.index-invert 0
setp hm2_5i25.0.encoder.00.index-mask 0
setp hm2_5i25.0.encoder.00.index-mask-invert 0
setp hm2_5i25.0.encoder.00.scale [SPINDLE_9]ENCODER_SCALE
net spindle-revs <= hm2_5i25.0.encoder.00.position
net spindle-vel-fb <= hm2_5i25.0.encoder.00.velocity
net spindle-index-enable <=> hm2_5i25.0.encoder.00.index-enable
# ---digital potentionmeter output signals/setup---
setp hm2_5i25.0.7i76.0.0.spinout-minlim [SPINDLE_9]OUTPUT_MIN_LIMIT
setp hm2_5i25.0.7i76.0.0.spinout-maxlim [SPINDLE_9]OUTPUT_MAX_LIMIT
setp hm2_5i25.0.7i76.0.0.spinout-scalemax [SPINDLE_9]OUTPUT_SCALE
net abs-vel-cmd abs.0.out => hm2_5i25.0.7i76.0.0.spinout
net spindle-enable => hm2_5i25.0.7i76.0.0.spinena
net spindle-cw => hm2_5i25.0.7i76.0.0.output-04
net spindle-ccw => hm2_5i25.0.7i76.0.0.output-05
# ---setup spindle control signals---
net spindle-vel-cmd-rps <= motion.spindle-speed-out-rps
net spindle-vel-cmd abs.0.in <= motion.spindle-speed-out
net spindle-enable <= motion.spindle-on
net spindle-cw <= motion.spindle-forward
net spindle-ccw <= motion.spindle-reverse
net spindle-brake <= motion.spindle-brake
net spindle-revs => motion.spindle-revs
net spindle-at-speed => motion.spindle-at-speed
net spindle-vel-fb => motion.spindle-speed-in
net spindle-index-enable <=> motion.spindle-index-enable
# ---Setup spindle at speed signals---
#sets spindle-at-speed true
net spindle-vel-cmd-rps => near.0.in1
net spindle-vel-fb => near.0.in2
net spindle-at-speed <= near.0.out
setp near.0.scale 1.000000
setp near.0.difference 3.333333
#******************************
# 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-b halui.joint.1.select
net y-is-homed halui.joint.1.is-homed
net jog-y-pos halui.jog.1.plus
net jog-y-neg halui.jog.1.minus
net jog-y-analog halui.jog.1.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
# ---coolant signals---
net coolant-mist <= iocontrol.0.coolant-mist
net coolant-flood <= iocontrol.0.coolant-flood
# ---probe signal---
net probe-in => motion.probe-input
# ---jog button signals---
sets jog-speed 1.000000
## MPG stuff##########
# ---jogwheel signals to mesa encoder - shared MPG---
net joint-selected-count <= hm2_5i25.0.7i84.0.1.enc0.count
setp hm2_5i25.0.encoder.00.filter true
setp hm2_5i25.0.encoder.00.counter-mode true
# ---mpg signals---
# for axis x MPG
setp axis.0.jog-vel-mode 0
net selected-jog-incr => axis.0.jog-scale
net joint-select-a => axis.0.jog-enable
net joint-selected-count => axis.0.jog-counts
# for axis y MPG
setp axis.1.jog-vel-mode 0
net selected-jog-incr => axis.1.jog-scale
net joint-select-b => axis.1.jog-enable
net joint-selected-count => axis.1.jog-counts
# for axis z MPG
setp axis.2.jog-vel-mode 0
net selected-jog-incr => axis.2.jog-scale
net joint-select-c => axis.2.jog-enable
net joint-selected-count => axis.2.jog-counts
##connect jog incr override increments
net jog-incr-a => mux16.0.sel0
net jog-incr-b => mux16.0.sel1
net jog-incr-c => mux16.0.sel2
net jog-incr-d => mux16.0.sel3
net selected-jog-incr <= mux16.0.out-f
setp mux16.0.debounce-time 0.200000
setp mux16.0.use-graycode False
setp mux16.0.suppress-no-input False
setp mux16.0.in00 0.0001
setp mux16.0.in01 0.001
setp mux16.0.in02 .01
setp mux16.0.in03 .1
setp mux16.0.in04 1
# connect feed overide increments - switches
setp halui.feed-override.count-enable true
setp halui.feed-override.direct-value true
setp halui.feed-override.scale .01
net feedoverride-incr => halui.feed-override.counts
net fo-incr-a => mux-gen.00.sel-bit-00
net fo-incr-b => mux-gen.00.sel-bit-01
net fo-incr-c => mux-gen.00.sel-bit-02
net fo-incr-d => mux-gen.00.sel-bit-03
net fo-incr-e => mux-gen.00.sel-bit-04
net feedoverride-incr <= mux-gen.00.out-s32
setp mux-gen.00.debounce-us 200000
setp mux-gen.00.suppress-no-input False
setp mux-gen.00.in-s32-00 0
setp mux-gen.00.in-s32-01 10
setp mux-gen.00.in-s32-02 20
setp mux-gen.00.in-s32-03 30
setp mux-gen.00.in-s32-04 40
setp mux-gen.00.in-s32-05 50
setp mux-gen.00.in-s32-06 60
setp mux-gen.00.in-s32-07 70
setp mux-gen.00.in-s32-08 80
setp mux-gen.00.in-s32-09 90
setp mux-gen.00.in-s32-10 100
setp mux-gen.00.in-s32-11 110
setp mux-gen.00.in-s32-12 120
setp mux-gen.00.in-s32-13 130
setp mux-gen.00.in-s32-14 140
setp mux-gen.00.in-s32-15 150
setp mux-gen.00.in-s32-16 160
setp mux-gen.00.in-s32-17 170
setp mux-gen.00.in-s32-18 180
setp mux-gen.00.in-s32-19 190
setp mux-gen.00.in-s32-20 200
# connect max velocity overide increments - switches
setp halui.max-velocity.count-enable true
setp halui.max-velocity.direct-value true
setp halui.max-velocity.scale 0.016670
net max-vel-override-incr => halui.max-velocity.counts
net mvo-incr-a => mux-gen.01.sel-bit-00
net mvo-incr-b => mux-gen.01.sel-bit-01
net mvo-incr-c => mux-gen.01.sel-bit-02
net mvo-incr-d => mux-gen.01.sel-bit-03
net mvo-incr-e => mux-gen.01.sel-bit-04
net max-vel-override-incr <= mux-gen.01.out-s32
setp mux-gen.01.debounce-us 200000
setp mux-gen.01.suppress-no-input False
setp mux-gen.01.in-s32-00 0
setp mux-gen.01.in-s32-01 2
setp mux-gen.01.in-s32-02 4
setp mux-gen.01.in-s32-03 6
setp mux-gen.01.in-s32-04 8
setp mux-gen.01.in-s32-05 10
setp mux-gen.01.in-s32-06 12
setp mux-gen.01.in-s32-07 14
setp mux-gen.01.in-s32-08 16
setp mux-gen.01.in-s32-09 18
setp mux-gen.01.in-s32-10 20
setp mux-gen.01.in-s32-11 25
setp mux-gen.01.in-s32-12 30
setp mux-gen.01.in-s32-13 35
setp mux-gen.01.in-s32-14 40
setp mux-gen.01.in-s32-15 45
setp mux-gen.01.in-s32-16 50
setp mux-gen.01.in-s32-17 55
setp mux-gen.01.in-s32-18 60
# connect spindle overide increments
setp halui.spindle-override.count-enable true
setp halui.spindle-override.direct-value true
setp halui.spindle-override.scale .01
net spindleoverride-incr => halui.spindle-override.counts
net so-incr-a => mux16.3.sel0
net so-incr-b => mux16.3.sel1
net so-incr-c => mux16.3.sel2
net spindleoverride-incr <= mux16.3.out-s
setp mux16.3.debounce-time 0.200000
setp mux16.3.use-graycode False
setp mux16.3.suppress-no-input False
setp mux16.3.in00 100.000000
setp mux16.3.in01 90.000000
setp mux16.3.in02 70.000000
setp mux16.3.in03 80.000000
setp mux16.3.in04 110.000000
setp mux16.3.in05 120.000000
setp mux16.3.in06 60.000000
setp mux16.3.in07 50.000000
# ---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-out => iocontrol.0.emc-enable-in
# ---manual tool change signals---
loadusr -W hal_manualtoolchange
net tool-change-request iocontrol.0.tool-change => hal_manualtoolchange.change
net tool-change-confirmed 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
INI file
# Generated by PNCconf at Sun Jan 6 10:34:22 2002
# If you make changes to this file, they will be
# overwritten when you run PNCconf again
[EMC]
MACHINE = Boss5
DEBUG = 0
[DISPLAY]
DISPLAY = axis
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/shefron/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
EDITOR = gedit
GEOMETRY = xyz
[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 = linuxcnc.var
[EMCMOT]
EMCMOT = motmod
COMM_TIMEOUT = 1.0
COMM_WAIT = 0.010
SERVO_PERIOD = 1000000
[HOSTMOT2]
# **** This is for info only ****
# DRIVER0=hm2_pci
# BOARD0=5i25
[HAL]
HALUI = halui
HALFILE = Boss5.hal
HALFILE = custom.hal
POSTGUI_HALFILE = postgui_call_list.hal
SHUTDOWN = shutdown.hal
[HALUI]
[TRAJ]
AXES = 3
COORDINATES = X Y Z
LINEAR_UNITS = inch
ANGULAR_UNITS = degree
CYCLE_TIME = 0.010
DEFAULT_VELOCITY = 0.17
MAX_LINEAR_VELOCITY = 1.67
[EMCIO]
EMCIO = io
CYCLE_TIME = 0.100
TOOL_TABLE = tool.tbl
TOOLCHANGE_QUILL_UP = 1
#********************
# Axis X
#********************
[AXIS_0]
TYPE = LINEAR
HOME = 9
FERROR = .05
MIN_FERROR = .005
MAX_VELOCITY = 1.00
MAX_ACCELERATION = 2
# these are in nanoseconds
DIRSETUP = 200
DIRHOLD = 200
STEPLEN = 1000
STEPSPACE = 2000
STEP_SCALE = -10000.0
MIN_LIMIT = -0.0
MAX_LIMIT = 18.0
HOME_OFFSET = -0.050000
HOME_SEARCH_VEL = -0.2
HOME_LATCH_VEL = -0.016667
HOME_FINAL_VEL = 0.000000
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = YES
HOME_SEQUENCE = 1
#********************
# Axis Y
#********************
[AXIS_1]
TYPE = LINEAR
HOME = 10
FERROR = .05
MIN_FERROR = .001
MAX_VELOCITY = 1.00
MAX_ACCELERATION = 2
# these are in nanoseconds
DIRSETUP = 200
DIRHOLD = 200
STEPLEN = 1000
STEPSPACE = 2000
STEP_SCALE = -10000.0
MIN_LIMIT = -0.0
MAX_LIMIT = 12.0
HOME_OFFSET = -0.060000
HOME_SEARCH_VEL = -0.2
HOME_LATCH_VEL = -0.016667
HOME_FINAL_VEL = 0.000000
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = YES
HOME_SEQUENCE = 2
#********************
# Axis Z
#********************
[AXIS_2]
TYPE = LINEAR
HOME = 0.0
FERROR = 0.020
MIN_FERROR = 0.001
MAX_VELOCITY = 1.667
MAX_ACCELERATION = 1.5
# these are in nanoseconds
DIRSETUP = 200
DIRHOLD = 200
STEPLEN = 1000
STEPSPACE = 2000
STEP_SCALE = -10000.0
MIN_LIMIT = -5.0
MAX_LIMIT = 0.001
HOME_OFFSET = 0.050000
HOME_SEARCH_VEL = 0.100000
HOME_LATCH_VEL = 0.016667
HOME_FINAL_VEL = 0.000000
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = YES
HOME_SEQUENCE = 0
#********************
# Spindle
#********************
[SPINDLE_9]
ENCODER_SCALE = 1000.0
OUTPUT_SCALE = 5800
OUTPUT_MIN_LIMIT = 0.0
OUTPUT_MAX_LIMIT = 5000
Please Log in or Create an account to join the conversation.
13 Jul 2015 03:29 #60599
by PCW
Replied by PCW on topic Spindle encoder setup
A couple observations:
A 1000 P/R encoder (1000 line) should have the encoder scale set to 4000
When scaled properly you should get a encoder position change of 1.00
for every full turn of the spindle.
Also when scaled properly, the encoder velocity is in units of RPS
A 1000 P/R encoder (1000 line) should have the encoder scale set to 4000
When scaled properly you should get a encoder position change of 1.00
for every full turn of the spindle.
Also when scaled properly, the encoder velocity is in units of RPS
Please Log in or Create an account to join the conversation.
13 Jul 2015 05:03 #60601
by Duc
After the tips I was able to find my problem. The scale worked perfect at 1000, I forgot the read out was in RPS plus my scaler was off for the vfd. All fixed now and got the RPM bar working for pyvcp.
Finally getting around to tweaking the system.
Thanks
Replied by Duc on topic Spindle encoder setup
A couple observations:
A 1000 P/R encoder (1000 line) should have the encoder scale set to 4000
When scaled properly you should get a encoder position change of 1.00
for every full turn of the spindle.
Also when scaled properly, the encoder velocity is in units of RPS
After the tips I was able to find my problem. The scale worked perfect at 1000, I forgot the read out was in RPS plus my scaler was off for the vfd. All fixed now and got the RPM bar working for pyvcp.
Finally getting around to tweaking the system.
Thanks
Please Log in or Create an account to join the conversation.
Time to create page: 0.068 seconds