Znaleziono 8 wyników

autor: MlKl
10 lut 2012, 23:29
Forum: Mach 2 / 3 / 4 (ArtSoft software)
Temat: mach 3 błąd
Odpowiedzi: 32
Odsłony: 7639

Ładnych parę lat temu w VBA Excela robiłem sobie aukcje na Allegro z cennika hurtowni - kilka tysięcy pozycji jednym kliknięciem do załadowania przez Aukcjonera. I z wielką ulgą przerzuciłem się z tym na PHP.

Język wbudowany w LinuxCNC jest jeszcze dużo prostszy od PHP - ale do celów programowania G-code aż nadto wystarczający.

Naprawdę łatwiej jest napisać takie makro, niż ręcznie rzeźbić większego G-coda. To się pisze raz, i potem tylko używa.
autor: MlKl
10 lut 2012, 01:51
Forum: Mach 2 / 3 / 4 (ArtSoft software)
Temat: mach 3 błąd
Odpowiedzi: 32
Odsłony: 7639

Nie ma znaczenia, jaki kanałek - istotne jest to, jakim narzędziem utworzony został G-code, który jest do maszyny wysyłany. I tu w porównaniu możliwości rozbudowy o własne procedury Mach przegrywa z kretesem z LinuxCNC. Nawet tworzenie procedur w Pythonie pod LinuxCNC jest prostsze, niż budowa makra do Macha - bo to prostszy język. A NGCGUI to klasa sama dla siebie.
autor: MlKl
09 lut 2012, 21:13
Forum: Mach 2 / 3 / 4 (ArtSoft software)
Temat: mach 3 błąd
Odpowiedzi: 32
Odsłony: 7639

Używaj przycisku [ code ] przy wklejaniu kodów. Tylko nie zapomnij o zamknięciu znacznika po wklejeniu kodu.

To, że się da programować g-code w Machu nie ulega wątpliwości. Ale kamar pokazał nie kod, a gotowe makro, jego pracownik podchodzi do tokarki, wpisuje w tabelkę kilka parametrów i program jedzie. W Machu to jest realizowalne, ale trzeba zrobić cały wygląd okienka, nie mówiąc o skomplikowanej składni VB.

LinuxCNC ma wbudowany język programowania, może o mniejszych możliwościach niż VB, za to dużo prostszy. Dzięki niemu pisząc plik z g-code można używać warunków, pętli, skoków, odwoływać się do podprocedur. Nauczyć się tego można w godzinę, i wystarczy jeden kumaty w zakładzie, żeby reszta mogła pracować praktycznie nie znając nawet g-code.

Makra w LinuxCNC pracują w głównym oknie programu, wizualizują się jak każdy wprowadzony do niego G-code.
autor: MlKl
08 lut 2012, 21:36
Forum: Mach 2 / 3 / 4 (ArtSoft software)
Temat: mach 3 błąd
Odpowiedzi: 32
Odsłony: 7639

Dodawanie takich zakładek jest śmiesznie proste:

Taki plik tworzy zakładkę do toczenia półkuli - część formatki zatytułowana "Parametry" to efekt odpowiednio sformatowanych komentarzy na początku pliku, za wykonanie odpowiada kod z jego zakończenia. Nie ma ograniczenia ilości takich procedur, można je łączyć w dowolnej kolejności i z dowolnymi parametrami.

Kod: Zaznacz cały

; Author: Z. Maciej "Miki" Bajkowski

(info: Toczenie półkuli lub zaokrąglenia krawędzi wałka. ) 
o<polkula> sub

#<promien_walca> =     #1 (=30 Promień walca) 
#<promien_na_plasko> =  #2 (=20 Promień części bez zaokrąglenia. 0 - toczymy półkulę) 
#<promien_kulki> =     #3 (=15 Promień zaokrąglenia) 
#<przybranie> =     #4 (=3 Przybranie materiału) 
#<przesuniecie_z> =     #5 (=0 Punkt początku operacji na osi Z) 
 #<Coolant>    =        #6 (=8 8 - Chłodziwo włączone, 9 - wyłączone) 
#<predkosc> = #7 (=400 Prędkość skrawania) 

#<promien> = #<promien_walca> 
; Turn the OD
M3 M#<Coolant> ; spindle cw, coolant on/off

#<walec> = 0
#<promien_walca> = [#<promien_walca>-#<promien_na_plasko>] 
g18 (g7) 
M3 S1000

