Znaleziono 5 wyników

autor: szary11
29 sty 2020, 19:46
Forum: LinuxCNC (dawniej EMC2)
Temat: pomoc w G38.x tokarka digitalizacja
Odpowiedzi: 8
Odsłony: 1246

Re: pomoc w G38.x tokarka digitalizacja

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
autor: szary11
29 sty 2020, 08:55
Forum: LinuxCNC (dawniej EMC2)
Temat: pomoc w G38.x tokarka digitalizacja
Odpowiedzi: 8
Odsłony: 1246

Re: pomoc w G38.x tokarka digitalizacja

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

autor: szary11
27 sty 2020, 14:14
Forum: LinuxCNC (dawniej EMC2)
Temat: pomoc w G38.x tokarka digitalizacja
Odpowiedzi: 8
Odsłony: 1246

Re: pomoc w G38.x tokarka digitalizacja

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ę.
autor: szary11
27 sty 2020, 13:33
Forum: LinuxCNC (dawniej EMC2)
Temat: pomoc w G38.x tokarka digitalizacja
Odpowiedzi: 8
Odsłony: 1246

Re: pomoc w G38.x tokarka digitalizacja

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ś ?
autor: szary11
27 sty 2020, 11:55
Forum: LinuxCNC (dawniej EMC2)
Temat: pomoc w G38.x tokarka digitalizacja
Odpowiedzi: 8
Odsłony: 1246

Re: pomoc w G38.x tokarka digitalizacja

Pięknie, będzie felga alu przetaczana? :)

Wróć do „pomoc w G38.x tokarka digitalizacja”