LinuxCNC - tokarka
-
Autor tematu - Lider FORUM (min. 2000)
- Posty w temacie: 96
- Posty: 16284
- Rejestracja: 18 wrz 2010, 06:17
- Lokalizacja: Kozienice
- Kontakt:
Bylo by miło ale już jest niezleMlKl pisze:To i je w miarę możliwości oswajamy na spółkę. Na razie cisnę na emc-developers o ten import zakłądek z pliku, ale udają, że nie widzą... Tego jedną zmienną nie da się załatwić.


-
- Lider FORUM (min. 2000)
- Posty w temacie: 82
- Posty: 3705
- Rejestracja: 15 sie 2010, 13:44
- Lokalizacja: Błonie
- Kontakt:
Pobawiłem się właśnie tym zestawem od Thorntona. I to jest dopiero zemsta programisty nad użytkownikiem
Ale już rozumiem, o co mu chodziło ze zmiennymi globalnymi. Tyle, że mi to do kobyły na nic, bo ja potrzebuję sobie absolutnie wszystko móc z osobna ustawić dla pojedynczej zakładki, a nie raz globalnie dla wszystkich.
A tam jest zakładka start, w której się ustawia część tych zmiennych globalnych, zakładka end na drugą część, i między nie trzeba jeszcze nawkładać zakładek, żeby w ogóle cokolwiek zacząć robić. A zanim człowiek zrozumie, o co w tym chodzi, osiwieje.
Jest tam co prawda ciekawa procedura ustawienia wielu punktów ścieżki, którą potem tokarka powtarza aż dojdzie do zadanej średnicy. Tyle, że jak tą ścieżkę trzeba wykonać trzema nożami, to już du** blada, bo nie ma możliwości wprowadzenia, że od punktu x inny nóż.
A ilość zmiennych do wprowadzenia w tych paru zakładkach, zanim cokolwiek się zobaczy na podglądzie kładzie kobyłę na łopatki



Podprocedur jest 40 - trzeba by napisać książkę, jak je obsługiwać. Żadna nie działa samodzielnie - trzeba za każdym razem składać agregat z przynajmniej trzech.

A tam jest zakładka start, w której się ustawia część tych zmiennych globalnych, zakładka end na drugą część, i między nie trzeba jeszcze nawkładać zakładek, żeby w ogóle cokolwiek zacząć robić. A zanim człowiek zrozumie, o co w tym chodzi, osiwieje.
Jest tam co prawda ciekawa procedura ustawienia wielu punktów ścieżki, którą potem tokarka powtarza aż dojdzie do zadanej średnicy. Tyle, że jak tą ścieżkę trzeba wykonać trzema nożami, to już du** blada, bo nie ma możliwości wprowadzenia, że od punktu x inny nóż.
A ilość zmiennych do wprowadzenia w tych paru zakładkach, zanim cokolwiek się zobaczy na podglądzie kładzie kobyłę na łopatki




Podprocedur jest 40 - trzeba by napisać książkę, jak je obsługiwać. Żadna nie działa samodzielnie - trzeba za każdym razem składać agregat z przynajmniej trzech.
-
Autor tematu - Lider FORUM (min. 2000)
- Posty w temacie: 96
- Posty: 16284
- Rejestracja: 18 wrz 2010, 06:17
- Lokalizacja: Kozienice
- Kontakt:
Ten typ tak maMlKl pisze: I to jest dopiero zemsta programisty nad użytkownikiem.

