postprocesor Mach dla SheetCam-a, Detekcja pływającą głowicą

Dyskusje dotyczące SheetCam
Awatar użytkownika

Autor tematu
karpik74
Specjalista poziom 2 (min. 300)
Specjalista poziom 2 (min. 300)
Posty w temacie: 10
Posty: 394
Rejestracja: 27 cze 2015, 16:36
Lokalizacja: kłodzko

postprocesor Mach dla SheetCam-a, Detekcja pływającą głowicą

#1

Post napisał: karpik74 » 09 wrz 2015, 17:04

To jest postprocesor Mach dla SheetCama-a.
Realizacja detekcji pływającą głowicą (palnikiem) z czujnikiem na probe, z makrem dla Mach-a- M300 (G31 z korektą czujnika G92 Z-?). Do pobrania w oddzielnym temacie.

Plik wkleić do C:\Program Files\SheetCam TNG\Posts

...ewentualnie- skopiować poniższe, edytować dowolny post w SheetCamie- zamienić tym, zapisać.

function OnAbout(event)
ctrl = event:GetTextCtrl()
ctrl:AppendText("plasma THC300 post processor\n")
ctrl:AppendText("\n")
ctrl:AppendText("Modal G-codes and coordinates\n")
ctrl:AppendText("Comments enclosed with ( and )\n")
ctrl:AppendText("M03/M05 turn the torch on/off\n")
ctrl:AppendText("Incremental IJ\n")
ctrl:AppendText("The torch is referenced at cut start and every 500mm of movement thereafter\n")
ctrl:AppendText("Designed for use with Mach2 and Campbell Designs THC300\n")
ctrl:AppendText("Post variables:\n")
ctrl:AppendText("refdistance - set the distance between each reference\n")
end



-- revision 3/2/07
-- Removed final safety move. This is now done in SheetCam

-- revision 7/10/05
-- Added new arc handling

-- created 27/10/04
-- Based on plasma1.post



function OnInit()

post.SetCommentChars ("()", "[]") --make sure ( and ) characters do not appear in system text
post.Text (" (Filename: ", fileName, ")\n")
post.Text (" (Post processor: ", postName, ")\n")
post.Text (" (Date: ", date, ")\n")
if(scale == metric) then
post.Text (" G21 (Units: Metric)\n") --metric mode
else
post.Text (" G20 (Units: Inches)\n") --inch mode
end
post.Text (" G53 G90 G40\n F1\n S500\n")

dist = 9999999
refdistance = 500 * scale
switchoffset = -0.08
bigarcs = 1 --stitch arc segments together
minArcSize = 0.05 --arcs smaller than this are converted to moves
end

function OnNewLine()
post.Text ("N")
post.Number (lineNumber, "0000")
lineNumber = lineNumber + 10
end


function OnFinish()
post.Text (" M05 M30\n")
end

function OnRapid()
if(math.hypot(endX-currentX , endY-currentY) < 0.001 and endZ < currentZ) then return end
dist = dist + math.hypot(endX-currentX , endY-currentY)
post.ModalText (" G00")
post.ModalNumber (" X", endX * scale, "0.0000")
post.ModalNumber (" Y", endY * scale, "0.0000")
post.ModalNumber (" Z", endZ * scale, "0.0000")
post.Eol()
end

function OnMove()
dist = dist + math.hypot(endX-currentX , endY-currentY)
post.ModalText (" G01")
post.ModalNumber (" X", endX * scale, "0.0000")
post.ModalNumber (" Y", endY * scale, "0.0000")
post.ModalNumber (" Z", endZ * scale, "0.0000")
post.ModalNumber (" F", feedRate * scale, "0.###")
post.Eol()
end