g0 z[#<przesuniecie_z>+1] x[[#<promien>]+1] 

o100 while [#<walec> lt [#<promien_walca>]] 

#<walec>=[[#<walec>]+[#<przybranie>]] 
x[[#<promien_walca>]-[#<walec>]+[[#<promien_na_plasko>]]] 
z[#<przesuniecie_z>] 

g3 x[[#<promien>]] z-[[#<walec>]-[#<przesuniecie_z>]] r[#<promien_kulki>]  f[#<predkosc>] 

g0
x [[#<promien>]+1] 
z[#<przesuniecie_z>+1] 

o100 endwhile ( koniec toczenia ) 


o<polkula> endsub
Obrazek

Obrazek


Odpaliłem sobie tego Macha3 - chodzi pod Wine bez żadnego problemu, pewnie i maszynę w takiej konfiguracji by obsłużył. Wrażenie - choinka :) Poczytałem ten dział - większość wpisów to "ratunku, Mach mi robi co sam chce"...

Na razie nie doszedłem, czy da się tam pracować na symulacji.

Makra do Macha to pomyłka totalna - ot przykładowy kodzik:

Kod: Zaznacz cały

'sub Main() 
Option Explicit
dim units, toolPath, toolDirection,toolEntryMode
dim xyFeedRate,zFeedRate,toolDiameter,maxDepthPerPass,TotalDepthOfCut
dim finishCutDepth, finishCutWidth,zRapidClearanceHeight, zInitialStartHeight
dim spindleSpeed, slotOrientation, coolant
dim xStart,slotLength,yStart,slotWidth
dim roughSlotLength,roughSlotWidth, radius
dim beginX, beginY
dim nextX, nextY
dim i, numberOfPasses,calculatedToolDiameter,entry
dim pi,slotAngle
dim finishSlotLength,finishSlotWidth
dim startAngle,endAngle, arcCenterPointX,arcCenterPointY, arcRadius
dim arcStartX,arcStartY,arcEndX,arcEndY,centerPointY,centerPointX
dim arcStartX1,arcStartY1,arcEndX1,arcEndY1
dim arcStartX2,arcStartY2,arcEndX2,arcEndY2
dim arcStartX3,arcStartY3,arcEndX3,arcEndY3
dim arcCalcRadius
dim roughArcArray(5) 
dim outterArcStart,outterArcEnd,innerArcStart,innerArcEnd
dim outterArc, innerArc, centerArcG3, centerArcG2, outterArcG3, innerArcG2
dim inputStatus,maxDepthPerPassDRO,finishStop
dim finishFlag
dim IJState
 



 pi = 3.1415926535897932384626433832795
 finishFlag = 0

'setTicker 1, GetUserLed (1200) 
'------------------------------
' Get unit selection
'
if getUserLed (1200)  = 1 then
units = "G20" 
else
units = "G21" 
end if

'-------------------------------
' Get tool entry mode selection
'
if getUserLed (1206)  = 1 then
toolEntryMode = "plunge" 
else
toolEntryMode = "ramp" 
end if

'debug
'setUserLabel 1, "ToolEntryMode " & toolEntryMode

'-------------------------------
' Get slot orientation selection
'
if getUserLed (1208)  = 1 then
slotOrientation = "straight" 
else
slotOrientation = "arc" 
end if

'debug
'setUserLabel 1, "slotOrientation " & slotOrientation

'-------------------------------
' Get collant selection
'
if getUserLed (1210)  = 1 then
coolant = "M7" 
else
coolant = "M9" 
end if

'-------------------------------
' Get M1 selection
'
if getUserLed (1215)  = 1 then
finishStop = "on" 
else
finishStop = "off" 
end if

'check IJ Mode - set it to IJ and restore it upon exit
'IJState = GetParam ("IJMode") 
'Call SetParam("IJMode", 1) 
'IJState = GetIJMode() 
'Call SetIJMode(1)'force to incremental
IJState = GetOEMLED (73) 'incremental = 1, ABS = 0


'-------------------------------
' Get dro values
'
xyFeedRate = getOEMDRO (1100) 
zFeedRate = getOEMDRO (1101) 
toolDiameter = getOEMDRO (1102) 
maxDepthPerPass = getOEMDRO (1103) 
maxDepthPerPassDRO = getOEMDRO (1103) 
TotalDepthOfCut = getOEMDRO (1104) 
finishCutDepth = getOEMDRO (1105) 
finishCutWidth = getOEMDRO (1107) 
zRapidClearanceHeight = getOEMDRO (1108) 
zInitialStartHeight = getOEMDRO (1109) 
xStart = getOEMDRO (1110) 
slotLength = getOEMDRO (1111) 
yStart = getOEMDRO (1112) 
slotWidth = getOEMDRO (1113) 
spindleSpeed = getOEMDRO (1114) 
slotAngle = (pi/180) * getOEMDRO (1115) 



startAngle = (pi/180) * getOEMDRO (1116) 
endAngle = (pi/180) * getOEMDRO (1117) 
arcCenterPointX = getOEMDRO (1118) 
arcCenterPointY = getOEMDRO (1119) 
arcRadius = getOEMDRO (1120) 


beginX = xStart
beginY = yStart

nextX =  beginX + (slotLength-slotWidth)*(cos (slotAngle)) 
nextY =  beginY + (slotLength-slotWidth)*(sin (slotAngle)) 


roughSlotLength = slotLength
roughslotWidth = (slotWidth - (2*finishCutWidth)) - (toolDiameter) 
finishSlotLength = slotLength
finishSlotWidth = slotWidth - toolDiameter

'====================================================
'calculate number of passes required
'adjust max depth per pass to match
'
numberOfPasses = (TotalDepthOfCut-finishCutDepth)/maxDepthPerPass
if numberOfPasses - int(numberOfPasses) <> 0 then
numberOfPasses = Int(numberOfPasses)+1
maxDepthPerPass = (TotalDepthOfCut-finishCutDepth)/numberOfPasses
end if

calculatedToolDiameter = (toolDiameter/2)+(2*finishCutWidth) 
radius = roughslotWidth/2
entry = radius * .9

OpenTeachFile "slot.tap" 


if slotOrientation = "arc" then
    setUserLabel 2, nFmt(((endAngle-startAngle)*arcRadius)+slotWidth,4) 
   
    setUserLabel 1, nFmt((sin((endAngle-startAngle)/2))*arcRadius*2,4) 
   
else
    setUserLabel 2, "---" 
    setUserLabel 1, "---" 
end if


if slotOrientation = "arc" then
    code units
    code "G17 G40 G80" 
    code "G00 Z"& zRapidClearanceHeight
    code "G90 G54" 
    code "S" & spindleSpeed & " M03" 
    code "(insure IJ mode is incremental)" 
    code "G91.1" 
    code "G00 Z" & zRapidClearanceHeight
   
    call arcSlot(numberOfPasses,maxDepthPerPass,radius,roughSlotWidth) 

else
    code units
    code "G17 G40 G80" 
    code "G00 Z"& zRapidClearanceHeight
    code "G90 G54" 
    code "S" & spindleSpeed & " M03" 
    code "(insure IJ mode is incremental)" 
    code "G91.1" 
    code "G00 Z" & zRapidClearanceHeight
    code "G00 X" & beginX & " Y" & beginY
    code coolant
    code "G00 Z" & zInitialStartHeight
    code "G01 Z0 F" & zFeedRate
    call straightSlot(numberOfPasses,maxDepthPerPass,calculatedToolDiameter,entry,radius,roughSlotLength,roughSlotWidth) 
end if

'====================================================
'finish pass
'
if finishCutDepth >0 or finishCutWidth >0 then
    finishFlag = 1
    if slotOrientation = "arc" then
        numberOfPasses = 1
        maxDepthPerPass = TotalDepthOfCut
        radius = finishSlotWidth/2
        if finishStop = "on" then
            if coolant = "M7" then
                code "M9" 
                end if
            code "G01 Z" & zRapidClearanceHeight
            code "(M1 stop)" 
            code "M1" 
        end if       
        code "(finish cut)" 
        code coolant
        code "G00 Z"& ((TotalDepthOfCut-finishCutDepth)*-1) 
        call arcSlot(numberOfPasses,maxDepthPerPass,radius,finishSlotWidth) 
    else
        numberOfPasses = 1
        maxDepthPerPass = TotalDepthOfCut
        calculatedToolDiameter = toolDiameter/2
        radius = finishSlotWidth/2
        if finishStop = "on" then
            if coolant = "M7" then
                code "M9" 
                end if
            code "G01 Z" & zRapidClearanceHeight
            code "(M1 stop)" 
            code "M1" 
        end if
        entry = radius * .9
        code "(finish cut)" 
        code coolant
        code "G00 Z"& ((TotalDepthOfCut-finishCutDepth)*-1) 
        call straightSlot(numberOfPasses,maxDepthPerPass,calculatedToolDiameter,entry,radius,finishSlotLength,finishSlotWidth) 
    end if
end if


'---
'program end
'
code "G00 Z" & zRapidClearanceHeight
if coolant = "M7" then
    code "M9" 
end if
if IJState = 0  then
code "(return IJ mode to absolute)" 
code "G90.1" 
end if
code "M30" 
closeTeachFile
call loadTeachFile

'==============================================================
'
'end sub 'main
'main


'******************* ARCSLOT  *****************
'
sub arcSlot(passCount,depthPerPass,calcRadius,arcSlotWidth) 

arcStartX1 =  (arcCenterPointX + arcRadius) *(cos(startAngle)) 
arcStartX1 = nFmt(arcStartX1,4) 
arcStartY1 =  (arcCenterPointY + arcRadius) *(sin(startAngle)) 
arcStartY1 = nFmt(arcStartY1,4) 
arcEndX1 =  arcRadius*(cos (endAngle)) 
arcEndX1 = nFmt(arcEndX1,4) 
arcEndY1 =  arcRadius*(sin (endAngle)) 
arcEndY1 = nFmt(arcEndY1,4) 

centerPointX= arcCenterPointX - (arcCenterPointX + arcStartX1) 
centerPointY = arcCenterPointY - (arcCenterPointY + arcStartY1) 
centerArcG3 = "G03 X" & nFmt(arcEndX1,4) & " Y" & nFmt(arcEndY1,4) & " I" & nFmt(centerPointX,4)  & " J" & nFmt(centerPointY,4) & " F" & xyFeedRate

centerPointX= arcCenterPointX - (arcCenterPointX + arcEndX1) 
centerPointY = arcCenterPointY - (arcCenterPointY + arcEndY1) 
centerArcG2 = "G02 X" & nFmt(arcStartX1,4) & " Y" & nFmt(arcStartY1,4) & " I" & nFmt(centerPointX,4)  & " J" & nFmt(centerPointY,4) & " F" & xyFeedRate

'******************* define slot outter contour *****************
'

arcStartX2 =  (arcRadius + arcSlotWidth/2 + arcCenterPointX ) *(Cos (startAngle)) 
arcStartY2 =  (arcRadius + arcSlotWidth/2 + arcCenterPointY) *(sin (startAngle)) 
arcEndX2 =  (arcRadius + arcSlotWidth/2)*(Cos (endAngle)) 
arcEndY2 =  (arcRadius + arcSlotWidth/2)*(sin (endAngle)) 

centerPointX= arcCenterPointX - (arcCenterPointX + arcStartX2) 
centerPointY = arcCenterPointY - (arcCenterPointY + arcStartY2) 

outterArcG3 = "G03 X" & nFmt(arcEndX2,4) & " Y" & nFmt(arcEndY2,4) & " I" & nFmt(centerPointX,4)  & " J" & nFmt(centerPointY,4) & " F" & xyFeedRate
outterArcStart = "X" & nFmt(arcStartX2,4) & " Y" & nFmt(arcStartY2,4) 
outterArcEnd = "X" & nFmt(arcEndX2,4) & " Y" & nFmt(arcEndY2,4) 

'******************* define slot inner contour *****************
'

arcStartX3 =  (arcRadius - arcSlotWidth/2 + arcCenterPointX ) *(Cos (startAngle)) 
arcStartY3 =  (arcRadius - arcSlotWidth/2 + arcCenterPointY) *(sin (startAngle)) 
arcEndX3 =  (arcRadius - arcSlotWidth/2)*(Cos (endAngle)) 
arcEndY3 =  (arcRadius - arcSlotWidth/2)*(sin (endAngle)) 

centerPointX= arcCenterPointX - (arcCenterPointX + arcEndX3) 
centerPointY = arcCenterPointY - (arcCenterPointY + arcEndY3) 

innerArcG2 = "G02 X" & nFmt(arcStartX3,4) & " Y" & nFmt(arcStartY3,4) & " I" & nFmt(centerPointX,4)  & " J" & nFmt(centerPointY,4) & " F" & xyFeedRate
'flipped end start for G2
innerArcEnd = "X" & nFmt(arcStartX3,4) & " Y" & nFmt(arcStartY3,4) 
innerArcStart = "X" & nFmt(arcEndX3,4) & " Y" & nFmt(arcEndY3,4) 

'******************* set up *****************
'


'numberOfPasses = (totalDepthOfCut-finishCutDepth)/maxDepthPerPass
'if numberOfPasses - int(numberOfPasses) <> 0 then
'numberOfPasses = int(numberOfPasses)+1
'maxDepthPerPass = (totalDepthOfCut-finishCutDepth)/numberOfPasses
'end if

'******************* Start code *****************
'

inputStatus = verifyInput() 
if inputStatus = "failed" then
exit sub
end if

if finishFlag = 0 then
code "G00 X" & nFmt(arcStartX1,4) & " Y" & nFmt(arcStartY1,4) 
code coolant
code "G00 Z" & zInitialStartHeight
code "G01 Z0 F" & zFeedRate
code "(zig-zag - center cut)" 
end if

if toolEntryMode = "ramp" then
    for i = 1 to passCount
        code centerArcG3 &" Z" & nFmt(((depthPerPass*-1)*i),4) 
        code centerArcG2
    next
        code "(clean up last slope)" 
        code centerArcG3
        code centerArcG2

else

    code "(plunge - center cut)" 
    for i = 1 to passCount
        code "G01 Z" & nFmt(((depthPerPass*-1)*i),4) & " F" & zFeedRate
        'if odd
        '
        if i mod 2 >0 then
            code centerArcG3
        else
            code centerArcG2
        end if
       
    next
    ' position to correct end
    if i mod 2 >0 then
    else
        code centerArcG2
    end if
end if

code "G00 Z0" 
code "(lead in)" 
code "G03 " & outterArcStart & "R"&calcRadius/2

if toolEntryMode = "ramp" then
    for i = 1 to passCount
        code "(outter arc)" 
        code "G01 X" & nFmt(arcStartX2,4) & " Y" & nFmt(arcStartY2,4) 
        code outterArcG3 &" Z" & nFmt(((depthPerPass*-1)*i),4) 
        code "G03 " & innerArcStart & "R"&calcRadius
        code "(inner arc)" 
        code innerArcG2
        code "G03 " & outterArcStart & "R"&calcRadius
    next
    code "(smooth last ramp)" 
    code "G01 X" & nFmt(arcStartX2,4) & " Y" & nFmt(arcStartY2,4) 
    code outterArcG3
    code "G03 " & innerArcStart & "R"&calcRadius
    code "(inner arc)" 
    code innerArcG2
    code "G03 " & outterArcStart & "R"&calcRadius
else
    for i = 1 to passCount
    code "G01 Z" & nFmt(((depthPerPass*-1)*i),4) 
    code "(outter arc)" 
    code "G01 X" & nFmt(arcStartX2,4) & " Y" & nFmt(arcStartY2,4) 
    code outterArcG3
    code "G03 " & innerArcStart & "R"&calcRadius
    code "(inner arc)" 
    code innerArcG2
    code "G03 " & outterArcStart & "R"&calcRadius
    next
end if

code "(lead out)" 
code "G03 X" & nFmt(arcStartX1,4) & " Y" & nFmt(arcStartY1,4) & "R"&calcRadius/2

end sub

'==============================================================
'

sub straightSlot(passCount,depthPerPass,calcToolDiameter,leadInLength,calcRadius,codeSlotLength,codeSlotWidth) 

inputStatus = verifyInput() 
if inputStatus = "failed" then
exit sub
end if


if toolEntryMode = "ramp" then
    code "(ramp - center cut)" 
    for i = 1 to passCount
        code "G01 X" & nFmt(beginX,4) & " Y" & Roun(beginY) & " F" & xyFeedRate
        code "G01 X" & nFmt(nextX,4) & " Y" & nFmt(nextY,4) & " F" & xyFeedRate &" Z" & nFmt(((depthPerPass*-1)*i),4) 
    next
    code "G01 X" & nFmt(beginX,4) & " Y" & nFmt(beginY ,4) & " F" & xyFeedRate   
else
    code "(plunge - center cut)" 
    for i = 1 to passCount
        code "G01 Z" & nFmt(((depthPerPass*-1)*i)) & " F" & zFeedRate
        'if odd
        '
        if i mod 2 >0 then
        code "G01 X" & nFmt(nextX,4) & " Y" & nFmt(nextY,4  )  & " F" & xyFeedRate
        else
        code "G01 X" & nFmt(beginX,4) & " Y" & nFmt(beginY,4)  & " F" & xyFeedRate
        end if
    Next
    ' position to correct end
    if i mod 2 >0 then
    else
        code "G01 X" & nFmt(beginX,4) & " Y" & nFmt(beginY,4)  & " F" & xyFeedRate
    end if
end if

code "G00 Z0" 


code "(lead in)" 
code "G01 X" & nFmt(nextX + (leadInLength*cos(slotAngle))-(calcRadius*.05*sin(slotAngle)),4) & " Y" & nFmt(nextY+(leadInLength*sin(slotAngle))+(calcRadius*.05*cos(slotAngle)),4) & " F" & xyFeedRate
code "G03 X"& nFmt(nextX -calcRadius*sin(slotAngle),4)& " Y" & nFmt(nextY + calcRadius*cos(slotAngle),4) & " R"& nFmt(calcRadius-(calcRadius*.05) ,4)& " F" & xyFeedRate

if toolEntryMode = "ramp" then

code "(ramp)" 
for i = 1 to passCount
    code "G01 X" & nFmt(beginX -calcRadius*sin(slotAngle),4)& " Y" & nFmt(beginY + calcRadius*cos(slotAngle),4)&" Z" & nFmt(((depthPerPass*-1)*i),4) & " F" & xyFeedRate
    code "G03 X" & nFmt(beginX +calcRadius*sin(slotAngle),4) &" Y" & nFmt(beginY - calcRadius*cos(slotAngle),4) & " R"& calcRadius
    code "G01 X" & nFmt(nextX +calcRadius*sin(slotAngle),4)  &" Y" & nFmt(nextY - calcRadius*cos(slotAngle),4) 
    code "G03 X" & nFmt(nextX -calcRadius*sin(slotAngle),4)& " Y" & nFmt(nextY + calcRadius*cos(slotAngle),4)& " R"& calcRadius
next
'----
'clean last sloped path so bottom is smooth and flat
    code "(smooth last ramp)" 
    code "G01 X" & nFmt(beginX -calcRadius*sin(slotAngle),4)& " Y" & nFmt(beginY + calcRadius*cos(slotAngle),4)& " F" & xyFeedRate
    code "G03 X" & nFmt(beginX +calcRadius*sin(slotAngle),4) &" Y" & nFmt(beginY - calcRadius*cos(slotAngle),4) & " R"& calcRadius
    code "G01 X" & nFmt(nextX +calcRadius*sin(slotAngle),4)  &" Y" & nFmt(nextY - calcRadius*cos(slotAngle),4) 
    code "G03 X" & nFmt(nextX -calcRadius*sin(slotAngle),4) & " Y" & nFmt(nextY + calcRadius*cos(slotAngle),4)& " R"& calcRadius

else
code "(plunge)" 
for i = 1 to passCount
   
    code "G01 Z" & nFmt(((depthPerPass*-1)*i),4) & " F" & zFeedRate
    code "G01 X" & nFmt(beginX -calcRadius*sin(slotAngle),4)& " Y" & nFmt(beginY + calcRadius*cos(slotAngle),4)&" F" & xyFeedRate
    code "G03 X" & nFmt(beginX +calcRadius*sin(slotAngle),4) &" Y" & nFmt(beginY - calcRadius*cos(slotAngle),4) & " R"& calcRadius
    code "G01 X" & nFmt(nextX +calcRadius*sin(slotAngle),4)  &" Y" & nFmt(nextY - calcRadius*cos(slotAngle),4) 
    code "G03 X" & nFmt(nextX -calcRadius*sin(slotAngle),4)& " Y" & nFmt(nextY + calcRadius*cos(slotAngle),4)& " R"& calcRadius
next
end if

'---
'exit path
'
code "(lead out)" 
code "G03 X"& nFmt(nextX- calcRadius*Cos(slotAngle),4) & " Y"& nFmt(nextY-calcRadius*Sin(slotAngle),4) & " R" & calcRadius-(calcRadius*.05) 

end sub
'==============================================================
'

function verifyInput() 
'-------------------------------
' Verfify input values
'

setTicker 1, "" 

'setUserLabel 1, abs(slotLength)-(finishCutWidth*2) 
if SlotLength <= toolDiameter then
Call errors("Tool Diameter is larger than slot length") 
verifyInput = "failed" 
exit function
end if

if toolDiameter >= slotWidth-(finishCutWidth*2)then
Call errors("Tool Diameter is too large for slot and finish pass ") 
verifyInput = "failed" 
exit function
end if

if (toolDiameter*3)< slotWidth+(finishCutWidth*2) then
Call errors("Tool Diameter is too small to cut slot in 3 passes") 
verifyInput = "failed" 
exit function
end if

if zRapidClearanceHeight <= 0  then
Call errors("Z rapid clearance height must be greater than 0") 
verifyInput = "failed" 
exit function
end if

if TotalDepthOfCut <= 0  then
Call errors("Depth of cut is entered as a positive value and must be greater than 0") 
verifyInput = "failed" 
exit function
end if

if zRapidClearanceHeight < 0  then
Call errors("Z initial move safe height is entered as a positive value and must be 0 or greater") 
verifyInput = "failed" 
exit function
end if

if zInitialStartHeight < 0  then
Call errors("Z initial start height is entered as a positive value and must be 0 or greater") 
verifyInput = "failed" 
exit function
end if


if slotWidth > slotLength/2 then
Call errors("Slot length must be twice as long as slot width") 
verifyInput = "failed" 
exit function
end if

if finishCutWidth > toolDiameter*.1 then
Call errors("Finsh cut with must <= 10% of tool diameter") 
verifyInput = "failed" 
exit function
end if

if finishCutDepth > maxDepthPerPassDRO then
Call errors("Finsh cut depth must <= maxium depth per pass") 
verifyInput = "failed" 
exit function
end if

verifyInput = "passed" 
end function
Toto generuje wcięcie na klin w wałku - w NGCGUI byłoby max 30 linijek prostego kodu...
autor: MlKl
07 lut 2012, 21:03
Forum: Mach 2 / 3 / 4 (ArtSoft software)
Temat: mach 3 błąd
Odpowiedzi: 32
Odsłony: 7639

Mach to oprogramowanie z zamkniętym kodem, nie pracuje w czasie rzeczywistym, makra do niego trzeba pisać w VB - a to wcale ani proste, ani przyjemne nie jest - swego czasu trochę się tym bawiłem.

No i koszt maszyny od razu wzrasta o cenę programu i licencji na shita. Pod linuxem se mogę odpalić w trakcie pracy maszyny CNC film, albo i trzy w osobnych oknach - i jak maszynie zasobów zbraknie, to się będą cięły filmy, a nie silniki maszyny.

Dostosować se mogę program jak mi się tylko zamarzy - mam cały kod, pliki źródłowe. I nikt mi nie zarzuci, że piracę...

NGCGUI to system pisania makr wprost w G-code - intuicyjny, bardzo prosty w obsłudze. Program sam wciąga takie makro i wyświetla je jako część swojego interfejsu, tworząc automatycznie formatkę z polami do wpisania wszystkich zadeklarowanych w makrze zmiennych.
autor: MlKl
07 lut 2012, 10:47
Forum: Mach 2 / 3 / 4 (ArtSoft software)
Temat: mach 3 błąd
Odpowiedzi: 32
Odsłony: 7639

wieslawbarek pisze:No ja też z tym shitem tylko z konieczności :mrgreen: a Emc tez sie do tego shita zalicza :mrgreen:

[ Dodano: 2012-02-06, 21:22 ]
Kamar to mozna okreslic w parametrach i nie trzeba zadnych G Code
Shit to wszystkie wersje Window$ - a LinuxCNC z systemopodobnym produktem Billa G. nie współpracuje :)

I choć może nie imponuje rozbudowanym interfejsem, to zostawia Macha daleko w tyle, jeśli idzie o funkcjonalność.
autor: MlKl
06 lut 2012, 21:17
Forum: Mach 2 / 3 / 4 (ArtSoft software)
Temat: mach 3 błąd
Odpowiedzi: 32
Odsłony: 7639

Ja się shita ogólnie staram nie tykać, więc i Macha nie znam. Ale norma ISO przewiduje G-cody na tę okazję, i powinny być również w Machu zaimplementowane...
autor: MlKl
06 lut 2012, 17:55
Forum: Mach 2 / 3 / 4 (ArtSoft software)
Temat: mach 3 błąd
Odpowiedzi: 32
Odsłony: 7639

Poczytajcie sobie ten wątek , powinno to sprawę rozjaśnić.

Wróć do „mach 3 błąd”