Dlatego najlepiej mi się robi na procedurkach które sam zrobie albo ktoś zrobi pod moje dyktando. I dotyczy to nie tylko ngcgui. Całą księgowość i kadry mam od 22 lat na arkuszu kalkulacyjnym i zadne e-firmy mi nie potrzebne.
-
- Lider FORUM (min. 2000)
- Posty w temacie: 82
- Posty: 3705
- Rejestracja: 15 sie 2010, 13:44
- Lokalizacja: Błonie
- Kontakt:
Książkę napisano już... To jest bardziej skomplikowane, niż obsługa Dreamlinera...
Metric Lathe subroutines - G71, G72, boring, internal and external taper and other utilities
**********************************************************
I have taken a modular, lego block, approach to this, intending that the user strings a series of subs together to build the full program.
Whilst I have titled this Metric lathe subs, the only metric setting is G21 in <start>
The subs do not make any assumptions or add any clearances etc. other than those provided through the gui, so they will work in any unit base
<start> contains all the important settings ( G and M codes, rotation, coolant, feed, feed system (g96 or g97), speed,
start and end points for each axis etc.)
Compulsory field 20 is X axis orientation, with regards to arcs especially.
g71 and g72 need to know which G code could produce a concave arc which overcuts into the billet diameter at early iterations
of the roughing cycle, in order to compensate for this
Conventional lathes are Front Toolpost, whereas tooling approaching from behind in a conventional lathe are Rear Toolpost
The parameters in <start> are global and used by the other subs
There is no NGCGUI_PREAMBLE = lathe_std.ngc or similar
ngcgui inserts these codes at the start of every sub, which is either unnecessary or worse could cancel a setting or offset that has been applied.
Add in any G or M codes you want to <start>
<moveto> sub is an optional G00 to a stand-off position that may not be the same as the start points.
<path1> (and <path2 if used) plot the external profile of a workpiece, in finished dimensions, using G01, G02 and G03 moves
Currently 14 sets of G0n Xn Zn Rn co-ordinates are catered for using both subs.
A value of 9999 set in the G0n field terminates the sequence.
It is important to make this termination or the g71 and g72 subs could read beyond the fields intended and produce some very
strange / dangerous results.
This sub cannot be created as a new instance and re-used, there will be clashes between parameters with later ones overwriting earlier ones.
The code only checks up to 56 fields in any case at present
These co-ordinates are moved into a simple array to enable indirect addressing within loops
The arcs are in radius mode for simplicity.
It is possible to calculate the I and K parameters for every decremented loop of the g71 or g72 routine, in a way which would work with any arc
thrown at it, but is not easy or quick.
I have a template program which does just this, but using R values seems to work OK with lathes.
Because arcs on a lathe are seldom beyond 135 -145 degree ish the problems with radius based arcs are not the same as on a mill.
The arcs generated do not follow the finished profile exactly at early stages, but often this is beneficial because the initial cuts
from the start point are shallower.
<g71r> is the G71 roughing sub.
g71 works in decrementing X values from billet diameter down to finished size in a series of cuts following the finished profile
It will use the co-ordinate array generated from <path1> (and <path2> ), calculate the depth of the deepest cut, work out number of loops
and cut down leaving a finishing allowance (if that allowance was specified in <start>)
NB
The toolpath is assumed to be from X+nn to X0 and Z0 to Z-nn ie conventional towards centreline and chuck respectively
If you are doing something different the arc overcut compensation will not work
<710> is the internal called by g71 sub, calculates X value for next cut and returns it in param #31
Limiting of fresh air cuts to #<_diameter> + #<_clearance> has been removed because of adverse effects if cutting a large
taper as part of the profile, when the billet size is considerably larger than the finished size.
<711> another internal which calculates the overcut beyond the lowest X value from a concave arc and compensates
<g72r> is the G72 roughing sub
g72 works in terms of Z values and would be most commonly used for radiused facing of a billet for example.
NB
The toolpath is assumed to be from X+nn to X0 ie conventional facing direction
So a radiused facing cut say would begin at Xdiam Z-rad, go to X[diam -[rad*2]] Z0 then to X0
If you are doing something different the arc overcut compensation will not work
<720> is the internal called by g72 sub, calculates Z value for next cut and returns it in param #31
<721> another internal which calculates the overcut beyond the lowest Z value from a concave arc and compensates
<toolchange>
Is self explanatory and can be programmed to go to either G28 home or another location before the change and then return to the
current location.
(works as is with 2.5 > only, see commented out code for implementing this return under 2.4 and lower)
Spindle and coolant are switched off before change and re-instated to values in <start> on return
<g71f> is the G71 finishing sub
<g72f> is the G72 finishing sub
<taper-r> is an external taper roughing sub
startX and endZ set the diameter of the small end and the length of the taper respectively and endX is calculated from the angle
<taper-f> is the external taper finishing sub
<int-taper> is an internal taper cutting sub
Unlike the other routines it finishes within the same sub, but you could subdivide it if you happen to have a finishing boring bar.
There is a compulsory parameter for the Safe X Path setting to be used when retracting the bar after a cut.
When used to cut a taper the meaning of StartX and EndX is subtly changed, with the former being the diameter of the clearance hole
drilled in the billet from which to start but the latter being the finished diameter of the mouth of the taper, still at StartZ not at
EndZ as pertains in the other subs.
<bore> is an internal boring sub
As per <int-taper> it roughs and finishes in one routine
<end> is the final sub
This switches off spindle, coolant, re-sets co-ordinate system to G54, turns off tool offsets etc
plus optionally moves to G28 home or another specified position
Notes
*********
There is no provision for setting tool tip radius compensation. This is a conscious decision, which I will attempt to explain.
If you set your X and Z co-ordinates by a light cut with the tool to be used as I do, cutter tip radius compensation is redundant for linear
turning, you will get what you command.
Cutting arcs with compensation enabled within loops, threw up a lot of problems.
There needs to be a 'lead in' linear move of more that the tool tip diameter before an arc is programmed with G41/42 set.
If the first cut of the profile is an arc, this causes a lot of problems as a non cutting linear move needs to precede it. EMC does not know that this move is
non cutting and even an approach at 90deg to the first cut, can throw up gouging errors where emc thinks the tool is going into a concave corner
that it cannot fit into.
The exact shape of the looping plot cannot be anticipated when entering the finished profile, as it will be decremented from a high stand off point,
sometimes decreasing the angle of the non-cutting approach, even if the one programmed was OK.
I decided that it made life too difficult for the user, trying to program a profile loop that not only described the finished shape required, but
avoided the other problems described.
Usage
************************************
The sequence selected within the ngcgui governs the workflow in the program, so make sure it is correct
An example might be
<start> <moveto> <path1> <g71r> <toolchange> <g71f> <end>
or
<start> <bore> <toolchange> <moveto> <int-taper> <end>
The only subs that you should need to create extra instances of, are <moveto> and <toolchange>
Their parameters are standalone and having multiple instances will not affect other subs
Examples
***********************************
In the separate directory are some example output files using these subs and a .png of the Axis preview of the loaded file.
They can be loaded into Axis (so long as you have put all the .ngc subs in the correct place) and run in simulation
All are from a front toolpost perspective.
Disclaimer
*************
These subs are work in progress, subject to update and polish, tested in simulation for the most part not on metal, but derived from
existing and proven template files.
Carefully study the preview plot, run in simulation and ensure that they do what you expect before using.
Working purely with subs and no gcode lines to follow, makes mistakes difficult to predict when running.
Not warranted suitable for anything - use at your own risk
(c)ArcEye 2011
Licence GPL
-
Autor tematu - Lider FORUM (min. 2000)
- Posty w temacie: 96
- Posty: 16284
- Rejestracja: 18 wrz 2010, 06:17
- Lokalizacja: Kozienice
- Kontakt:
Drobna sprawa która dziś wyniknęła. Wypada jednak deklarować w każdej procedurce G18.
Wczoraj było wiercone na tokarce a w procedurce jest zmiana na g17 i dzis , mimo ze w .ini jest wstawione g18 na sztywno, plaszczyzn nie zmieniło.
[ Dodano: 2012-11-30, 09:42 ]
Poprawiony stożek zewnetrzny ze zbieraniem naddatku i działającym kącie.


