XHC-HB03, XHC-HB04, linuxcnc-2.7.11, 29.7.2017


Pre usb zariadenie XHC-HB03, XHC-HB04 definovať pravidlá.
vytvorením súboru /etc/udev/rules.d/90-xhc.rules
s obsahom pre XHC-HB04:
SYSFS{idProduct}=="eb70", SYSFS{idVendor}=="10ce", MODE+="666", OWNER="root", GROUP="users"
alebo pre XHC-HB03
SYSFS{idProduct}=="eb6b", SYSFS{idVendor}=="10ce", MODE+="666", OWNER="root", GROUP="users"


Linuxcnc od verzie 2.7.x obsahuje ovládač pre XHC-HB04.
ktorého adresa je 10CE:EB70. XHC-HB03 má adresu 10CE:EB6E.
Pre spojazdenie XHC-HB03 stačí v súbore
build/src/hal/user_comps/xhc-hb04.cc
zameniť adresu 10CE:EB70 za adresu 10CE:EB6E
a kompilovať linuxcnc.


Následne realizovať nastavenia v súboroch *.ini a *.hal


v *.ini definovať:

[XHC_HB04_CONFIG]
layout = 2
coords = x y z a
coefs = 1 1 1 1
scales = 1 -1 1 1
jogmode = vnormal
sequence = 1
require_pendant = no
inch_or_mm = mm
mpg_accels = 50 50 500 600

[APPLICATIONS]
APP = xhc-hb04-accels
APP = monitor-xhc-hb04

[XHC-HB04]
BUTTON=01:button-stop #rad 1 tlacidlo 1
BUTTON=02:button-start-pause #rad 1 tlacidlo 2
BUTTON=03:button-rewind #rad 1 tlacidlo 3
BUTTON=04:button-spindle-stop #rad 1 tlacidlo 4
BUTTON=05:button-home #rad 3 tlacidlo 4
BUTTON=06:button-spindle-decrease #rad 2 tlacidlo 2
BUTTON=07:button-spindle-increase #rad 2 tlacidlo 3
BUTTON=08:button-spindle-reverse #rad 2 tlacidlo 4
BUTTON=09:button-home-x #rad 3 tlacidlo 1
BUTTON=0A:button-home-y #rad 3 tlacidlo 2
BUTTON=0B:button-home-z #rad 3 tlacidlo 3
BUTTON=0C:button-spindle-forward #rad 2 tlacidlo 1
BUTTON=0D:button-vlavo #rad 4 tlacidlo 1
BUTTON=0E:button-vpravo #rad 4 tlacidlo 1
BUTTON=0F:button-macro-1 #rad 4 tlacidlo 3
BUTTON=10:button-macro-2 #rad 4 tlacidlo 4
BUTTON=16:button-yes #tlacidlo yes
BUTTON=17:button-no #tlacidlo no

[HALUI]

MDI_COMMAND=G0 X10 (debug, example: mdi-00 G0 X10)
MDI_COMMAND=G0 X0 (debug, example: mdi-01 G0 X0)



v *.hal definovať:
loadrt or2 names=or2_spindle-forward,or2_spindle-reverse,or2_spindle-stop
loadrt flipflop names=flipflop_resume,flipflop_pause,flipflop_remrun

addf flipflop_resume servo-thread
addf flipflop_pause servo-thread
addf flipflop_remrun servo-thread

addf or2_spindle-forward servo-thread
addf or2_spindle-reverse servo-thread
addf or2_spindle-stop servo-thread

loadusr -W xhc-hb04 -I POKUS2.ini -H

net home halui.home-all <= xhc-hb04.button-home
net homex xhc-hb04.button-home-x => halui.joint.0.home
net homey xhc-hb04.button-home-y => halui.joint.1.home
net homez xhc-hb04.button-home-z => halui.joint.2.home

net pos-x halui.axis.0.pos-feedback => xhc-hb04.x.pos-absolute
net pos-y halui.axis.1.pos-feedback => xhc-hb04.y.pos-absolute
net pos-z halui.axis.2.pos-feedback => xhc-hb04.z.pos-absolute

net pos-rel-x halui.axis.0.pos-relative => xhc-hb04.x.pos-relative
net pos-rel-y halui.axis.1.pos-relative => xhc-hb04.y.pos-relative
net pos-rel-z halui.axis.2.pos-relative => xhc-hb04.z.pos-relative

net jog-x axis.0.jog-enable <= xhc-hb04.jog.enable-x
net jog-y axis.1.jog-enable <= xhc-hb04.jog.enable-y
net jog-z axis.2.jog-enable <= xhc-hb04.jog.enable-z

