w 95% się udało
musiałem wykorzystać inny kod bo tego pierwszego nie potrafiłem przerobić przypadkiem znalazłem taki -
http://www.foxpointdesign.com/cnc_stuff/pendant.hal
przerobiony pod ustawienie portu loadrt hal_parport cfg="0xd000 out 0x378 in " i usunięta kontrola prędkości obrotowej wrzeciona
uwaga: musiałem jeszcze odszukać w pliku .ini [HAL] i dodać tam HALUI = halui
wersja działająca u mnie :
# Jog Pendant
loadrt encoder num_chan=1
loadrt mux4 count=1
# loadrt mux2 count=2
loadrt ilowpass
setp ilowpass.0.scale 1
setp ilowpass.0.gain .15
addf encoder.capture-position servo-thread
addf encoder.update-counters base-thread
addf mux4.0 servo-thread
# addf mux2.0 servo-thread
# addf mux2.1 servo-thread
addf ilowpass.0 servo-thread
# If your MPG outputs a quadture signal per click set x4 to 1
# If your MPG puts out 1 pulse per click set x4 to 0
setp encoder.0.x4-mode 0
# For velocity mode, set n to 1
# In velocity mode the axis stops when dial is stopped even if that means
# the commanded motion is not completed,
# For position mode (the default), set n to 0
# In position mode the axis will move exactly jog-scale
# units for each count, regardless of how long that might take,
# This must be set for each axis you want to behave other than default
setp axis.0.jog-vel-mode 0
setp axis.1.jog-vel-mode 0
setp axis.2.jog-vel-mode 0
setp mux4.0.in0 0.0001
setp mux4.0.in1 0.001
setp mux4.0.in2 0.01
net scale1 mux4.0.sel0 <= parport.1.pin-09-in
net scale2 mux4.0.sel1 <= parport.1.pin-10-in
net pend-scale axis.0.jog-scale <= mux4.0.out
net pend-scale axis.1.jog-scale
net pend-scale axis.2.jog-scale
net mpg-a encoder.0.phase-A <= parport.1.pin-02-in
net mpg-b encoder.0.phase-B <= parport.1.pin-03-in
net mpg-x axis.0.jog-enable <= parport.1.pin-04-in
net mpg-y axis.1.jog-enable <= parport.1.pin-05-in
net mpg-z axis.2.jog-enable <= parport.1.pin-06-in
newsig fo_en bit
linksp fo_en <= parport.1.pin-08-in
linksp fo_en => halui.feed-override.count-enable
# set up lowpass input to filter raw jog counts
net raw-pend-counts encoder.0.counts => ilowpass.0.in
net pend-counts ilowpass.0.out => axis.0.jog-counts
net pend-counts ilowpass.0.out => axis.1.jog-counts
net pend-counts ilowpass.0.out => axis.2.jog-counts
net pend-counts halui.feed-override.counts <= ilowpass.0.out
# set feed override scale
setp halui.feed-override.scale 0.01
wspomagałem się
http://wiki.linuxcnc.org/cgi-bin/wiki.pl?Halui
Ale mam jeden problem , mianowicie chce by po zatrzymaniu kółka zatrzymywała się także oś a nie jechała tak długo do puki nie dogoni wykonanej prze zemnie liczby obrotów.... wiem że za to odpowiada ten fragment :
# For velocity mode, set n to 1
# In velocity mode the axis stops when dial is stopped even if that means
# the commanded motion is not completed,
# For position mode (the default), set n to 0
# In position mode the axis will move exactly jog-scale
# units for each count, regardless of how long that might take,
# This must be set for each axis you want to behave other than default
setp axis.0.jog-vel-mode 0
setp axis.1.jog-vel-mode 0
setp axis.2.jog-vel-mode 0
ale gdy zmienię na 1 to owszem zatrzymuje się jak przestaje kręcić ale ogólnie wszystko jest pomieszane: nie dość że zamiast przeskakiwań np. mikrony to skaczą setki i w dodatku jeszcze np co 2 lub jeszcze dziwniej ma ktoś może pomysł jak to opanować??