spindle pwm scaling

More
13 Jul 2011 23:16 #11503 by fabworx
spindle pwm scaling was created by fabworx
im not sure what is going on im running mesa 7i48 and using type 2 (up. down) +-10 v to a vfd for my spindle control. no mater which way i write the pwm gen in hal either like the exapmle in the intergrator manual or by using a pid loop i cant get axis to output more then one volt. im using both hal meter while looking at motion.spindle.speed_out and a fluke meter on the actual pins of the 7i48 board. as i slide the spindle override between 0-100% the voltage moves from .01 to 1 . what am i doing wrong? thanx in advace.:(

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

More
13 Jul 2011 23:46 #11504 by andypugh
Replied by andypugh on topic Re:spindle pwm scaling
Type 2 surprises me. I though that the Mesa daughter cards wanted PDM (type 3)

You might be confusing -1 to +1 PWM duty cycle with -10 to +10 voltage output. The HAL pins don't know what the external hardware will do with the PWm signal (it could easily be converted such that 100% duty cycle (ie 1) = 400V in some servo motor direct-drive applications.

What have you set as your pwmgen scale?

Feel free to attach INI and HAL files.

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

More
13 Jul 2011 23:49 #11505 by PCW
Replied by PCW on topic Re:spindle pwm scaling
The 7I48 uses up/down PWM mode (mode 2)
24KHz is optimum

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

More
13 Jul 2011 23:57 #11506 by fabworx
Replied by fabworx on topic Re:spindle pwm scaling
ini file
[EMC]
MACHINE = my_EMC_machine
DEBUG = 0

[DISPLAY]
DISPLAY = axis
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
MAX_FEED_OVERRIDE = 2.000000
MAX_SPINDLE_OVERRIDE = 2.000000
MIN_SPINDLE_OVERRIDE = 0.500000
INTRO_GRAPHIC = emc2.gif
INTRO_TIME = 5
PROGRAM_PREFIX = /home/denny/emc2/nc_files
INCREMENTS = 5 1 .5 .1 .05 .01 .005
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
DEFAULT_LINEAR_VELOCITY = 2.5000000
MAX_LINEAR_VELOCITY = 6.50000
MIN_LINEAR_VELOCITY = 0.1445086
FAULT_ANGULAR_VELOCITY = 0.250000
MAX_ANGULAR_VELOCITY = 720000.000000
MIN_ANGULAR_VELOCITY = 1.0000
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 = emc.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=5i20
# CONFIG0="firmware=hm2/5i20/SV12_2X7I48_72.BIT num_encoders=5 num_pwmgens=6 num_3pwmgens=0 num_stepgens=0"

[HAL]
HALUI = halui
HALFILE = my_EMC_machine.hal
SHUTDOWN = shutdown.hal

[HALUI]

[TRAJ]
AXES = 4
COORDINATES = X Y Z A
MAX_ANGULAR_VELOCITY = 12000
DEFAULT_ANGULAR_VELOCITY = 60.00
LINEAR_UNITS = inch
ANGULAR_UNITS = degree
CYCLE_TIME = 0.010
DEFAULT_VELOCITY = .5
MAX_LINEAR_VELOCITY = 6
NO_FORCE_HOMING = 1


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

#********************
# Axis X
#********************
[AXIS_0]
TYPE = LINEAR
HOME = 0.0
FERROR = 2.01
MIN_FERROR = 2.005
MAX_VELOCITY =6
BACKLASH = 0.0028
MAX_ACCELERATION = 5
P = 40
I = 0.05
D = 0.06
FF0 = 0
FF1 = 0.05
FF2 = 0
BIAS = 0
DEADBAND = 0
ENCODER_SCALE = -40640
INPUT_SCALE = -40640
OUTPUT_SCALE = 10
OUTPUT_OFFSET = 0.0
MAX_OUTPUT = 10
MIN_LIMIT = 0
MAX_LIMIT = 30.708661
HOME_OFFSET = 0.000000
HOME_SEARCH_VEL = .5
HOME_LATCH_VEL = .25
HOME_FINAL_VEL = .1
HOME_USE_INDEX = YES
HOME_SEQUENCE = 1
HOME_IGNORE_LIMITS = Yes

#********************
# Axis Y
#********************
[AXIS_1]
TYPE = LINEAR
HOME = 0.0
FERROR = .001
MIN_FERROR = .0005
MAX_VELOCITY =6
MAX_ACCELERATION = 5
P = 1
I = 0
D = 0
FF0 = 0
FF1 = 0
FF2 = 0
BIAS = 0
DEADBAND = 0
ENCODER_SCALE = -40640
INPUT_SCALE = -40640
OUTPUT_SCALE = 10
OUTPUT_OFFSET = 0.0
MAX_OUTPUT = 10
MIN_LIMIT = 0.0
MAX_LIMIT = 16.25
HOME_OFFSET = 0.000000
HOME_SEARCH_VEL = .5
HOME_LATCH_VEL = .25
HOME_FINAL_VEL = .1
HOME_USE_INDEX = YES
HOME_SEQUENCE = 2
HOME_IGNORE_LIMITS = Yes

#********************
# Axis Z
#********************
[AXIS_2]
TYPE = LINEAR
HOME = 0.0
FERROR = .001
MIN_FERROR = .0005
MAX_VELOCITY =4
MAX_ACCELERATION = 2
P = 1
I = 0
D = 0
FF0 = 0
FF1 = 0
FF2 = 0
BIAS = 0
DEADBAND = 0
ENCODER_SCALE = 40640
INPUT_SCALE = 40640
OUTPUT_SCALE = 10
OUTPUT_OFFSET = 0.0
MAX_OUTPUT = 10
MIN_LIMIT = -0.01
MAX_LIMIT = 5.5
HOME_OFFSET = 0.000000
HOME_SEARCH_VEL = .5
HOME_LATCH_VEL = .25
HOME_FINAL_VEL = .1
HOME_USE_INDEX = YES
HOME_SEQUENCE = 0

#********************
# Axis A
#********************
[AXIS_3]
TYPE = ANGULAR
HOME = 0.0
FERROR = 0.05
MIN_FERROR = 0.005
MAX_VELOCITY = 12000
MAX_ACCELERATION = 21600000
P = 1
I = 0
D = 0
FF0 = 0
FF1 = 0
FF2 = 0
BIAS = 0
DEADBAND = 0
ENCODER_SCALE = 22.2222
INPUT_SCALE = 22.2222
OUTPUT_SCALE = 10
OUTPUT_OFFSET = 0.0
MAX_OUTPUT = 10
MIN_LIMIT = -9999.0
MAX_LIMIT = 9999.0
HOME_OFFSET = 0.000000
HOME_SEARCH_VEL = 0.0
HOME_LATCH_VEL = -6.0
HOME_FINAL_VEL = 0
HOME_USE_INDEX = YES
HOME_SEQUENCE = 3

#********************
# Spindle
#********************
[SPINDLE_9]
MAX_VELOCITY = 141600
MAX_ACCELERATION = 200.0
P = 1.0
I = 0.0
D = 0.0
FF0 = 0.0
FF1 = 0.0
FF2 = 0.0
BIAS = 0.0
DEADBAND = 0.0
ENCODER_SCALE = 133.3333
INPUT_SCALE = 133.3333
OUTPUT_SCALE = 10.0
OUTPUT_OFFSET = 0.0
MAX_OUTPUT = 10.0


hal file

# Generated by PNCconf at Tue May 10 17:25:32 2011
# If you make changes to this file, they will be
# overwritten when you run PNCconf again

loadrt trivkins
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
loadrt hostmot2
loadrt hm2_pci config="firmware=hm2/5i20/SV12_2X7I48_72.BIT num_encoders=5 num_pwmgens=6 num_3pwmgens=0 num_stepgens=0"
setp hm2_5i20.0.pwmgen.pwm_frequency 100000
setp hm2_5i20.0.pwmgen.pdm_frequency 100000
setp hm2_5i20.0.watchdog.timeout_ns 10000000
loadrt near

addf hm2_5i20.0.read servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
loadrt pid num_chan=5
addf pid.0.do-pid-calcs servo-thread
addf pid.1.do-pid-calcs servo-thread
addf pid.2.do-pid-calcs servo-thread
addf pid.3.do-pid-calcs servo-thread
addf pid.4.do-pid-calcs servo-thread
alias pin pid.0.Pgain pid.x.Pgain
alias pin pid.0.Igain pid.x.Igain
alias pin pid.0.Dgain pid.x.Dgain
alias pin pid.0.bias pid.x.bias
alias pin pid.0.FF0 pid.x.FF0
alias pin pid.0.FF1 pid.x.FF1
alias pin pid.0.FF2 pid.x.FF2
alias pin pid.0.deadband pid.x.deadband
alias pin pid.0.maxoutput pid.x.maxoutput
alias pin pid.0.enable pid.x.enable
alias pin pid.0.command pid.x.command
alias pin pid.0.feedback pid.x.feedback
alias pin pid.0.output pid.x.output
alias pin pid.0.index-enable pid.x.index-enable

alias pin pid.1.Pgain pid.y.Pgain
alias pin pid.1.Igain pid.y.Igain
alias pin pid.1.Dgain pid.y.Dgain
alias pin pid.1.bias pid.y.bias
alias pin pid.1.FF0 pid.y.FF0
alias pin pid.1.FF1 pid.y.FF1
alias pin pid.1.FF2 pid.y.FF2
alias pin pid.1.deadband pid.y.deadband
alias pin pid.1.maxoutput pid.y.maxoutput
alias pin pid.1.enable pid.y.enable
alias pin pid.1.command pid.y.command
alias pin pid.1.feedback pid.y.feedback
alias pin pid.1.output pid.y.output
alias pin pid.1.index-enable pid.y.index-enable

alias pin pid.2.Pgain pid.z.Pgain
alias pin pid.2.Igain pid.z.Igain
alias pin pid.2.Dgain pid.z.Dgain
alias pin pid.2.bias pid.z.bias
alias pin pid.2.FF0 pid.z.FF0
alias pin pid.2.FF1 pid.z.FF1
alias pin pid.2.FF2 pid.z.FF2
alias pin pid.2.deadband pid.z.deadband
alias pin pid.2.maxoutput pid.z.maxoutput
alias pin pid.2.enable pid.z.enable
alias pin pid.2.command pid.z.command
alias pin pid.2.feedback pid.z.feedback
alias pin pid.2.output pid.z.output
alias pin pid.2.index-enable pid.z.index-enable

alias pin pid.3.Pgain pid.a.Pgain
alias pin pid.3.Igain pid.a.Igain
alias pin pid.3.Dgain pid.a.Dgain
alias pin pid.3.bias pid.a.bias
alias pin pid.3.FF0 pid.a.FF0
alias pin pid.3.FF1 pid.a.FF1
alias pin pid.3.FF2 pid.a.FF2
alias pin pid.3.deadband pid.a.deadband
alias pin pid.3.maxoutput pid.a.maxoutput
alias pin pid.3.enable pid.a.enable
alias pin pid.3.command pid.a.command
alias pin pid.3.feedback pid.a.feedback
alias pin pid.3.output pid.a.output
alias pin pid.3.index-enable pid.a.index-enable

alias pin pid.4.Pgain pid.s.Pgain
alias pin pid.4.Igain pid.s.Igain
alias pin pid.4.Dgain pid.s.Dgain
alias pin pid.4.bias pid.s.bias
alias pin pid.4.FF0 pid.s.FF0
alias pin pid.4.FF1 pid.s.FF1
alias pin pid.4.FF2 pid.s.FF2
alias pin pid.4.deadband pid.s.deadband
alias pin pid.4.maxoutput pid.s.maxoutput
alias pin pid.4.enable pid.s.enable
alias pin pid.4.command pid.s.command
alias pin pid.4.feedback pid.s.feedback
alias pin pid.4.output pid.s.output
alias pin pid.4.index-enable pid.s.index-enable

addf near.0 servo-thread
addf hm2_5i20.0.write servo-thread
addf hm2_5i20.0.pet_watchdog servo-thread


# --- COOLANT_PUMP ---
setp hm2_5i20.0.pwmgen.05.output-type 1
net coolant_pump-enable <= hm2_5i20.0.pwmgen.05.enable
net coolant_pump-value <= hm2_5i20.0.pwmgen.05.value


#*******************
# 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

net x-index-enable <=> pid.x.index-enable

# ---PWM Generator signals/setup---

setp hm2_5i20.0.pwmgen.00.output-type 2
setp hm2_5i20.0.pwmgen.00.scale [AXIS_0]OUTPUT_SCALE

net xenable => pid.x.enable
net xoutput pid.x.output => hm2_5i20.0.pwmgen.00.value
net xpos-cmd axis.0.motor-pos-cmd => pid.x.command
net xenable axis.0.amp-enable-out => hm2_5i20.0.pwmgen.00.enable hm2_5i20.0.gpio.047.out


# ---Encoder feedback signals/setup---

setp hm2_5i20.0.encoder.00.counter-mode 0
setp hm2_5i20.0.encoder.00.filter 1
setp hm2_5i20.0.encoder.00.index-invert 0
setp hm2_5i20.0.encoder.00.index-mask 0
setp hm2_5i20.0.encoder.00.index-mask-invert 0
setp hm2_5i20.0.encoder.00.scale [AXIS_0]ENCODER_SCALE

net xpos-fb <= hm2_5i20.0.encoder.00.position
net xpos-fb => pid.x.feedback
net xpos-fb => axis.0.motor-pos-fb
net x-index-enable axis.0.index-enable <=> hm2_5i20.0.encoder.00.index-enable

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

net x-home-sw => axis.0.home-sw-in hm2_5i20.0.gpio.033.in
net x-neg-limit => axis.0.neg-lim-sw-in hm2_5i20.0.gpio.035.in
net x-pos-limit => axis.0.pos-lim-sw-in hm2_5i20.0.gpio.034.in

#*******************
# AXIS Y
#*******************

setp pid.y.Pgain [AXIS_1]P
setp pid.y.Igain [AXIS_1]I
setp pid.y.Dgain [AXIS_1]D
setp pid.y.bias [AXIS_1]BIAS
setp pid.y.FF0 [AXIS_1]FF0
setp pid.y.FF1 [AXIS_1]FF1
setp pid.y.FF2 [AXIS_1]FF2
setp pid.y.deadband [AXIS_1]DEADBAND
setp pid.y.maxoutput [AXIS_1]MAX_OUTPUT

net y-index-enable <=> pid.y.index-enable

# ---PWM Generator signals/setup---

setp hm2_5i20.0.pwmgen.01.output-type 2
setp hm2_5i20.0.pwmgen.01.scale [AXIS_1]OUTPUT_SCALE

net yenable => pid.y.enable
net youtput pid.y.output => hm2_5i20.0.pwmgen.01.value
net ypos-cmd axis.1.motor-pos-cmd => pid.y.command
net yenable axis.1.amp-enable-out => hm2_5i20.0.pwmgen.01.enable

# ---Encoder feedback signals/setup---

setp hm2_5i20.0.encoder.01.counter-mode 0
setp hm2_5i20.0.encoder.01.filter 1
setp hm2_5i20.0.encoder.01.index-invert 0
setp hm2_5i20.0.encoder.01.index-mask 0
setp hm2_5i20.0.encoder.01.index-mask-invert 0
setp hm2_5i20.0.encoder.01.scale [AXIS_1]ENCODER_SCALE

net ypos-fb <= hm2_5i20.0.encoder.01.position
net ypos-fb => pid.y.feedback
net ypos-fb => axis.1.motor-pos-fb
net y-index-enable axis.1.index-enable <=> hm2_5i20.0.encoder.01.index-enable

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

net y-home-sw => axis.1.home-sw-in hm2_5i20.0.gpio.030.in
net y-neg-limit => axis.1.neg-lim-sw-in hm2_5i20.0.gpio.031.in
net y-pos-limit => axis.1.pos-lim-sw-in hm2_5i20.0.gpio.032.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

net z-index-enable <=> pid.z.index-enable

# ---PWM Generator signals/setup---

setp hm2_5i20.0.pwmgen.02.output-type 2
setp hm2_5i20.0.pwmgen.02.scale [AXIS_2]OUTPUT_SCALE

net zenable => pid.z.enable
net zoutput pid.z.output => hm2_5i20.0.pwmgen.02.value
net zpos-cmd axis.2.motor-pos-cmd => pid.z.command
net zenable axis.2.amp-enable-out => hm2_5i20.0.pwmgen.02.enable

# ---Encoder feedback signals/setup---

setp hm2_5i20.0.encoder.02.counter-mode 0
setp hm2_5i20.0.encoder.02.filter 1
setp hm2_5i20.0.encoder.02.index-invert 0
setp hm2_5i20.0.encoder.02.index-mask 0
setp hm2_5i20.0.encoder.02.index-mask-invert 0
setp hm2_5i20.0.encoder.02.scale [AXIS_2]ENCODER_SCALE

net zpos-fb <= hm2_5i20.0.encoder.02.position
net zpos-fb => pid.z.feedback
net zpos-fb => axis.2.motor-pos-fb
net z-index-enable axis.2.index-enable <=> hm2_5i20.0.encoder.02.index-enable

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

net z-home-sw hm2_5i20.0.gpio.046.out => axis.2.home-sw-in hm2_5i20.0.gpio.027.in
net z-neg-limit => axis.2.neg-lim-sw-in hm2_5i20.0.gpio.028.in
net z-pos-limit => axis.2.pos-lim-sw-in hm2_5i20.0.gpio.029.in

#*******************
# AXIS A
#*******************

setp pid.a.Pgain [AXIS_3]P
setp pid.a.Igain [AXIS_3]I
setp pid.a.Dgain [AXIS_3]D
setp pid.a.bias [AXIS_3]BIAS
setp pid.a.FF0 [AXIS_3]FF0
setp pid.a.FF1 [AXIS_3]FF1
setp pid.a.FF2 [AXIS_3]FF2
setp pid.a.deadband [AXIS_3]DEADBAND
setp pid.a.maxoutput [AXIS_3]MAX_OUTPUT

net a-index-enable <=> pid.a.index-enable

# ---PWM Generator signals/setup---

setp hm2_5i20.0.pwmgen.03.output-type 2
setp hm2_5i20.0.pwmgen.03.scale [AXIS_3]OUTPUT_SCALE

net aenable => pid.a.enable
net aoutput pid.a.output => hm2_5i20.0.pwmgen.03.value
net apos-cmd axis.3.motor-pos-cmd => pid.a.command
net aenable axis.3.amp-enable-out => hm2_5i20.0.pwmgen.03.enable

# ---Encoder feedback signals/setup---

setp hm2_5i20.0.encoder.03.counter-mode 0
setp hm2_5i20.0.encoder.03.filter 1
setp hm2_5i20.0.encoder.03.index-invert 0
setp hm2_5i20.0.encoder.03.index-mask 0
setp hm2_5i20.0.encoder.03.index-mask-invert 0
setp hm2_5i20.0.encoder.03.scale [AXIS_3]ENCODER_SCALE

net apos-fb <= hm2_5i20.0.encoder.03.position
net apos-fb => pid.a.feedback
net apos-fb => axis.3.motor-pos-fb
net a-index-enable axis.3.index-enable <=> hm2_5i20.0.encoder.03.index-enable



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

setp pid.s.Pgain [SPINDLE_9]P
setp pid.s.Igain [SPINDLE_9]I
setp pid.s.Dgain [SPINDLE_9]D
setp pid.s.bias [SPINDLE_9]BIAS
setp pid.s.FF0 [SPINDLE_9]FF0
setp pid.s.FF1 [SPINDLE_9]FF1
setp pid.s.FF2 [SPINDLE_9]FF2
setp pid.s.deadband [SPINDLE_9]DEADBAND
setp pid.s.maxoutput [SPINDLE_9]MAX_OUTPUT

net spindle-index-enable <=> pid.s.index-enable

# ---PWM Generator signals/setup---

setp hm2_5i20.0.pwmgen.04.output-type 2
setp hm2_5i20.0.pwmgen.04.scale [SPINDLE_9]OUTPUT_SCALE


net spindle-vel-cmd => pid.s.command
net spindle-output => hm2_5i20.0.pwmgen.04.value
net spindle-enable => pid.s.enable
net spindle-enable => hm2_5i20.0.pwmgen.04.enable
net spindle-vel-fb => pid.s.feedback

# ---Encoder feedback signals/setup---
setp hm2_5i20.0.encoder.04.counter-mode 0
setp hm2_5i20.0.encoder.04.filter 1
setp hm2_5i20.0.encoder.04.index-invert 0
setp hm2_5i20.0.encoder.04.index-mask 0
setp hm2_5i20.0.encoder.04.index-mask-invert 0
setp hm2_5i20.0.encoder.04.scale [SPINDLE_9]ENCODER_SCALE

net spindle-revs <= hm2_5i20.0.encoder.04.position
net spindle-vel-fb <= hm2_5i20.0.encoder.04.velocity
net spindle-index-enable <=> hm2_5i20.0.encoder.04.index-enable

# ---setup spindle control signals---

net spindle-vel-cmd-rps <= motion.spindle-speed-out-rps
net spindle-vel-cmd <= motion.spindle-speed-out
net spindle-enable hm2_5i20.0.gpio.071.out <= 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---

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

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

# ---coolant signals---

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


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

# ---estop signals---
# create a signal for the estop loopback
#net estop-loop iocontrol.0.user-enable-out => iocontrol.0.emc-enable-in
net estop-tripped hm2_5i20.0.gpio.036.in => iocontrol.0.emc-enable-in
#net machine-off hm2_5i20.0.gpio.036.in_not => halui.machine.off
# ---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

#Middle 7i37 COM board is 12vdc
#Top 7i37 COM is 24vdc

#Tool Out
setp hm2_5i20.0.gpio.040.is_output true

#Tool In
setp hm2_5i20.0.gpio.041.is_output true

#Turret Home
setp hm2_5i20.0.gpio.042.is_output true

#Turret CW
setp hm2_5i20.0.gpio.043.is_output true

#Turret CCW
setp hm2_5i20.0.gpio.044.is_output true

#Spindle Stoped
setp hm2_5i20.0.gpio.045.is_output true

#Z is in home position
setp hm2_5i20.0.gpio.046.is_output true
setp hm2_5i20.0.gpio.046.invert_output true

#drive enable and estop loop powerup
setp hm2_5i20.0.gpio.047.is_output true
setp hm2_5i20.0.gpio.047.invert_output true

#
setp hm2_5i20.0.gpio.064.is_output true

#
setp hm2_5i20.0.gpio.065.is_output true

#
setp hm2_5i20.0.gpio.066.is_output true

#
setp hm2_5i20.0.gpio.067.is_output true

#
setp hm2_5i20.0.gpio.068.is_output true

#
setp hm2_5i20.0.gpio.069.is_output true

#
setp hm2_5i20.0.gpio.070.is_output true

#Spindle Enable
setp hm2_5i20.0.gpio.071.is_output true
setp hm2_5i20.0.gpio.071.invert_output true

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

More
14 Jul 2011 00:06 #11507 by andypugh
Replied by andypugh on topic Re:spindle pwm scaling
Sorry if this seems a silly question, but I have seen this a few times:

You have turned the spindle on? Either M3 S141600 (is that really your peak spindle speed?) or pressing the little clockwise button, then the + button several times?

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

More
14 Jul 2011 02:29 #11509 by fabworx
Replied by fabworx on topic Re:spindle pwm scaling
ive have tried all of those. andy. the reason my scale is set at 141600 is because im runing a pid loop and upon working out the math with peter thats what wwe came up with. how ever i did have it set at 2360 which is the rpm at full throttle. im going on 16 hrs of trying to get the spindle turning and to no avail. i have even writen a hal enabling all of the pmw gens true at seting the values at 10 with a setp . none of that worked which is weird because while using the hal that i posted my axis motors spin fine. pid has not been adjusted as im not there yet.

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

More
14 Jul 2011 03:30 #11510 by PCW
Replied by PCW on topic Re:spindle pwm scaling
The number I came up with was 133.3 for encoder scale on the spindle encoder as this would make the spindle encoder velocity pin be scaled directly in RPM with your 8000 count encoders. This is so a PID spindle setup would be programmed directly in RPM.

For an open loop setup the HotsMot2 PWMGEN scale should be set to the maximum RPM at 10V input to the VFD (2360 in your case) and the commanded spindle speed in RPM can connect directly to the PWMGEN
There's no need for funny number in the S commands

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

More
14 Jul 2011 06:15 #11514 by fabworx
Replied by fabworx on topic Re:spindle pwm scaling
i got it workin with linksp commands. it was funny i couldnt get the pid loop to work till i inserted a pid.s.output so i knew that i wasnt getting a command from axis to command the output to pmwgen.04.value. so the scaling had nothing to do with it. i did find in the integrater manual under m5i20 that the pmw gens scale function maxes out at 1 so thats now what its set at. i have the vfd set up to be 80hz at 10 volts. but at 50% on the spindle speed over ride slider the vfd says 39.92 hz. so the scaling is close but i want it right on so im not sure how to go about that yet. ultimately i would like to have the hal setup so that i can do rigid tapping and syncronous moves, like electronic gearing so that if i rotate the spindle by hand the axis its geared to, weather it be my a axis for gear cutting or z axis for tapping, the corresponding axis moves as well. thanx you guys for your input i appreciate all of your help peter. hes spent many hours of his time on the phone with me thanx again.

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

More
14 Jul 2011 09:09 #11515 by andypugh
Replied by andypugh on topic Re:spindle pwm scaling
Glad you have some movement.

When you do the PID tuning you might find that it works best with PGain = 0 , because of the nature of the loop.
I also think that it is probably one of the few occasions where FF0 is useful. If you set FF0 to 1/max_rpm and P,I,D at zero, then you should have open-loop control which is fairly close. Then you can use the I and P terms to modify that to make it accurate.

(However, exact accuracy isn't that critical for a spindle, as you don't really care about SFM to 0.1% really.)

Electronic gearing and rigid tapping work directly from the spindle encoder counts, so are not dependant on the PID particularly, However the FF0-based scheme I outlined above should give you a nice fast response for the tapping reverse.

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

More
15 Jul 2011 18:38 #11557 by fabworx
Replied by fabworx on topic Re:spindle pwm scaling
thanx for your help andy.

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

Time to create page: 0.304 seconds
Powered by Kunena Forum