# core HAL config file for steppers # first load the core RT modules that will be needed # kinematics loadrt trivkins # motion controller, get name and thread periods from ini file loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD traj_period_nsec=[EMCMOT]TRAJ_PERIOD key=[EMCMOT]SHMEM_KEY num_joints=[TRAJ]AXES # stepper module, three step generators, all three using step/dir loadrt stepgen step_type=0,0,0 # hook functions to base thread (high speed thread for step generation) addf stepgen.make-pulses base-thread # hook functions to servo thread addf stepgen.capture-position servo-thread addf motion-command-handler servo-thread addf motion-controller servo-thread addf stepgen.update-freq servo-thread # connect position commands from motion module to step generator newsig Xpos-cmd float linksp Xpos-cmd <= axis.0.motor-pos-cmd linksp Xpos-cmd => stepgen.0.position-cmd newsig Ypos-cmd float linksp Ypos-cmd <= axis.1.motor-pos-cmd linksp Ypos-cmd => stepgen.1.position-cmd newsig Zpos-cmd float # Disabled to make THC work better #linksp Zpos-cmd <= axis.2.motor-pos-cmd # Disabled for THC to work #linksp Zpos-cmd => stepgen.2.position-cmd # connect position feedback from step generators # to motion module newsig Xpos-fb float linksp Xpos-fb <= stepgen.0.position-fb linksp Xpos-fb => axis.0.motor-pos-fb newsig Ypos-fb float linksp Ypos-fb <= stepgen.1.position-fb linksp Ypos-fb => axis.1.motor-pos-fb newsig Zpos-fb float linksp Zpos-fb <= stepgen.2.position-fb linksp Zpos-fb => axis.2.motor-pos-fb # connect enable signals for step generators newsig Xen bit linksp Xen <= axis.0.amp-enable-out linksp Xen => stepgen.0.enable newsig Yen bit linksp Yen <= axis.1.amp-enable-out linksp Yen => stepgen.1.enable newsig Zen bit linksp Zen <= axis.2.amp-enable-out linksp Zen => stepgen.2.enable # connect signals to step pulse generator outputs newsig Xstep bit newsig Xdir bit newsig Ystep bit newsig Ydir bit newsig Zstep bit newsig Zdir bit linkps stepgen.0.step Xstep linkps stepgen.0.dir Xdir linkps stepgen.1.step Ystep linkps stepgen.1.dir Ydir linkps stepgen.2.step Zstep linkps stepgen.2.dir Zdir # set stepgen module scaling - get values from ini file setp stepgen.0.position-scale [AXIS_0]SCALE setp stepgen.1.position-scale [AXIS_1]SCALE setp stepgen.2.position-scale [AXIS_2]SCALE # set stepgen module accel limits - get values from ini file setp stepgen.0.maxaccel [AXIS_0]STEPGEN_MAXACCEL setp stepgen.1.maxaccel [AXIS_1]STEPGEN_MAXACCEL setp stepgen.2.maxaccel [AXIS_2]STEPGEN_MAXACCEL