# HAL config file for Pico Systems UPC board # Modified and intended for use only with Kirk Wallace's HNC lathe - KW 20070823 # # NOTE: this is a copy of the stepper board file, it will be edited soon for PWM - do not use yet # set the PWM frequency to suit Pico's PWM amps (50KHz) # users with other amps may need to change this setp ppmc.0.pwm.00-03.freq 50000 # turn on bootstrapping for the MOSFET drivers # this also depends on the amplifiers setp ppmc.0.pwm.00.bootstrap TRUE setp ppmc.0.pwm.01.bootstrap TRUE setp ppmc.0.pwm.02.bootstrap TRUE setp ppmc.0.pwm.03.bootstrap TRUE # set max duty cycle to 99.5% for the MOSFET drives # at 50KHz this corresponds to 100nS setp ppmc.0.pwm.00.max-dc 0.995 setp ppmc.0.pwm.01.max-dc 0.995 setp ppmc.0.pwm.02.max-dc 0.995 setp ppmc.0.pwm.03.max-dc 0.995 # connect position feedback signals to encoders linksp Xpos-fb <= ppmc.0.encoder.00.position #linksp Ypos-fb <= ppmc.0.encoder.01.position linksp Zpos-fb <= ppmc.0.encoder.02.position #linksp Apos-fb <= ppmc.0.encoder.03.position # get feedback scaling from ini file setp ppmc.0.encoder.00.scale [AXIS_0]INPUT_SCALE setp ppmc.0.encoder.01.scale [AXIS_1]INPUT_SCALE setp ppmc.0.encoder.02.scale [AXIS_2]INPUT_SCALE # spindle encoder settings setp ppmc.0.encoder.03.scale [SPINDLE]INPUT_SCALE #setp ppmc.0.encoder.03.scale 6912 # connect PID output signals to PWM generators linksp Xoutput => ppmc.0.pwm.00.value linksp Youtput => ppmc.0.pwm.01.value linksp Zoutput => ppmc.0.pwm.02.value # connect axis enables to PWM generators linksp Xenable => ppmc.0.pwm.00.enable linksp Yenable => ppmc.0.pwm.01.enable linksp Zenable => ppmc.0.pwm.02.enable # set output scaling from ini file # note that these are using PWM_OUTPUT_SCALE - they should # use OUTPUT_SCALE, but right now EMC2 re-writes that to # 1 on shutdown for some reason. Once that is fixed, this # should be changed setp ppmc.0.pwm.00.scale [AXIS_0]PWM_OUTPUT_SCALE setp ppmc.0.pwm.01.scale [AXIS_1]PWM_OUTPUT_SCALE setp ppmc.0.pwm.02.scale [AXIS_2]PWM_OUTPUT_SCALE ##setp ppmc.0.pwm.00.scale [AXIS_0]OUTPUT_SCALE ##setp ppmc.0.pwm.01.scale [AXIS_1]OUTPUT_SCALE ##setp ppmc.0.pwm.02.scale [AXIS_2]OUTPUT_SCALE # add a couple of tuning test links # if these are useful will want to add them to the other axes as well # or make these setup with the tuning script linkps ddt.0.in Xoutput linkps ddt.1.in Xpos-fb # next three lines are in io.hal ##newsig spindle-index-enable bit ##linksp spindle-index-enable <= ppmc.0.encoder.03.index-enable ##linksp spindle-index-enable => motion.spindle-index-enable # report rev count to motion controller newsig spindle-pos float linksp spindle-pos ppmc.0.encoder.03.position linksp spindle-pos motion.spindle-revs # connect jogwheel net jogCounts ppmc.0.encoder.01.count axis.0.jog-counts setp axis.0.jog-scale 0.00001