net jog-scale xhc-hb04.jog.scale => axis.0.jog-scale axis.1.jog-scale axis.2.jog-scale
net jog-counts xhc-hb04.jog.counts => axis.0.jog-counts axis.1.jog-counts
net jog-counts-neg xhc-hb04.jog.counts-neg => axis.2.jog-counts

setp halui.max-velocity.scale 1
net jog-counts => halui.max-velocity.counts
net jog-max-velocity halui.max-velocity.count-enable <= xhc-hb04.jog.enable-feed-override
net jog-max-velocity2 halui.max-velocity.value => xhc-hb04.feed-override

setp halui.spindle-override.scale 0.01
net jog-counts => halui.spindle-override.counts
net jog-spindle halui.spindle-override.count-enable <= xhc-hb04.jog.enable-spindle-override
net jog-spindle2 halui.spindle-override.value => xhc-hb04.spindle-override
net spindle-rps motion.spindle-speed-cmd-rps => xhc-hb04.spindle-rps

net stepsize-up xhc-hb04.button-vpravo => xhc-hb04.stepsize-up
net stepsize-down xhc-hb04.button-vlavo => xhc-hb04.stepsize-down

net estop xhc-hb04.button-stop => halui.program.stop
net step xhc-hb04.button-rewind => halui.program.step

net button-start xhc-hb04.button-yes => halui.machine.on
net button-stop xhc-hb04.button-no => halui.machine.off

net macro1 halui.mdi-command-00 xhc-hb04.button-macro-1
net macro2 halui.mdi-command-01 xhc-hb04.button-macro-2

net button-start-pause xhc-hb04.button-start-pause => flipflop_pause.clk flipflop_resume.clk flipflop_remrun.clk
net is-paused halui.program.is-paused => flipflop_resume.data flipflop_pause.reset
net is-running halui.program.is-running => flipflop_pause.data flipflop_remrun.reset flipflop_resume.reset
net is-idle halui.program.is-idle => flipflop_remrun.data
net resume flipflop_resume.out => halui.program.resume
net pause flipflop_pause.out => halui.program.pause
net remrun flipflop_remrun.out => halui.program.run

net or2_spindle-forward-in1 or2_spindle-forward.in1 <= xhc-hb04.button-spindle-forward
net or2_spindle-reverse-in1 or2_spindle-reverse.in1 <= xhc-hb04.button-spindle-reverse
net or2_spindle-stop-in1 or2_spindle-stop.in1 <= xhc-hb04.button-spindle-stop
net button-increase xhc-hb04.button-spindle-increase => halui.spindle.increase
net button-decrease xhc-hb04.button-spindle-decrease => halui.spindle.decrease

net spindle-manual-cw => or2_spindle-forward.in0
net or2-spindle-forward-out or2_spindle-forward.out halui.spindle.forward

net spindle-manual-ccw => or2_spindle-reverse.in0
net or2-spindle-reverse-out or2_spindle-reverse.out halui.spindle.reverse

net spindle-manual-stop => or2_spindle-stop.in0
net or2-spindle-stop-out or2_spindle-stop.out halui.spindle.stop





XHC-HB03, release 7.10.2016


ako root:
apt-get install libc6-dev
apt-get install libusb-1.0-0-dev
cd /usr/src
wget wiki.linuxcnc.org/uploads/xhc-hb04-V06.tgz
tar zxvf xhc-hb04-V06.tgz
mv src xhc-hb03
cd xhc-hb03
sudo gedit xhc-hb04.cc

v súbore zmeniť riadok
dev_handle = libusb_open_device_with_vid_pid(ctx, 0x10CE, 0xEB70);
riadkom
dev_handle = libusb_open_device_with_vid_pid(ctx, 0x10CE, 0xEB6E);
zmeny uložiť

make
make install

gedit /etc/udev/rules.d/90-xhc.rules
do súboru vložiť riadok:
SYSFS{idProduct}=="eb70", SYSFS{idVendor}=="10ce", MODE+="666", OWNER="root", GROUP="users"
alebo
ATTR{idProduct}=="eb6e", ATTR{idVendor}=="10ce", MODE+="666"
uložiť
chmod -R 644 /etc/udev/rules.d/90-xhc.rules
chown -R root:root /etc/udev/rules.d/90-xhc.rules

testovať:
/usr/local/bin/xhc-hb04

do *.ini súboru doplniť riadok v sekcii HAL
HALFILE = xhc-hb04.hal
do adresára s *.ini súborom kopírovať súbory
xhc-hb04.hal
xhc-hb04-layout1.ini
xhc-hb04-layout2.ini






Kontakt :
0905 345640
ivan.saliga@uhliky.sk.