Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # #######################################
- #
- # HAL file for HostMot2 with 3 servos
- #
- # Derived from Ted Hyde's original hm2-servo config
- #
- # Based up work and discussion with Seb & Peter & Jeff
- # GNU license references - insert here. www.linuxcnc.org
- #
- #
- # ########################################
- # Firmware files are in /lib/firmware/hm2/7i43/
- # Must symlink the hostmot2 firmware directory of sanbox to
- # /lib/firmware before running EMC2...
- # sudo ln -s $HOME/emc2-sandbox/src/hal/drivers/mesa-hostmot2/firmware /lib/firmware/hm2
- #
- # See also:
- # <http://www.linuxcnc.org/docs/devel/html/man/man9/hostmot2.9.html#config%20modparam>
- # and http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl?HostMot2
- #
- # #####################################################################
- # ###################################
- # Core EMC/HAL Loads
- # ###################################
- # kinematics
- loadrt trivkins
- # motion controller, get name and thread periods from ini file
- loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
- # standard components
- loadrt pid num_chan=4 debug=1
- loadrt abs
- # only the 7i43 needs this, but it doesnt hurt the others
- loadrt probe_parport
- # hostmot2 driver
- # if you have any firmware trouble, enable the debug flags here and see what's going on in the syslog
- #loadrt hostmot2 debug_idrom=1 debug_module_descriptors=1 debug_pin_descriptors=1 debug_modules=1
- loadrt hostmot2
- # load low-level driver
- loadrt [HOSTMOT2](DRIVER) config=[HOSTMOT2](CONFIG)
- #gearshift module
- loadrt gearshift16
- setp hm2_[HOSTMOT2](BOARD).0.pwmgen.pwm_frequency 40000
- setp hm2_[HOSTMOT2](BOARD).0.watchdog.timeout_ns 10000000
- setp hm2_[HOSTMOT2](BOARD).1.pwmgen.pwm_frequency 24000
- setp hm2_[HOSTMOT2](BOARD).1.watchdog.timeout_ns 10000000
- # This configuration uses classicladder for machine logic
- # (load the realtime portion)
- # these classicladder parameters need to be optimized after ladder completion
- loadrt classicladder_rt numRungs=24 numBits=30 numWords=4 numTimers=5 numMonostables=10 numPhysInputs=50 numPhysOutputs=30 numArithmExpr=30 numSections=10
- # We kick ladder into a thread at the slower servo rate rather than base rate
- addf classicladder.0.refresh servo-thread 1
- # invoke the user part of CL to silently load the program
- # later we will need to add the clp file mentioned below
- # to the ini file so that we do not need to hardcode it here.
- loadusr -w classicladder --nogui demo_step_cl.clp
- # load the GUI aswell
- # loadusr classicladder
- # ################################################
- # THREADS
- # ################################################
- addf hm2_[HOSTMOT2](BOARD).0.read servo-thread
- addf hm2_[HOSTMOT2](BOARD).1.read servo-thread
- addf motion-command-handler servo-thread
- addf motion-controller servo-thread
- 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 hm2_[HOSTMOT2](BOARD).0.write servo-thread
- addf hm2_[HOSTMOT2](BOARD).1.write servo-thread
- addf hm2_[HOSTMOT2](BOARD).0.pet_watchdog servo-thread
- addf hm2_[HOSTMOT2](BOARD).1.pet_watchdog servo-thread
- addf abs.0 servo-thread
- addf gearshift16.0 servo-thread
- # ######################################################
- # Axis-of-motion Specific Configs (not the GUI)
- # ######################################################
- # ################
- # X [0] Axis
- # ################
- # axis enable chain
- newsig emcmot.00.enable bit
- sets emcmot.00.enable FALSE
- net emcmot.00.enable => pid.0.enable
- # remove when tuning loop today
- net emcmot.00.enable => hm2_[HOSTMOT2](BOARD).0.pwmgen.00.enable
- # setp hm2_[HOSTMOT2](BOARD).0.pwmgen.00.enable true
- net emcmot.00.enable <= axis.0.amp-enable-out
- # encoder feedback
- setp hm2_[HOSTMOT2](BOARD).0.encoder.00.counter-mode 0
- setp hm2_[HOSTMOT2](BOARD).0.encoder.00.filter 1
- setp hm2_[HOSTMOT2](BOARD).0.encoder.00.index-invert 0
- setp hm2_[HOSTMOT2](BOARD).0.encoder.00.index-mask 0
- setp hm2_[HOSTMOT2](BOARD).0.encoder.00.index-mask-invert 0
- setp hm2_[HOSTMOT2](BOARD).0.encoder.00.scale [AXIS_0]INPUT_SCALE
- net motor.00.pos-fb hm2_[HOSTMOT2](BOARD).0.encoder.00.position => pid.0.feedback
- net motor.00.pos-fb => axis.0.motor-pos-fb #push copy back to Axis GUI
- # set PID loop gains from inifile
- setp pid.0.Pgain [AXIS_0]P
- setp pid.0.Igain [AXIS_0]I
- setp pid.0.Dgain [AXIS_0]D
- setp pid.0.bias [AXIS_0]BIAS
- setp pid.0.FF0 [AXIS_0]FF0
- setp pid.0.FF1 [AXIS_0]FF1
- setp pid.0.FF2 [AXIS_0]FF2
- setp pid.0.deadband [AXIS_0]DEADBAND
- setp pid.0.maxoutput [AXIS_0]MAX_OUTPUT
- # position command signals
- setp hm2_[HOSTMOT2](BOARD).0.pwmgen.00.output-type 1 #pwm on pin1, dir on pin2
- setp hm2_[HOSTMOT2](BOARD).0.pwmgen.00.scale [AXIS_0]OUTPUT_SCALE
- net emcmot.00.pos-cmd axis.0.motor-pos-cmd => pid.0.command
- # remove when tuning servo today
- net motor.00.command pid.0.output => hm2_[HOSTMOT2](BOARD).0.pwmgen.00.value
- # ################
- # Y [1] Axis
- # ################
- # axis enable chain
- newsig emcmot.01.enable bit
- sets emcmot.01.enable FALSE
- net emcmot.01.enable => pid.1.enable
- #today1
- #setp hm2_[HOSTMOT2](BOARD).0.pwmgen.01.enable true
- net emcmot.01.enable => hm2_[HOSTMOT2](BOARD).0.pwmgen.01.enable
- net emcmot.01.enable hm2_[HOSTMOT2](BOARD).1.gpio.058.out
- net emcmot.01.enable <= axis.1.amp-enable-out
- # encoder feedback
- setp hm2_[HOSTMOT2](BOARD).0.encoder.01.counter-mode 0
- setp hm2_[HOSTMOT2](BOARD).0.encoder.01.filter 1
- setp hm2_[HOSTMOT2](BOARD).0.encoder.01.index-invert 0
- setp hm2_[HOSTMOT2](BOARD).0.encoder.01.index-mask 0
- setp hm2_[HOSTMOT2](BOARD).0.encoder.01.index-mask-invert 0
- setp hm2_[HOSTMOT2](BOARD).0.encoder.01.scale [AXIS_1]INPUT_SCALE
- #today1
- net motor.01.pos-fb hm2_[HOSTMOT2](BOARD).0.encoder.01.position => pid.1.feedback
- net motor.01.pos-fb => axis.1.motor-pos-fb #push copy back to Axis GUI
- # set PID loop gains from inifile
- setp pid.1.Pgain [AXIS_1]P
- setp pid.1.Igain [AXIS_1]I
- setp pid.1.Dgain [AXIS_1]D
- setp pid.1.bias [AXIS_1]BIAS
- setp pid.1.FF0 [AXIS_1]FF0
- setp pid.1.FF1 [AXIS_1]FF1
- setp pid.1.FF2 [AXIS_1]FF2
- setp pid.1.deadband [AXIS_1]DEADBAND
- setp pid.1.maxoutput [AXIS_1]MAX_OUTPUT
- # position command signals
- setp hm2_[HOSTMOT2](BOARD).0.pwmgen.01.output-type 1 #pwm on pin1, dir on pin2
- setp hm2_[HOSTMOT2](BOARD).0.pwmgen.01.scale [AXIS_1]OUTPUT_SCALE
- net emcmot.01.pos-cmd axis.1.motor-pos-cmd => pid.1.command
- # today1
- net motor.01.command pid.1.output => hm2_[HOSTMOT2](BOARD).0.pwmgen.01.value
- # ################
- # Z [2] Axis
- # ################
- # axis enable chain
- newsig emcmot.02.enable bit
- sets emcmot.02.enable FALSE
- net emcmot.02.enable => pid.2.enable
- # again
- net emcmot.02.enable => hm2_[HOSTMOT2](BOARD).0.pwmgen.02.enable
- #setp hm2_[HOSTMOT2](BOARD).0.pwmgen.02.enable true
- net emcmot.02.enable <= axis.2.amp-enable-out
- # encoder feedback
- setp hm2_[HOSTMOT2](BOARD).0.encoder.02.counter-mode 0
- setp hm2_[HOSTMOT2](BOARD).0.encoder.02.filter 1
- setp hm2_[HOSTMOT2](BOARD).0.encoder.02.index-invert 0
- setp hm2_[HOSTMOT2](BOARD).0.encoder.02.index-mask 0
- setp hm2_[HOSTMOT2](BOARD).0.encoder.02.index-mask-invert 0
- setp hm2_[HOSTMOT2](BOARD).0.encoder.02.scale [AXIS_2]INPUT_SCALE
- net motor.02.pos-fb hm2_[HOSTMOT2](BOARD).0.encoder.02.position => pid.2.feedback
- net motor.02.pos-fb => axis.2.motor-pos-fb #push copy back to Axis GUI
- # set PID loop gains from inifile
- setp pid.2.Pgain [AXIS_2]P
- setp pid.2.Igain [AXIS_2]I
- setp pid.2.Dgain [AXIS_2]D
- setp pid.2.bias [AXIS_2]BIAS
- setp pid.2.FF0 [AXIS_2]FF0
- setp pid.2.FF1 [AXIS_2]FF1
- setp pid.2.FF2 [AXIS_2]FF2
- setp pid.2.deadband [AXIS_2]DEADBAND
- setp pid.2.maxoutput [AXIS_2]MAX_OUTPUT
- # position command signals
- setp hm2_[HOSTMOT2](BOARD).0.pwmgen.02.output-type 1 #pwm on pin1, dir on pin2
- setp hm2_[HOSTMOT2](BOARD).0.pwmgen.02.scale [AXIS_2]OUTPUT_SCALE
- net emcmot.02.pos-cmd axis.2.motor-pos-cmd => pid.2.command
- # again
- net motor.02.command pid.2.output => hm2_[HOSTMOT2](BOARD).0.pwmgen.02.value
- # ################
- # B [4] Axis
- # ################
- # axis enable chain
- newsig emcmot.04.enable bit
- sets emcmot.04.enable FALSE
- net emcmot.04.enable => pid.3.enable
- # again
- net emcmot.04.enable => hm2_[HOSTMOT2](BOARD).1.pwmgen.00.enable
- net emcmot.04.enable <= axis.4.amp-enable-out
- # encoder feedback
- setp hm2_[HOSTMOT2](BOARD).1.encoder.00.counter-mode 0
- setp hm2_[HOSTMOT2](BOARD).1.encoder.00.filter 1
- setp hm2_[HOSTMOT2](BOARD).1.encoder.00.index-invert 0
- setp hm2_[HOSTMOT2](BOARD).1.encoder.00.index-mask 0
- setp hm2_[HOSTMOT2](BOARD).1.encoder.00.index-mask-invert 0
- setp hm2_[HOSTMOT2](BOARD).1.encoder.00.scale [AXIS_4]INPUT_SCALE
- net motor.04.pos-fb hm2_[HOSTMOT2](BOARD).1.encoder.00.position => pid.3.feedback
- net motor.04.pos-fb => axis.4.motor-pos-fb #push copy back to Axis GUI
- # set PID loop gains from inifile
- setp pid.3.Pgain [AXIS_4]P
- setp pid.3.Igain [AXIS_4]I
- setp pid.3.Dgain [AXIS_4]D
- setp pid.3.bias [AXIS_4]BIAS
- setp pid.3.FF0 [AXIS_4]FF0
- setp pid.3.FF1 [AXIS_4]FF1
- setp pid.3.FF2 [AXIS_4]FF2
- setp pid.3.deadband [AXIS_4]DEADBAND
- setp pid.3.maxoutput [AXIS_4]MAX_OUTPUT
- # position command signals
- setp hm2_[HOSTMOT2](BOARD).1.pwmgen.00.output-type 2 #pwm on pin1, pwm on pin2
- setp hm2_[HOSTMOT2](BOARD).1.pwmgen.00.scale [AXIS_4]OUTPUT_SCALE
- net emcmot.04.pos-cmd axis.4.motor-pos-cmd => pid.3.command
- # again
- net motor.04.command pid.3.output => hm2_[HOSTMOT2](BOARD).1.pwmgen.00.value
- # velocity feedback for pid
- net bvel pid.3.feedback-deriv hm2_5i20.1.encoder.00.velocity
- # ##################################################
- # Standard I/O Block - EStop, Etc
- # ##################################################
- # create a signal for the estop loopback
- # net estop-loop iocontrol.0.user-enable-out => iocontrol.0.emc-enable-in
- # setp hm2_[HOSTMOT2](BOARD).1.gpio.060.is_output true
- # setp hm2_[HOSTMOT2](BOARD).1.gpio.060.is_opendrain true
- # setp hm2_[HOSTMOT2](BOARD).1.gpio.060.invert_output true
- # net estop-loop hm2_[HOSTMOT2](BOARD).1.gpio.060.out
- setp hm2_[HOSTMOT2](BOARD).1.gpio.060.is_output true
- setp hm2_[HOSTMOT2](BOARD).1.gpio.060.is_opendrain true
- setp hm2_[HOSTMOT2](BOARD).1.gpio.060.invert_output true
- net estop-loop-out hm2_[HOSTMOT2](BOARD).1.gpio.060.out iocontrol.0.user-enable-out classicladder.0.in-02
- net ext-loop-in hm2_[HOSTMOT2](BOARD).1.gpio.061.in_not classicladder.0.in-00
- net estop-enable iocontrol.0.emc-enable-in classicladder.0.out-00
- net Reset-estop iocontrol.0.user-request-enable classicladder.0.in-01
- # maybe engage some motor start relays at estop enable.
- #400psi pump
- setp hm2_[HOSTMOT2](BOARD).0.gpio.048.is_output true
- setp hm2_[HOSTMOT2](BOARD).0.gpio.048.is_opendrain true
- setp hm2_[HOSTMOT2](BOARD).0.gpio.048.invert_output true
- #1200psi pump
- setp hm2_[HOSTMOT2](BOARD).0.gpio.049.is_output true
- setp hm2_[HOSTMOT2](BOARD).0.gpio.049.is_opendrain true
- setp hm2_[HOSTMOT2](BOARD).0.gpio.049.invert_output true
- # servo drive transformer
- setp hm2_[HOSTMOT2](BOARD).0.gpio.050.is_output true
- setp hm2_[HOSTMOT2](BOARD).0.gpio.050.is_opendrain true
- setp hm2_[HOSTMOT2](BOARD).0.gpio.050.invert_output true
- #sump pump
- setp hm2_[HOSTMOT2](BOARD).0.gpio.051.is_output true
- setp hm2_[HOSTMOT2](BOARD).0.gpio.051.is_opendrain true
- setp hm2_[HOSTMOT2](BOARD).0.gpio.051.invert_output true
- #spindle vfd
- setp hm2_[HOSTMOT2](BOARD).0.gpio.054.is_output true
- setp hm2_[HOSTMOT2](BOARD).0.gpio.054.is_opendrain true
- setp hm2_[HOSTMOT2](BOARD).0.gpio.054.invert_output true
- #y servo brake output
- setp hm2_[HOSTMOT2](BOARD).1.gpio.058.is_output true
- setp hm2_[HOSTMOT2](BOARD).1.gpio.058.is_opendrain true
- setp hm2_[HOSTMOT2](BOARD).1.gpio.058.invert_output true
- net estop-enable hm2_[HOSTMOT2](BOARD).0.gpio.048.out hm2_[HOSTMOT2](BOARD).0.gpio.049.out hm2_[HOSTMOT2](BOARD).0.gpio.051.out hm2_[HOSTMOT2](BOARD).0.gpio.050.out hm2_[HOSTMOT2](BOARD).0.gpio.054.out
- #today1
- #net estop-enable hm2_[HOSTMOT2](BOARD).1.gpio.058.out
- # net estop-activate-halui halui.estop.activate classicladder.0.out-00
- # net estop-loop-in classicladder.0.in-00
- #
- # homing
- #
- #
- # In this example, each of the three axes have their own home switch. All
- # home switches are connected to GPIO 25, though hostmot2 boards generally
- # have enough GPIO pins to put each axis' home switch on its own pin.
- #
- # Each switch is normally open, momentarily closed. When the switch is open,
- # GPIO 25 floats high (because that is the hostmot2 way). When the switch is
- # closed, it shorts GPIO 25 to ground.
- #
- # EMC expects the value on the .home-sw-in HAL pin to be active high, ie
- # True when the switch is closed and False when the switch is open.
- # We get this behavior by linking the GPIO .in_not pin instead of the .in
- # pin.
- #
- # x axis home switch hookup
- net xhome-switch axis.0.home-sw-in hm2_[HOSTMOT2](BOARD).1.gpio.069.in_not
- net x-index-enable hm2_[HOSTMOT2](BOARD).0.encoder.00.index-enable <=> axis.0.index-enable
- # only the Y servo has an index, X and Z home without using the index
- net yhome-switch axis.1.home-sw-in hm2_[HOSTMOT2](BOARD).0.gpio.030.in_not
- net y-index-enable hm2_[HOSTMOT2](BOARD).0.encoder.01.index-enable <=> axis.1.index-enable
- # z axis homing switch hookup
- net zhome-switch axis.2.home-sw-in hm2_[HOSTMOT2](BOARD).1.gpio.028.in_not
- net z-index-enable hm2_[HOSTMOT2](BOARD).0.encoder.02.index-enable <=> axis.2.index-enable
- #baxis home setup
- net b-index-enable hm2_[HOSTMOT2](BOARD).1.encoder.00.index-enable <=> axis.4.index-enable pid.3.index-enable
- # here is the TRP solinoid enable....
- setp hm2_[HOSTMOT2](BOARD).0.gpio.063.is_output true
- setp hm2_[HOSTMOT2](BOARD).0.gpio.063.is_opendrain true
- setp hm2_[HOSTMOT2](BOARD).0.gpio.063.invert_output true
- net emcmot.00.enable hm2_[HOSTMOT2](BOARD).0.gpio.063.out
- #tool changer
- #clamp/unclamp
- setp hm2_[HOSTMOT2](BOARD).0.gpio.069.is_output true
- setp hm2_[HOSTMOT2](BOARD).0.gpio.069.is_opendrain true
- setp hm2_[HOSTMOT2](BOARD).0.gpio.069.invert_output true
- net chain-unclamp hm2_[HOSTMOT2](BOARD).0.gpio.069.out classicladder.0.out-01
- #chain Advance
- setp hm2_[HOSTMOT2](BOARD).0.gpio.071.is_output true
- setp hm2_[HOSTMOT2](BOARD).0.gpio.071.is_opendrain true
- setp hm2_[HOSTMOT2](BOARD).0.gpio.071.invert_output true
- net chain-advance hm2_[HOSTMOT2](BOARD).0.gpio.071.out classicladder.0.out-02
- #chain creep
- setp hm2_[HOSTMOT2](BOARD).0.gpio.070.is_output true
- setp hm2_[HOSTMOT2](BOARD).0.gpio.070.is_opendrain true
- setp hm2_[HOSTMOT2](BOARD).0.gpio.070.invert_output true
- net chain-creep hm2_[HOSTMOT2](BOARD).0.gpio.070.out classicladder.0.out-03
- # create signals for tool loading loopback
- # net tool-prep-loop iocontrol.0.tool-prepare => iocontrol.0.tool-prepared
- # net tool-change-loop iocontrol.0.tool-change => iocontrol.0.tool-changed
- net Tool-prepare iocontrol.0.tool-prepare classicladder.0.in-03
- net Tool-prepared iocontrol.0.tool-prepared classicladder.0.out-04
- # tool unclamped switch
- net chain-unclamped hm2_5i20.0.gpio.029.in_not classicladder.0.in-04
- net chain-clamped hm2_5i20.0.gpio.028.in_not classicladder.0.in-05
- net toolchain-strobe hm2_5i20.1.gpio.047.in classicladder.0.in-06
- net tool-prep-number iocontrol.0.tool-prep-number classicladder.0.s32in-00
- net tool-bit0 hm2_5i20.1.gpio.046.in_not classicladder.0.in-07
- net tool-bit1 hm2_5i20.1.gpio.045.in_not classicladder.0.in-08
- net tool-bit2 hm2_5i20.1.gpio.044.in_not classicladder.0.in-09
- net tool-bit3 hm2_5i20.1.gpio.043.in_not classicladder.0.in-10
- net tool-bit4 hm2_5i20.1.gpio.042.in_not classicladder.0.in-11
- net tool-bit5 hm2_5i20.1.gpio.041.in_not classicladder.0.in-12
- net tool-bit6 hm2_5i20.1.gpio.040.in_not classicladder.0.in-13
- net tool-bit7 hm2_5i20.1.gpio.039.in_not classicladder.0.in-14
- net tool-bit8 hm2_5i20.1.gpio.038.in_not classicladder.0.in-15
- net tool-bit9 hm2_5i20.1.gpio.037.in_not classicladder.0.in-16
- net tool-bit10 hm2_5i20.1.gpio.036.in_not classicladder.0.in-17
- net tool-bit11 hm2_5i20.1.gpio.035.in_not classicladder.0.in-18
- net tool-bit12 hm2_5i20.1.gpio.034.in_not classicladder.0.in-19
- net tool-bit13 hm2_5i20.1.gpio.033.in_not classicladder.0.in-20
- net tool-bit14 hm2_5i20.1.gpio.032.in_not classicladder.0.in-21
- #tool arm in/out
- setp hm2_[HOSTMOT2](BOARD).0.gpio.068.is_output true
- setp hm2_[HOSTMOT2](BOARD).0.gpio.068.is_opendrain true
- setp hm2_[HOSTMOT2](BOARD).0.gpio.068.invert_output true
- net toolarmout hm2_[HOSTMOT2](BOARD).0.gpio.068.out classicladder.0.out-05
- #tool arm ccw
- setp hm2_[HOSTMOT2](BOARD).0.gpio.066.is_output true
- setp hm2_[HOSTMOT2](BOARD).0.gpio.066.is_opendrain true
- setp hm2_[HOSTMOT2](BOARD).0.gpio.066.invert_output true
- net toolarmccw hm2_[HOSTMOT2](BOARD).0.gpio.066.out classicladder.0.out-07
- #tool arm cw
- setp hm2_[HOSTMOT2](BOARD).0.gpio.065.is_output true
- setp hm2_[HOSTMOT2](BOARD).0.gpio.065.is_opendrain true
- setp hm2_[HOSTMOT2](BOARD).0.gpio.065.invert_output true
- net toolarmcw hm2_[HOSTMOT2](BOARD).0.gpio.065.out classicladder.0.out-06
- #changer rotate pressure reduction
- setp hm2_[HOSTMOT2](BOARD).0.gpio.067.is_output true
- setp hm2_[HOSTMOT2](BOARD).0.gpio.067.is_opendrain true
- setp hm2_[HOSTMOT2](BOARD).0.gpio.067.invert_output true
- net toolarmlowerpress hm2_[HOSTMOT2](BOARD).0.gpio.067.out classicladder.0.out-08
- #changer loopback through gearshift comp
- net toolchange iocontrol.0.tool-change gearshift16.0.spindlelock
- net toolchangelocked classicladder.0.in-26 gearshift16.0.spindlelocked
- net toolchanged iocontrol.0.tool-changed classicladder.0.out-09
- #tool arm vertical limit switch
- net armvert hm2_5i20.0.gpio.026.in_not classicladder.0.in-22
- #tool arm horizontal limit switch
- net armhoriz hm2_5i20.0.gpio.025.in_not classicladder.0.in-23
- #tool arm in limit
- net armin hm2_5i20.0.gpio.024.in_not classicladder.0.in-25
- #tool arem out limit
- net armout hm2_5i20.0.gpio.027.in_not classicladder.0.in-24
- # spindle
- # Forward
- setp hm2_[HOSTMOT2](BOARD).1.gpio.062.is_output true
- setp hm2_[HOSTMOT2](BOARD).1.gpio.062.is_opendrain true
- setp hm2_[HOSTMOT2](BOARD).1.gpio.062.invert_output false
- # reverse
- setp hm2_[HOSTMOT2](BOARD).1.gpio.063.is_output true
- setp hm2_[HOSTMOT2](BOARD).1.gpio.063.is_opendrain true
- setp hm2_[HOSTMOT2](BOARD).1.gpio.063.invert_output true
- # Enable vfd and pwm3 keep
- setp hm2_[HOSTMOT2](BOARD).1.gpio.064.is_output true
- setp hm2_[HOSTMOT2](BOARD).1.gpio.064.is_opendrain true
- setp hm2_[HOSTMOT2](BOARD).1.gpio.064.invert_output true
- net emcmot.00.enable hm2_[HOSTMOT2](BOARD).1.gpio.064.out hm2_[HOSTMOT2](BOARD).0.pwmgen.03.enable
- #scale vfd pwm3
- setp hm2_5i20.0.pwmgen.03.scale -4000
- # hook up pins
- net spindledir hm2_[HOSTMOT2](BOARD).1.gpio.062.out abs.0.sign hm2_[HOSTMOT2](BOARD).1.gpio.063.out
- # net spindlerev hm2_[HOSTMOT2](BOARD).1.gpio.063.out motion.spindle-reverse
- net actualspin abs.0.in gearshift16.0.spnmotorspeed
- net outtovfd abs.0.out hm2_5i20.0.pwmgen.03.value
- #shift rails/enables
- #Keylock
- setp hm2_[HOSTMOT2](BOARD).1.gpio.053.is_output true
- setp hm2_[HOSTMOT2](BOARD).1.gpio.053.is_opendrain true
- setp hm2_[HOSTMOT2](BOARD).1.gpio.053.invert_output true
- net keylock hm2_[HOSTMOT2](BOARD).1.gpio.053.out gearshift16.0.ksol
- #shiftrail pressure enable
- setp hm2_[HOSTMOT2](BOARD).1.gpio.048.is_output true
- setp hm2_[HOSTMOT2](BOARD).1.gpio.048.is_opendrain true
- setp hm2_[HOSTMOT2](BOARD).1.gpio.048.invert_output true
- net emcmot.00.enable hm2_[HOSTMOT2](BOARD).1.gpio.048.out
- #shiftrail sssol
- setp hm2_[HOSTMOT2](BOARD).1.gpio.052.is_output true
- setp hm2_[HOSTMOT2](BOARD).1.gpio.052.is_opendrain true
- setp hm2_[HOSTMOT2](BOARD).1.gpio.052.invert_output true
- net sssolsig hm2_[HOSTMOT2](BOARD).1.gpio.052.out gearshift16.0.sssol
- #shiftrail SC2sol
- setp hm2_[HOSTMOT2](BOARD).1.gpio.051.is_output true
- setp hm2_[HOSTMOT2](BOARD).1.gpio.051.is_opendrain true
- setp hm2_[HOSTMOT2](BOARD).1.gpio.051.invert_output true
- net sc2solsig hm2_[HOSTMOT2](BOARD).1.gpio.051.out gearshift16.0.sc2sol
- #shiftrail SC1sol
- setp hm2_[HOSTMOT2](BOARD).1.gpio.049.is_output true
- setp hm2_[HOSTMOT2](BOARD).1.gpio.049.is_opendrain true
- setp hm2_[HOSTMOT2](BOARD).1.gpio.049.invert_output true
- net sc1solsig hm2_[HOSTMOT2](BOARD).1.gpio.049.out gearshift16.0.sc1sol
- #shiftrail SAsol
- setp hm2_[HOSTMOT2](BOARD).1.gpio.050.is_output true
- setp hm2_[HOSTMOT2](BOARD).1.gpio.050.is_opendrain true
- setp hm2_[HOSTMOT2](BOARD).1.gpio.050.invert_output true
- net sasolsig hm2_[HOSTMOT2](BOARD).1.gpio.050.out gearshift16.0.sasol
- # collet clamp/unclamp
- setp hm2_[HOSTMOT2](BOARD).0.gpio.064.is_output true
- setp hm2_[HOSTMOT2](BOARD).0.gpio.064.is_opendrain true
- setp hm2_[HOSTMOT2](BOARD).0.gpio.064.invert_output true
- net collet classicladder.0.out-10 hm2_[HOSTMOT2](BOARD).0.gpio.064.out
- # encoder feedback
- setp hm2_[HOSTMOT2](BOARD).0.encoder.03.counter-mode 0
- setp hm2_[HOSTMOT2](BOARD).0.encoder.03.filter 1
- setp hm2_[HOSTMOT2](BOARD).0.encoder.03.index-invert 0
- setp hm2_[HOSTMOT2](BOARD).0.encoder.03.index-mask 0
- setp hm2_[HOSTMOT2](BOARD).0.encoder.03.index-mask-invert 0
- setp hm2_[HOSTMOT2](BOARD).0.encoder.03.scale 66.666666667
- #shiftrail pressure sensor
- net oneps gearshift16.0.oneps hm2_5i20.0.gpio.031.in_not
- #encoder hookup
- #setup
- setp gearshift16.0.shiftrpm -300
- setp gearshift16.0.shiftencodercounts -10000
- setp gearshift16.0.atspeedwindow 150
- #velocity feedback to comp
- net spindlespfb gearshift16.0.spnmotorspeedfb hm2_[HOSTMOT2](BOARD).0.encoder.03.velocity
- #commanded from emc
- net spindlespeed motion.spindle-speed-cmd-rps gearshift16.0.cmdspnspeed
- #enable gearshift comp
- net emcmot.00.enable gearshift16.0.enable
- #spindle on
- net spindleon motion.spindle-on gearshift16.0.spnon
- #encoder count feedback
- net spindleenccnt hm2_[HOSTMOT2](BOARD).0.encoder.03.count gearshift16.0.rawcountsin
- #spindlebrake
- net spindlebrake gearshift16.0.spnbrake motion.spindle-brake
- #override
- net spindleoverride motion.spindle-speed-out gearshift16.0.cmdspnwithoverride
- #connect halui spindle stop to spindle
- net spindlestop gearshift16.0.spindlestop halui.spindle.stop
- #connect halui spindle is on
- net spindleison gearshift16.0.spindleison halui.spindle.is-on
- #connect spindle reverse so that ccw button apears in axis
- net spindlerev motion.spindle-reverse
- #table b axis lift and unlock sensors.
- setp hm2_[HOSTMOT2](BOARD).0.gpio.061.is_output true
- setp hm2_[HOSTMOT2](BOARD).0.gpio.061.is_opendrain true
- setp hm2_[HOSTMOT2](BOARD).0.gpio.061.invert_output true
- net baxisup hm2_[HOSTMOT2](BOARD).0.gpio.061.out axis.4.unlock
- net couplingunclamped hm2_5i20.1.gpio.024.in_not classicladder.0.in-36
- net couplinguncdelay classicladder.0.out-15 axis.4.is-unlocked
- #pallet stuff..
- #pallet unclamp
- setp hm2_[HOSTMOT2](BOARD).0.gpio.062.is_output true
- setp hm2_[HOSTMOT2](BOARD).0.gpio.062.is_opendrain true
- setp hm2_[HOSTMOT2](BOARD).0.gpio.062.invert_output true
- net palletunclamp hm2_[HOSTMOT2](BOARD).0.gpio.062.out classicladder.0.out-11
- # pallet unclamed sensor
- net palletunclamped hm2_5i20.1.gpio.025.in classicladder.0.in-32
- net palletclamped hm2_5i20.1.gpio.026.in classicladder.0.in-33
- #right pallet
- #right cylinder rotate
- setp hm2_[HOSTMOT2](BOARD).0.gpio.058.is_output true
- setp hm2_[HOSTMOT2](BOARD).0.gpio.058.is_opendrain true
- setp hm2_[HOSTMOT2](BOARD).0.gpio.058.invert_output true
- net rpalletcylrot hm2_[HOSTMOT2](BOARD).0.gpio.058.out classicladder.0.out-17
- #right cylinder out
- setp hm2_[HOSTMOT2](BOARD).0.gpio.059.is_output true
- setp hm2_[HOSTMOT2](BOARD).0.gpio.059.is_opendrain true
- setp hm2_[HOSTMOT2](BOARD).0.gpio.059.invert_output true
- net rpalletcylout hm2_[HOSTMOT2](BOARD).0.gpio.059.out classicladder.0.out-18
- net rcyldown hm2_5i20.0.gpio.046.in_not classicladder.0.in-37
- net rcylup hm2_5i20.0.gpio.047.in_not classicladder.0.in-38
- net rcylin hm2_5i20.0.gpio.044.in_not classicladder.0.in-40
- net rcylout hm2_5i20.0.gpio.045.in_not classicladder.0.in-39
- net rpalletonall classicladder.0.in-42 hm2_5i20.0.gpio.042.in_not
- #left pallet
- #left cylinder rotate
- setp hm2_[HOSTMOT2](BOARD).0.gpio.056.is_output true
- setp hm2_[HOSTMOT2](BOARD).0.gpio.056.is_opendrain true
- setp hm2_[HOSTMOT2](BOARD).0.gpio.056.invert_output true
- net lpalletcylrot hm2_[HOSTMOT2](BOARD).0.gpio.056.out classicladder.0.out-12
- #left cylinder out
- setp hm2_[HOSTMOT2](BOARD).0.gpio.057.is_output true
- setp hm2_[HOSTMOT2](BOARD).0.gpio.057.is_opendrain true
- setp hm2_[HOSTMOT2](BOARD).0.gpio.057.invert_output true
- net lpalletcylout hm2_[HOSTMOT2](BOARD).0.gpio.057.out classicladder.0.out-13
- net lcyldown hm2_5i20.0.gpio.038.in_not classicladder.0.in-27
- net lcylup hm2_5i20.0.gpio.039.in_not classicladder.0.in-28
- net lcylin hm2_5i20.0.gpio.040.in_not classicladder.0.in-29
- net lcylout hm2_5i20.0.gpio.041.in_not classicladder.0.in-30
- net lpalletonall classicladder.0.in-34 hm2_5i20.0.gpio.036.in_not
- #oiler
- setp hm2_[HOSTMOT2](BOARD).0.gpio.055.is_output true
- setp hm2_[HOSTMOT2](BOARD).0.gpio.055.is_opendrain true
- setp hm2_[HOSTMOT2](BOARD).0.gpio.055.invert_output true
- net oilways hm2_[HOSTMOT2](BOARD).0.gpio.055.out classicladder.0.out-14
- #jog wheel try
- setp hm2_[HOSTMOT2](BOARD).1.encoder.01.counter-mode 0
- setp hm2_[HOSTMOT2](BOARD).1.encoder.01.filter 1
- setp hm2_[HOSTMOT2](BOARD).1.encoder.01.index-invert 0
- setp hm2_[HOSTMOT2](BOARD).1.encoder.01.index-mask 0
- setp hm2_[HOSTMOT2](BOARD).1.encoder.01.index-mask-invert 0
- setp hm2_[HOSTMOT2](BOARD).1.encoder.01.scale 1600
- setp axis.0.jog-vel-mode 1
- setp axis.1.jog-vel-mode 1
- setp axis.2.jog-vel-mode 1
- net pend-counts axis.0.jog-counts <= hm2_[HOSTMOT2](BOARD).1.encoder.01.count
- net pend-counts axis.1.jog-counts
- net pend-counts axis.2.jog-counts
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement