mach 3 błąd

Dyskusje dotyczące najpopularniejszego programu sterującego maszynami CNC

kamar
Lider FORUM (min. 2000)
Lider FORUM (min. 2000)
Posty w temacie: 11
Posty: 16283
Rejestracja: 18 wrz 2010, 06:17
Lokalizacja: Kozienice
Kontakt:

#21

Post napisał: kamar » 07 lut 2012, 21:07

wieslawbarek pisze:co to jest to NGCGUI ?
Przejrzyj Parę ostatnich tematów na linuxe.
np. https://www.cnc.info.pl/topics54/linuxc ... 747,80.htm



Tagi:


wieslawbarek
Specjalista poziom 3 (min. 600)
Specjalista poziom 3 (min. 600)
Posty w temacie: 8
Posty: 851
Rejestracja: 05 gru 2006, 22:28
Lokalizacja: Bielsko Biała

#22

Post napisał: wieslawbarek » 08 lut 2012, 20:30

Kamar litości czego ty odemnie chcesz se myślalem przejżę parę postów i sie dowiem w czym rzecz a tu masz widzę że goście lubia pisać .Temat o tokarce doczytałem tylko do tego ze jeden jest odporny na wiedzę a drugi buc :mrgreen: czy to ma cos wspólnego z NGCGUI sie zastanawiam ? chyba też jestem odporny na wiedzę :wink: A poza tym nie jestem uzalezniony od internetu i komputera (wolę inne nałogi :mrgreen: ) i myślę też że to nie ja twierdzę że Mach jest lepszy od EMC tylko na odwrot i dlatego wy powinniście mi to udowodnić a mnie jest szkoda czasu by samemu sobie samemu udowadniać że tak jest.


kamar
Lider FORUM (min. 2000)
Lider FORUM (min. 2000)
Posty w temacie: 11
Posty: 16283
Rejestracja: 18 wrz 2010, 06:17
Lokalizacja: Kozienice
Kontakt:

#23

Post napisał: kamar » 08 lut 2012, 20:37

To nie czytaj głupotek i przekomarzanek a patrz na zrzuty ekranów. Jako stary fachman nie możesz nie docenić możliwości wybrania podstawowych procedur z zakładek i wykonania po podaniu parametrów.
Obrazek

Obrazek
Że o składaniu tych operacji w jedną nie wspomnę. :)

Awatar użytkownika

MlKl
Lider FORUM (min. 2000)
Lider FORUM (min. 2000)
Posty w temacie: 8
Posty: 3705
Rejestracja: 15 sie 2010, 13:44
Lokalizacja: Błonie
Kontakt:

#24

Post napisał: MlKl » 08 lut 2012, 21:36

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...


wieslawbarek
Specjalista poziom 3 (min. 600)
Specjalista poziom 3 (min. 600)
Posty w temacie: 8
Posty: 851
Rejestracja: 05 gru 2006, 22:28
Lokalizacja: Bielsko Biała

#25

Post napisał: wieslawbarek » 09 lut 2012, 20:46

No kurcze :shock: no ja na szczeście nie znam VB Script :mrgreen: i program na takie cuś jak pokazał Kamar piszę w kilka minut no dołozyłem trochę żeby nie było że w Mach się nie da ,troche zmiennych brakuje np.F dla Z albo X ale sie mi nie chciało no i zostawiłem z jakiego Macro wziałem współrzedne otworów

[ Dodano: 2012-02-09, 20:50 ]
O kurcze co to sie wkleiło :?:

[ Dodano: 2012-02-09, 20:53 ]
No może teraz

[ Dodano: 2012-02-09, 20:54 ]
Nie wiem dlaczego wkleja mi w takim formacie ktos to wie :?:

[ Dodano: 2012-02-09, 20:57 ]
No to może tak




#100=20(średnica pierwszego otworu)
#101= 5(Srednica freza)


G0 G49 G40.1 G17
G80 G50 G90 G98
G21 (mm)
(***** Circular Hole Pattern *****)
M6 T3
M03 S1000
M9
G00
X25 Y0 Z-0.3 m98p1l1

X12.5 Y21.6506 m98p1l1

X-12.5 Y21.6506 m98p1l1

X-25 Y0 m98p1l1

X-12.5 Y-21.6506 m98p1l1

X12.5 Y-21.6506 m98p1l1


M30


o1
g90
g0z0
m98p2l5
m98p3l3

g0z5m99


o2
g91
g1z-5
g90
g13i[#100/2-#101/2]r[#100/2-#101/2]


m99

o3
g91

g1z-5
g90
g13i2r2


m99
Załączniki
Otwory.txt
(556 Bajtów) Pobrany 210 razy
Otwory.txt
(556 Bajtów) Pobrany 234 razy


kamar
Lider FORUM (min. 2000)
Lider FORUM (min. 2000)
Posty w temacie: 11
Posty: 16283
Rejestracja: 18 wrz 2010, 06:17
Lokalizacja: Kozienice
Kontakt:

#26

Post napisał: kamar » 09 lut 2012, 21:08

Ja wiem ,że jesteś biegły w pisaniu kodów i taki tez piszesz w minuty.
I pracowników też masz takich biegłych ? :)

Obrazek

Obrazek
I co być nie mówił to jednak nie to samo :)
Ostatnio zmieniony 09 lut 2012, 21:18 przez kamar, łącznie zmieniany 1 raz.

Awatar użytkownika

MlKl
Lider FORUM (min. 2000)
Lider FORUM (min. 2000)
Posty w temacie: 8
Posty: 3705
Rejestracja: 15 sie 2010, 13:44
Lokalizacja: Błonie
Kontakt:

#27

Post napisał: MlKl » 09 lut 2012, 21:13

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.


kamar
Lider FORUM (min. 2000)
Lider FORUM (min. 2000)
Posty w temacie: 11
Posty: 16283
Rejestracja: 18 wrz 2010, 06:17
Lokalizacja: Kozienice
Kontakt:

#28

Post napisał: kamar » 09 lut 2012, 21:49

MlKl pisze: Toto generuje wcięcie na klin w wałku - w NGCGUI byłoby max 30 linijek prostego kodu...
Kanałek prosty czy kryty ? :)
Obrazek

Obrazek

Awatar użytkownika

MlKl
Lider FORUM (min. 2000)
Lider FORUM (min. 2000)
Posty w temacie: 8
Posty: 3705
Rejestracja: 15 sie 2010, 13:44
Lokalizacja: Błonie
Kontakt:

#29

Post napisał: MlKl » 10 lut 2012, 01:51

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.


kamar
Lider FORUM (min. 2000)
Lider FORUM (min. 2000)
Posty w temacie: 11
Posty: 16283
Rejestracja: 18 wrz 2010, 06:17
Lokalizacja: Kozienice
Kontakt:

#30

Post napisał: kamar » 10 lut 2012, 04:36

MlKl pisze:Nie ma znaczenia, jaki kanałek
Nie czujesz podtekstu. My, starzy partyzanci z kielecczyzny, jak robimy dywersję na terenie wroga, to opłotkami, opłotkami :)

ODPOWIEDZ Poprzedni tematNastępny temat

Wróć do „Mach 2 / 3 / 4 (ArtSoft software)”