function OnArc()
dist = dist + math.hypot(endX-currentX , endY-currentY)
if(arcAngle <0) then
post.ModalText (" G03")
else
post.ModalText (" G02")
end
post.NonModalNumber (" X", endX * scale, "0.0000")
post.NonModalNumber (" Y", endY * scale, "0.0000")
post.ModalNumber (" Z", endZ * scale, "0.0000")
post.Text (" I")
post.Number ((arcCentreX - currentX) * scale, "0.0000")
post.Text (" J")
post.Number ((arcCentreY - currentY) * scale, "0.0000")
post.ModalNumber (" F", feedRate * scale, "0.0###")
post.Eol()
end


function OnPenDown()

--[[ post.ModalText (" G00")
post.ModalNumber (" X", endX * scale, "0.0000")
post.ModalNumber (" Y", endY * scale, "0.0000")
post.Eol()]]
if (preheat > 0) then
post.ModalText (" G00")
post.ModalNumber (" Z", cutHeight * scale, "0.0000")
post.Eol()
post.Text(" M801\n G04 P 0.5\n M802\n G04 P0.1\n M902")
post.Text ("\n G04 P")
post.Number (preheat,"0.###")
post.Eol()
end
post.ModalText (" M300\n G00")
post.ModalNumber (" Z", pierceHeight * scale, "0.0000")
post.Text ("\n M03\n")
if (pierceDelay > 0) then
post.Text (" G04 P")
post.Number (pierceDelay,"0.###")
post.Eol()
end
end


function OnPenUp()
post.Text (" M05\n")

end


function OnNewOperation()
post.Text (" (Process: ", operationName, ")\n")
if (plungeRate <= 0) then
post.Warning("WARNING: Plunge rate is zero")
end
if (feedRate <= 0) then
post.Warning("WARNING: Feed rate is zero")
end
end

function OnComment()
post.Text(" (",commentText,")\n")
end

function OnToolChange()
post.Text (" M06 T")
post.Number (tool, "0")
post.Text (" (", toolName, ")\n")
end

function OnNewPart()
post.Text(" (Part: ",partName,")\n");
end

function OnDrill()
OnRapid()
OnPenDown()
endZ = drillZ
OnMove()
OnPenUp()
endZ = safeZ
OnRapid()
end


Dajcie znać czy działa u was poprawnie :wink:
Załączniki
steelbox.rar
(1.42 KiB) Pobrany 502 razy



Tagi:


RobiszToŹle
Specjalista poziom 1 (min. 100)
Specjalista poziom 1 (min. 100)
Posty w temacie: 1
Posty: 287
Rejestracja: 12 lip 2013, 15:53
Lokalizacja: wziąć na cnc?

#2

Post napisał: RobiszToŹle » 09 wrz 2015, 20:15

karpik74, a schetcam'em też się podzielisz? (pełną wersją) :wink:

Awatar użytkownika

Autor tematu
karpik74
Specjalista poziom 2 (min. 300)
Specjalista poziom 2 (min. 300)
Posty w temacie: 10
Posty: 394
Rejestracja: 27 cze 2015, 16:36
Lokalizacja: kłodzko

#3

Post napisał: karpik74 » 09 wrz 2015, 21:13

Przykro mi ...gdybym miał :?: :sad: ...ściągnąłem demo na potrzeby przeróbki postprocesora.


snajperman-s1
Specjalista poziom 2 (min. 300)
Specjalista poziom 2 (min. 300)
Posty w temacie: 3
Posty: 340
Rejestracja: 22 kwie 2010, 10:34
Lokalizacja: Nowy Sącz

#4

Post napisał: snajperman-s1 » 09 wrz 2015, 22:59

Karpik - makro wraz z Twoim postprocesorem na sucho działa - robi detekcję za każdym razem. Nie miałem czasu palić ale mniej więcej ogarnąłem temat. Jutro będę palił to się okaże.


snajperman-s1
Specjalista poziom 2 (min. 300)
Specjalista poziom 2 (min. 300)
Posty w temacie: 3
Posty: 340
Rejestracja: 22 kwie 2010, 10:34
Lokalizacja: Nowy Sącz

#5

Post napisał: snajperman-s1 » 12 wrz 2015, 07:56

