Как допилить хал, чтоб вместо +- управлял выходами? Кусок хала, полный во вложении
Код: Выделить всё
#############################
# --- SPINDLE ---
#############################
net spindle-vel-cmd-rps <= spindle.0.speed-out-rps
net spindle-vel-cmd-rps-abs <= spindle.0.speed-out-rps-abs
net spindle-vel-cmd-rpm-abs <= spindle.0.speed-out-abs
net spindle-enable <= spindle.0.on
net spindle-cw <= spindle.0.forward
net spindle-ccw <= spindle.0.reverse
net spindle-brake <= spindle.0.brake
#------- SPINDLE FEEDBACK -----------------
setp to_pci.1.feedback.enc_scale2 [SPINDLE]ENCODER_SCALE
net spindle-position to_pci.1.feedback.encoder2 => spindle.0.revs
net spindle-velocity to_pci.1.feedback.enc_vel2 => spindle.0.speed-in
net spindle-index-enable to_pci.1.feedback.index_en2 <=> spindle.0.index-enable
#------- SPINDLE CONTROL ----------------
setp to_pci.1.PWM.out_scale2 [SPINDLE]OUTPUT_SCALE
setp scale.2.gain 0.00542 #0.00542 точно на 500об
net spindle-speed-scale spindle.0.speed-out => scale.2.in
net spindle-speed-DAC scale.2.out => mux2.0.in0
net mux2-out mux2.0.out abs.1.in
net spindle-abs-pwm abs.1.out => to_pci.1.PWM.dcontrol2
#------- SPINDLE ORIENT ----------------
setp pid.orient.Pgain [SPINDLE]P
setp pid.orient.Igain [SPINDLE]I
setp pid.orient.Dgain [SPINDLE]D
setp pid.orient.bias [SPINDLE]BIAS
setp pid.orient.FF0 [SPINDLE]FF0
setp pid.orient.FF1 [SPINDLE]FF1
setp pid.orient.FF2 [SPINDLE]FF2
setp pid.orient.deadband [SPINDLE]DEADBAND
setp pid.orient.maxoutput [SPINDLE]MAX_OUTPUT
net orient-enable spindle.0.orient => orient.0.enable pid.orient.enable
net orient-angle spindle.0.orient-angle => orient.0.angle
net orient-mode spindle.0.orient-mode => orient.0.mode
net spindle-position orient.0.position pid.orient.feedback
net orient-command orient.0.command => pid.orient.command
net is-oriented orient.0.is-oriented spindle.0.is-oriented
net orient-enable mux2.0.sel
net mult2 mult2.0.out mux2.0.in1
setp mult2.0.in0 10
net pid-out pid.orient.output mult2.0.in1
#------- SPINDLE-AT-SPEED ----------------
setp near.0.scale 1.08
net spindle-vel-cmd-rps => near.0.in1
net spindle-velocity => near.0.in2 #энкодер
net spindle-at-speed <= near.0.out => spindle.0.at-speed