# # 5th stepgen for controlling the spindle. # Type must be set to velocity # loadrt stepgen step_type=0,0,0,0,0 ctrl_type=p,p,p,p,v # # Use a scale module for offset and scaling of the stepgen # Offset and scale are determined by first calculating and testing # setp scale.0.in 0 setp scale.0.gain 0.36 setp scale.0.offset 60.0 addf scale.0 servo-thread # # Initialise the stepgen for the spindle # setp stepgen.4.position-scale 1 setp stepgen.4.maxvel 1300 setp stepgen.4.steplen 1 setp stepgen.4.stepspace 0 setp stepgen.4.dirhold 20000 setp stepgen.4.dirsetup 20000 setp stepgen.4.maxaccel 200 # # Enable # net spindle-enable <= motion.spindle-on => stepgen.4.enable # # Connect spindle speed to scaler # net spindle-cmd motion.spindle-speed-out => scale.0.in # # Connect scaler output to stepgen velocity # net spindle-freq <= scale.0.out => stepgen.4.velocity-cmd # # Connect output to the pin for the analog voltage of cnc4pc board # net spindle-out <= stepgen.4.step => parport.0.pin-14-out # # Control of spindle on/off (I1/I2 of KBIC speed controller over the # relay instead of triac # net spindle-cw => parport.0.pin-16-out