Strona 1 z 1
pomoc w G38.x tokarka digitalizacja
: 27 sty 2020, 11:41
autor: jarucki
Witam
od jakiegoś czasu próbuje uruchomić skanowanie na tokarce...
w sieci albo nie mogę albo nie potrafie znaleść, ale w skrócie coś tam wyciąłem coś tam wkleiłem i zaczeło działać.
Gdyby jednak było tak cudowanie to bym nikomu nie zawracał neuronów pod czapką:D
Program (jeśli tak można to nazwać) podczas ładowania strasznie zamula AXIsa, próbowałem na wiele sposobów go zapisać, ale jestem durny, ale brakuje mi mentora :p prędzej to pierwsze

cała magia to kod G38.x
poniżej to na czym maszyna działą ale zachowuje się tak jak wcześniej już nadmieniłem...
Kod: Zaznacz cały
(Configuration section)
G21 (Inches)
F350 (probe speed)
#1=5 (X start)
#2=1 (X increment)
#3=250 (X count)
#7=10 (Z safety)
#8=-40.8 (Z probe)
(End configuration section)
(LOGOPEN,testt.ngc)
(PROBEOPEN probtest.ngc)
#9=10 #10=0
G0Z#7
O1 while [#9 lt #3]
#10=0
G0 X[#1+#2]
O2 while [#10 lt #3]
O3 if [[#9/2] - fix[#9/2] eq 0]
#11=[#1+#2*#10]
O3 else
#11=[#1+#2*[#3-#10-1]]
O3 endif
(#11 is X target)
#5070=1
O4 while [#5070 NE 0]
G38.5 z#7
G91 G01 Z0.5 (Lines added to the SmartProbe.ngc)
G90 (Lines added to the SmartProbe.ngc)
G38.3 x#11
O4 endwhile
G38.2Z#8
(LOG,G1 X#5061 Z#5063)
#10=[#10+1]
O2 endwhile
G0Z#7
#9=[#9+1]
O1 endwhile
(PROBEOPENCLOSE)
(LOGCLOSE)
G0Z#7
G0X#1
M2
filmiki się ładują... więc niebawem je dołącze
czy ktoś z Was mógł by mi pomóc i wyrzucić z codu nie potrzebne elementy, bo za pewne takie są ewentualnie nakierunkował w toku rozumowania
Dodane 1 godzina 2 minuty 32 sekundy:
https://youtu.be/WhAJ11bDlZg
Re: pomoc w G38.x tokarka digitalizacja
: 27 sty 2020, 11:55
autor: szary11
Pięknie, będzie felga alu przetaczana?

Re: pomoc w G38.x tokarka digitalizacja
: 27 sty 2020, 13:13
autor: jarucki
szary11
Będzie a nawet już była :p
Tylko maszyna była za mała, teraz czeka tuc50 na fuzję i podniesienie wrzeciennika o 100-150mm
Oprócz felgi bardziej mi zależy na bębnach motocyklowych która mają już swoje lata i utlenienia!
Re: pomoc w G38.x tokarka digitalizacja
: 27 sty 2020, 13:33
autor: szary11
Nie wiem czy wiesz, ale domyślnie w katalogu nc_files/ngcgui_lib jest sub ractangle_probe.ngc na trzy osie, ale na symulatorze u mnie jak ymin i ymax dam na 0 to generuje dla x i z zobacz. Twój kod u mnie także zamula na jakieś 10 sek.
Ładnie, jakimi płytkami robiłeś ?
Re: pomoc w G38.x tokarka digitalizacja
: 27 sty 2020, 13:55
autor: jarucki

Mi wywala błąd podczas próby uruchomienia tego wsadu.
Re: pomoc w G38.x tokarka digitalizacja
: 27 sty 2020, 14:14
autor: szary11
Chyba jednak na configu tokarki to działać nie będzie.
Wieczorem poproszę mojego magika od tych robaczków, aby to obejrzał i pozmieniał.
Mi także cosik takiego się przyda.
Odezwę się.
Re: pomoc w G38.x tokarka digitalizacja
: 29 sty 2020, 08:55
autor: szary11
Tak na szybko to u mnie na frezarce działa tyle że podnosi do "z safe" ale to na czasie, zapisuje do pliku ładnie.
zakomentowane tylko dla osi Y
Na tokarce nie mam podpięcia pod sondę ale generuje ok.
Kod: Zaznacz cały
( Rectangular area probe )
( adapted for ngcgui-compatibility from smartprobe.ngc written by Chris Radek )
( This program repeatedly probes a regular XY grid and writes the )
( probed locations to the file 'probe_result.txt' in the same directory )
( as the .ini file )
( Requires a probe connected to motion.probe-input )
( or use scripts/simulate_probe )
(info: Probe a rectangular area)
o<probe> sub
#<xmin> = #1 (= 0.0)
#<xmax> = #2 (= 10.0)
#<xinterval> = #3 (= 0.1)
#<ymin> = #4 (= 0.0 nie dotykaj dla tokarki)
#<ymax> = #5 (= 0.0 zostaw dla tokarki)
#<yinterval> = #6 (= 1.0 nierusz dla tokarki)
#<zsafe> = #7 (= 1.0)
#<zprobe> = #8 (= -10.)
#<probespeed> = #9 (= 200)
#<in_or_mm> = #10 (= 21 in|mm 20|21)
#<wait> = #11 (= 1 Wait for Start)
O1 if [ [#<in_or_mm> ne 20] and [#<in_or_mm> ne 21]]
(debug, in_or_mm invalid: #<in_or_mm> - EXITING)
(print, in_or_mm invalid: #<in_or_mm> - EXITING)
(AXIS,notify, probe: in_or_mm invalid - EXITING)
m2
O1 endif
#<xsteps> = [fix [abs[#<xmax> - #<xmin>]/#<xinterval> + 1]]
#<ysteps> = [fix [abs[#<ymax> - #<ymin>]/#<yinterval> + 1]]
G#<in_or_mm>
#<points> = [#<xsteps> * #<ysteps>]
(debug, Probing #<xsteps> * #<ysteps> = #<points> points)
(LOGOPEN,probe_result.txt)
(LOG,# xmin = #<xmin> xmax = #<xmax> xinterval = #<xinterval> xsteps = #<xsteps>)
/(LOG,# ymin = #<ymin> ymax = #<ymax> yinterval = #<yinterval> ysteps = #<ysteps>)
#<yct> = 0
#<xct> = 0
G0Z#<zsafe>
F#<probespeed>
O2 while [#<yct> lt #<ysteps>]
#<xct> = 0
/ G0 Y[#<ymin>+#<yinterval>*#<yct>]
O3 while [#<xct> lt #<xsteps>]
#<xtarget> = 0
O4 if [[#<yct>/2] - fix[#<yct>/2] eq 0]
#<xtarget> = [#<xmin> + #<xinterval> * #<xct>]
O4 else
#<xtarget> = [#<xmin> + #<xinterval> * [#<xsteps> - #<xct> - 1]]
O4 endif
#<probesuccess> = 1
O5 while [#<probesuccess> NE 0]
G38.5 z#<zsafe> (probe until no contact away from work, no error)
#<probesuccess> = #5070
G38.3 x#<xtarget> (probe until contact, toward work, no error)
#<probesuccess> = #5070
O5 endwhile
O6 if [[#<wait> eq 1] and [[#<yct> eq 0] and [#<xct> eq 0]]]
(debug, S to Begin Probe)
m0 (mandatory stop)
/ M110 (axisui.notifications-clear)
O6 endif
G38.2Z#<zprobe> (probe until contact, toward work, with error)
G0z#<zsafe>
#<probex> = #5061
#<probey> = #5062
#<probez> = #5063
/ (LOG,X#<probex> Y#<probey> Z#<probez>) odkomentuj dla frezarki
(LOG,X#<probex> Z#<probez>)
#<xct> = [#<xct> + 1]
O3 endwhile
G0Z#<zsafe>
#<yct> = [#<yct> + 1]
O2 endwhile
(LOG,# Finished: total points = #<points>)
(LOGCLOSE)
(debug, Finished: see probe_result.txt)
G0Z#<zsafe>
G0X#<xmin>
/Y#<ymin>
o<probe> endsub
Re: pomoc w G38.x tokarka digitalizacja
: 29 sty 2020, 19:46
autor: szary11
Teraz podskakuje o "zretract"
Kod: Zaznacz cały
( Rectangular area probe )
( adapted for ngcgui-compatibility from smartprobe.ngc written by Chris Radek )
( This program repeatedly probes a regular XY grid and writes the )
( probed locations to the file 'probe_result.txt' in the same directory )
( as the .ini file )
( Requires a probe connected to motion.probe-input )
( or use scripts/simulate_probe )
(info: Probe a rectangular area)
o<probe> sub
#<xmin> = #1 (= 0.0)
#<xmax> = #2 (= 10.0)
#<xinterval> = #3 (= 0.1)
#<ymin> = #4 (= 0.0 nie dotykaj dla tokarki)
#<ymax> = #5 (= 0.0 zostaw dla tokarki)
#<yinterval> = #6 (= 1.0 nierusz dla tokarki)
#<zsafe> = #7 (= 1.0)
#<zretract> = #8 (= 2.0 wycofanie Z offset)
#<zprobe> = #9 (= -10.)
#<probespeed> = #10 (= 200)
#<in_or_mm> = #11 (= 21 in|mm 20|21)
#<wait> = #12 (= 1 Wait for Start)
O1 if [ [#<in_or_mm> ne 20] and [#<in_or_mm> ne 21]]
(debug, in_or_mm invalid: #<in_or_mm> - EXITING)
(print, in_or_mm invalid: #<in_or_mm> - EXITING)
(AXIS,notify, probe: in_or_mm invalid - EXITING)
m2
O1 endif
#<xsteps> = [fix [abs[#<xmax> - #<xmin>]/#<xinterval> + 1]]
#<ysteps> = [fix [abs[#<ymax> - #<ymin>]/#<yinterval> + 1]]
G#<in_or_mm>
#<points> = [#<xsteps> * #<ysteps>]
(debug, Probing #<xsteps> * #<ysteps> = #<points> points)
(LOGOPEN,probe_result.txt)
(LOG,# xmin = #<xmin> xmax = #<xmax> xinterval = #<xinterval> xsteps = #<xsteps>)
/(LOG,# ymin = #<ymin> ymax = #<ymax> yinterval = #<yinterval> ysteps = #<ysteps>)
#<yct> = 0
#<xct> = 0
G0Z#<zsafe>
F#<probespeed>
O2 while [#<yct> lt #<ysteps>]
#<xct> = 0
/ G0 Y[#<ymin>+#<yinterval>*#<yct>]
O3 while [#<xct> lt #<xsteps>]
#<xtarget> = 0
O4 if [[#<yct>/2] - fix[#<yct>/2] eq 0]
#<xtarget> = [#<xmin> + #<xinterval> * #<xct>]
O4 else
#<xtarget> = [#<xmin> + #<xinterval> * [#<xsteps> - #<xct> - 1]]
O4 endif
#<probesuccess> = 1
O5 while [#<probesuccess> NE 0]
G38.5 z#<zsafe> (probe until no contact away from work, no error)
#<probesuccess> = #5070
G38.3 x#<xtarget> (probe until contact, toward work, no error)
#<probesuccess> = #5070
O5 endwhile
O6 if [[#<wait> eq 1] and [[#<yct> eq 0] and [#<xct> eq 0]]]
(debug, S to Begin Probe)
m0 (mandatory stop)
/ M110 (axisui.notifications-clear)
O6 endif
G38.2Z#<zprobe> (probe until contact, toward work, with error)
(G0z#<zsafe>)
G91
G0Z#<zretract>
G90
#<probex> = #5061
#<probey> = #5062
#<probez> = #5063
/ (LOG,X#<probex> Y#<probey> Z#<probez>) odkomentuj dla frezarki
(LOG,X#<probex> Z#<probez>)
#<xct> = [#<xct> + 1]
O3 endwhile
(G0Z#<zsafe>)
G91
G0Z#<zretract>
G90
#<yct> = [#<yct> + 1]
O2 endwhile
(LOG,# Finished: total points = #<points>)
(LOGCLOSE)
(debug, Finished: see probe_result.txt)
G0Z#<zsafe>
G0X#<xmin>
/Y#<ymin>
o<probe> endsub
Re: pomoc w G38.x tokarka digitalizacja
: 30 sty 2020, 08:34
autor: jarucki
zonk