Miałem pisać i pisze - Makro m300 i Postprocek do Sheetcam DZIAŁA SUPER

DZIĘKIIIIII !!!!

[ Dodano: 2015-09-12, 23:44 ]
No i jednak kicha - brak pauzy w końcu cięcia.... Dasz rade dopisać?

Awatar użytkownika

Autor tematu
karpik74
Specjalista poziom 2 (min. 300)
Specjalista poziom 2 (min. 300)
Posty w temacie: 10
Posty: 394
Rejestracja: 27 cze 2015, 16:36
Lokalizacja: kłodzko

#6

Post napisał: karpik74 » 31 paź 2015, 20:04

snajperman poprawiłem tą pauzę ...już nie pamiętam?


snajperman-s1
Specjalista poziom 2 (min. 300)
Specjalista poziom 2 (min. 300)
Posty w temacie: 3
Posty: 340
Rejestracja: 22 kwie 2010, 10:34
Lokalizacja: Nowy Sącz

#7

Post napisał: snajperman-s1 » 17 lis 2015, 07:38

Sorki że tak późno ale nie miałem czasu, TAK postprocesor teraz jest OK i ma wszystkie funkcje. DZIĘKI


stalmasz
Sympatyk forum poziom 2 (min. 50)
Sympatyk forum poziom 2 (min. 50)
Posty w temacie: 2
Posty: 63
Rejestracja: 21 gru 2015, 20:19
Lokalizacja: Krosno

#8

Post napisał: stalmasz » 03 sty 2016, 21:45

Zamierzam zrobić pływanie do głowicy plazmowej i zainteresował mnie ten temat
ponieważ używam SheetCama czy ten postprocesor od karpik74 jest poprawiony chodzi o tą pauzę o której pisze snajperman na programowaniu to się nie znam bardziej na elektronice, mechanice.

Awatar użytkownika

Autor tematu
karpik74
Specjalista poziom 2 (min. 300)
Specjalista poziom 2 (min. 300)
Posty w temacie: 10
Posty: 394
Rejestracja: 27 cze 2015, 16:36
Lokalizacja: kłodzko

#9

Post napisał: karpik74 » 03 sty 2016, 23:01

Nie wiem jakie masz THC? Musisz wziąć pod uwagę, że jak na końcu nie wyłączysz THC lub nie masz anty-nurkowania to przy pauzie palnik będzie miał więcej czasu żeby pójść w materiał, kolizję.

Poprawiony z pauzą na końcu.

function OnAbout(event)
ctrl = event:GetTextCtrl()
ctrl:AppendText("plasma THC300 post processor\n")
ctrl:AppendText("\n")
ctrl:AppendText("Modal G-codes and coordinates\n")
ctrl:AppendText("Comments enclosed with ( and )\n")
ctrl:AppendText("M03/M05 turn the torch on/off\n")
ctrl:AppendText("Incremental IJ\n")
ctrl:AppendText("The torch is referenced at cut start and every 500mm of movement thereafter\n")
ctrl:AppendText("Designed for use with Mach2 and Campbell Designs THC300\n")
ctrl:AppendText("Post variables:\n")
ctrl:AppendText("refdistance - set the distance between each reference\n")
end



-- revision 3/2/07
-- Removed final safety move. This is now done in SheetCam

-- revision 7/10/05
-- Added new arc handling

-- created 27/10/04
-- Based on plasma1.post



function OnInit()

post.SetCommentChars ("()", "[]") --make sure ( and ) characters do not appear in system text
post.Text (" (Filename: ", fileName, ")\n")
post.Text (" (Post processor: ", postName, ")\n")
post.Text (" (Date: ", date, ")\n")
if(scale == metric) then
post.Text (" G21 (Units: Metric)\n") --metric mode
else
post.Text (" G20 (Units: Inches)\n") --inch mode
end
post.Text (" G53 G90 G40\n F1\n S500\n")

dist = 9999999
refdistance = 500 * scale
switchoffset = -0.08
bigarcs = 1 --stitch arc segments together
minArcSize = 0.05 --arcs smaller than this are converted to moves
end