Wczoraj było wiercone na tokarce a w procedurce jest zmiana na g17 i dzis , mimo ze w .ini jest wstawione g18 na sztywno, plaszczyzn nie zmieniło.
[ Dodano: 2012-11-30, 09:42 ]
Poprawiony stożek zewnetrzny ze zbieraniem naddatku i działającym kącie.


Kod: Zaznacz cały
( ------------------------------ )
( S T O Z E K )
( ------------------------------ )
( Kamar )
( Time-stamp: <2012-11-30 08:48> )
( ------------------------------ )
(info: Stożek )
o<stozek> sub
#<sr_materialu> = #1 (=40 Średnica materiału)
#<sr_pocz> = #2 (=20 Średnica początkowa )
#<sr_koncowa> = #3 (=30 Średnica końcowa )
#<z_pocz> = #4 (=0 Z początkowe )
#<dl_stozka> = #5 (=20 Długość stożka... )
#<kat> = #6 (=0 ...albo kąt )
#<dobieranie> = #7 (=2 Dobieranie )
#<posuw> = #8 (=60 Posuw )
#<korekta> = #9 (=0 Korekta )
#<woda> = #10 (=1 Woda )
g7 g61 g80 g18
m3 s1
o10 if [#<woda> eq 1]
M8
o10 endif
o20 if [#<kat> gt 0 and #<dl_stozka> gt 0]
(msg, Podajemy albo kąt albo długość stożka)
M30
o20 endif
( jeżeli podany kąt)
o1000 if [#<kat> gt 0]
(---------- rosnacy z kątem ----------)
o1100 if [#<sr_pocz> lt #<sr_koncowa>]
#<krok> = 0
#<dl_stozka> = [[[#<sr_koncowa> - #<sr_pocz>] / 2] / tan[#<kat>]]
o1110 if [#<korekta> eq 0]
( jezeli srednica koncowa mniejsza niz material to zbieram naddatek)
o1010 if [#<sr_koncowa> lt #<sr_materialu>]
#<x_akt_start> = #<sr_materialu>
#<x_akt_koniec> = #<sr_koncowa>
o1020 while [#<x_akt_start> gt #<x_akt_koniec>]
#<x_akt_start> = [#<x_akt_start> - #<dobieranie>]
o1030 if [#<x_akt_start> lt #<x_akt_koniec>]
#<x_akt_start> = #<x_akt_koniec>
o1030 endif
g0 z[#<z_pocz> + 1]
g0 x#<x_akt_start>
g1 z[#<z_pocz>] F#<posuw>
g1 z[#<z_pocz> - #<dl_stozka>] F#<posuw>
g1 x[#<x_akt_start> + #<dobieranie>]
g0 z[#<z_pocz> + 1]
o1020 endwhile
o1010 endif
#<akt_start> = #<sr_koncowa>
g0 z[#<z_pocz> + 1]
o1200 while [#<akt_start> gt #<sr_pocz>]
#<akt_start> = [#<akt_start> - #<dobieranie>]
#<krok> = [#<krok> + 1]
o1300 if [#<akt_start> lt #<sr_pocz>]
#<akt_start> = #<sr_koncowa>
o1300 endif
g0 x#<akt_start>
o1400 if [#<sr_koncowa> gt #<sr_materialu>]
#<sr_koncowa> = #<sr_materialu>
o1400 endif
g1 z#<z_pocz> F#<posuw>
( g1 x#<sr_koncowa> z[-1 * [[#<z_pocz> + [#<krok> * #<dobieranie> / 2]] / tan[#<kat>]]] f#<posuw>)
g1 x#<sr_koncowa> z[#<z_pocz> - [[#<sr_koncowa> - #<akt_start>] / [2 * tan[#<kat>]]]] F#<posuw>
g0 z[#<z_pocz> + 1]
o1200 endwhile
o1110 else
(---------- korekta ----------)
g0 z[#<z_pocz> + 1] F#<posuw>
g0 x[#<sr_pocz> - #<korekta>]
g1 z[#<z_pocz>]
g1 x[#<sr_koncowa> - #<korekta>] z[#<z_pocz> - #<dl_stozka>] f#<posuw>
g0 z[#<z_pocz> + 1]
o1110 endif
o1100 endif
(---------- malejacy z kątem ----------)
o2000 if [#<sr_pocz> gt #<sr_koncowa>]
#<dl_stozka> = [[[#<sr_pocz> - #<sr_koncowa>] / 2] / tan[#<kat>]]
o2111 if [#<korekta> eq 0]
( jezeli srednica koncowa mniejsza niz material to zbieram naddatek)
o2010 if [#<sr_koncowa> lt #<sr_materialu>]
#<x_akt_start> = #<sr_materialu>
#<x_akt_koniec> = #<sr_pocz>
o2020 while [#<x_akt_start> gt #<x_akt_koniec>]
#<x_akt_start> = [#<x_akt_start> - #<dobieranie>]
o2030 if [#<x_akt_start> lt #<x_akt_koniec>]
#<x_akt_start> = #<x_akt_koniec>
o2030 endif
g0 z[#<z_pocz> + 1]
g0 x#<x_akt_start>
g1 z[#<z_pocz> - #<dl_stozka>] F#<posuw>
g1 x[#<x_akt_start> + #<dobieranie>]
g0 z[#<z_pocz> + 1]
o2020 endwhile
o2010 endif
#<akt_koniec> = #<sr_pocz>
o2500 while [#<akt_koniec> gt #<sr_koncowa>]
#<akt_koniec> = [#<akt_koniec> - #<dobieranie>]
o2100 if [#<akt_koniec> lt #<sr_koncowa>]
#<akt_koniec> = #<sr_koncowa>
o2100 endif
g0 x[#<sr_pocz> + 1]
g0 z[#<z_pocz> - [-1 * [[#<sr_koncowa> - #<akt_koniec>] * #<dl_stozka>] / [#<sr_pocz> - #<sr_koncowa>]]]
g0 x#<sr_pocz>
g1 x[#<akt_koniec>] z[#<z_pocz> - #<dl_stozka>] f#<posuw>
o2500 endwhile
o2111 else
(---------- korekta ----------)
g0 z[#<z_pocz> + 1] F#<posuw>
g0 x[#<sr_pocz> - #<korekta>]
g1 z[#<z_pocz>]
g1 x[#<sr_koncowa> - #<korekta>] z[#<z_pocz> - #<dl_stozka>] f#<posuw>
g0 x[#<sr_pocz> + 1]
g0 z[#<z_pocz> + 1]
o2111 endif
o2000 endif
(--------------------)
o1000 else (kat == 0)
(--------------------)
(---------- rosnacy z długością ----------)
o2000 if [#<sr_pocz> lt #<sr_koncowa>]
#<krok> = 0
( jezeli srednica koncowa mniejsza niz material to zbieram naddatek)
o2222 if [#<korekta> eq 0]
o2110 if [#<sr_koncowa> lt #<sr_materialu>]
#<x_akt_start> = #<sr_materialu>
#<x_akt_koniec> = #<sr_koncowa>
o2120 while [#<x_akt_start> gt #<x_akt_koniec>]
#<x_akt_start> = [#<x_akt_start> - #<dobieranie>]
o2130 if [#<x_akt_start> lt #<x_akt_koniec>]
#<x_akt_start> = #<x_akt_koniec>
o2130 endif
g0 z[#<z_pocz> + 1]
g0 x#<x_akt_start>
g1 z[#<z_pocz> - #<dl_stozka>] F#<posuw>
g1 x[#<x_akt_start> + #<dobieranie>]
g0 z[#<z_pocz> + 1]
o2120 endwhile
o2110 endif
#<z_krok> = [[#<dl_stozka> * #<dobieranie>] / [#<sr_koncowa> - #<sr_pocz>]]
#<x_akt_start> = #<sr_koncowa>
#<z_akt_koniec> = #<z_pocz>
o2600 while [#<x_akt_start> gt #<sr_pocz>]
#<x_akt_start> = [#<x_akt_start> - #<dobieranie>]
#<krok> = [#<krok> + 1]
o2610 if [#<x_akt_start> lt #<sr_pocz>]
#<x_akt_start> = #<sr_pocz>
o2610 endif
#<z_akt_koniec> = [#<z_akt_koniec> - #<z_krok>]
o2620 if [#<z_akt_koniec> lt [#<z_pocz> - #<dl_stozka>]]
#<z_akt_koniec> = [#<z_pocz> - #<dl_stozka>]
o2620 endif
g0 z[#<z_pocz> + 1]
g0 x#<x_akt_start>
g1 z#<z_pocz> f#<posuw>
( o312 if[#<sr_koncowa> ge #<sr_materialu>])
g1 x#<sr_koncowa> z#<z_akt_koniec> f#<posuw>
( o312 else)
( g1 x#<sr_materialu> z#<z_akt_koniec> f#<posuw>)
( o312 endif)
g0 z#<z_pocz>
o2600 endwhile
o2222 else
(---------- korekta ----------)
g0 z[#<z_pocz> + 1] F#<posuw>
g0 x[#<sr_pocz> - #<korekta>]
g1 z[#<z_pocz>]
g1 x[#<sr_koncowa> - #<korekta>] z[#<z_pocz> - #<dl_stozka>] f#<posuw>
g0 z[#<z_pocz> + 1]
o2222 endif
o2000 endif
(---------- malejacy z długością ----------)
o3000 if [#<sr_pocz> gt #<sr_koncowa>]
o3333 if [#<korekta> eq 0]
( jezeli srednica koncowa mniejsza niz material to zbieram naddatek)
o3010 if [#<sr_pocz> lt #<sr_materialu>]
#<x_akt_start> = #<sr_materialu>
#<x_akt_koniec> = #<sr_pocz>
o3020 while [#<x_akt_start> gt #<x_akt_koniec>]
#<x_akt_start> = [#<x_akt_start> - #<dobieranie>]
o3030 if [#<x_akt_start> lt #<x_akt_koniec>]
#<x_akt_start> = #<x_akt_koniec>
o3030 endif
g0 z[#<z_pocz> + 1]
g0 x#<x_akt_start>
g1 z[#<z_pocz> - #<dl_stozka>] F#<posuw>
g1 x[#<x_akt_start> + #<dobieranie>]
g0 z[#<z_pocz> + 1]
o3020 endwhile
o3010 endif
#<akt_koniec> = #<sr_pocz>
o4000 while [#<akt_koniec> gt #<sr_koncowa>]
#<akt_koniec> = [#<akt_koniec> - #<dobieranie>]
o4100 if [#<akt_koniec> lt #<sr_koncowa>]
#<akt_koniec> = #<sr_koncowa>
o4100 endif
g0 x[#<sr_pocz> + 1]
g0 z[#<z_pocz> - [-1 * [[#<sr_koncowa> - #<akt_koniec>] * #<dl_stozka>] / [#<sr_pocz> - #<sr_koncowa>]]]
g0 x#<sr_pocz>
g1 x[#<akt_koniec>] z[#<z_pocz> - #<dl_stozka>] f#<posuw>
o4000 endwhile
o3333 else
(---------- korekta ----------)
g0 z[#<z_pocz> + 1] F#<posuw>
g0 x[#<sr_pocz> - #<korekta>]
g1 z[#<z_pocz>]
g1 x[#<sr_koncowa> - #<korekta>] z[#<z_pocz> - #<dl_stozka>] f#<posuw>
g0 x[#<sr_pocz> + 1]
g0 z[#<z_pocz> + 1]
o3333 endif
o3000 endif
o1000 endif
o<stozek> endsub
-
- Lider FORUM (min. 2000)
- Posty w temacie: 82
- Posty: 3705
- Rejestracja: 15 sie 2010, 13:44
- Lokalizacja: Błonie
- Kontakt:
Jak zmieniam w procedurze któreś z defaultowych ustawień, to na końcu procedury zawsze przywracam. LinuxCNC pamięta to, co się ustawiło ostatnio.
Procedurze to nie robi różnicy, a każda następna, czy polecenie z palca, pracują już w ustawieniach defaultowych.
[ Dodano: 2012-12-01, 05:13 ]
Stożek działa fajnie, już go mam w zakładkach.

Parę postów wcześniej pisałem, że coś takiego da się zrobić w dwóch zakładkach kobyły - słowo stało się ciałem
Wypełnić musiałem 16 pól formularza łącznie.
Procedurze to nie robi różnicy, a każda następna, czy polecenie z palca, pracują już w ustawieniach defaultowych.
[ Dodano: 2012-12-01, 05:13 ]
Stożek działa fajnie, już go mam w zakładkach.

Parę postów wcześniej pisałem, że coś takiego da się zrobić w dwóch zakładkach kobyły - słowo stało się ciałem

Wypełnić musiałem 16 pól formularza łącznie.
-
Autor tematu - Lider FORUM (min. 2000)
- Posty w temacie: 96
- Posty: 16284
- Rejestracja: 18 wrz 2010, 06:17
- Lokalizacja: Kozienice
- Kontakt:
Poprawiony stożek. Wersja już chyba bez błędów

Kod: Zaznacz cały
( ------------------------------ )
( S T O Z E K )
( ------------------------------ )
( Kamar )
( Time-stamp: <2012-12-03 07:31> )
( ------------------------------ )
(info: Stożek )
o<stozek> sub
#<sr_materialu> = #1 (=40 Średnica materiału)
#<sr_pocz> = #2 (=20 Średnica początkowa )
#<sr_koncowa> = #3 (=30 Średnica końcowa )
#<z_pocz> = #4 (=0 Z początkowe )
#<dl_stozka> = #5 (=20 Długość stożka... )
#<kat> = #6 (=0 ...albo kąt )
#<dobieranie> = #7 (=2 Dobieranie )
#<posuw> = #8 (=60 Posuw )
#<korekta> = #9 (=0 Korekta )
#<woda> = #10 (=1 Woda )
g7 g61 g80 g18
m3 s1
o10 if [#<woda> eq 1]
M8
o10 endif
o20 if [#<kat> gt 0 and #<dl_stozka> gt 0]
(msg, Podajemy albo kąt albo długość stożka)
M30
o20 endif
( jeżeli podany kąt)
o1000 if [#<kat> gt 0]
(---------- rosnacy z kątem ----------)
o1100 if [#<sr_pocz> lt #<sr_koncowa>]
#<krok> = 0
#<dl_stozka> = [[[#<sr_koncowa> - #<sr_pocz>] / 2] / tan[#<kat>]]
o1110 if [#<korekta> eq 0]
( jezeli srednica koncowa mniejsza niz material to zbieram naddatek)
o1010 if [#<sr_koncowa> lt #<sr_materialu>]
#<x_akt_start> = #<sr_materialu>
#<x_akt_koniec> = #<sr_koncowa>
o1020 while [#<x_akt_start> gt #<x_akt_koniec>]
#<x_akt_start> = [#<x_akt_start> - #<dobieranie>]
o1030 if [#<x_akt_start> lt #<x_akt_koniec>]
#<x_akt_start> = #<x_akt_koniec>
o1030 endif
g0 z[#<z_pocz> + 1]
g0 x#<x_akt_start>
g1 z[#<z_pocz>] F#<posuw>
g1 z[#<z_pocz> - #<dl_stozka>] F#<posuw>
g1 x[#<x_akt_start> + #<dobieranie>]
g0 z[#<z_pocz> + 1]
o1020 endwhile
o1010 endif
#<akt_start> = #<sr_koncowa>
g0 z[#<z_pocz> + 1]
o1200 while [#<akt_start> gt #<sr_pocz>]
#<akt_start> = [#<akt_start> - #<dobieranie>]
#<krok> = [#<krok> + 1]
o1300 if [#<akt_start> lt #<sr_pocz>]
#<akt_start> = #<sr_pocz>
o1300 endif
g0 x#<akt_start>
o1400 if [#<sr_koncowa> gt #<sr_materialu>]
#<sr_koncowa> = #<sr_materialu>
o1400 endif
g1 z#<z_pocz> F#<posuw>
( g1 x#<sr_koncowa> z[-1 * [[#<z_pocz> + [#<krok> * #<dobieranie> / 2]] / tan[#<kat>]]] f#<posuw>)
g1 x#<sr_koncowa> z[#<z_pocz> - [[#<sr_koncowa> - #<akt_start>] / [2 * tan[#<kat>]]]] F#<posuw>
g0 z[#<z_pocz> + 1]
o1200 endwhile
o1110 else
(---------- korekta ----------)
g0 z[#<z_pocz> + 1] F#<posuw>
g0 x[#<sr_pocz> - #<korekta>]
g1 z[#<z_pocz>]
g1 x[#<sr_koncowa> - #<korekta>] z[#<z_pocz> - #<dl_stozka>] f#<posuw>
g0 z[#<z_pocz> + 1]
o1110 endif
o1100 endif
(---------- malejacy z kątem ----------)
o2000 if [#<sr_pocz> gt #<sr_koncowa>]
#<dl_stozka> = [[[#<sr_pocz> - #<sr_koncowa>] / 2] / tan[#<kat>]]
o2111 if [#<korekta> eq 0]
( jezeli srednica koncowa mniejsza niz material to zbieram naddatek)
o2010 if [#<sr_koncowa> lt #<sr_materialu>]
#<x_akt_start> = #<sr_materialu>
#<x_akt_koniec> = #<sr_pocz>
o2020 while [#<x_akt_start> gt #<x_akt_koniec>]
#<x_akt_start> = [#<x_akt_start> - #<dobieranie>]
o2030 if [#<x_akt_start> lt #<x_akt_koniec>]
#<x_akt_start> = #<x_akt_koniec>
o2030 endif
g0 z[#<z_pocz> + 1]
g0 x#<x_akt_start>
g1 z[#<z_pocz> - #<dl_stozka>] F#<posuw>
g1 x[#<x_akt_start> + #<dobieranie>]
g0 z[#<z_pocz> + 1]
o2020 endwhile
o2010 endif
#<akt_koniec> = #<sr_pocz>
o2500 while [#<akt_koniec> gt #<sr_koncowa>]
#<akt_koniec> = [#<akt_koniec> - #<dobieranie>]
o2100 if [#<akt_koniec> lt #<sr_koncowa>]
#<akt_koniec> = #<sr_koncowa>
o2100 endif
g0 x[#<sr_pocz> + 1]
g0 z[#<z_pocz> - [-1 * [[#<sr_koncowa> - #<akt_koniec>] * #<dl_stozka>] / [#<sr_pocz> - #<sr_koncowa>]]]
g0 x#<sr_pocz>
g1 x[#<akt_koniec>] z[#<z_pocz> - #<dl_stozka>] f#<posuw>
o2500 endwhile
o2111 else
(---------- korekta ----------)
g0 z[#<z_pocz> + 1] F#<posuw>
g0 x[#<sr_pocz> - #<korekta>]
g1 z[#<z_pocz>]
g1 x[#<sr_koncowa> - #<korekta>] z[#<z_pocz> - #<dl_stozka>] f#<posuw>
g0 x[#<sr_pocz> + 1]
g0 z[#<z_pocz> + 1]
o2111 endif
o2000 endif
(--------------------)
o1000 else (kat == 0)
(--------------------)
(---------- rosnacy z długością ----------)
o2000 if [#<sr_pocz> lt #<sr_koncowa>]
#<krok> = 0
( jezeli srednica koncowa mniejsza niz material to zbieram naddatek)
o2222 if [#<korekta> eq 0]
o2110 if [#<sr_koncowa> lt #<sr_materialu>]
#<x_akt_start> = #<sr_materialu>
#<x_akt_koniec> = #<sr_koncowa>
o2120 while [#<x_akt_start> gt #<x_akt_koniec>]
#<x_akt_start> = [#<x_akt_start> - #<dobieranie>]
o2130 if [#<x_akt_start> lt #<x_akt_koniec>]
#<x_akt_start> = #<x_akt_koniec>
o2130 endif
g0 z[#<z_pocz> + 1]
g0 x#<x_akt_start>
g1 z[#<z_pocz> - #<dl_stozka>] F#<posuw>
g1 x[#<x_akt_start> + #<dobieranie>]
g0 z[#<z_pocz> + 1]
o2120 endwhile
o2110 endif
#<z_krok> = [[#<dl_stozka> * #<dobieranie>] / [#<sr_koncowa> - #<sr_pocz>]]
#<x_akt_start> = #<sr_koncowa>
#<z_akt_koniec> = #<z_pocz>
o2600 while [#<x_akt_start> gt #<sr_pocz>]
#<x_akt_start> = [#<x_akt_start> - #<dobieranie>]
#<krok> = [#<krok> + 1]
o2610 if [#<x_akt_start> lt #<sr_pocz>]
#<x_akt_start> = #<sr_pocz>
o2610 endif
#<z_akt_koniec> = [#<z_akt_koniec> - #<z_krok>]
o2620 if [#<z_akt_koniec> lt [#<z_pocz> - #<dl_stozka>]]
#<z_akt_koniec> = [#<z_pocz> - #<dl_stozka>]
o2620 endif
g0 z[#<z_pocz> + 1]
g0 x#<x_akt_start>
g1 z#<z_pocz> f#<posuw>
( o312 if[#<sr_koncowa> ge #<sr_materialu>])
g1 x#<sr_koncowa> z#<z_akt_koniec> f#<posuw>
( o312 else)
( g1 x#<sr_materialu> z#<z_akt_koniec> f#<posuw>)
( o312 endif)
g0 z#<z_pocz>
o2600 endwhile
o2222 else
(---------- korekta ----------)
g0 z[#<z_pocz> + 1] F#<posuw>
g0 x[#<sr_pocz> - #<korekta>]
g1 z[#<z_pocz>]
g1 x[#<sr_koncowa> - #<korekta>] z[#<z_pocz> - #<dl_stozka>] f#<posuw>
g0 z[#<z_pocz> + 1]
o2222 endif
o2000 endif
(---------- malejacy z długością ----------)
o3000 if [#<sr_pocz> gt #<sr_koncowa>]
o3333 if [#<korekta> eq 0]
( jezeli srednica koncowa mniejsza niz material to zbieram naddatek)
o3010 if [#<sr_pocz> lt #<sr_materialu>]
#<x_akt_start> = #<sr_materialu>
#<x_akt_koniec> = #<sr_pocz>
o3020 while [#<x_akt_start> gt #<x_akt_koniec>]
#<x_akt_start> = [#<x_akt_start> - #<dobieranie>]
o3030 if [#<x_akt_start> lt #<x_akt_koniec>]
#<x_akt_start> = #<x_akt_koniec>
o3030 endif
g0 z[#<z_pocz> + 1]
g0 x#<x_akt_start>
g1 z[#<z_pocz> - #<dl_stozka>] F#<posuw>
g1 x[#<x_akt_start> + #<dobieranie>]
g0 z[#<z_pocz> + 1]
o3020 endwhile
o3010 endif
#<akt_koniec> = #<sr_pocz>
o4000 while [#<akt_koniec> gt #<sr_koncowa>]
#<akt_koniec> = [#<akt_koniec> - #<dobieranie>]
o4100 if [#<akt_koniec> lt #<sr_koncowa>]
#<akt_koniec> = #<sr_koncowa>
o4100 endif
g0 x[#<sr_pocz> + 1]
g0 z[#<z_pocz> - [-1 * [[#<sr_koncowa> - #<akt_koniec>] * #<dl_stozka>] / [#<sr_pocz> - #<sr_koncowa>]]]
g0 x#<sr_pocz>
g1 x[#<akt_koniec>] z[#<z_pocz> - #<dl_stozka>] f#<posuw>
o4000 endwhile
o3333 else
(---------- korekta ----------)
g0 z[#<z_pocz> + 1] F#<posuw>
g0 x[#<sr_pocz> - #<korekta>]
g1 z[#<z_pocz>]
g1 x[#<sr_koncowa> - #<korekta>] z[#<z_pocz> - #<dl_stozka>] f#<posuw>
g0 x[#<sr_pocz> + 1]
g0 z[#<z_pocz> + 1]
o3333 endif
o3000 endif
o1000 endif
o<stozek> endsub