orzel pisze: ↑25 gru 2019, 23:52
Pytanie: co źle robię?
Wygląda na to, że próbujesz robić coś, o czym nie masz bladego pojęcia.
Masz jakiś schemat ?
Gdzie wpiąłeś te ledy ?
Wywal tą płytę od macha, bo cholera wie co ona robi i czy jest sprawna, Gniazdo z pęczkiem przewodów gorzej wygląda, ale działa lepiej.
Jak już port test będzie widział sygnały z enkodera, to musisz napisać plik konfiguracyjny hal ze swoimi parametrami, a potem wyregulować transoptory przy użyciu oscyloskopu hal.
Poniżej moja konfiguracja hal, więcej Ci nie pomogę bo nie ma jak.
# add the encoder to HAL and attach it to threads.
loadrt encoder num_chan=1
addf encoder.update-counters base-thread
addf encoder.capture-position servo-thread
loadrt comp count=2
addf comp.0 servo-thread
addf comp.1 servo-thread
setp comp.0.in1 0.01
setp comp.1.in0 -0.01
loadrt or2 count=2
addf or2.0 base-thread
addf or2.1 base-thread
loadrt and2 count=4
addf and2.0 base-thread
addf and2.1 base-thread
addf and2.2 base-thread
addf and2.3 base-thread
# set the HAL encoder to 160 pulses per revolution.
setp encoder.0.position-scale 160
#setp encoder.0.index-enable true
# set the HAL encoder to non-quadrature simple counting using A only.
#setp encoder.0.counter-mode true
# connect the HAL encoder outputs to LinuxCNC.
net spindle-position encoder.0.position motion.spindle-revs
net spindle-velocity encoder.0.velocity motion.spindle-speed-in comp.0.in0 comp.1.in1
net spindle-index-enable encoder.0.index-enable motion.spindle-index-enable
net spindle-err-fwd-in comp.0.out and2.1.in1
net spindle-err-rev-in comp.1.out and2.0.in1
# connect the HAL encoder inputs to the real encoder.
net spindle-phase-a encoder.0.phase-A parport.0.pin-11-in
net spindle-phase-b encoder.0.phase-B parport.0.pin-12-in
net spindle-index encoder.0.phase-Z parport.0.pin-13-in