All pastes #400525 Raw Copy code Copy link Edit

Something

public unlisted text v1 · immutable
#400525 ·published 2007-03-18 19:08 UTC
rendered paste body
############################## Kinematics & Motion Controller ####################################
# Kinematics
loadrt gantrykins

# Settings for gantrykins
setp gantrykins.joint-0 0
setp gantrykins.joint-1 1
setp gantrykins.joint-2 2
setp gantrykins.joint-3 1

# 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

############################# Step Generators ##########################################

# stepper module, three step generators, all three using step/dir
loadrt stepgen step_type=0,0,0,0

# hook functions to base thread (high speed thread for step generation)
addf stepgen.make-pulses base-thread

#Configure the  step signals for a crappy Slo-syn driver which can't handle base-thread 15000
setp stepgen.2.steplen 2
setp stepgen.2.stepspace 2

# 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

# set stepgen module scaling - get values from ini file
setp stepgen.0.position-scale [AXIS_0]INPUT_SCALE
setp stepgen.1.position-scale [AXIS_1]INPUT_SCALE
setp stepgen.2.position-scale [AXIS_2]INPUT_SCALE
setp stepgen.3.position-scale [AXIS_3]INPUT_SCALE

# set stepgen module velocity limits - get values from ini file
setp stepgen.0.maxvel [AXIS_0]STEPGEN_MAXVEL
setp stepgen.1.maxvel [AXIS_1]STEPGEN_MAXVEL
setp stepgen.2.maxvel [AXIS_2]STEPGEN_MAXVEL
setp stepgen.3.maxvel [AXIS_3]STEPGEN_MAXVEL

# 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
setp stepgen.3.maxaccel [AXIS_3]STEPGEN_MAXACCEL

############################# Parallel Ports ##############################################

# Load Driver for Two Parallel Ports, one for Breakout Board, other for Plasma Torch Height Control
loadrt hal_parport cfg="0xa400 0xac00"

# Connect both Paralell Ports to Threads for Read / Write
addf parport.0.read base-thread 1
addf parport.0.write base-thread -1
addf parport.1.read base-thread 1
addf parport.1.write base-thread -1

################################ Other ##########################################

#Connect Estop and ChargePump

loadrt estop_latch
addf estop-latch.0 base-thread

linkpp parport.0.pin-10-in => estop-latch.0.fault-in
linkpp estop-latch.0.watchdog => parport.0.pin-17-out 
linkpp iocontrol.0.user-request-enable => estop-latch.0.reset  
linkpp iocontrol.0.user-enable-out => estop-latch.0.ok-in
linkpp estop-latch.0.ok-out => iocontrol.0.emc-enable-in

################################ Hook UP ###########################################

# Invert pins to make motors move in right direction
setp parport.0.pin-06-out-invert 1
setp parport.0.pin-07-out-invert 1
setp parport.0.pin-08-out-invert 1

# Hook up the step and dir signals to the parport pins
# Axis A and Y are the same axis but different motors 
net StepX stepgen.0.step => parport.0.pin-02-out
net StepY stepgen.1.step => parport.0.pin-03-out
net StepZ stepgen.2.step => parport.0.pin-04-out
net StepA stepgen.3.step => parport.0.pin-05-out
net DirX stepgen.0.dir => parport.0.pin-06-out
net DirY stepgen.1.dir => parport.0.pin-07-out
net DirZ stepgen.2.dir => parport.0.pin-08-out
net DirA stepgen.3.dir => parport.0.pin-09-out

# Hook up limit and home switches, each axis shares a common pin for homing, limit min and limit max
net LimitX parport.0.pin-11-in-not => axis.0.neg-lim-sw-in axis.0.pos-lim-sw-in axis.0.home-sw-in
net LimitY parport.0.pin-12-in-not => axis.1.neg-lim-sw-in axis.1.pos-lim-sw-in axis.1.home-sw-in
net LimitZ parport.0.pin-13-in => axis.2.neg-lim-sw-in axis.2.pos-lim-sw-in axis.2.home-sw-in
net LimitA parport.0.pin-15-in-not => axis.3.neg-lim-sw-in axis.3.pos-lim-sw-in axis.3.home-sw-in

# Hook up stepgen to motion modules
net PosX-cmd axis.0.motor-pos-cmd => stepgen.0.position-cmd
net PosX-fb stepgen.0.position-fb => axis.0.motor-pos-fb #ddt.0.in
net PosY-cmd axis.1.motor-pos-cmd => stepgen.1.position-cmd
net PosY-fb stepgen.1.position-fb => axis.1.motor-pos-fb #ddt.1.in
net PosZ-cmd axis.2.motor-pos-cmd => stepgen.2.position-cmd
net PosZ-fb stepgen.2.position-fb => axis.2.motor-pos-fb
net PosA-cmd axis.3.motor-pos-cmd => stepgen.3.position-cmd
net PosA-fb stepgen.3.position-fb => axis.3.motor-pos-fb

# Hook up enable signals for step generators
linkpp axis.0.amp-enable-out => stepgen.0.enable
linkpp axis.1.amp-enable-out => stepgen.1.enable
linkpp axis.2.amp-enable-out => stepgen.2.enable
linkpp axis.3.amp-enable-out => stepgen.3.enable