linuxcnc/lib/hallib/core_stepper.hal
Dewey Garrett b92baa8b3c hallib: relocate common halfiles to lib/hallib
Eliminates multiple file copies and removes unneeded sym links by
taking advantage of the search path (HALLIB_PATH) used by the
linuxcnc script

0) move most configs/common/*.hal files to lib/hallib/
1) eliminate copy_configs etc. from Makefile
2) remove sym links that are no longer needed for
   the relocated hal files
3) also move most-used halfiles (not managed by make)
     simulated_home.hal
     sim_spindle_encoder.hal
     locking_indexer.hal
     lathe.hal
     gantrysim.hal
     simulated-gantry-home.hal
     simulated_limits.hal
     tripodsim.hal
     servo_sim.hal
4) lib/hallib/README: update and reorganize
5) pickconfig: make convenience link for HALLIB_DIR
   The linuxcnc script prints the name of halfiles when they
   are found using the search path (.:HALLIB_DIR) but the
   HALLIB_DIR pathname may be long so this patch has pickconfig.tcl
   make a sym link in the copied config directory
   A user can use the link to copy a halfile to make local modifications,
    for example:
    $ cd  ~/linuxcnc/configs/sim.config.name # sim config created by pickconfig
    $ cp hallib/halfilename halfilename      # copy lib file for local mods
6) update docs: Running-linuxCNC.txt

Notes:
a) affected configs require no changes as the linuxcnc script will
   find files using HALLIB_PATH (defined in scripts/linuxcnc.in)
b) postgui halfiles are not affected since processing depends on gui
c) not working (but has not for a long time):
   configs/sim/axis/remap/iocontrol-removed/iocontrol-removed.ini

Signed-off-by: Dewey Garrett <dgarrett@panix.com>
2015-01-10 13:59:32 -07:00

53 lines
2 KiB
Text

# 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 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
net Xpos-cmd axis.0.motor-pos-cmd => stepgen.0.position-cmd
net Ypos-cmd axis.1.motor-pos-cmd => stepgen.1.position-cmd
net Zpos-cmd axis.2.motor-pos-cmd => stepgen.2.position-cmd
# connect position feedback from step generators
# to motion module
net Xpos-fb stepgen.0.position-fb => axis.0.motor-pos-fb
net Ypos-fb stepgen.1.position-fb => axis.1.motor-pos-fb
net Zpos-fb stepgen.2.position-fb => axis.2.motor-pos-fb
# connect enable signals for step generators
net Xen axis.0.amp-enable-out => stepgen.0.enable
net Yen axis.1.amp-enable-out => stepgen.1.enable
net Zen axis.2.amp-enable-out => stepgen.2.enable
# connect signals to step pulse generator outputs
net Xstep <= stepgen.0.step
net Xdir <= stepgen.0.dir
net Ystep <= stepgen.1.step
net Ydir <= stepgen.1.dir
net Zstep <= stepgen.2.step
net Zdir <= stepgen.2.dir
# 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