# Generated by PNCconf at Mon Jul 26 08:23:11 2010 # 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 probe_parport loadrt hostmot2 loadrt hm2_pci config="firmware=hm2/5i20/SVST8_4.BIT num_encoders=4 num_pwmgens=4 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 abs names=abs.spindle # loadrt scale names=scale.spindle loadrt classicladder_rt numPhysInputs=32 numPhysOutputs=16 numS32in=10 numS32out=10 numFloatIn=10 numFloatOut=10 loadrt conv_s32_float loadrt mux8 names=mux8.jogincr loadrt near addf near.0 servo-thread # load the parport driver loadrt hal_parport cfg="0xdd00" addf hm2_5i20.0.read servo-thread addf motion-command-handler servo-thread addf motion-controller servo-thread loadrt pid num_chan=2 addf pid.0.do-pid-calcs servo-thread addf pid.1.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.z.Pgain alias pin pid.1.Igain pid.z.Igain alias pin pid.1.Dgain pid.z.Dgain alias pin pid.1.bias pid.z.bias alias pin pid.1.FF0 pid.z.FF0 alias pin pid.1.FF1 pid.z.FF1 alias pin pid.1.FF2 pid.z.FF2 alias pin pid.1.deadband pid.z.deadband alias pin pid.1.maxoutput pid.z.maxoutput alias pin pid.1.enable pid.z.enable alias pin pid.1.command pid.z.command alias pin pid.1.feedback pid.z.feedback alias pin pid.1.output pid.z.output alias pin pid.1.index-enable pid.z.index-enable addf conv-s32-float.0 servo-thread addf classicladder.0.refresh servo-thread addf mux8.jogincr servo-thread # addf abs.spindle servo-thread # addf scale.spindle servo-thread addf hm2_5i20.0.write servo-thread addf hm2_5i20.0.pet_watchdog servo-thread # connect the parport functions to threads addf parport.0.read servo-thread addf parport.0.write servo-thread # external output signals # GEARSHIFT outputs setp hm2_5i20.0.gpio.069.is_output true setp hm2_5i20.0.gpio.069.invert_output true # net shift_neutral => hm2_5i20.0.gpio.069.out # net shift_g1 => parport.0.pin-16-out setp hm2_5i20.0.gpio.070.is_output true setp hm2_5i20.0.gpio.070.invert_output true # net shift_g2 => hm2_5i20.0.gpio.070.out # net shift_g3 => parport.0.pin-17-out # barfeed enable net feeder_on => parport.0.pin-06-out # mesa card outputs # --- ENABLE --- setp hm2_5i20.0.gpio.040.is_output true setp hm2_5i20.0.gpio.040.invert_output true net enable => hm2_5i20.0.gpio.040.out # --- SPINDLE-CW --- setp hm2_5i20.0.gpio.041.is_output true setp hm2_5i20.0.gpio.041.invert_output true # net spindle-cw => hm2_5i20.0.gpio.041.out # --- SPINDLE-CCW --- setp hm2_5i20.0.gpio.042.is_output true setp hm2_5i20.0.gpio.042.invert_output true # net spindle-ccw => hm2_5i20.0.gpio.042.out # --- COOLANT-FLOOD --- setp hm2_5i20.0.gpio.043.is_output true setp hm2_5i20.0.gpio.043.invert_output true net coolant-flood => hm2_5i20.0.gpio.043.out # --- FTUCL --- setp hm2_5i20.0.gpio.044.is_output true setp hm2_5i20.0.gpio.044.invert_output true net FtUcl => hm2_5i20.0.gpio.044.out # --- FTROT --- setp hm2_5i20.0.gpio.045.is_output true setp hm2_5i20.0.gpio.045.invert_output true net FtRot => hm2_5i20.0.gpio.045.out # --- RTUCL --- setp hm2_5i20.0.gpio.046.is_output true setp hm2_5i20.0.gpio.046.invert_output true net RtUcl => hm2_5i20.0.gpio.046.out # --- RTROT --- setp hm2_5i20.0.gpio.047.is_output true setp hm2_5i20.0.gpio.047.invert_output true net RtRot => hm2_5i20.0.gpio.047.out # --- RTROTSL --- setp hm2_5i20.0.gpio.064.is_output true setp hm2_5i20.0.gpio.064.invert_output true net RtRotSl => hm2_5i20.0.gpio.064.out # --- QUILLFWD --- setp hm2_5i20.0.gpio.065.is_output true setp hm2_5i20.0.gpio.065.invert_output true # net QuillFwd => hm2_5i20.0.gpio.065.out # --- QUILLREV --- setp hm2_5i20.0.gpio.066.is_output true setp hm2_5i20.0.gpio.066.invert_output true # net QuillRev => hm2_5i20.0.gpio.066.out # --- LIGHTS --- setp hm2_5i20.0.gpio.067.is_output true setp hm2_5i20.0.gpio.067.invert_output true net Lights => hm2_5i20.0.gpio.067.out # --- FRCOOLANT --- setp hm2_5i20.0.gpio.068.is_output true setp hm2_5i20.0.gpio.068.invert_output true net FRCoolant => hm2_5i20.0.gpio.068.out # --- OPENCHUCK --- setp hm2_5i20.0.gpio.071.is_output true setp hm2_5i20.0.gpio.071.invert_output true # net OpenChuck => hm2_5i20.0.gpio.071.out # external input signals # Parallel port inputs # --- NEUTRAL --- net neutral_pos <= parport.0.pin-10-in-not # --- GEAR1 --- net g1_pos <= parport.0.pin-11-in-not # --- GEAR2 --- net g2_pos <= parport.0.pin-12-in-not # --- GEAR3 --- net g3_pos <= parport.0.pin-13-in-not # mesa card inputs # --- ESTOP-EXT --- net estop-ext <= hm2_5i20.0.gpio.024.in # --- HOME-X --- net home-x <= hm2_5i20.0.gpio.025.in # --- HOME-Z --- net home-z <= hm2_5i20.0.gpio.026.in # --- MAX-X --- net max-x <= hm2_5i20.0.gpio.027.in # --- MIN-X --- net min-x <= hm2_5i20.0.gpio.028.in # --- MAX-Z --- net max-z <= hm2_5i20.0.gpio.029.in # --- MIN-Z --- net min-z <= hm2_5i20.0.gpio.030.in # --- QUILLREVSW --- net QuillRevsw <= hm2_5i20.0.gpio.031.in_not # --- QUILLFWDSW --- net QuillFwdsw <= hm2_5i20.0.gpio.032.in_not # --- FEEDHOLDSW --- net FeedHoldsw <= hm2_5i20.0.gpio.033.in_not # --- CYCLESTARTSW --- net CycleStartsw <= hm2_5i20.0.gpio.034.in_not # --- JOINT-SELECT-A --- net joint-select-a <= hm2_5i20.0.gpio.035.in_not # --- JOINT-SELECT-B --- net joint-select-b <= hm2_5i20.0.gpio.035.in # --- JOG-X-POS --- net jog-x-pos <= hm2_5i20.0.gpio.036.in_not # --- JOG-X-NEG --- net jog-x-neg <= hm2_5i20.0.gpio.037.in_not # --- JOG-Z-POS --- net jog-z-pos <= hm2_5i20.0.gpio.038.in_not # --- JOG-Z-NEG --- net jog-z-neg <= hm2_5i20.0.gpio.039.in_not # --- TP26 --- net Tp26 <= hm2_5i20.0.gpio.048.in_not # --- TP25 --- net Tp25 <= hm2_5i20.0.gpio.049.in_not # --- TP24 --- net Tp24 <= hm2_5i20.0.gpio.050.in_not # --- TP23 --- net Tp23 <= hm2_5i20.0.gpio.051.in_not # --- TP22 --- net Tp22 <= hm2_5i20.0.gpio.052.in_not # --- TP21 --- net Tp21 <= hm2_5i20.0.gpio.053.in_not # --- TP1 --- net Tp1 <= hm2_5i20.0.gpio.054.in_not # --- RTUP --- net RtUp <= hm2_5i20.0.gpio.055.in_not # --- FTUP --- net Ftup <= hm2_5i20.0.gpio.056.in_not # --- SPINDLE_Zsig --- # net SPINDLE_Zsig <= hm2_5i20.0.gpio.057.in_not # --- RTCLAMP --- net RtClamp <= hm2_5i20.0.gpio.058.in_not # --- FTCLAMP --- net FtClamp <= hm2_5i20.0.gpio.059.in_not # --- BARFEEDFIN --- net BarFeedFin <= hm2_5i20.0.gpio.063.in_not # --- BARFEEDPUMP --- net BarFeedpump <= hm2_5i20.0.gpio.061.in_not # --- FTINDEX --- net FtIndex <= hm2_5i20.0.gpio.062.in_not # --- RTINDEX --- net RtIndex <= hm2_5i20.0.gpio.060.in_not #******************* # AXIS X #******************* setp pid.x.Pgain [AXIS_0]P setp pid.x.Igain [AXIS_0]I setp pid.x.Dgain [AXIS_0]D setp pid.x.bias [AXIS_0]BIAS setp pid.x.FF0 [AXIS_0]FF0 setp pid.x.FF1 [AXIS_0]FF1 setp pid.x.FF2 [AXIS_0]FF2 setp pid.x.deadband [AXIS_0]DEADBAND setp pid.x.maxoutput [AXIS_0]MAX_OUTPUT net x-index-enable <=> pid.x.index-enable # PWM Generator signals/setup setp hm2_5i20.0.pwmgen.01.output-type 1 setp hm2_5i20.0.pwmgen.01.scale [AXIS_0]OUTPUT_SCALE net xenable => pid.x.enable net xoutput pid.x.output => hm2_5i20.0.pwmgen.01.value net xpos-cmd axis.0.motor-pos-cmd => pid.x.command net xenable axis.0.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_0]INPUT_SCALE net xpos-fb <= hm2_5i20.0.encoder.01.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.01.index-enable # ---setup home / limit switch signals--- net home-x => axis.0.home-sw-in net min-x => axis.0.neg-lim-sw-in net max-x => axis.0.pos-lim-sw-in #******************* # AXIS Z #******************* setp pid.z.Pgain [AXIS_2]P setp pid.z.Igain [AXIS_2]I setp pid.z.Dgain [AXIS_2]D setp pid.z.bias [AXIS_2]BIAS setp pid.z.FF0 [AXIS_2]FF0 setp pid.z.FF1 [AXIS_2]FF1 setp pid.z.FF2 [AXIS_2]FF2 setp pid.z.deadband [AXIS_2]DEADBAND setp pid.z.maxoutput [AXIS_2]MAX_OUTPUT net z-index-enable <=> pid.z.index-enable # PWM Generator signals/setup setp hm2_5i20.0.pwmgen.00.output-type 1 setp hm2_5i20.0.pwmgen.00.scale [AXIS_2]OUTPUT_SCALE net zenable => pid.z.enable net zoutput pid.z.output => hm2_5i20.0.pwmgen.00.value net zpos-cmd axis.2.motor-pos-cmd => pid.z.command net zenable axis.2.amp-enable-out => hm2_5i20.0.pwmgen.00.enable # ---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_2]INPUT_SCALE net zpos-fb <= hm2_5i20.0.encoder.00.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.00.index-enable # ---setup home / limit switch signals--- net home-z => axis.2.home-sw-in net min-z => axis.2.neg-lim-sw-in net max-z => axis.2.pos-lim-sw-in #******************* # SPINDLE S #******************* # ---Encoder feedback signals/setup--- # net spindle-phase-a <= hm2_5i20.0.gpio.014.in # net spindle-phase-b <= hm2_5i20.0.gpio.014.in net spindle-index-z <= hm2_5i20.0.gpio.017.in_not setp hm2_5i20.0.encoder.02.counter-mode false setp hm2_5i20.0.encoder.02.filter true setp hm2_5i20.0.encoder.02.index-invert 0 setp hm2_5i20.0.encoder.02.index-enable 1 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 [SPINDLE_9]INPUT_SCALE net spindle-vel-fb <= hm2_5i20.0.encoder.02.velocity net spindle-index motion.spindle-index-enable <= hm2_5i20.0.encoder.02.index-enable # ---setup spindle control signals--- net spindle-cw <= motion.spindle-forward net spindle-ccw <= motion.spindle-reverse net spindle-vel-cmd-rps <= motion.spindle-speed-out-rps net spindle-vel-cmd <= motion.spindle-speed-out net spindle-enable <= motion.spindle-on net spindle-vel-cmd => near.0.in1 net spindle-vel-fb => near.0.in2 # net spindle-brake <= motion.spindle-brake net spindle-revs => motion.spindle-revs net spindle-at-speed motion.spindle-at-speed <= near.0.out net spindle-vel-fb => motion.spindle-speed-in setp near.0.scale 1.07 #****************************** # connect miscellaneous signals #****************************** # ---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--- net jog-speed halui.jog-speed sets jog-speed 200.0 net jog-x-pos halui.jog.0.plus net jog-x-neg halui.jog.0.minus net jog-z-pos halui.jog.1.plus net jog-z-neg halui.jog.1.minus net spindle-manual-cw halui.spindle.forward net spindle-manual-ccw halui.spindle.reverse net spindle-manual-stop halui.spindle.stop # ---mpg signals--- # connect jogwheel signals to mesa encoder - shared MPG net joint-selected-count <= hm2_5i20.0.encoder.03.count setp hm2_5i20.0.encoder.03.filter true setp hm2_5i20.0.encoder.03.counter-mode false # 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 z 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 # connect selectable mpg jog increments net jog-incr-a => mux8.jogincr.sel0 net jog-incr-b => mux8.jogincr.sel1 net jog-incr-c => mux8.jogincr.sel2 net selected-jog-incr <= mux8.jogincr.out setp mux8.jogincr.in0 0.001000 setp mux8.jogincr.in1 0.010000 setp mux8.jogincr.in2 0.100000 setp mux8.jogincr.in3 0.000010 setp mux8.jogincr.in4 0.000100 setp mux8.jogincr.in5 0.001000 setp mux8.jogincr.in6 0.001000 setp mux8.jogincr.in7 0.001000 # ---digital in / out signals--- # ---estop signals--- net estop-out <= iocontrol.0.user-enable-out net estop-ext => iocontrol.0.emc-enable-in net enable => motion.motion-enabled # ---toolchange signals for custom tool changer--- net tool-number-req <= iocontrol.0.tool-prep-number net tool-number-now <= iocontrol.0.tool-number net tool-change-request <= iocontrol.0.tool-change net tool-change-confirmed => iocontrol.0.tool-changed net tool-prepare-request <= iocontrol.0.tool-prepare net tool-prepare-confirmed => iocontrol.0.tool-prepared # Load Classicladder with modbus master included (GUI must run for Modbus) loadusr classicladder --modmaster custom.clp # classicladder toolchanger net tool-prepare-request => classicladder.0.in-00 net tool-number-req => classicladder.0.s32in-01 net tool-number-now => classicladder.0.s32in-02 net tool-change-request => classicladder.0.in-02 net tool-prepare-confirmed <= classicladder.0.out-00 net tool-change-confirmed <= classicladder.0.out-01 # panel buttons net Feed-Hold => halui.program.pause net AUTO-Cycle => halui.mode.auto net Cycle-Start => halui.program.run net Feed-RESUME => halui.program.resume net paused_pgm <= halui.program.is-paused net running_pgm <= halui.program.is-running # Classicladder hooks net BarFeedFin => classicladder.0.in-14 net FeedHoldsw => classicladder.0.in-05 net CycleStartsw => classicladder.0.in-06 net paused_pgm => classicladder.0.in-07 net running_pgm => classicladder.0.in-08 net Feed-Hold <= classicladder.0.out-09 net AUTO-Cycle <= classicladder.0.out-10 net Cycle-Start <= classicladder.0.out-11 net Feed-RESUME <= classicladder.0.out-13 # classicladder SPINDLE SPEED net spindle-vel-cmd => classicladder.0.floatin-03 net spindle-cw => classicladder.0.in-03 net spindle-ccw => classicladder.0.in-04 # classicladder gear positions net neutral_pos => classicladder.0.in-10 net g1_pos => classicladder.0.in-11 net g2_pos => classicladder.0.in-12 net g3_pos => classicladder.0.in-13 # hydraulic solenoids net FtUcl <= classicladder.0.out-04 net RtUcl <= classicladder.0.out-06 net FtRot <= classicladder.0.out-05 net RtRot <= classicladder.0.out-07 net RtRotSl <= classicladder.0.out-08 net FRCoolant <= classicladder.0.out-12 # turret switches net RtClamp => classicladder.0.in-26 net FtClamp => classicladder.0.in-27 net Ftup => classicladder.0.in-24 net Rtup => classicladder.0.in-23 # tool sensors net Tp1 => classicladder.0.in-22 net Tp21 => classicladder.0.in-21 net Tp22 => classicladder.0.in-20 net Tp23 => classicladder.0.in-19 net Tp24 => classicladder.0.in-18 net Tp25 => classicladder.0.in-17 net Tp26 => classicladder.0.in-16