All pastes #871416 Raw Edit

m5i20 motion

public text v1 · immutable
#871416 ·published 2008-01-24 22:47 UTC
rendered paste body
# HAL config file for Mesa Electronics 5i20 PCI board
#
# Install driver.
loadrt hal_m5i20

# Add functions to servo thread so they will be evaluated
# every servo period.
# read inputs first
addf m5i20.0.encoder-read servo-thread 1
# write outputs last
addf m5i20.0.dac-write servo-thread -1

# Connect position feedback signals to encoders.
linksp Xpos-fb <= m5i20.0.enc-00-position
linksp Ypos-fb <= m5i20.0.enc-01-position
linksp Zpos-fb <= m5i20.0.enc-02-position

# Get feedback scaling from ini file.
setp m5i20.0.enc-00-scale [AXIS_0]INPUT_SCALE 
setp m5i20.0.enc-01-scale [AXIS_1]INPUT_SCALE 
setp m5i20.0.enc-02-scale [AXIS_2]INPUT_SCALE 

# Connect PID output signals to DACs.
linksp Xoutput => m5i20.0.dac-00-value
linksp Youtput => m5i20.0.dac-01-value
linksp Zoutput => m5i20.0.dac-02-value

# Set output scaling from ini file.
setp m5i20.0.dac-00-gain [AXIS_0]OUTPUT_SCALE
setp m5i20.0.dac-01-gain [AXIS_1]OUTPUT_SCALE
setp m5i20.0.dac-02-gain [AXIS_2]OUTPUT_SCALE

# Set output offset from ini file.
setp m5i20.0.dac-00-offset [AXIS_0]OUTPUT_OFFSET
setp m5i20.0.dac-01-offset [AXIS_1]OUTPUT_OFFSET
setp m5i20.0.dac-02-offset [AXIS_2]OUTPUT_OFFSET


# Get maximum (and minimum) output volts from ini file.
setp pid.0.maxoutput [AXIS_0]MAX_OUTPUT
setp pid.1.maxoutput [AXIS_1]MAX_OUTPUT
setp pid.2.maxoutput [AXIS_2]MAX_OUTPUT

# Connect index enables to motion controller, for homing.
net Xindex-enable m5i20.0.enc-00-index-enable <=> axis.0.index-enable
net Yindex-enable m5i20.0.enc-01-index-enable <=> axis.1.index-enable
net Zindex-enable m5i20.0.enc-02-index-enable <=> axis.2.index-enable