function OnNewLine()
post.Text ("N")
post.Number (lineNumber, "0000")
lineNumber = lineNumber + 10
end


function OnFinish()
post.Text (" M05 M30\n")
end

function OnRapid()
if(math.hypot(endX-currentX , endY-currentY) < 0.001 and endZ < currentZ) then return end
dist = dist + math.hypot(endX-currentX , endY-currentY)
post.ModalText (" G00")
post.ModalNumber (" X", endX * scale, "0.0000")
post.ModalNumber (" Y", endY * scale, "0.0000")
post.ModalNumber (" Z", endZ * scale, "0.0000")
post.Eol()
end

function OnMove()
dist = dist + math.hypot(endX-currentX , endY-currentY)
post.ModalText (" G01")
post.ModalNumber (" X", endX * scale, "0.0000")
post.ModalNumber (" Y", endY * scale, "0.0000")
post.ModalNumber (" Z", endZ * scale, "0.0000")
post.ModalNumber (" F", feedRate * scale, "0.###")
post.Eol()
end

function OnArc()
dist = dist + math.hypot(endX-currentX , endY-currentY)
if(arcAngle <0) then
post.ModalText (" G03")
else
post.ModalText (" G02")
end
post.NonModalNumber (" X", endX * scale, "0.0000")
post.NonModalNumber (" Y", endY * scale, "0.0000")
post.ModalNumber (" Z", endZ * scale, "0.0000")
post.Text (" I")
post.Number ((arcCentreX - currentX) * scale, "0.0000")
post.Text (" J")
post.Number ((arcCentreY - currentY) * scale, "0.0000")
post.ModalNumber (" F", feedRate * scale, "0.0###")
post.Eol()
end


function OnPenDown()

--[[ post.ModalText (" G00")
post.ModalNumber (" X", endX * scale, "0.0000")
post.ModalNumber (" Y", endY * scale, "0.0000")
post.Eol()]]
if (preheat > 0) then
post.ModalText (" G00")
post.ModalNumber (" Z", cutHeight * scale, "0.0000")
post.Eol()
post.Text(" M801\n G04 P 0.5\n M802\n G04 P0.1\n M902")
post.Text ("\n G04 P")
post.Number (preheat,"0.###")
post.Eol()
end
post.ModalText (" M300\n G00")
post.ModalNumber (" Z", pierceHeight * scale, "0.0000")
post.Text ("\n M03\n")
if (pierceDelay > 0) then
post.Text (" G04 P")
post.Number (pierceDelay,"0.###")
post.Eol()
end
end


function OnPenUp()
post.Text (" M05\n")
if (endDelay > 0) then
post.Text (" G04 P")
post.Number (endDelay,"0.###")
post.Eol()
end
end


function OnNewOperation()
if (plungeRate <= 0) then
post.Warning("WARNING: Plunge rate is zero")
end
if (feedRate <= 0) then
post.Warning("WARNING: Feed rate is zero")
end
end

function OnComment()
post.Text(" (",commentText,")\n")
end

function OnToolChange()
post.Text (" M06 T")
post.Number (tool, "0")
post.Text (" (", toolName, ")\n")
end

function OnNewPart()
post.Text(" (Part: ",partName,")\n");
end

function OnDrill()
OnRapid()
OnPenDown()
endZ = drillZ
OnMove()
OnPenUp()
endZ = safeZ
OnRapid()
end


stalmasz
Sympatyk forum poziom 2 (min. 50)
Sympatyk forum poziom 2 (min. 50)
Posty w temacie: 2
Posty: 63
Rejestracja: 21 gru 2015, 20:19
Lokalizacja: Krosno

#10

Post napisał: stalmasz » 04 sty 2016, 22:14

Dzięki za pomoc thc mam od prokopcia jak dodrze pójdzie to może jutro wypróbuję.

ODPOWIEDZ Poprzedni tematNastępny temat

Wróć do „SheetCam”