summaryrefslogtreecommitdiff
path: root/configs/by_interface/pico/ppmc_vel/ppmc_motion.hal
blob: 3875a50ccd1ce0475555d227eab7e46be3f1070a (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
38
39
40
41
42
43
44
# HAL config file for Pico Systems UPC board
#

# connect position feedback signals to encoders
net Xpos-fb <= ppmc.0.encoder.00.position
net Ypos-fb <= ppmc.0.encoder.01.position
net Zpos-fb <= ppmc.0.encoder.02.position
net Apos-fb <= ppmc.0.encoder.03.position

# get feedback scaling from ini file
setp ppmc.0.encoder.00.scale [AXIS_0]INPUT_SCALE
setp ppmc.0.encoder.01.scale [AXIS_1]INPUT_SCALE
setp ppmc.0.encoder.02.scale [AXIS_2]INPUT_SCALE
setp ppmc.0.encoder.03.scale [AXIS_3]INPUT_SCALE

# connect PID output signals to step generators
net Xoutput => ppmc.0.DAC.00.value
net Youtput => ppmc.0.DAC.01.value
net Zoutput => ppmc.0.DAC.02.value
net Aoutput => ppmc.0.DAC.03.value

# set output scaling from ini file
setp ppmc.0.DAC.00.scale [AXIS_0]OUTPUT_SCALE
setp ppmc.0.DAC.01.scale [AXIS_1]OUTPUT_SCALE
setp ppmc.0.DAC.02.scale [AXIS_2]OUTPUT_SCALE
setp ppmc.0.DAC.03.scale [AXIS_3]OUTPUT_SCALE

# set slowest velocity for estimation
setp ppmc.0.encoder.00.min-speed-estimate 0.001
setp ppmc.0.encoder.01.min-speed-estimate 0.001
setp ppmc.0.encoder.02.min-speed-estimate 0.001
setp ppmc.0.encoder.03.min-speed-estimate 0.001

# Here's the part that connects the encoder velocity to the PID
net Xfbderiv ppmc.0.encoder.00.velocity pid.0.feedback-deriv
net Yfbderiv ppmc.0.encoder.01.velocity pid.1.feedback-deriv
net Zfbderiv ppmc.0.encoder.02.velocity pid.2.feedback-deriv
net Afbderiv ppmc.0.encoder.03.velocity pid.3.feedback-deriv

# add a couple of tuning test links
# if these are useful will want to add them to the other axes as well
# or make these setup with the tuning script
net Xoutput ddt.0.in
net Xpos-fb ddt.1.in