# ####################################### # # HAL file for HostMot2 with 5 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 # # Modified by Jon Schmidt for use on a Mori Sieki MVJR # Presently set up for 3 axis with hardware to support 5 axis of servos the machine has # # # ######################################## # Firmware files are in /lib/firmware/hm2/7i43net machine-on => hm2_5i23.0.7i64.0.1.digout.00.out/ # 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: # # and http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl?HostMot2 # # ##################################################################### #################################################################### # Start EMC Internal Stuff #################################################################### # ################################### # 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 loadrt probe_parport # standard components loadrt pid num_chan=6 # 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 hm2_pci config="firmware=hm2/5i23/SVSS6_8.BIT num_encoders=6 num_pwmgens=6 num_sserials=3" #loadrt hm2_pci config="firmware=hm2/5i23/SVSS6_8.BIT num_encoders=6 num_pwmgens=6 sserial_mode0=000xxxxx" loadrt hm2_pci config="firmware=hm2/5i23/SVSS6_8.BIT num_encoders=6 num_pwmgens=6 sserial_port_0=00000000" setp hm2_5i23.0.pwmgen.pwm_frequency 24000 setp hm2_5i23.0.watchdog.timeout_ns 10000000 # ################################################ # THREADS # ################################################ addf hm2_5i23.0.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 pid.4.do-pid-calcs servo-thread addf hm2_5i23.0.write servo-thread addf hm2_5i23.0.pet_watchdog servo-thread #################################################################### # End EMC Internal Stuff #################################################################### ############################################ #Clasic Ladder ############################################ #loadrt classicladder_rt numBits=100 numPhysInputs=30 numPhysOutputs=30 #addf classicladder.0.refresh servo-thread #load the ladder #loadusr clasicladder mori.clp ############################################ #Machine On ############################################ # Turn on SVM relay #net machine-on => hm2_5i23.0.7i64.0.1.digout.13.out #################################################################### # Start Axis Related Parameter Settings #################################################################### # ################ # X [0] Axis # ################ # axis enable chain newsig emcmot.00.enable bit sets emcmot.00.enable FALSE net emcmot.00.enable => pid.0.enable net emcmot.00.enable => hm2_5i23.0.pwmgen.00.enable net machine-on => hm2_5i23.0.7i64.0.1.digout.00.out net emcmot.00.enable => hm2_5i23.0.7i64.0.1.digout.04.out net emcmot.00.enable <= axis.0.amp-enable-out # encoder feedback setp hm2_5i23.0.encoder.00.counter-mode 0 setp hm2_5i23.0.encoder.00.filter 1 setp hm2_5i23.0.encoder.00.index-invert 0 setp hm2_5i23.0.encoder.00.index-mask 0 setp hm2_5i23.0.encoder.00.index-mask-invert 0 setp hm2_5i23.0.encoder.00.scale [AXIS_0]INPUT_SCALE net motor.00.pos-fb hm2_5i23.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_5i23.0.pwmgen.00.output-type 2 #PWM up on pin0, #PWM down on pin1 setp hm2_5i23.0.pwmgen.00.scale [AXIS_0]OUTPUT_SCALE net emcmot.00.pos-cmd axis.0.motor-pos-cmd => pid.0.command net motor.00.command pid.0.output => hm2_5i23.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 net emcmot.01.enable => hm2_5i23.0.pwmgen.01.enable net machine-on => hm2_5i23.0.7i64.0.1.digout.01.out net emcmot.01.enable => hm2_5i23.0.7i64.0.1.digout.05.out net emcmot.01.enable <= axis.1.amp-enable-out # encoder feedback setp hm2_5i23.0.encoder.01.counter-mode 0 setp hm2_5i23.0.encoder.01.filter 1 setp hm2_5i23.0.encoder.01.index-invert 0 setp hm2_5i23.0.encoder.01.index-mask 0 setp hm2_5i23.0.encoder.01.index-mask-invert 0 setp hm2_5i23.0.encoder.01.scale [AXIS_1]INPUT_SCALE net motor.01.pos-fb hm2_5i23.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_5i23.0.pwmgen.01.output-type 2 #PWM up on pin0, #PWM down on pin1 setp hm2_5i23.0.pwmgen.01.scale [AXIS_1]OUTPUT_SCALE net emcmot.01.pos-cmd axis.1.motor-pos-cmd => pid.1.command net motor.01.command pid.1.output => hm2_5i23.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 net emcmot.02.enable => hm2_5i23.0.pwmgen.02.enable net machine-on => hm2_5i23.0.7i64.0.1.digout.02.out net emcmot.02.enable => hm2_5i23.0.7i64.0.1.digout.06.out net emcmot.02.enable <= axis.2.amp-enable-out # encoder feedback setp hm2_5i23.0.encoder.02.counter-mode 0 setp hm2_5i23.0.encoder.02.filter 1 setp hm2_5i23.0.encoder.02.index-invert 0 setp hm2_5i23.0.encoder.02.index-mask 0 setp hm2_5i23.0.encoder.02.index-mask-invert 0 setp hm2_5i23.0.encoder.02.scale [AXIS_2]INPUT_SCALE net motor.02.pos-fb hm2_5i23.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_5i23.0.pwmgen.02.output-type 2 #PWM up on pin0, #PWM down on pin1 setp hm2_5i23.0.pwmgen.02.scale [AXIS_2]OUTPUT_SCALE net emcmot.02.pos-cmd axis.2.motor-pos-cmd => pid.2.command net motor.02.command pid.2.output => hm2_5i23.0.pwmgen.02.value #Note: Rotary axis commented out for now # ################ # R [3] Axis # ################ # axis enable chain #newsig emcmot.03.enable bit #sets emcmot.03.enable FALSE #net emcmot.03.enable => pid.3.enable #net emcmot.03.enable => hm2_5i23.0.pwmgen.03.enable #net emcmot.03.enable <= axis.3.amp-enable-out # encoder feedback #setp hm2_5i23.0.encoder.03.counter-mode 0 #setp hm2_5i23.0.encoder.03.filter 1 #setp hm2_5i23.0.encoder.03.index-invert 0 #setp hm2_5i23.0.encoder.03.index-mask 0 #setp hm2_5i23.0.encoder.03.index-mask-invert 0 #setp hm2_5i23.0.encoder.03.scale [AXIS_2]INPUT_SCALE #net motor.03.pos-fb hm2_5i23.0.encoder.03.position => pid.3.feedback #net motor.03.pos-fb => axis.3.motor-pos-fb #push copy back to Axis GUI # set PID loop gains from inifile #setp pid.3.Pgain [AXIS_3]P #setp pid.3.Igain [AXIS_3]I #setp pid.3.Dgain [AXIS_3]D #setp pid.3.bias [AXIS_3]BIAS #setp pid.3.FF0 [AXIS_3]FF0 #setp pid.3.FF1 [AXIS_3]FF1 #setp pid.3.FF2 [AXIS_3]FF2 #setp pid.3.deadband [AXIS_3]DEADBAND #setp pid.3.maxoutput [AXIS_3]MAX_OUTPUT # position command signals #setp hm2_5i23.0.pwmgen.03.output-type 2 #PWM up on pin0, #PWM down on pin1 #setp hm2_5i23.0.pwmgen.03.scale [AXIS_2]OUTPUT_SCALE #net emcmot.03.pos-cmd axis.3.motor-pos-cmd => pid.3.command #net motor.03.command pid.3.output => hm2_5i23.0.pwmgen.03.value # ################ # P [4] Axis # ################ # axis enable chain #newsig emcmot.04.enable bit #sets emcmot.04.enable FALSE #net emcmot.04.enable => pid.4.enable #net emcmot.04.enable => hm2_5i23.0.pwmgen.04.enable #net emcmot.04.enable <= axis.4.amp-enable-out # encoder feedback #setp hm2_5i23.0.encoder.04.counter-mode 0 #setp hm2_5i23.0.encoder.04.filter 1 #setp hm2_5i23.0.encoder.04.index-invert 0 #setp hm2_5i23.0.encoder.04.index-mask 0 #setp hm2_5i23.0.encoder.04.index-mask-invert 0 #setp hm2_5i23.0.encoder.04.scale [AXIS_2]INPUT_SCALE #net motor.04.pos-fb hm2_5i23.0.encoder.04.position => pid.4.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.4.Pgain [AXIS_4]P #setp pid.4.Igain [AXIS_4]I #setp pid.4.Dgain [AXIS_4]D #setp pid.4.bias [AXIS_4]BIAS #setp pid.4.FF0 [AXIS_4]FF0 #setp pid.4.FF1 [AXIS_4]FF1 #setp pid.4.FF2 [AXIS_4]FF2 #setp pid.4.deadband [AXIS_4]DEADBAND #setp pid.4.maxoutput [AXIS_4]MAX_OUTPUT # position command signals #setp hm2_5i23.0.pwmgen.04.output-type 2 #PWM up on pin0, #PWM down on pin1 #setp hm2_5i23.0.pwmgen.04.scale [AXIS_4]OUTPUT_SCALE #net emcmot.04.pos-cmd axis.4.motor-pos-cmd => pid.4.command #net motor.04.command pid.4.output => hm2_5i23.0.pwmgen.04.value #----4th Axis ---- #4th AXIS CLAMP OK IO04 p17 #net 4_AXIS_CLAMP_OK #5th AXIS UNCLAMP OK IO04 p5 #net 4_AXIS_UNCLAMP_OK #4th AXIS CLAMP OK IO04 p11 #net 5_AXIS_CLAMP_OK #5th AXIS UNCLAMP OK IO04 p18 #net 5_AXIS_UNCLAMP_OK #################################################################### # End Axis Related Parameter Settings #################################################################### #################################################################### # Spindle Speed Setup #################################################################### #PWM up on pin0 #PWM down on pin1 #setp hm2_5i23.0.pwmgen.05.output-type 2 #net spindle-speed-cmd motion.spindle-speed-out => hm2_5i23.0.pwmgen.05.value # Set the spindle’s top speed in RPM #setp hm2_5i23.0.pwmgen.05.scale 6000 #################################################################### # Spindle Inputs #################################################################### #motion.spindle-at-speed (bit, in) Motion will pause until this pin is TRUE, #net spindle-at-speed motion.spindle-at-speed <= hm2_5i23.0.7i64.0.1.digin.01.in #################################################################### # Spindle Outputs #################################################################### net spindle-drive-enable => hm2_5i23.0.pwmgen.05.enable #---Spindle Action--- #spindle enable #net machine-on => hm2_5i23.0.7i64.0.0.digout.10.out # spindle estop #net machine-on => hm2_5i23.0.7i64.0.0.digout.11.out #spindle forward net spindle-drive-enable => hm2_5i23.0.7i64.0.1.digout.09.out #motion.spindle-forward (bit, out) TRUE when the spindle should rotate forward. #net spindle-fwd motion.spindle-forward => hm2_5i23.0.7i64.0.1.digout.09.out # motion.spindle-reverse (bit, out) TRUE when the spindle should rotate backward #net ext-spindle-rev motion.spindle-reverse => hm2_5i23.0.7i64.0.1.digout.09.out #motion.spindle-brake (bit, out) TRUE when the spindle brake should be applied. #net ext-spindle-brake motion.spindle-brake => hm2_5i23.0.7i64.0.1.digout.09.out #net ext-spindle-stop halui.spindle.stop => hm2_5i23.0.7i64.0.1.digout.09.out # --- SPINDLE MANUAL CONTROL --- #Spindle Forward #net ext-spindle-start halui.spindle.start => hm2_5i23.0.7i64.0.1.digout.09.out #Spindle Stop #################################################################### # Machine related conections #################################################################### #---Setup--- #net machine-on halui.machine.is-on #net machine-on classicladder.0.in-21 #MANUAL MODE #net manual-mode <= halui.mode.is-manual #net manual-mode => classicladder.0.in-22 #---Output--- #servo power contactor #net machine-on hm2_5i23.0.7i64.0.1.digout.08.out ######################################################## #----DONE ----SERVO ON (SVON X,Y,Z,4,5) ######################################################## #Servo X On #net machine-on hm2_5i23.0.7i64.0.1.digout.0.out #Servo Y On #net machine-on hm2_5i23.0.7i64.0.1.digout.1.out #Servo Z On #net machine-on hm2_5i23.0.7i64.0.1.digout.2.out #Servo A On #net machine-on hm2_5i23.0.7i64.0.1.digout.3.out #Servo B On #net machine-on hm2_5i23.0.7i64.0.1.digout.4.out ######################################################## #END ----DONE ----SERVO ON (SVON X,Y,Z,4,5) ######################################################## #pump on #net machine-on hm2_5i23.0.7i64.0.0.digout.07.out #tool unclamp #net tool-unclamp classicladder.0.out-19 hm2_5i23.0.7i64.0.0.digout.00.out #---Input--- #machine error #net machine-error iocontrol.0.lube_level <= hm2_5i23.0.7i64.0.1.digin.03.in-not #tool clamp button #net tool-clamp-but hm2_5i23.0.7i64.0.0.digin.12.in #tool unclamp button #net tool-unclamp-but classicladder.0.in-19 hm2_5i23.0.7i64.0.0.digin.13.in ################################################################### # DONE----Homing and Limit Switches #################################################################### #Home Switches #Limit Switch X Wire 130 #net X_home axis.0.home-sw-in <= hm2_5i23.0.7i64.0.2.digin.0.in-not #Limit Switch Y Wire 131 #net Y_home axis.1.home-sw-in <= hm2_5i23.0.7i64.0.2.digin.1.in-not #Limit Switch Y Wire 132 #net Z_home axis.2.home-sw-in <= hm2_5i23.0.7i64.0.2.digin.2.in-not #Limit Switch A Wire 132A #net A_home axis.3.home-sw-in <= hm2_5i23.0.7i64.0.2.digin.3.in-not #Limit Switch B Wire 133 #net B_home axis.4.home-sw-in <= hm2_5i23.0.7i64.0.2.digin.4.in-not ################################################################### # End DONE----Homing and Limit Switches ################################################################### #################################################################### # Control Panel Related Connections #################################################################### # --- MACHINE ON_OFF --- #net ext-machine_off halui.machine.off <= hm2_5i23.0.7i64.0.0.in #net ext-machine_on halui.machine.on <= hm2_5i23.0.7i64.0.0.in # --- EMERGENCY STOP --- # create a signal for the estop loopback #net estop-out <= iocontrol.0.user-enable-out #net estop-out => iocontrol.0.emc-enable-in #net ext_emergency_stop halui.estop.activate #net ext_emergency_stop_reset halui.estop.reset #pyVCP checbutton simulates NC estop #net ext-estop => classicladder.0.in-00 #Request E-stop Enable from EMC #net estop-all-ok iocontrol.0.emc-enable-in <= classicladder.0.out-00 #Request E-stop Enable from External #net ext-estop-reset classicladder.0.in-03 => hm2_5i23.0.7i64.0.1.digin.04.in-not #Estop from EMC #net emc-reset-estop iocontrol.0.user-request-enable => classicladder.0.in-02 #Enables EMC to unlatch E-stop #net emc-estop iocontrol.0.user-enable-out => classicladder.0.in-01 # --- DONE--- PROGRAM START, STOP RESUME --- # Reset button should stop the program # Emergency stop should also stop program #EXTERNAL CYCLE START Direct to 7i64.0 pin 0 #Cycle Start IO2 50 PIN p19 24V #net ext_program_start halui.program.run <= hm2_5i23.0.7i64.0.0.digin.00.in #net ext_program_start halui.program.resume #EXTERNAL FEED HOLD Direct to 7i64.0 pin 1 #motion.feed-hold (bit, in) When Feed Stop Control is enabled with M53 P1, and this bit is TRUE, the feed rate is set to 0. #net ext_feed_hold motion.feed-hold <= hm2_5i23.0.7i64.0.0.digin.01.in # --- END DONE--- PROGRAM START, STOP RESUME --- ############################################################## # ---DONE---Maximum Feed Velocity 4 Position Rotary Switch--- ############################################################## # Set the maximin feed rate to be set with a count setp halui.max-velocity.count-enable true loadrt conv_float_s32 count=1 loadrt mux4 count=2 addf mux4.0 servo-thread addf conv-float-s32.0 servo-thread setp halui.max-velocity.scale 0.01 #Set the max feed rate % setp mux4.0.in0 -98 setp mux4.0.in1 -75 setp mux4.0.in2 -25 setp mux4.0.in3 0 #Get the choice from the maximum feed velocity rotary switch #Max Feed Rotary Position Switch ROV1, Direct #net ext_max_feed_0 mux4.0.sel0 <= hm2_5i23.0.7i64.0.0.digin.17.in #Max Feed Rotary Position Switch ROV2, Direct #net ext_max_feed_1 mux4.0.sel1 <= hm2_5i23.0.7i64.0.0.digin.18.in #Use counts to set max velocity % convert to from float to s32 #net set_max_feed_float <= mux4.0.out conv-float-s32.0.in #net set_max_feed_s32 conv-float-s32.0.out halui.max-velocity.counts ############################################################## # ---END DONE---Maximum Feed Velocity 4 Position Rotary Switch--- ############################################################## ############################################################## # --- DONE --- Hand Wheel Jog Axis Select --- ############################################################## loadrt weighted_sum wsum_sizes=3 addf process_wsums servo-thread #Axis Select Rotary Position Switch AA, Direct #net axis-select-0 wsum.0.bit.0.in <= hm2_5i23.0.7i64.0.0.digin.9.in #Axis Select Rotary Position Switch BB, Direct #net axis-select-1 wsum.0.bit.1.in <= hm2_5i23.0.7i64.0.0.digin.10.in #Axis Select Rotary Position Switch CC, Direct #net axis-select-2 wsum.0.bit.2.in <= hm2_5i23.0.7i64.0.0.digin.11.in net axis-selected- <= wsum.0.sum loadrt select8 count=1 addf select8.0 servo-thread net axis-selected => select8.0.sel #set the axis jog enable selection based on output from select8 net ext-x-jog-enable axis.0.jog-enable <= select8.0.out0 net ext-y-jog-enable axis.1.jog-enable <= select8.0.out1 net ext-z-jog-enable axis.2.jog-enable <= select8.0.out2 #net ext-a-jog-enable axis.3.jog-enable <= select8.0.out3 #net ext-b-jog-enable axis.3.jog-enable <= select8.0.out4 ############################################################## # --- END DONE --- Hand Wheel Jog Axis Select --- ############################################################## ############################################################## # --- Jogging --- ############################################################## #?????Need to check this out???????? #sets jog-speed 1.000000 #net jog-speed halui.jog-speed ############################################################## # DONE---Feed Override--- ############################################################## #loadrt mux32 count=0 #addf mux32.0 servo-thread #setp mux32.0.suppress-no-input false #setp mux32.0.debounce-time .1 #setp halui.feed-override.count-enable true #setp halui.feed-override.direct-value true #Set the scale of feed override to be multiplied by feed rate #setp halui.feed-override.scale 0.01 #Set the choices for feed override #setp mux32.0.in00 0 #setp mux32.0.in01 10 #setp mux32.0.in02 20 #setp mux32.0.in03 30 #setp mux32.0.in04 40 #setp mux32.0.in05 50 #setp mux32.0.in06 60 #setp mux32.0.in07 70 #setp mux32.0.in08 80 #setp mux32.0.in09 90 #setp mux32.0.in10 100 #setp mux32.0.in11 110 #setp mux32.0.in12 120 #setp mux32.0.in13 130 #setp mux32.0.in14 140 #setp mux32.0.in15 150 #setp mux32.0.in16 160 #setp mux32.0.in17 170 #setp mux32.0.in18 180 #setp mux32.0.in19 190 #setp mux32.0.in20 200 #Feed Override 1 Direct 7i64 Board 0 in Pin 12 #net ext_feed_override_0 mux32.0.sel0 <= hm2_5i23.0.7i64.0.0.digin.12.in #Feed Override 2 Direct 7i64 Board 0 in Pin 13 #net ext_feed_override_1 mux32.0.sel1 <= hm2_5i23.0.7i64.0.0.digin.13.in #Feed Override 4 Direct 7i64 Board 0 in Pin 14 #net ext_feed_override_2 mux32.0.sel2 <= hm2_5i23.0.7i64.0.0.digin.14.in #Feed Override 8 Direct 7i64 Board 0 in Pin 15 #net ext_feed_override_3 mux32.0.sel3 <= hm2_5i23.0.7i64.0.0.digin.15.in #Feed Override 16 Direct 7i64 Board 0 in Pin 16 #net ext_feed_override_4 mux32.0.sel4 <= hm2_5i23.0.7i64.0.0.digin.16.in #net ext_feed_override halui.feed-override.counts <= mux32.0.out-s #note need to install comp mux32 #To install a comp just change to the directory where it is and do #sudo comp --install name.comp ############################################################## # End DONE---Feed Override--- ############################################################## ############################################################## # DONE --- JOG BUTTONS --- ############################################################## #Jog +X 7i64 Board 1 In Pin 12 #net ext-jog-x-pos halui.jog.0.plus <= hm2_5i23.0.7i64.0.1.digin.12.in #Jog -X 7i64 Board 1 In Pin 13 #net ext-jog-x-neg halui.jog.0.minus <= hm2_5i23.0.7i64.0.1.digin.13.in #Jog +Y 7i64 Board 1 In Pin 14 #net ext-jog-y-pos halui.jog.1.plus <= hm2_5i23.0.7i64.0.1.digin.13.in #Jog -Y 7i64 Board 1 In Pin 15 #net ext-jog-y-neg halui.jog.1.minus <= hm2_5i23.0.7i64.0.1.digin.15.in #Jog +Z 7i64 Board 1 In Pin 16 #net ext-jog-z-pos halui.jog.2.plus <= hm2_5i23.0.7i64.0.1.digin.16.in #Jog -Z 7i64 Board 1 In Pin 17 #net ext-jog-z-neg halui.jog.2.minus <= hm2_5i23.0.7i64.0.1.digin.17.in #Jog +4th IO2 50 PIN 4 +24V #net ext-jog-a-pos halui.jog.1.plus <= hm2_5i23.0.7i64.0.0.in #Jog -4th IO2 50 PIN 20 +24V #net ext-jog-a-neg halui.jog.1.minus <= hm2_5i23.0.7i64.0.0.in #Jog -5th IO2 50 PIN 36 +24V #net ext-jog-b-pos halui.jog.2.plus <= hm2_5i23.0.7i64.0.0.in #Jog -5th IO2 50 PIN 5 +24V #net ext-jog-b-neg halui.jog.2.minus <= hm2_5i23.0.7i64.0.0.in ############################################################## # END DONE --- JOG BUTTONS --- ############################################################## ############################################################### # DONE --- Hand Wheel Step Selection (MPG Manual Pulse Generator)--- ############################################################### loadrt mux8 count=1 addf mux8.0 servo-thread setp mux8.0.in0 0.0001 setp mux8.0.in1 0.0010 setp mux8.0.in2 0.0100 setp mux8.0.in3 0.0100 setp mux8.0.in4 0.0100 #MPG Multiplier MPG Mult 1 7i64 Board 0 pin 6 #net ext_mpg_step_0 mux8.0.sel0 <= hm2_5i23.0.7i64.0.0.digin.6.in #MPG Multiplier MPG Mult 1 7i64 Board 0 pin 7 #net ext_mpg_step_1 mux8.0.sel1 <= hm2_5i23.0.7i64.0.0.digin.7.in #MPG Multiplier MPG Mult 1 7i64 Board 0 pin 8 #net ext_mpg_step_2 mux8.0.sel2 <= hm2_5i23.0.7i64.0.0.digin.8.in net selected-jog-scale mux8.0.out => axis.0.jog-scale net selected-jog-scale mux8.0.out => axis.1.jog-scale net selected-jog-scale mux8.0.out => axis.2.jog-scale #??????? how to scale rotary axis ?????? #net selected-jog-scale mux8.0.out => axis.3.jog-scale #net selected-jog-scale mux8.0.out => axis.4.jog-scale ############################################################## # END----DONE--- Hand Wheel Pulse Generation --- ############################################################## ############################################################## # ----DONE---- Hand Wheel Pulse Generation--- ############################################################## # loadrt encoder num_chan=6 addf encoder.capture-position servo-thread addf encoder.update-counters servo-thread setp encoder.5.x4-mode 1 #Get input pulse count from pulse generator #Manual Pulse Gen CP07 F p16 +12 #net ext_mpg_a encoder.5.phase-A <= hm2_5i23.0.7i64.0.1.digin.0.in #Manual Pulse Gen CP07 F p9 012 #net ext_mpg_a encoder.5.phase-A #Manual Pulse Gen CP07 F p18 +12 #net ext_mpg_b encoder.5.phase-B <= hm2_5i23.0.7i64.0.1.digin.1.in #Manual Pulse Gen CP07 F p2 012 #net ext_mpg_b encoder.5.phase-B #Send counts to jog counts for all axis (that's ok since only one is active) net mpg_counts axis.0.jog-counts <= encoder.5.counts net mpg_counts axis.1.jog-counts <= encoder.5.counts net mpg_counts axis.2.jog-counts <= encoder.5.counts #net mpg_counts axis.3.jog-counts <= encoder.5.counts #net mpg_counts axis.4.jog-counts <= encoder.5.counts ############################################################## # END DONE--- Hand Wheel Pulse Generation --- ############################################################## ################################################### # ---DONE ---Spindle Speed Override ################################################### #loadrt mux16 count=0 #addf mux16.0 servo-thread #setp mux16.0.suppress-no-input true #setp mux16.0.debounce-time .1 #setp halui.override.count-enable true #setp halui.spindle-override.scale 0.01 #Make some parameters for the spindle override mux16 choices and the corresponding values #setp mux16.0.in00 0 #setp mux16.0.in01 0 #setp mux16.0.in02 0 #setp mux16.0.in03 0 #setp mux16.0.in04 0 #setp mux16.0.in05 0 #setp mux16.0.in06 0 #setp mux16.0.in07 0 #setp mux16.0.in08 50 #setp mux16.0.in09 60 #setp mux16.0.in10 70 #setp mux16.0.in11 80 #setp mux16.0.in12 90 #setp mux16.0.in13 100 #setp mux16.0.in14 110 #setp mux16.0.in15 120 #Send state of rotary switch pins to mux16 function #Spindle Override A 7i64 Board 0 in pin 2 #net spindle_switch_pin_0 mux16.0.sel0 <= hm2_5i23.0.7i64.0.0.digin.2.in #Spindle Override B 7i64 Board 0 in pin 3 #net spindle_switch_pin_1 mux16.0.sel1 <= hm2_5i23.0.7i64.0.0.digin.3.in #Spindle Override C 7i64 Board 0 in pin 4 #net spindle_switch_pin_2 mux16.0.sel2 <= hm2_5i23.0.7i64.0.0.digin.4.in #Spindle Override D 7i64 Board 0 in pin 5 #net spindle_switch_pin_3 mux16.0.sel3 <= hm2_5i23.0.7i64.0.0.digin.5.in #Set the spindle override scale based on output from mux16 #net ext-speed-override halui.spindle-override.scale <= mux16.0.out-s ################################################### # END---DONE ---Spindle Speed Override ################################################### ################################################### # Start Machine Related Connections ################################################### # --- Lube --- #(bit, in) Should be driven TRUE when lube level is high enough #net lube_level iocontrol.0.lube_level #??????????????????????????? how to turn lube on and off by level? #net lube_on iocontrol.0.lube_level halui.lube.on #net lube_off iocontrol.0.lube_level halui.lube.off # --- Coolant --- #COOLANT PUMP (M2) IO10 p12 24V #net coolant_pump_switch halui.flood.is-on <= hm2_5i23.0.7i64.0.0.digout.05.out ################################################### # Probe ################################################### # (bit, in) G38.x uses the value on this pin to determine when the probe has made contact. # TRUE for probe contact closed (touching), FALSE for probe contact open. #net probe-in motion.probe-input <= hm2_5i23.0.7i64.0.0.in ################################################### # SPINDLE ################################################### #################################################################### # Tool Changer #################################################################### # --- Tool Changer Inputs ---- #Schmidt #LS10 IO06 pin 17 #net ATC_MAGAZINE_A <= hm2_5i23.0.7i64.0.2.digout.5.out #LS11 IO06 pin 5 #net ATC_MAGAZINE_B <= hm2_5i23.0.7i64.0.2.digout.6.out #LS12 IO06 pin 11 #net MAGAZINE_Z <= hm2_5i23.0.7i64.0.2.digout.7.out #LS14 IO04 pin 15 #net ARM_DECELERATION <= hm2_5i23.0.7i64.0.2.digout.8.out #LS15 IO04 pin 3 #net ARM_DOWN <= hm2_5i23.0.7i64.0.2.digout.9.out #LS16 IO06 pin 4 #net POT_UP_OK <= hm2_5i23.0.7i64.0.2.digout.10.out #LS17 IO06 pin 10 #net POT_DOWN_OK <= hm2_5i23.0.7i64.0.2.digout.11.out #LS18 IO06 pin 9 #net TOOL_CLAMP_OK <= hm2_5i23.0.7i64.0.2.digout.12.out #LS19 IO06 pin 2 #net ORIENT_PIN_IN_OK <= hm2_5i23.0.7i64.0.2.digout.13.out #LS20 IO06 pin 8 #net ORIENT_PIN_OUT_OK <= hm2_5i23.0.7i64.0.2.digout.14.out #LS21 IO06 pin 15 #net ARM_HOME_POSITION <= hm2_5i23.0.7i64.0.2.digout.15.out #??? #net OIL_LEVEL <= hm2_5i23.0.7i64.0.2.digout.16.out #??? IO06 pin 3 #net ATC_AIR_PRESSURE <= hm2_5i23.0.7i64.0.2.digout.17.out ######################## #toolchanger transducer# ######################## #loadrt weighted_sum wsum_sizes=5 #addf process_wsums servo-thread ################ # Decode for pot locations ################ # Tool 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 # 16 BitE 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 # 8 BitD 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 # 4 BitC 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 # 2 BitB 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 # 1 BitA 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 ################ #mag bit ins #net rot-transducer-0 wsum.0.bit.0.in <= hm2_5i23.0.7i64.0.1.digin.18.in #net rot-transducer-1 wsum.0.bit.1.in <= hm2_5i23.0.7i64.0.1.digin.17.in #net rot-transducer-2 wsum.0.bit.2.in <= hm2_5i23.0.7i64.0.1.digin.16.in #net rot-transducer-3 wsum.0.bit.3.in <= hm2_5i23.0.7i64.0.1.digin.15.in #net rot-transducer-4 wsum.0.bit.4.in <= hm2_5i23.0.7i64.0.1.digin.14.in #net pocket-position wsum.0.sum => classicladder.0.s32in-02 # --- Tool Changer Ouputs ---- #schmidt #ORIENTATION PIN IN IO 08 p5 24V #net ATC_orientation_pin <= hm2_5i23.0.7i64.0.0.out #TOOL UNCLAMP IO 08 p11 24V #net ATC_tool_unclamp <= hm2_5i23.0.7i64.0.0.out #POT UP IO 08 p18 24V #net ATC_pot_up <= hm2_5i23.0.7i64.0.0.out #POTDOWN IO 08 p6 24V #net ATC_pot_down <= hm2_5i23.0.7i64.0.0.out #MAGAZINE & ARM FORWARD IO 10 p2 24V #net ATC_magazine_and_arm_fwd <= hm2_5i23.0.7i64.0.0.out #MAGAZINE & ARM REVERSE IO 10 p8 24V #net ATC_magazine_and_arm_rev <= hm2_5i23.0.7i64.0.0.out #MOVE MAGAZINE IO 10 p15 24V #net ATC_move_magazine <= hm2_5i23.0.7i64.0.0.out #MOVE ARM IO 10 p3 24V #net ATC_move_arm <= hm2_5i23.0.7i64.0.0.out #cory #net ATC_arm_up classicladder.0.out-03 => hm2_5i23.0.7i64.0.0.digout.12.out #net ATC_arm_down classicladder.0.out-04 <= hm2_5i23.0.7i64.0.0.digout.13.out #net ATC_75_CW classicladder.0.out-05 <= hm2_5i23.0.7i64.0.0.digout.14.out #net ATC_75_CCW classicladder.0.out-06 <= hm2_5i23.0.7i64.0.0.digout.15.out #net ATC_180_CCW classicladder.0.out-07 <= hm2_5i23.0.7i64.0.0.digout.16.out #net ATC_180_CW classicladder.0.out-08 <= hm2_5i23.0.7i64.0.0.digout.17.out #net ATC_pot_up classicladder.0.out-09 <= hm2_5i23.0.7i64.0.0.digout.18.out #net ATC_pot_down classicladder.0.out-10 <= hm2_5i23.0.7i64.0.0.digout.19.out #net ATC_magazine_unlock classicladder.0.out-11 <= hm2_5i23.0.7i64.0.0.digout.20.out #net ATC_magazine_slow classicladder.0.out-12 <= hm2_5i23.0.7i64.0.0.digout.21.out #net ATC_magazine_CW classicladder.0.out-13 <= hm2_5i23.0.7i64.0.0.digout.22.out #net ATC_magazine_CCW classicladder.0.out-14 <= hm2_5i23.0.7i64.0.0.digout.23.out #air blast thru spindle #net air-blast-spindle classicladder.0.out-15 <= hm2_5i23.0.7i64.0.0.digout.01.out #toolchanger home #####net tool-changer-home-pos classicladder.0.out-16 => hm2_5i23.0.7i64.0.1.digout.12.out ######## #Ladder# ######## #tool change request ####net tool-change iocontrol.0.tool-change => classicladder.0.in-04 #tool change completed ####net tool-changed iocontrol.0.tool-changed <= classicladder.0.out-01 #tool number #####net tool-number iocontrol.0.tool-number => classicladder.0.s32in-00 #next tool number #net tool-prep-pocket iocontrol.0.tool-prep-pocket => classicladder.0.s32in-01 #tool prepare ######net tool-prepare iocontrol.0.tool-prepare => classicladder.0.in-05 #tool prepared #####net tool-prepared iocontrol.0.tool-prepared => classicladder.0.out-02 #-------------------------------------------------------------------------------- #################################################################### # LAMPS #################################################################### #halui.program.optional-stop.is-on #halui.flood.is-on #halui.mist.is-on #axis.0.homed #axis.1.homed #axis.2.homed #axis.3.homed #axis.4.homed #halui.lube.is-on (bit, out) - indicates lube is on #halui.program.is-paused (bit, out) - status pin telling that a program is paused #Memory Lamp IO2 50-PIN p39 +5V #MDI LAMP IO2 50-PIN p8 +5V #Edit Lamp IO2 50-PIN p23 +5V #Function 1 Lamp IO2 50-PIN p40 +5V #Handle Lamp IO2 50-PIN p9 +5V #Step Lamp IO2 50-PIN p25 +5V #Jog Lamp IO2 50-PIN p41 +5V #Rapid Lamp IO2 50-PIN p10 +5V #Zero Return IO2 50-PIN p25 +5V #Single Block Lamp IO2 50-PIN p42 +5V #Optional Stop Lamp IO2 50-PIN p11 +5V #Block Delete Lamp IO2 50-PIN p27 +5V #Dry Run Lamp IO2 50-PIN p43 +5V #Sequence Return Lamp IO2 50-PIN p12 +5V #Z Axis Neglect Lamp IO2 50-PIN p28 +5V #Coolant On Lamp IO2 50-PIN p44 +5V #Coolant Off Lamp IO2 50-PIN p13 +5V # Length Lamp IO2 50-PIN p29 +5V #Chip Coolant Lamp IO2 50-PIN p45 +5V #M00/M01 Lamp IO2 50-PIN p14 +5V #Program End Lamp IO2 50-PIN p30 +5V #ATC Lamp IO2 50-PIN p46 +5V #4th Clamp Lamp IO2 50-PIN p15 +5V #Orientation Arival lamp IO2 50-PIN p31 +5V #Zero Point X Lamp IO2 50-PIN p47 +5V #Zero Point Y Lamp IO2 50-PIN p16 +5V #Zero Point Z Lamp IO2 50-PIN p32 +5V #Zero Point 4 Lamp IO2 50-PIN p48 +5V #Override On Lamp IO2 50-PIN p17 +5V #Error Lamp IO2 50-PIN p49 +5V #Cycle Start Lamp IO2 50-PIN p18 +5V #Feed Hold Lamp IO2 50-PIN p50 +5V #Auto Power Off Lamp