blob: bc810444f45b2103610555cb2b07aaa217c74048 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# HAL config file for Vigilant Technologoes VTI PCI board
#
# install driver, this should autodetect the board
# if that doesn't work, try using base=0xABC, where ABC matches your setup
# loadrt hal_stg base=0x200
loadrt hal_vti num_chan=4 dio="IOIO"
# add functions to servo thread so they will be evaluated
# every servo period
# read inputs first
addf vti.capture-position servo-thread 1
# write outputs last
addf vti.write-dacs servo-thread -1
# connect position feedback signals to encoders
net Xpos-fb <= vti.0.position
net Ypos-fb <= vti.1.position
net Zpos-fb <= vti.2.position
# get feedback scaling from ini file
setp vti.0.position-scale [AXIS_0]INPUT_SCALE
setp vti.1.position-scale [AXIS_1]INPUT_SCALE
setp vti.2.position-scale [AXIS_2]INPUT_SCALE
# connect PID output signals to DACs
net Xoutput => vti.0.dac-value
net Youtput => vti.1.dac-value
net Zoutput => vti.2.dac-value
# set output scaling from ini file
setp vti.0.dac-gain [AXIS_0]OUTPUT_SCALE
setp vti.1.dac-gain [AXIS_1]OUTPUT_SCALE
setp vti.2.dac-gain [AXIS_2]OUTPUT_SCALE
# set output offset to zero
setp vti.0.dac-offset [AXIS_0]OUTPUT_OFFSET
setp vti.1.dac-offset [AXIS_1]OUTPUT_OFFSET
setp vti.2.dac-offset [AXIS_2]OUTPUT_OFFSET
|