Compare commits

...

36 Commits

Author SHA1 Message Date
andrea.villa 827e9e3c03 - Allineamento con common ver. 2.6h2 2024-08-07 10:12:12 +02:00
andrea.villa f8c217a85d - Allineamento con common ver. 2.6h1 2024-08-01 12:57:16 +02:00
andrea.villa e029dfa64b Tolto stato finale paratia carico 2024-07-31 17:18:21 +02:00
andrea.villa e925500b5f Piccola correzione segni quote parcheggio 2024-07-31 15:23:57 +02:00
andrea.villa cf04020f10 Merge remote-tracking branch 'origin/develop' 2024-07-31 11:05:48 +02:00
andrea.villa f06bfab111 - Allineamento con common ver. 2.6g5 2024-07-31 11:05:37 +02:00
andrea.villa d344027033 Merge branch 'AdjustClampAfterRotation' into develop 2024-07-31 11:04:33 +02:00
andrea.villa c082727044 Alla linea con EA75 e EA76 si scrive ET1 2024-07-25 15:36:53 +02:00
andrea.villa 496e5fdc07 Corretta scrittura ISO per parcheggiare morsa 3 dopo ribaltamento. Da testare 2024-07-25 09:23:03 +02:00
andrea.villa 0882e41e4b Merge remote-tracking branch 'origin/master' into develop 2024-07-25 09:21:32 +02:00
andrea.villa 3ec3c830e9 FixDeployAndCompile01 2024-07-23 09:24:34 +02:00
andrea.villa 9d5a62bc7c - Gestione pezzi fino a 30 metri
- Allineamento con common ver. 2.6g4
2024-07-22 15:51:50 +02:00
andrea.villa 4d41b6bcbf Allineamento con common ver. 2.6g3 2024-07-17 16:01:50 +02:00
andrea.villa 016554b0f5 Allineamento con common ver. 2.6g2 2024-07-16 08:04:09 +02:00
andrea.villa b0bc0b134e Tolta chiamata debug 2024-07-10 16:03:35 +02:00
andrea.villa 2a0d801451 Merge branch 'master' of https://gitlab.steamware.net/egalware-machines/essetre/Essetre-PF 2024-07-10 15:58:55 +02:00
andrea.villa 4842975059 Allineamento con common ver. 2.6g1 2024-07-10 15:58:52 +02:00
luca.mazzoleni f0e0e2ffe9 ripristino a 2.6f1 2024-07-01 12:24:24 +02:00
luca.mazzoleni 2ff1f440ca Merge branch 'develop' 2024-07-01 12:17:03 +02:00
luca.mazzoleni 80faa3876b Merge branch 'test' into develop 2024-07-01 12:16:12 +02:00
luca.mazzoleni 94a7611036 - modifica LimX1PlRotSaw 2024-07-01 12:11:43 +02:00
luca.mazzoleni 1587b11099 - aggiunto NestingData
- modifica LimX1PlRotSaw
2024-07-01 12:08:19 +02:00
andrea.villa 3fbc3e8f79 Modificato 'LimX1PlRotSaw' a 1970mm 2024-06-03 12:41:25 +02:00
andrea.villa 08ee1dffaf - Aggiunta funzione GetSetupInfo a BeamData per nuovo automatismo
- Allineamento con common ver. 2.6f1
2024-06-03 12:31:55 +02:00
andrea.villa 1ec9cb3721 - Allineamento con common ver. 2.6e1
- Aggiunta variabile WoodDensity per gestione WOOD_DENSITY
2024-04-30 17:13:21 +02:00
luca.mazzoleni 63820acf65 Merge branch 'develop' 2024-04-16 17:05:52 +02:00
luca.mazzoleni 479c28778b in yaml aggiunta copia in R anche per develop (senza versione) 2024-04-16 17:05:42 +02:00
luca.mazzoleni 6a6cc28be1 Merge branch 'develop' 2024-04-16 15:08:20 +02:00
luca.mazzoleni 23bcf23f07 yaml lanciato solo per master 2024-04-16 15:08:07 +02:00
luca.mazzoleni acbfb66e00 aggiunto yaml per compilazione e copia su R 2024-04-16 13:23:17 +02:00
andrea.villa 7c0e6a816e - Allineamento con common ver. 2.6d2
- Aggiunto parametro ForceToCloseRollersGate
2024-04-12 08:54:43 +02:00
andrea.villa dd552b9180 Merge branch 'develop' 2024-03-28 12:27:02 +01:00
andrea.villa 67609582e4 Allineamento con common ver. 2.6d1 2024-03-28 12:26:54 +01:00
andrea.villa 682077b6a1 Merge remote-tracking branch 'origin/master' into develop 2024-03-26 08:21:14 +01:00
luca.mazzoleni 335a8d2e40 - aggiunti portautensili custom 2024-03-08 18:14:20 +01:00
luca.mazzoleni 6ada8ecf10 - Allineamento con common ver. 2.6c3
- In mlde aggiunto parametro EstimationRapidMultiplier per correggere la stima tempi su macchine vecchie (anche da TS3v7).
2024-03-05 12:02:16 +01:00
17 changed files with 967 additions and 184 deletions
+239
View File
@@ -0,0 +1,239 @@
variables:
VERS_MAIN: '1.0'
MACH_NAME: ''
MACH_NAME_TEST: ''
NEW_REL: ''
NET_SHARE_X: '\\10.74.82.201\EgwTech'
NET_SHARE_Z: '\\10.74.82.201\Artifacts'
NET_SHARE_S: '\\10.74.82.201\Scambio'
NET_SHARE_R: '\\10.74.82.201\EgwTech'
NET_USERQ: 'steamw\egalware'
MACH_VERS: '0.0.0.0'
TEMP_PATH: 'C:\MachinesDeploy'
MACHINES_PATH_R: 'R:\EgtData\Machines'
DEST_MACHINES_PATH_R: 'R:\EgtData\Machines\zTestYAML'
SRC_PATH: ''
BASE_PATH: ''
TEST_PATH: ''
#Note compilazione LUA:
# lua54 -o bin\$FileName -s $FileName: -o = output, -s = NON include i debug symbols
# helper copia script verso cartella di rete S:\ delle cartelle bin
.ReplicaS: &ReplicaS
- |
net use S: /delete
SLEEP 2
net use S: $env:NET_SHARE_S /u:$env:NET_USERQ $SDRIVE_PASSWD
ROBOCOPY /MIR $env:BASE_PATH S:\LucaM\MachinesDeploy\$env:MACH_NAME\$env:MACH_VERS\ /XD "bin" /XD "$env:MACH_NAME_TEST"
SLEEP 2
net use S: /delete
# helper copia script verso cartella di rete R:\
.ReplicaR: &ReplicaR
- |
net use R: /delete
SLEEP 2
net use R: $env:NET_SHARE_R /u:$env:NET_USERQ $ZDRIVE_PASSWD
echo "-----------------------"
echo " Copia macchina su R"
echo "-----------------------"
ROBOCOPY /MIR "$env:SRC_PATH" "$env:DEST_MACHINES_PATH_R\$env:MACH_NAME\" /XD "bin"
ROBOCOPY "$env:TEST_PATH" "$env:DEST_MACHINES_PATH_R\$env:MACH_NAME_TEST\" /E /XD "bin"
ROBOCOPY /MIR "$env:BASE_PATH" "$env:DEST_MACHINES_PATH_R\Deploy\$env:MACH_NAME\$env:MACH_VERS\" /XD "bin" /XD "$env:MACH_NAME_TEST"
SLEEP 2
net use R: /delete
# helper copia script verso cartella di rete R:\ per develop
.ReplicaR_DEV: &ReplicaR_DEV
- |
net use R: /delete
SLEEP 2
net use R: $env:NET_SHARE_R /u:$env:NET_USERQ $ZDRIVE_PASSWD
echo "-----------------------"
echo " Copia macchina su R - DEV"
echo "-----------------------"
ROBOCOPY /MIR "$env:BASE_PATH" "$env:DEST_MACHINES_PATH_R\Deploy\$env:MACH_NAME\_DEV\$env:MACH_VERS\" /XD "bin" /XD "$env:MACH_NAME_TEST"
SLEEP 2
net use R: /delete
#helper copia sorgenti da R a percorso temporaneo
.CreateBaseFolder: &CreateBaseFolder
- |
net use R: /delete
SLEEP 2
net use R: $env:NET_SHARE_R /u:$env:NET_USERQ $ZDRIVE_PASSWD
echo "-----------------------"
echo " Recupero file non git da R e copia su macchina virtuale"
echo "-----------------------"
ROBOCOPY "$env:LAST_MACHINE_PATH" "$env:SRC_PATH" /E /XF "*.bat" /XF "*.yml" /XF ".gitignore" /XD ".git" /XF "UpdateLog.txt" /XD ".vscode"
ROBOCOPY "$env:LAST_MACHINE_PATH" "$env:SRC_PATH\bin\$env:MACH_NAME\" /E /XF "*.bat" /XF "*.yml" /XF ".gitignore" /XD ".git" /XF "UpdateLog.txt" /XD ".vscode"
SLEEP 2
net use R: /delete
# helper compilazione LUA a 32 e 64 bit
.LuaCompile: &LuaCompile
- |
Set-Alias lua54 C:\Tools\Lua32\luac54
echo "-----------------------"
echo " Copia file su macchina virtuale"
echo "-----------------------"
ROBOCOPY . "$env:SRC_PATH" /E /XF "*.bat" /XF "*.yml" /XF ".gitignore" /XD ".git" /XF "UpdateLog.txt" /XD ".vscode"
ROBOCOPY . "$env:TEST_PATH" /E /XF "*.bat" /XF "*.yml" /XF ".gitignore" /XD ".git" /XF "UpdateLog.txt" /XD ".vscode"
Rename-Item -Path "$env:TEST_PATH\$env:MACH_NAME.mlde" -NewName "$env:MACH_NAME_TEST.mlde"
Rename-Item -Path "$env:TEST_PATH\$env:MACH_NAME.ini" -NewName "$env:MACH_NAME_TEST.ini"
ROBOCOPY . "$env:SRC_PATH\bin\$env:MACH_NAME\" /E /XF "*.bat" /XF "*.yml" /XF ".gitignore" /XD ".git" /XF "UpdateLog.txt" /XD ".vscode"
echo "-----------------------"
echo " Compilazione file *.lua 32/64bit di Common*"
echo "-----------------------"
$FileList = Get-ChildItem("Common*")
ForEach ($File in $FileList) {
$FileName = Split-Path $File -leaf
lua54 -o $env:SRC_PATH\bin\$env:MACH_NAME\$FileName -s $FileName
echo "lua54 -o bin\$FileName -s $FileName"
}
echo "-----------------------"
echo " FINE Compilazione"
echo "-----------------------"
# helper recupero nome macchina
.machName-fix: &machName-fix
- |
echo "-----------------------"
echo " Recupero nome macchina"
echo "-----------------------"
$fileName = dir *.mlde
$env:MACH_NAME = $fileName.BaseName
$env:MACH_NAME_TEST = $env:MACH_NAME + ".TEST"
# helper calcolo versione
.version-fix: &version-fix
- |
echo "-----------------------"
echo " Calcolo versione"
echo "-----------------------"
$fPath = "$env:MACH_NAME.mlde";
$vLine = Select-String -path $fPath -Pattern 'PP_VER';
$comp = $vLine -split "=";
$env:MACH_VERS = $comp[1].Replace("'","").Trim()
# display versione
Write-Output $env:MACH_VERS;
# helper calcolo versione se develop
.version-fix_DEV: &version-fix_DEV
- |
echo "-----------------------"
echo " Calcolo versione - DEV"
echo "-----------------------"
$commitAuthor = $CI_COMMIT_AUTHOR -split " "
$commitAuthor = $commitAuthor[0].Trim()
$env:MACH_VERS = $commitAuthor
# display versione
Write-Output $env:MACH_VERS;
# helper creazione folders
.folder-fix: &folder-fix
- |
echo "-----------------------"
echo " Creazione cartelle su macchina virtuale"
echo "-----------------------"
$env:LAST_MACHINE_PATH = "$env:MACHINES_PATH_R\$env:MACH_NAME";
Write-Output $env:LAST_MACHINE_PATH;
$env:SRC_PATH = "$env:TEMP_PATH\$env:MACH_NAME\$env:MACH_VERS\$env:MACH_NAME";
$env:BASE_PATH = "$env:TEMP_PATH\$env:MACH_NAME\$env:MACH_VERS";
$env:TEST_PATH = "$env:TEMP_PATH\$env:MACH_NAME\$env:MACH_VERS\$env:MACH_NAME_TEST";
Write-Output $env:BASE_PATH;
if (Test-Path $env:BASE_PATH) { Remove-Item -Path "$env:BASE_PATH\*" -R -Force };
Write-Output $env:TEST_PATH;
# helper compressione e pulizia folders
.ZipClean: &ZipClean
- |
" Compressione file su macchina virtuale"
$7zipPath = $env:ProgramFiles+"\7-Zip\7z.exe";
if (-not (Test-Path -Path $7zipPath -PathType Leaf)) {
throw "7 zip file '$7zipPath' not found"
}
Set-Alias 7zip $7zipPath
$Target = "$env:BASE_PATH\$env:MACH_NAME.zip"
cd "$env:SRC_PATH\bin\"
$Source = "*"
7zip a -tzip $Target $Source
Write-Output "called ZIP $Source --> $Target"
# helper esecuzione test
.RunTest: &RunTest
- |
Write-Output "Test done!"
stages:
- build
# - test
# - deploy
LuaCompile:build:
stage: build
only:
- main
- master
tags:
- win
before_script:
- *machName-fix
- *version-fix
- *folder-fix
script:
- *CreateBaseFolder
- *LuaCompile
- *ZipClean
- *ReplicaR
LuaCompileDev:build:
stage: build
only:
- develop
tags:
- win
before_script:
- *machName-fix
- *version-fix_DEV
- *folder-fix
script:
- *CreateBaseFolder
- *LuaCompile
- *ZipClean
- *ReplicaR_DEV
# LuaCompile:test:
# stage: test
# needs: ["LuaCompile:build"]
# only:
# - main
# - master
# - develop
# tags:
# - win
# before_script:
# - *version-fix
# - *folder-fix
# script:
# - *LuaCompile
# - *RunTest
# LuaCompile:deploy:
# stage: deploy
# needs: ["LuaCompile:test"]
# only:
# - main
# - master
# tags:
# - win
# before_script:
# - *version-fix
# - *folder-fix
# script:
# - *LuaCompile
# - *ZipClean
# - *ReplicaR
+36 -1
View File
@@ -14,7 +14,7 @@ local BeamData = {
MAX_HEIGHT = 800, -- altezza massima del grezzo
LEN_SHORT_PART = 1200, -- lunghezza massima pezzo piccolo
LEN_VERY_SHORT_PART = 400, -- lunghezza massima pezzo molto corto (molto probabile lo scarico a caduta)
MAX_RAW = 20000, -- massima lunghezza grezzo (deve essere minore di LenTable - RAW_OFFSET)
MAX_RAW = 30000, -- massima lunghezza grezzo (deve essere minore di LenTable - RAW_OFFSET)
STD_RAW = 14000, -- lunghezza standard della barra di grezzo
OVM_HEAD = 10, -- sovramateriale testa
OVM_MID = 5.0, -- sovramateriale intermedio (spessore lama)
@@ -206,5 +206,40 @@ local function GetChainSawInitAngs( vtN, vtO, nInd)
end
BeamData.GetChainSawInitAngs = GetChainSawInitAngs
---------------------------------------------------------------------
local function GetSetupInfo( sHead)
local SetupInfo = {}
-- dati comuni
SetupInfo.bIsCSymmetric = true
SetupInfo.dCAxisEncumbrance = 180
SetupInfo.bToolOnAggregate = false
-- testa 5 assi da sopra
if sHead == 'H11' or sHead == 'H21' then
SetupInfo.bIsTopHead = true
SetupInfo.bIsBottomHead = not SetupInfo.bIsTopHead
SetupInfo.dMaxNegativeAngle = sin( -45)
-- lama su testa 5 assi da sopra
elseif sHead == 'H12' or sHead == 'H22' then
SetupInfo.bIsTopHead = true
SetupInfo.bIsBottomHead = not SetupInfo.bIsTopHead
SetupInfo.dMaxNegativeAngle = sin( -45)
-- motosega 1
elseif sHead == 'H13' or sHead == 'H23' then
SetupInfo.bIsTopHead = true
SetupInfo.bIsBottomHead = not SetupInfo.bIsTopHead
SetupInfo.dMaxNegativeAngle = 0
-- motosega 2
elseif sHead == 'H15' then
SetupInfo.bIsBottomHead = true
SetupInfo.bIsTopHead = not SetupInfo.bIsBottomHead
SetupInfo.dMaxPositiveAngle = 0
end
return SetupInfo
end
BeamData.GetSetupInfo = GetSetupInfo
---------------------------------------------------------------------
return BeamData
+2
View File
@@ -8,6 +8,8 @@
2=Drill_H2
3=Pocket
4=Pocket_H2
5=Predrill
6=Predrill_H2
[Milling]
1=Prof
+3
View File
@@ -0,0 +1,3 @@
[BEAM]
StartOffset=10
Offset=0
+306 -99
View File
@@ -28,6 +28,9 @@ function OnStart()
--EMT.Ft = 'F' -- token per feed
--EMT.St = 'S' -- token per speed
EMT.FMAXPINZE = 102000 -- feed massima pinze
-- utensili default
EMT.PREVTCPOS_H1 = DefTcPos1
EMT.PREVTCPOS_H2 = DefTcPos2
end
---------------------------------------------------------------------
@@ -42,13 +45,17 @@ function OnProgramStart()
local BtlInfoId = EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo') or EgtGetCurrMachGroup() or GDB_ID.NULL
local nPattId = EgtGetInfo( BtlInfoId, 'PATTID', 'i') or 40
EmtOutput( '%' .. EgtNumToString( nPattId,-1))
-- aggiungo prefisso per commentae commenti iniziali se la macchina è utilizzata per fare i test
local sPrefixCommentLine = '' ; if IS_TEST_MACHINE or EgtEndsWith( EgtGetCurrMachineDir(), '.TEST') then sPrefixCommentLine = '//' end
if EMT.INFO then
EmtOutput( '('..EMT.INFO..')')
EmtOutput( sPrefixCommentLine..'('..EMT.INFO..')')
else
EmtOutput( '(Program Start)')
end
EmtOutput( '('.. CSP_INFO..')')
EmtOutput( '('.. MACHINE_INFO..')\n')
EmtOutput( sPrefixCommentLine..'('.. CSP_INFO..')')
EmtOutput( sPrefixCommentLine..'('.. MACHINE_INFO..')\n')
-- Se modalità test, aggiungo linee per muovere tappeto e alzare la testa (in automatico viene fatto dal main residente)
if TEST_USE then
EmitTestProgramStart()
@@ -264,22 +271,38 @@ function OnDispositionEnd()
end
-- se altrimenti disposizione intermedia, eventuale rotazione
elseif IsMidPhase( EMT.PHASE) or IsEnd2Phase( EMT.PHASE) then
-- recupero le rotazioni delle fasi corrente e precedente
local nRot = GetPhaseRot( EMT.PHASE)
local nPrevRot = GetPhaseRot( EMT.PHASE - 1)
-- verifico se sono diverse
if nRot ~= nPrevRot then
local nDeltaRot = nRot - nPrevRot
-- rotazione automatica o manuale (sempre con il medesimo comando)
local sOut = 'M180 L0=' .. tostring( nDeltaRot)
EmtOutput( sOut)
-- se rotazioni diverse, emetto il comando e aggiorno lo stato
if VerifyEmitRotation() then
-- imposto stato post-rotazione
EMT.POSTROT = true
-- imposto recupero sovramateriale in X non più presente
EMT.X_OFF = EMT.HOVM
end
-- se altrimenti disposizione intermedia speciale con eventuale rotazione
elseif IsMid2Phase( EMT.PHASE) then
-- emissione movimento carrelli
EMT.AUXCMD = {}
if #EMT.MDCHAR > 0 then
EmtOutput( '(ROTATION)')
end
for i = 1, #EMT.MDCHAR do
EmitMoveDataChars( EMT.MDCHAR[i])
end
if #EMT.MDCHAR > 0 then
EmitMoveStartChars( 1)
EmitMoveStartChars( 2)
end
EMT.MDCHAR = {}
EMT.AUXTYPE = nil
-- se rotazioni diverse, emetto il comando e aggiorno lo stato
if VerifyEmitRotation() then
-- imposto stato post-rotazione
EMT.POSTROT = true
-- imposto recupero sovramateriale in X non più presente
EMT.X_OFF = EMT.HOVM
end
-- altrimenti disposizione finale, eventuale scarico pezzo lavorato se non ci sono lavorazioni
else
else
if #EMT.MDCHAR > 0 then
MyOutputNoNum( '(PART UNLOAD)')
for i = 1, #EMT.MDCHAR do
@@ -419,7 +442,7 @@ function OnMachiningStart()
-- gestione eventuale lavorazione in doppio
local nDouType = EgtGetValInNotes( EMT.MCHUSERNOTES, 'DOUBLE', 'i')
if nDouType == 2 or nDouType == 3 then
local sDouTool = EgtGetValInNotes( EMT.TUSERNOTES, 'DOUBLE', 's') or ''
local sDouTool = EgtGetValInNotes( EMT.MCHUSERNOTES, 'TOOLDOUBLE', 's') or EgtGetValInNotes( EMT.TUSERNOTES, 'DOUBLE', 's') or ''
local sOldTool = EgtTdbGetCurrToolParam( MCH_TP.NAME)
if EgtTdbSetCurrTool( sDouTool) and EgtTdbGetCurrToolParam( MCH_TP.ACTIVE) then
-- salvo dati
@@ -579,6 +602,20 @@ function OnMachiningEnd()
EMT.PREVTOOL = EMT.TOOL
EMT.PREVHEAD = EMT.HEAD
EMT.PREVTCPOS = EMT.TCPOS
-- salvo anche utlimo utensile su testa
local nHSet = GetHeadSet( EMT.HEAD)
if nHSet == 1 then
EMT.PREVTOOL_H1 = EMT.TOOL
EMT.PREVHEAD_H1 = EMT.HEAD
EMT.PREVTCPOS_H1 = EMT.TCPOS
EMT.PREVHOMEX_H1 = EgtGetAxisHomePos( 'X1')
elseif nHSet == 2 then
EMT.PREVTOOL_H2 = EMT.TOOL
EMT.PREVHEAD_H2 = EMT.HEAD
EMT.PREVTCPOS_H2 = EMT.TCPOS
EMT.PREVHOMEX_H2 = EgtGetAxisHomePos( 'X2')
end
if EMT.DOU_TYPE and not EMT.ZMAX then EMT.DOU_TO_ZMAX = true end
EMT.DOU_TYPE = nil
end
@@ -761,6 +798,12 @@ function OnRapid()
local PrevR1 = EMT.R1p or EMT.R1pp or HomeR1
local PrevR2 = EMT.R2p or EMT.R2pp or HomeR2
EmtResetPrev()
-- gestione speciale per pezzi molto alti. Se il movimento successivo è più alto del precedente, allora prendo il successivo
if EMT.L3s then
if EMT.L3s > EMT.L3 then
EMT.L3 = EMT.L3s
end
end
-- se prima lavorazione
if EMT.LOAD then
EMT.V2POS = ParkV2
@@ -803,26 +846,41 @@ function OnRapid()
local HomeB1 = EgtGetAxisHomePos( 'B1')
local HomeC1 = EgtGetAxisHomePos( 'C1')
local dTRad, dTLen = GetToolRadLen()
local dXref = EMT.L2
if EMT.HEAD == 'H12' and EMT.L2 < -LimX1PlRotSaw then
dXref = -LimX1PlRotSaw
end
-- se fresa o lama
if not HeadIsChainSaw( EMT.HEAD) then
EmitMoveDataHead( 1, { X=dXref, Z=MyMaxZ1, B=ParkB1, C=ParkC1, TRad=dTRad, TLen=dTLen, S=Speed})
EmitMoveDataHead( 1, { X=-ParkX1, Z=MyMaxZ1, B=ParkB1, C=ParkC1, TRad=dTRad, TLen=dTLen, S=Speed})
EmitMoveStartHead( 1)
EmitMoveWaitHead( 1)
EmitMoveWaitChars( EgtIf( bOnlyCharY, 1, 3))
local bMoveZbeforeX = false
local dZref = EMT.L3
-- se carico destro e ho due teste, altrimenti in caso abbia una testa , tipo ONE, il controlo è invertito
if EMT.HEAD == 'H12' and ( EgtIf( not EgtGetHeadId( 'H21') or BD.RIGHT_LOAD, EMT.L2 < -LimX1RotSaw, EMT.L2 > -LimX1RotSaw) or EMT.R2 < -91) then
dZref = min( dSafeZ1 + GetZExtra( EMT.HEAD, EMT.R2) - 100, MyMaxZ1)
end
-- se la quota di lavoro è più in alta della posizione a ZHOME della testa, prima si va alla Z di lavoro e poi si approccia il pezzo
if EMT.L3 > dZref then
bMoveZbeforeX = true
end
local dXref = EMT.L2
if EMT.HEAD == 'H12' and EMT.L2 < -LimX1PlRotSaw then
dXref = -LimX1PlRotSaw
EmitMoveDataHead( 1, { X=dXref, Z=MyMaxZ1, B=ParkB1, C=ParkC1, S=Speed})
elseif not bMoveZbeforeX then
EmitMoveDataHead( 1, { X=dXref, Z=MyMaxZ1, B=ParkB1, C=ParkC1, S=Speed})
else
EmitMoveDataHead( 1, { X=-ParkX1, Z=MyMaxZ1, B=ParkB1, C=ParkC1, S=Speed})
end
-- caso speciale per trave alta con rotazione lama pericolosa (tolto "and EMT.SB > 379")
if EMT.HEAD == 'H12' and abs( PrevR1 - EMT.R1) > 1 and ( abs( HomeC1 - EMT.R1) > 30.1 or abs( HomeB1 - EMT.R2) > 30.1) then
EmitMoveDataHead( 1, { X=dXref, Z=MyMaxZ1, B=0, C=ParkC1, S=Speed})
EmitMoveDataHead( 1, { B=0, S=Speed})
EmitMoveDataHead( 1, { C=EMT.R1, S=Speed})
EmitMoveDataHead( 1, { Z=dZref, B=EMT.R2, S=Speed})
if bMoveZbeforeX then
EmitMoveDataHead( 1, { Z=EMT.L3, S=Speed})
end
-- caso standard
else
EmitMoveDataHead( 1, { X=dXref, Z=dZref, B=ParkB1, C=ParkC1, S=Speed})
@@ -838,11 +896,11 @@ function OnRapid()
-- se motosega configurata per lavorazioni di fianco o circa orizzontale
if dPosA == 0 or abs( EMT.R2) < 10 then
EmitMoveDataHead( 1, { X=EMT.L2, C=EMT.R1, S=Speed})
EmitMoveDataHead( 1, { X=EMT.L2, Z=ParkCSawZ1, B=ParkCSawB1, C=EMT.R1, S=Speed})
EmitMoveDataHead( 1, { Z=EMT.L3, B=EMT.R2, S=Speed})
-- se circa verticale
else
EmitMoveDataHead( 1, { X=EMT.L2, C=EMT.R1, S=Speed})
EmitMoveDataHead( 1, { X=EMT.L2, Z=ParkCSawZ1, B=ParkCSawB1, C=EMT.R1, S=Speed})
EmitMoveDataHead( 1, { Z=EMT.L3, B=EMT.R2, S=Speed})
end
end
@@ -870,29 +928,43 @@ function OnRapid()
-- allontanamento o eventuale preselezione successiva testa 1
PreselectNextDiffHead( EMT.MCHID, EMT.HEAD)
-- movimento testa
local dSafeZ1 = EgtGetAxisHomePos( 'Z21')
local dSafeZ1 = EgtGetAxisHomePos( 'Z1')
local MyMaxZ1 = EgtGetAxisMax( 'Z1')
local HomeC1 = EgtGetAxisHomePos( 'C1')
local HomeB1 = EgtGetAxisHomePos( 'B1')
local dTRad, dTLen = GetToolRadLen()
-- se fresa o lama
if not HeadIsChainSaw( EMT.HEAD) then
EmitMoveDataHead( 1, { X=EMT.L2, Z=MyMaxZ1, B=HomeB1, C=HomeC1, TRad=dTRad, TLen=dTLen, S=Speed})
EmitMoveDataHead( 1, { X=-ParkX2, Z=MyMaxZ1, B=HomeB1, C=HomeC1, TRad=dTRad, TLen=dTLen, S=Speed})
EmitMoveStartHead( 1)
EmitMoveWaitHead( 1)
EmitMoveWaitChars( EgtIf( bOnlyCharY, 1, 3))
local bMoveZbeforeX = false
local dZref = EMT.L3
if EMT.HEAD == 'H12' and ( EgtIf( not EgtGetHeadId( 'H21') or BD.RIGHT_LOAD, EMT.L2 < -LimX1RotSaw, EMT.L2 > -LimX1RotSaw) or EMT.R2 > 91) then
dZref = min( dSafeZ1 + GetZExtra( EMT.HEAD, EMT.R2) - 100, MyMaxZ1)
end
-- se la quota di lavoro è più in alta della posizione a ZHOME della testa, prima si va alla Z di lavoro e poi si approccia il pezzo
if EMT.L3 > dZref then
bMoveZbeforeX = true
end
if not bMoveZbeforeX then
EmitMoveDataHead( 1, { X=EMT.L2, Z=MyMaxZ1, B=HomeB1, C=HomeC1, S=Speed})
else
EmitMoveDataHead( 1, { X=-ParkX2, Z=MyMaxZ1, B=HomeB1, C=HomeC1, S=Speed})
end
-- caso speciale per trave alta con rotazione lama pericolosa (tolto "and EMT.SB > 379")
if EMT.HEAD == 'H12' and abs( PrevR1 - EMT.R1) > 1 and ( abs( HomeC1 - EMT.R1) > 30.1 or abs( HomeB1 - EMT.R2) > 30.1) then
EmitMoveDataHead( 1, { X=EMT.L2, Z=MyMaxZ1, B=0, C=HomeC1, S=Speed})
EmitMoveDataHead( 1, { B=0, S=Speed})
EmitMoveDataHead( 1, { C=EMT.R1, S=Speed})
EmitMoveDataHead( 1, { Z=dZref, B=EMT.R2, S=Speed})
if bMoveZbeforeX then
EmitMoveDataHead( 1, { Z=EMT.L3, S=Speed})
end
-- altrimenti caso standard
else
EmitMoveDataHead( 1, { X=EMT.L2, Z=dZref, B=HomeB1, C=HomeC1, S=Speed})
EmitMoveDataHead( 1, { Z=dZref, S=Speed})
EmitMoveDataHead( 1, { B=EMT.R2, S=Speed})
EmitMoveDataHead( 1, { C=EMT.R1, S=Speed})
end
@@ -905,11 +977,11 @@ function OnRapid()
-- se motosega configurata per lavorazioni di fianco o circa orizzontale
if dPosA == 0 or abs( EMT.R2) < 10 then
EmitMoveDataHead( 1, { X=EMT.L2, C=EMT.R1, S=Speed})
EmitMoveDataHead( 1, { X=EMT.L2, Z=ParkCSawZ1, B=ParkCSawB1, C=EMT.R1, S=Speed})
EmitMoveDataHead( 1, { Z=EMT.L3, B=EMT.R2, S=Speed})
-- se circa verticale
else
EmitMoveDataHead( 1, { X=EMT.L2, C=EMT.R1, S=Speed})
EmitMoveDataHead( 1, { X=EMT.L2, Z=ParkCSawZ1, B=ParkCSawB1, C=EMT.R1, S=Speed})
EmitMoveDataHead( 1, { Z=EMT.L3, B=EMT.R2, S=Speed})
end
@@ -931,22 +1003,37 @@ function OnRapid()
local dTRad, dTLen = GetToolRadLen()
-- se fresa o lama
if not HeadIsChainSaw( EMT.HEAD) then
EmitMoveDataHead( 2, { X=EMT.L2, Z=MyMaxZ2, B=HomeB2, C=HomeC2, TRad=dTRad, TLen=dTLen, S=Speed})
EmitMoveDataHead( 2, { X=-ParkX2, Z=MyMaxZ2, B=HomeB2, C=HomeC2, TRad=dTRad, TLen=dTLen, S=Speed})
EmitMoveStartHead( 2)
EmitMoveWaitHead( 2)
EmitMoveWaitChars( EgtIf( bOnlyCharY, 1, 3))
local bMoveZbeforeX = false
local dZref = EMT.L3
if EMT.HEAD == 'H22' and ( EgtIf( BD.RIGHT_LOAD, EMT.L2 < -LimX2RotSaw, EMT.L2 > -LimX2RotSaw) or EMT.R2 > 91) then
dZref = min( dSafeZ2 + GetZExtra( EMT.HEAD, EMT.R2) - 100, MyMaxZ2)
end
-- se la quota di lavoro è più in alta della posizione a ZHOME della testa, prima si va alla Z di lavoro e poi si approccia il pezzo
if EMT.L3 > dZref then
bMoveZbeforeX = true
end
if not bMoveZbeforeX then
EmitMoveDataHead( 2, { X=EMT.L2, Z=MyMaxZ2, B=HomeB2, C=HomeC2, S=Speed})
else
EmitMoveDataHead( 2, { X=-ParkX2, Z=MyMaxZ2, B=HomeB2, C=HomeC2, S=Speed})
end
-- caso speciale per trave alta con rotazione lama pericolosa (tolto "and EMT.SB > 379")
if EMT.HEAD == 'H22' and abs( PrevR1 - EMT.R1) > 1 and ( abs( HomeC2 - EMT.R1) > 30.1 or abs( HomeB2 - EMT.R2) > 30.1) then
EmitMoveDataHead( 2, { X=EMT.L2, Z=MyMaxZ2, B=0, C=HomeC2, S=Speed})
EmitMoveDataHead( 2, { B=0, S=Speed})
EmitMoveDataHead( 2, { C=EMT.R1, S=Speed})
EmitMoveDataHead( 2, { Z=dZref, B=EMT.R2, S=Speed})
if bMoveZbeforeX then
EmitMoveDataHead( 2, { Z=EMT.L3, S=Speed})
end
-- altrimenti caso standard
else
EmitMoveDataHead( 2, { X=EMT.L2, Z=dZref, B=HomeB2, C=HomeC2, S=Speed})
EmitMoveDataHead( 2, { Z=dZref, S=Speed})
EmitMoveDataHead( 2, { B=EMT.R2, S=Speed})
EmitMoveDataHead( 2, { C=EMT.R1, S=Speed})
end
@@ -957,13 +1044,13 @@ function OnRapid()
EmitMoveWaitHead( 2)
EmitMoveWaitChars( EgtIf( bOnlyCharY, 1, 3))
-- se motosega configurata per lavorazioni di fianco o circa orizzontale
-- se motosega configurata per lavorazioni di fianco o circa orizzontale. Dopo attesa movimento carrelli si devono scrivere tutti gli assi.
if dPosA == 0 or abs( EMT.R2) < 10 then
EmitMoveDataHead( 2, { X=EMT.L2, C=EMT.R1, S=Speed})
EmitMoveDataHead( 2, { X=EMT.L2, Z=ParkCSawZ2, B=ParkCSawB2, C=EMT.R1, S=Speed})
EmitMoveDataHead( 2, { Z=EMT.L3, B=EMT.R2, S=Speed})
-- se circa verticale
else
EmitMoveDataHead( 2, { X=EMT.L2, C=EMT.R1, S=Speed})
EmitMoveDataHead( 2, { X=EMT.L2, Z=ParkCSawZ2, B=ParkCSawB2, C=EMT.R1, S=Speed})
EmitMoveDataHead( 2, { Z=EMT.L3, B=EMT.R2, S=Speed})
end
end
@@ -1033,6 +1120,7 @@ function OnRapid()
EMT.ZMAX = true
EMT.TO_ZMAX = nil
EMT.TO_XHOME = nil
EMT.L1pp = nil
EMT.L3pp = nil
PrevR1 = EgtGetAxisHomePos( EgtIf( nHSet == 1, 'C1', 'C2'))
PrevR2 = EgtGetAxisHomePos( EgtIf( nHSet == 1, 'B1', 'B2'))
@@ -1044,43 +1132,44 @@ function OnRapid()
EMT.AUXCMD = {}
-- se necessario posizionamento in home (sono sicuramente già a Zmax)
if EMT.TO_XHOME then
-- se precedente non era sega a catena, vado in home con quella
if not HeadIsChainSaw( EMT.PREVHEAD) then
local nPrevHSet = GetHeadSet( EMT.PREVHEAD)
if nPrevHSet == 1 then
local nHSet = GetHeadSet( EMT.HEAD)
local nPrevHSet = GetHeadSet( EMT.PREVHEAD)
-- se successivo non è sega a catena e la testa è la stessa, vado in home con utensile succesivo
if not HeadIsChainSaw( EMT.HEAD) and nHSet == nPrevHSet then
if nHSet == 1 then
local HomeX1 = EgtGetAxisHomePos( 'X1')
EmitMoveDataHead( 1, { X=-HomeX1, Z=MaxZ1, B=ParkB1, C=ParkC1, TPos='0'})
EmitMoveDataHead( 1, { X=-HomeX1, Z=MaxZ1, B=ParkB1, C=ParkC1})
EmitMoveStartHead( 1, 'EA1')
else
local HomeX2 = EgtGetAxisHomePos( 'X2')
EmitMoveDataHead( 2, { X=-HomeX2, Z=MaxZ2, B=ParkB2, C=ParkC2, TPos='0'})
EmitMoveDataHead( 2, { X=-HomeX2, Z=MaxZ2, B=ParkB2, C=ParkC2})
EmitMoveStartHead( 2, 'EA1')
end
-- altrimenti la deposito e vado in home speciale
else
-- se successivo non è sega a catena, ne lancio il carico
if not HeadIsChainSaw( EMT.HEAD) then
if nHSet == 1 then
if not HeadIsChainSaw( EMT.PREVHEAD) then
if nPrevHSet == 1 then
local HomeX1 = EgtGetAxisHomePos( 'X1')
EmitMoveDataHead( 1, { X=-HomeX1, Z=MaxZ1, B=HomeR2, C=HomeR1})
EmitMoveDataHead( 1, { X=-EMT.PREVHOMEX_H1, Z=MaxZ1, B=ParkB1, C=ParkC1, TPos=AdjustTcPos( false, EMT.PREVTCPOS_H1)})
EmitMoveStartHead( 1, 'EA1')
else
local HomeX2 = EgtGetAxisHomePos( 'X2')
EmitMoveDataHead( 2, { X=-HomeX2, Z=MaxZ2, B=HomeR2, C=HomeR1})
EmitMoveDataHead( 2, { X=-EMT.PREVHOMEX_H2, Z=MaxZ2, B=ParkB2, C=ParkC2, TPos=AdjustTcPos( false, EMT.PREVTCPOS_H2)})
EmitMoveStartHead( 2, 'EA1')
end
-- altrimenti deposito e mi metto in posizione sicura
else
if GetHeadTCSet( EMT.HEAD, EMT.TCPOS) == 'Head1_TC1' or GetHeadTCSet( EMT.HEAD, EMT.TCPOS) == 'Head1_TC2' then
EmitMoveDataHead( 1, { X=-ParkCSawX1S, Z=MaxZ1, B=HomeR2, C=HomeR1, TPos='0'})
if GetHeadTCSet( EMT.PREVHEAD, EMT.PREVTCPOS) == 'Head1_TC1' or GetHeadTCSet( EMT.PREVHEAD, EMT.PREVTCPOS) == 'Head1_TC2' then
EmitMoveDataHead( 1, { X=-ParkCSawX1S, Z=MaxZ1, B=HomeR2, C=HomeR1, TPos='50'})
EmitMoveStartHead( 1, 'EA1')
else
EmitMoveDataHead( 2, { X=-ParkCSawX2S, Z=MaxZ2, B=HomeR2, C=HomeR1, TPos='0'})
EmitMoveDataHead( 2, { X=-ParkCSawX2S, Z=MaxZ2, B=HomeR2, C=HomeR1, TPos='50'})
EmitMoveStartHead( 2, 'EA1')
end
end
end
EMT.TO_XHOME = nil
EMT.L1pp = nil
EMT.L3pp = nil
PrevR1 = HomeR1
PrevR2 = HomeR2
@@ -1108,7 +1197,7 @@ function OnRapid()
end
EMT.MDCHAR = {}
-- se necessario allargo le cabine
if RollerParkingNeeded( EMT.HEAD, PrevR1, PrevR2, EMT.R1, EMT.R2) or
if RollerParkingNeeded( EMT.HEAD, PrevR1, PrevR2, EMT.R1, EMT.R2) or EMT.TOOL ~= EMT.PREVTOOL or
EMT.V1POS < EMT.V1NEXTPOS - 1 or EMT.V2POS > EMT.V2NEXTPOS + 1 then
local dPosT = EMT.TPOS or EMT.L1op
EmitParkRoller( dPosT, EMT.MCHSPLIT)
@@ -1125,23 +1214,39 @@ function OnRapid()
if EMT.ZMAX or ( EMT.FLAG == 2 and EMT.FLAG2 == 1) then
-- se fresa o lama
if not HeadIsChainSaw( EMT.HEAD) then
local CurrX1 = EMT.L1pp or ( -LimX1RotSaw)
local CurrZ1 = EMT.L3pp or MyMaxZ1
local CurrB1 = PrevR2
local CurrC1 = PrevR1
local dXref = EMT.L2
if EMT.HEAD == 'H12' and EMT.L2 < -LimX1PlRotSaw then
dXref = -LimX1PlRotSaw
end
EmitMoveDataHead( 1, { X=dXref, Z=CurrZ1, B=CurrB1, C=CurrC1, TRad=dTRad, TLen=dTLen, S=Speed})
local bMoveZbeforeX = false
local dZref = EMT.L3
if EMT.HEAD == 'H12' and ( EgtIf( not EgtGetHeadId( 'H21') or BD.RIGHT_LOAD, EMT.L2 < -LimX1RotSaw, EMT.L2 > -LimX1RotSaw) or EMT.R2 < -91) then
dZref = min( dSafeZ1 + GetZExtra( EMT.HEAD, EMT.R2) - 100, MyMaxZ1)
end
-- se la quota di lavoro è più in alta della posizione a ZHOME della testa, prima si va alla Z di lavoro e poi si approccia il pezzo
if EMT.L3 > dZref then
bMoveZbeforeX = true
end
local dXref = EMT.L2
if EMT.HEAD == 'H12' and EMT.L2 < -LimX1PlRotSaw then
dXref = -LimX1PlRotSaw
EmitMoveDataHead( 1, { X=dXref, Z=CurrZ1, B=CurrB1, C=CurrC1, TRad=dTRad, TLen=dTLen, S=Speed})
elseif not bMoveZbeforeX then
EmitMoveDataHead( 1, { X=dXref, Z=CurrZ1, B=CurrB1, C=CurrC1, TRad=dTRad, TLen=dTLen, S=Speed})
else
EmitMoveDataHead( 1, { X=CurrX1, Z=CurrZ1, B=CurrB1, C=CurrC1, TRad=dTRad, TLen=dTLen, S=Speed})
end
-- caso speciale per trave alta con rotazione lama pericolosa (tolto "and EMT.SB > 379")
if EMT.HEAD == 'H12' and abs( PrevR1 - EMT.R1) > 1 and ( abs( HomeC1 - EMT.R1) > 30.1 or abs( HomeB1 - EMT.R2) > 30.1) then
EmitMoveDataHead( 1, { B=0, S=Speed})
EmitMoveDataHead( 1, { C=EMT.R1, S=Speed})
EmitMoveDataHead( 1, { Z=dZref, B=EMT.R2, S=Speed})
if bMoveZbeforeX then
EmitMoveDataHead( 1, { Z=EMT.L3, S=Speed})
end
-- altrimenti caso standard
else
EmitMoveDataHead( 1, { Z=dZref, S=Speed})
@@ -1199,20 +1304,36 @@ function OnRapid()
if EMT.ZMAX or ( EMT.FLAG == 2 and EMT.FLAG2 == 1) then
-- se fresa o lama
if not HeadIsChainSaw( EMT.HEAD) then
local CurrX1 = EMT.L1pp or ( -LimX1RotSaw)
local CurrZ1 = EMT.L3pp or MyMaxZ1
local CurrB1 = PrevR2
local CurrC1 = PrevR1
EmitMoveDataHead( 1, { X=EMT.L2, Z=CurrZ1, B=CurrB1, C=CurrC1, TRad=dTRad, TLen=dTLen, S=Speed})
local bMoveZbeforeX = false
local dZref = EMT.L3
if EMT.HEAD == 'H12' and ( EgtIf( not EgtGetHeadId( 'H21') or BD.RIGHT_LOAD, EMT.L2 < -LimX1RotSaw, EMT.L2 > -LimX1RotSaw) or EMT.R2 > 91) then
if EMT.HEAD == 'H12' and ( EgtIf( not EgtGetHeadId( 'H21') or BD.RIGHT_LOAD, EMT.L2 < -LimX1RotSaw, EMT.L2 > -LimX1RotSaw) or EMT.R2 < -91) then
dZref = min( dSafeZ1 + GetZExtra( EMT.HEAD, EMT.R2) - 100, MyMaxZ1)
end
-- se la quota di lavoro è più in alta della posizione a ZHOME della testa, prima si va alla Z di lavoro e poi si approccia il pezzo
if EMT.L3 > dZref then
bMoveZbeforeX = true
end
if not bMoveZbeforeX then
EmitMoveDataHead( 1, { X=EMT.L2, Z=CurrZ1, B=CurrB1, C=CurrC1, TRad=dTRad, TLen=dTLen, S=Speed})
else
EmitMoveDataHead( 1, { X=CurrX1, Z=CurrZ1, B=CurrB1, C=CurrC1, TRad=dTRad, TLen=dTLen, S=Speed})
end
-- caso speciale per trave alta con rotazione lama pericolosa (tolto "and EMT.SB > 379")
if EMT.HEAD == 'H12' and abs( PrevR1 - EMT.R1) > 1 and ( abs( HomeC1 - EMT.R1) > 30.1 or abs( HomeB1 - EMT.R2) > 30.1) then
EmitMoveDataHead( 1, { B=0, S=Speed})
EmitMoveDataHead( 1, { C=EMT.R1, S=Speed})
EmitMoveDataHead( 1, { Z=dZref, B=EMT.R2, S=Speed})
-- altrimenti caso standard
if bMoveZbeforeX then
EmitMoveDataHead( 1, { Z=EMT.L3, S=Speed})
end
-- altrimenti caso standard
else
EmitMoveDataHead( 1, { Z=dZref, S=Speed})
EmitMoveDataHead( 1, { B=EMT.R2, S=Speed})
@@ -1247,19 +1368,35 @@ function OnRapid()
if EMT.ZMAX or ( EMT.FLAG == 2 and EMT.FLAG2 == 1) then
-- se fresa o lama
if not HeadIsChainSaw( EMT.HEAD) then
local CurrX2 = EMT.L1pp or ( -LimX1RotSaw)
local CurrZ2 = EMT.L3pp or MyMaxZ2
local CurrB2 = PrevR2
local CurrC2 = PrevR1
EmitMoveDataHead( 2, { X=EMT.L2, Z=CurrZ2, B=CurrB2, C=CurrC2, TRad=dTRad, TLen=dTLen, S=Speed})
local bMoveZbeforeX = false
local dZref = EMT.L3
if EMT.HEAD == 'H22' and ( EgtIf( BD.RIGHT_LOAD, EMT.L2 < -LimX2RotSaw, EMT.L2 > -LimX2RotSaw) or EMT.R2 > 91) then
if EMT.HEAD == 'H22' and ( EgtIf( not EgtGetHeadId( 'H21') or BD.RIGHT_LOAD, EMT.L2 < -LimX1RotSaw, EMT.L2 > -LimX1RotSaw) or EMT.R2 < -91) then
dZref = min( dSafeZ2 + GetZExtra( EMT.HEAD, EMT.R2) - 100, MyMaxZ2)
end
-- se la quota di lavoro è più in alta della posizione a ZHOME della testa, prima si va alla Z di lavoro e poi si approccia il pezzo
if EMT.L3 > dZref then
bMoveZbeforeX = true
end
if not bMoveZbeforeX then
EmitMoveDataHead( 2, { X=EMT.L2, Z=CurrZ2, B=CurrB2, C=CurrC2, TRad=dTRad, TLen=dTLen, S=Speed})
else
EmitMoveDataHead( 2, { X=CurrX2, Z=CurrZ2, B=CurrB2, C=CurrC2, TRad=dTRad, TLen=dTLen, S=Speed})
end
-- caso speciale per trave alta con rotazione lama pericolosa (tolto "and EMT.SB > 379")
if EMT.HEAD == 'H22' and abs( PrevR1 - EMT.R1) > 1 and ( abs( HomeC2 - EMT.R1) > 30.1 or abs( HomeB2 - EMT.R2) > 30.1) then
EmitMoveDataHead( 2, { B=0, S=Speed})
EmitMoveDataHead( 2, { C=EMT.R1, S=Speed})
EmitMoveDataHead( 2, { Z=dZref, B=EMT.R2, S=Speed})
if bMoveZbeforeX then
EmitMoveDataHead( 2, { Z=EMT.L3, S=Speed})
end
-- altrimenti caso standard
else
EmitMoveDataHead( 2, { Z=dZref, S=Speed})
@@ -1427,7 +1564,8 @@ function OnRapid()
-- se Split o Presplit lascio agganciata solo la pinza Y2 alla fine dei movimenti
local sNextTool = GetNextTool( EMT.MCHID)
-- vado in home se è ultimo movimento ed è ultima lavorazione, se sono con motosega e devo cambiare utensile, oppure se ho la lama
local bToXhome = ( IsLastPath( EMT.PATHID) and not sNextTool) or ( EMT.HEAD == 'H23' and EMT.TOOL ~= sNextTool) or ( EMT.HEAD == 'H13' and EMT.TOOL ~= sNextTool) or EMT.HEAD == 'H12' or EMT.HEAD == 'H22'
local bToXhome = ( IsLastPath( EMT.PATHID) and not sNextTool) or ( EMT.HEAD == 'H23' and EMT.TOOL ~= sNextTool) or ( EMT.HEAD == 'H13' and EMT.TOOL ~= sNextTool) or
( EMT.HEAD == 'H12' and EMT.TOOL ~= sNextTool ) or ( EMT.HEAD == 'H22' and EMT.TOOL ~= sNextTool) or EMT.MCHSPLIT
local CurrL3o = EMT.L3o
EMT.L3o = EMT.L3op
EmitZmax( true, true, bToXhome, EMT.R1p, EMT.R2p, EMT.MCHSPLIT)
@@ -1532,6 +1670,44 @@ end
---------------------------------------------------------------------
function OnArc()
-- se necessario, impostazione riferimento locale
if EMT.REFLOC == 0 then
-- gruppo della testa
local nHSet = GetHeadSet( EMT.HEAD)
-- calcolo per piano generico
CalcInterpPlane()
EMT.REFLOC = 1
-- salvo posizione attuale
local OldL1 = EMT.L1
local OldL2 = EMT.L2
local OldL3 = EMT.L3
-- imposto posizione precedente (non contiene l'offset in X per sovramateriale di testa EMT.X_OFF)
EMT.L1 = EMT.L1o
EMT.L2 = EMT.L2o
EMT.L3 = EMT.L3o
-- trasformo i punti nel piano
MyAdjustLinearAxes()
EmtAdjustRotaryAxes()
EMT.L1p = nil
EMT.L2p = nil
EMT.L3p = nil
local sDouFlag = EgtIf( EMT.DOU_TYPE, ' EE1', '')
EmtOutput( 'G142'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..EMT.IPLGLSTR..EgtIf( nHSet~=2, ' EU1', ' EU2')..sDouFlag..' EF'..GetFmaxClamp())
-- emissione movimento
local sOut = 'G0'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..
EmtGetAxis('R2')..EmtGetAxis('R1')
EmtOutput( sOut)
-- aggiorno precedenti
local nOriginalMove = EMT.MOVE
EMT.MOVE = 0
EmtUpdatePrev()
EMT.MOVE = nOriginalMove
-- ripristino posizione attuale
EMT.L1 = OldL1
EMT.L2 = OldL2
EMT.L3 = OldL3
end
-- non modale su archi
EmtResetPrevLinear()
-- aggiustamento valori
@@ -1568,7 +1744,7 @@ end
function CalcDinamicaPinze( dH, dS, dL)
local MinTempoAcc = 0.3 -- [s]
local MaxTempoAcc = 4.0 -- [s]
local KgMtCubo= 550 -- densità legno [Kg / metro cubo]
local KgMtCubo= WoodDensity or 550 -- densità legno [Kg / metro cubo]
local Massa = ( dH * dS * dL * KgMtCubo ) / 1e9 -- massa [Kg]
local FMaxPinze = EMT.FMAXPINZE -- Feed massima pinze [mm/min]
local ForzaAttrito = 350 * 9.8 * 0.2 -- Forza chiusura pinze [Kgf] * g * Coeff_Attrito -> [N]
@@ -2049,7 +2225,10 @@ function PreparePreRotation( sCmd, nInd)
if Cmd[2] ~= 'Z' then
local MDChar
if EMT.PREROT then
MDChar = { [Cmd[2]]=tonumber(Cmd[3]), IniStatY1=86, FinStatY1=87, IniStatY2=1, BeamVise=0}
-- parcheggio per sicurezza morsa e paratia lato scarico
MDChar = { Y2=ParkY2, V2=ParkV2, IniStatY2=1, FinStatY2=1, BeamVise=0}
table.insert( EMT.MDCHAR, MDChar)
MDChar = { [Cmd[2]]=tonumber(Cmd[3]), IniStatY1=86, FinStatY1=87, BeamVise=0}
elseif EMT.SPECSPLIT then
MDChar = { [Cmd[2]]=tonumber(Cmd[3]), V1=ParkV1, IniStatY1=EMT.ISY1, FinStatY1=EMT.FSY1, IniStatY2=EMT.ISY2, FinStatY2=EMT.FSY2, IniStatV1=3, BeamVise=EMT.BV}
EMT.V1POS = MDChar.V1
@@ -2444,6 +2623,48 @@ function GetSpecUnloading( nPathId)
return ( sVal == '0,Unloading SpecSplit')
end
---------------------------------------------------------------------
function VerifyEmitRotation()
-- recupero le rotazioni delle fasi corrente e precedente
local nRot = GetPhaseRot( EMT.PHASE)
local nPrevRot = GetPhaseRot( EMT.PHASE - 1)
-- se sono uguali non devo fare alcunchè
if nRot == nPrevRot then
return false
end
-- se ho la testa 2, quindi tipo PF
if EgtGetHeadId( 'H21') then
local nDeltaRot = nRot - nPrevRot
-- rotazione automatica o manuale (sempre con il medesimo comando)
local sOut = 'M180 L0=' .. tostring( nDeltaRot)
EmtOutput( sOut)
-- altrimenti se ONE
else
if nRot > nPrevRot then nRot = nRot - 4 end
local nDeltaRot = nRot - nPrevRot
-- se rotazione automatica richiesta e possibile
local dRefLen = EgtIf( IsMid2Phase( EMT.PHASE) or IsEnd2Phase( EMT.PHASE), EMT.LT, EMT.LB)
-- se rotazione automatica richiesta e possibile
if AutomaticRotation and dRefLen >= AutoRotMinLen then
local sOut = 'M180 L0=' .. tostring( -nDeltaRot)
EmtOutput( sOut)
else
local sOut
if nDeltaRot == -1 then
sOut = 'M151'
elseif nDeltaRot == -2 then
sOut = 'M152'
elseif nDeltaRot == -3 then
sOut = 'M153'
end
EmtOutput( sOut)
EmtOutput( 'M86')
EmtOutput( 'G4F.5')
end
end
return true
end
---------------------------------------------------------------------
function EmitZmax( bReset, bEnd, bXhome, PrevR1, PrevR2, bSplitCut, bUsePrevDelta)
if bReset then
@@ -2502,7 +2723,7 @@ function EmitZmax( bReset, bEnd, bXhome, PrevR1, PrevR2, bSplitCut, bUsePrevDelt
EmitMoveDataHead( 1, MovH)
EmitMoveDataHead( 1, { Z=dSafeZ1, B=dSafeB1})
if EMT.SB > 650 and abs( EMT.R3) < 0.1 then
EmitMoveDataHead( 1, { Z=ParkCSawZ1, B=ParkB1})
EmitMoveDataHead( 1, { Z=ParkCSawZ1})
end
EmitMoveDataHead( 1, { X=-dSafeX1, C=dSafeC1})
if bXhome then
@@ -2543,7 +2764,7 @@ function EmitZmax( bReset, bEnd, bXhome, PrevR1, PrevR2, bSplitCut, bUsePrevDelt
EmitMoveDataHead( 1, MovH)
EmitMoveDataHead( 1, { Z=dSafeZ1, B=dSafeB1})
if EMT.SB > 650 and abs( EMT.R3) < 0.1 then
EmitMoveDataHead( 1, { Z=ParkCSawZ1, B=ParkB1})
EmitMoveDataHead( 1, { Z=ParkCSawZ1})
end
EmitMoveDataHead( 1, { X=-dSafeX1, C=dSafeC1})
if bXhome then
@@ -2596,7 +2817,7 @@ function EmitZmax( bReset, bEnd, bXhome, PrevR1, PrevR2, bSplitCut, bUsePrevDelt
EmitMoveDataHead( 2, MovH)
EmitMoveDataHead( 2, { Z=dSafeZ2, B=dSafeB2})
if EMT.SB > 650 and abs( EMT.R3) < 0.1 then
EmitMoveDataHead( 2, { Z=ParkCSawZ2, B=ParkB2})
EmitMoveDataHead( 2, { Z=ParkCSawZ2})
end
EmitMoveDataHead( 2, { X=-dSafeX2, C=dSafeC2})
if bXhome then
@@ -2668,7 +2889,10 @@ end
---------------------------------------------------------------------
function EmitResetMachining()
if ( EMT.TOOL ~= GetNextTool( EMT.MCHID) and IsLastPath( EMT.PATHID)) or GetSpecUnloading( EMT.PATHID) or GetFall( EMT.PATHID) then
EmtOutput( 'M05')
-- se da MLDE parametro non settato, o settato a true, scrivo il comando arresto mandrino
if WriteM05Command == nil or WriteM05Command then
EmtOutput( 'M05')
end
end
local sOut = 'G157 EA1'
EmtOutput( sOut)
@@ -2695,10 +2919,14 @@ function EmitParkRoller( dPosT, bSplitCut, bUsePrevDelta)
if bSplitCut then
if DiffY1 > 0.1 then
MDChar.Y1 = dPosY1 + DiffY1
else
MDChar.Y1 = dPosY1
end
if DiffY2 < -0.1 then
MDChar.Y2 = dPosY2 + DiffY2
dPosT = dPosT + DiffY2
else
MDChar.Y2 = dPosY2
end
elseif DiffY1 > 0.1 and DiffY2 < -0.1 then
EmtSetLastError( 1201, 'Error Collision in ParkRoller')
@@ -2762,28 +2990,6 @@ function EmitParkRoller( dPosT, bSplitCut, bUsePrevDelta)
EMT.TPOS = dPosT
end
---------------------------------------------------------------------
function GetNextTool( nMchId)
-- inizializzo prossimo utensile
local sNextTool
-- recupero lavorazione successiva
local nNextMchId = EgtGetNextActiveOperation( nMchId)
while nNextMchId do
if EgtGetOperationType( nNextMchId) ~= MCH_OY.DISP then
break
end
nNextMchId = EgtGetNextActiveOperation( nNextMchId)
end
-- se trovata
if nNextMchId and EgtSetCurrMachining( nNextMchId) then
sNextTool = EgtGetMachiningParam( MCH_MP.TOOL)
end
-- ripristino stato corrente
EgtSetCurrMachining( EMT.MCHID)
EgtTdbSetCurrTool( EMT.TOOL)
return sNextTool
end
---------------------------------------------------------------------
function PreselectNextDiffHead( nMchId, sHead)
-- se non ho due teste, esco subito
@@ -2822,11 +3028,11 @@ function PreselectNextDiffHead( nMchId, sHead)
local sNextTcPos = EgtTdbGetCurrToolParam( MCH_TP.TCPOS)
-- se testa attuale da caricare è sega a catena, mando l'altra prima in HomeX (per evitare possibili collisioni) e poi lancio preselezione
if sHead == 'H13' and EMT.PREVHEAD ~= 'H13' then
EmitMoveDataHead( 2, { X=-ParkX2, Z=MaxZ2, B=ParkB2, C=ParkC2, TPos='0'})
EmitMoveDataHead( 2, { X=-ParkX2, Z=MaxZ2, B=ParkB2, C=ParkC2, TPos=AdjustTcPos( false, EMT.PREVTCPOS_H2)})
EmitMoveStartHead( 2)
EmitMoveWaitHead( 2)
elseif sHead == 'H23' and EMT.PREVHEAD ~= 'H23' then
EmitMoveDataHead( 1, { X=-ParkX1, Z=MaxZ1, B=ParkB1, C=ParkC1, TPos='0'})
EmitMoveDataHead( 1, { X=-ParkX1, Z=MaxZ1, B=ParkB1, C=ParkC1, TPos=AdjustTcPos( false, EMT.PREVTCPOS_H1)})
EmitMoveStartHead( 1)
EmitMoveWaitHead( 1)
end
@@ -2859,15 +3065,16 @@ function PreselectNextDiffHead( nMchId, sHead)
-- mi assicuro che l'altra testa sia in parcheggio
if nHSet == 1 then
-- non può essere la sega a catena
EmitMoveDataHead( 2, { X=-ParkX2, Z=MaxZ2, B=ParkB2, C=ParkC2, TPos='0'})
EmitMoveStartHead( 2)
if EMT.PREVHEAD == 'H23' and EMT.PREVHEAD ~= EMT.HEAD then
EmitMoveWaitHead( 2)
if EMT.PREVHEAD_H2 ~= 'H23' then
EmitMoveDataHead( 2, { X=-ParkX2, Z=MaxZ2, B=ParkB2, C=ParkC2, TPos=AdjustTcPos( false, EMT.PREVTCPOS_H2)})
EmitMoveStartHead( 2)
end
else
-- va bene per frese e lama
EmitMoveDataHead( 1, { X=-ParkX1, Z=MaxZ1, B=ParkB1, C=ParkC1, TPos='0'})
EmitMoveStartHead( 1)
-- non può essere la sega a catena
if EMT.PREVHEAD_H1 ~= 'H13' and EMT.PREVHEAD_H1 ~= 'H15' then
EmitMoveDataHead( 1, { X=-ParkX1, Z=MaxZ1, B=ParkB1, C=ParkC1, TPos=AdjustTcPos( false, EMT.PREVTCPOS_H1)})
EmitMoveStartHead( 1)
end
end
end
end
+151 -48
View File
@@ -152,7 +152,7 @@ function OnSimulStart()
local nId = EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( nGrpId, McdData[i].Sub), McdData[i].Name)
if nId then
table.insert( EMT.MCODET, nId)
EgtOutLog( 'Element ' .. McdData[i].Grp .. '/' .. McdData[i].Sub .. '/' .. McdData[i].Name .. ' is ok', 4)
EgtOutLog( 'Element ' .. McdData[i].Grp .. '/' .. McdData[i].Sub .. '/' .. McdData[i].Name .. ' (' .. tostring( nId) .. ') is ok', 4)
else
nMcdNullCnt = nMcdNullCnt + 1
EgtOutLog( 'Element ' .. McdData[i].Grp .. '/' .. McdData[i].Sub .. '/' .. McdData[i].Name .. ' is null', 4)
@@ -359,7 +359,6 @@ function OnSimulDispositionStart()
if EMT.VMILL and #EMT.VMILL > 0 then
EgtSetStatus( EMT.SCRAP or GDB_ID.NULL, GDB_ST.OFF)
end
-- se altrimenti fasi intermedia o finale speciali, aggancio primo grezzo alla tavola e gli altri in posizione pre-carico
elseif IsMid2Phase( EMT.PHASE) or IsEnd2Phase( EMT.PHASE) then
-- se cambiata giacitura, lo segnalo
@@ -454,6 +453,21 @@ function OnSimulDispositionEnd()
EMT.FALL = false
EMT.TO_FALL = false
end
-- se disposizione intermedia
if IsMidPhase( EMT.PHASE) or IsEnd2Phase( EMT.PHASE) then
-- se le rotazioni delle fasi corrente e precedente sono diverse
if GetPhaseRot( EMT.PHASE) ~= GetPhaseRot( EMT.PHASE - 1) then
-- imposto stato post-rotazione
EMT.POSTROT = true
end
-- se altrimenti disposizione intermedia speciale con eventuale rotazione
elseif IsMid2Phase( EMT.PHASE) then
-- se le rotazioni delle fasi corrente e precedente sono diverse
if GetPhaseRot( EMT.PHASE) ~= GetPhaseRot( EMT.PHASE - 1) then
-- imposto stato post-rotazione
EMT.POSTROT = true
end
end
EMT.SPLIT = false
EMT.SPECSPLIT = false
EMT.TO_SPECSPLIT = false
@@ -494,6 +508,8 @@ function OnSimulToolSelect( dPosA)
EgtSetAxisPos( 'C1', MyParkCSawC1)
EgtSetAxisPos( 'B1', ParkCSawB1)
EgtSetAxisPos( 'X1', ParkCSawX1)
-- l'utensile viene caricato qui, quindi setto come già cambiato
EMT.PREVHEAD_H1 = EMT.HEAD
else
-- imposto home dell'asse C2 (A=0 -> T111, A=-90 -> T112)
local MyParkCSawC2 = GetChainSawCHomeFromVirtualAxis( dPosA)
@@ -501,6 +517,8 @@ function OnSimulToolSelect( dPosA)
EgtSetAxisPos( 'C2', MyParkCSawC2)
EgtSetAxisPos( 'B2', ParkCSawB2)
EgtSetAxisPos( 'X2', ParkCSawX2)
-- l'utensile viene caricato qui, quindi setto come già cambiato
EMT.PREVHEAD_H2 = EMT.HEAD
end
-- Imposto visualizzazione
EgtSetMode( EgtGetHeadId( EMT.HEAD) or GDB_ID.NULL, GDB_MD.STD)
@@ -638,10 +656,10 @@ function OnSimulToolDeselect( dPrevA)
-- se devo scaricare un utensile normale
else
local nSetHead = GetHeadSet( EMT.HEAD)
if nSetHead == 1 then
if nSetHead == 1 and EMT.PREVHEAD_H1 then
local MyParkX1 = EgtIf( GetHeadTCSet( EMT.HEAD, EMT.TCPOS) == 'Head1_TC1', ParkX1, ParkFrnX1)
SimulMoveAxis( 'X1', MyParkX1, MCH_SIM_STEP.RAPID)
else
elseif EMT.PREVHEAD_H2 then
SimulMoveAxis( 'X2', ParkX2, MCH_SIM_STEP.RAPID)
end
end
@@ -727,17 +745,6 @@ function OnSimulMachiningStart()
end
-- salvo dati utensile
local nSetHead = GetHeadSet( EMT.HEAD)
-- per gruppo testa 1
if nSetHead == 1 then
EMT.PREVTOOL_H1 = EMT.TOOL
EMT.PREVHEAD_H1 = EMT.HEAD
EMT.PREVTCPOS_H1 = EMT.TCPOS
-- per gruppo testa 2
elseif nSetHead == 2 then
EMT.PREVTOOL_H2 = EMT.TOOL
EMT.PREVHEAD_H2 = EMT.HEAD
EMT.PREVTCPOS_H2 = EMT.TCPOS
end
-- recupero alcuni dati della lavorazione
EMT.MCHNAME = EgtGetOperationName( EMT.MCHID)
EMT.MCHTYPE = EgtGetMachiningParam( MCH_MP.TYPE)
@@ -813,6 +820,23 @@ function OnSimulMachiningEnd()
if EMT.DOU_TYPE and not EMT.ZMAX then EMT.DOU_TO_ZMAX = true end
EMT.DOU_TYPE = nil
EMT.DOU_TOOL = nil
-- salvo dati utensile
local nSetHead = GetHeadSet( EMT.HEAD)
-- se non ho già tolto la sega a catena, aggiorno valori
if not EMT.CHSAW_OUT then
-- per gruppo testa 1
if nSetHead == 1 then
EMT.PREVTOOL_H1 = EMT.TOOL
EMT.PREVHEAD_H1 = EMT.HEAD
EMT.PREVTCPOS_H1 = EMT.TCPOS
-- per gruppo testa 2
elseif nSetHead == 2 then
EMT.PREVTOOL_H2 = EMT.TOOL
EMT.PREVHEAD_H2 = EMT.HEAD
EMT.PREVTCPOS_H2 = EMT.TCPOS
end
end
end
---------------------------------------------------------------------
@@ -911,7 +935,8 @@ function OnSimulMoveStart()
local bParkV = false
if EMT.MCHFIRST then
-- se rulli più chiusi del richiesto o cambio direzione utensile (tranne solo asse B con C0 o equivalenti) devo mettere i rulli in parcheggio
if V1Pos < EMT.V1NEXTPOS - 1 or V2Pos > EMT.V2NEXTPOS + 1 or RollerParkingNeeded( EMT.HEAD, EMT.R1p, EMT.R2p, EMT.R1, EMT.R2) then
if V1Pos < EMT.V1NEXTPOS - 1 or V2Pos > EMT.V2NEXTPOS + 1 or RollerParkingNeeded( EMT.HEAD, EMT.R1p, EMT.R2p, EMT.R1, EMT.R2) or
( EMT.TOOL ~= EMT.PREVTOOL_H1 and EMT.TOOL ~= EMT.PREVTOOL_H2) then
bParkV = true
EMT.A3 = ParkV1
EMT.A4 = ParkV2
@@ -940,6 +965,12 @@ function OnSimulMoveStart()
end
-- se movimento in rapido ad inizio lavorazione
if EMT.MOVE == 0 and EMT.MOVEIND <= 3 then
-- gestione speciale per pezzi molto alti. Se il movimento successivo è più alto del precedente, allora prendo il successivo
if EMT.L3s then
if EMT.L3s > EMT.L3 then
EMT.L3 = EMT.L3s
end
end
-- Dati
local B1Pos = EgtGetAxisPos( 'B1')
local B1Home = EgtGetAxisHomePos( 'B1')
@@ -954,20 +985,35 @@ function OnSimulMoveStart()
-- se movimento iniziale da Zmax con lama o fresa
if EMT.ZMAX or EMT.FLAG == 1 or ( EMT.FLAG == 2 and EMT.FLAG2 == 1) then
--EgtOutBox( 'Flag 2,1', 'Info Rapid')
local dXref = EMT.L2
if EMT.HEAD == 'H12' and -EMT.L2 < -LimX1PlRotSaw then
dXref = LimX1PlRotSaw
end
SimulMoveAxis( 'X1', dXref, MCH_SIM_STEP.RAPID)
local bMoveZbeforeX = false
local dZref = EMT.L3
if EMT.HEAD == 'H12' and ( EgtIf( not EgtGetHeadId( 'H21') or BD.RIGHT_LOAD, -EMT.L2 < -LimX1RotSaw, -EMT.L2 > -LimX1RotSaw) or EMT.R2 < -91) then
dZref = Z1Home + GetZExtra( EMT.HEAD, EMT.R2) - 100
end
-- se la quota di lavoro è più in alta della posizione a ZHOME della testa, prima si va alla Z di lavoro e poi si approccia il pezzo
if EMT.L3 > dZref then
bMoveZbeforeX = true
end
local dXref = EMT.L2
if EMT.HEAD == 'H12' and -EMT.L2 < -LimX1PlRotSaw then
dXref = LimX1PlRotSaw
SimulMoveAxis( 'X1', dXref, MCH_SIM_STEP.RAPID)
elseif not bMoveZbeforeX then
SimulMoveAxis( 'X1', dXref, MCH_SIM_STEP.RAPID)
else
SimulMoveAxis( 'X1', LimX1RotSaw, MCH_SIM_STEP.RAPID)
end
-- caso speciale per trave alta con rotazione lama pericolosa (tolto "and EMT.SB > 379")
if EMT.HEAD == 'H12' and abs( C1Pos - EMT.R1) > 1 and ( abs( C1Home - EMT.R1) > 30.1 or abs(B1Home - EMT.R2) > 30.1) then
SimulMoveAxis( 'B1', 0, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'C1', EMT.R1, MCH_SIM_STEP.COLLROT)
SimulMoveAxes( 'Z1', dZref, MCH_SIM_STEP.RAPID, 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
if bMoveZbeforeX then
SimulMoveAxis( 'Z1', EMT.L3, MCH_SIM_STEP.RAPID)
end
-- caso standard
else
SimulMoveAxis( 'Z1', dZref, MCH_SIM_STEP.RAPID)
@@ -1011,16 +1057,27 @@ function OnSimulMoveStart()
if EMT.HEAD == 'H11' or EMT.HEAD == 'H12' then
if EMT.ZMAX or EMT.FLAG == 1 or ( EMT.FLAG == 2 and EMT.FLAG2 == 1) then
--EgtOutBox( 'Flag 2,1', 'Info Rapid')
SimulMoveAxis( 'X1', EMT.L2, MCH_SIM_STEP.RAPID)
local bMoveZbeforeX = false
local dZref = EMT.L3
if EMT.HEAD == 'H12' and ( -EMT.L2 < -LimX1RotSaw or EMT.R2 > 91) then
dZref = Z1Home + GetZExtra( EMT.HEAD, EMT.R2) - 100
end
-- se la quota di lavoro è più in alta della posizione a ZHOME della testa, prima si va alla Z di lavoro e poi si approccia il pezzo
if EMT.L3 > dZref then
bMoveZbeforeX = true
end
if not bMoveZbeforeX then
SimulMoveAxis( 'X1', EMT.L2, MCH_SIM_STEP.RAPID)
end
-- caso speciale per trave alta con rotazione lama pericolosa (tolto "and EMT.SB > 400")
if EMT.HEAD == 'H12' and abs( C1Pos - EMT.R1) > 1 and ( abs( C1Home - EMT.R1) > 30.1 or abs(B1Home - EMT.R2) > 30.1) then
SimulMoveAxis( 'B1', 0, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'C1', EMT.R1, MCH_SIM_STEP.COLLROT)
SimulMoveAxes( 'Z1', dZref, MCH_SIM_STEP.RAPID, 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
if bMoveZbeforeX then
SimulMoveAxis( 'Z1', EMT.L3, MCH_SIM_STEP.RAPID)
end
-- caso standard
else
SimulMoveAxis( 'Z1', dZref, MCH_SIM_STEP.RAPID)
@@ -1070,16 +1127,26 @@ function OnSimulMoveStart()
-- se movimento iniziale da Zmax con lama o fresa
if EMT.ZMAX or EMT.FLAG == 1 or ( EMT.FLAG == 2 and EMT.FLAG2 == 1) then
--EgtOutBox( 'Flag 2,1', 'Info Rapid')
SimulMoveAxis( 'X2', EMT.L2, MCH_SIM_STEP.RAPID)
local bMoveZbeforeX = false
local dZref = EMT.L3
if EMT.HEAD == 'H22' and ( EgtIf( BD.RIGHT_LOAD, EMT.L2 < -LimX2RotSaw, EMT.L2 > -LimX2RotSaw) or EMT.R2 > 91) then
dZref = Z2Home + GetZExtra( EMT.HEAD, EMT.R2) - 100
end
-- se la quota di lavoro è più in alta della posizione a ZHOME della testa, prima si va alla Z di lavoro e poi si approccia il pezzo
if EMT.L3 > dZref then
bMoveZbeforeX = true
end
if not bMoveZbeforeX then
SimulMoveAxis( 'X2', EMT.L2, MCH_SIM_STEP.RAPID)
end
-- caso speciale per trave alta con rotazione lama pericolosa (tolto "and EMT.SB > 379")
if EMT.HEAD == 'H22' and abs( C2Pos - EMT.R1) > 1 and ( abs( C2Home - EMT.R1) > 30.1 or abs(B2Home - EMT.R2) > 30.1) then
SimulMoveAxis( 'B2', 0, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'C2', EMT.R1, MCH_SIM_STEP.COLLROT)
SimulMoveAxes( 'Z2', dZref, MCH_SIM_STEP.RAPID, 'B2', EMT.R2, MCH_SIM_STEP.COLLROT)
if bMoveZbeforeX then
SimulMoveAxis( 'Z2', EMT.L3, MCH_SIM_STEP.RAPID)
end
-- caso standard
else
SimulMoveAxis( 'Z2', dZref, MCH_SIM_STEP.RAPID)
@@ -1089,6 +1156,23 @@ function OnSimulMoveStart()
end
-- altrimenti sega a catena
else
-- se anche precedente con sega a catena ma depositata, devo riprenderla
if EMT.CHSAW_OUT then
local dPosA = GetCurrChainSawingVirtualAxis()
EgtSetMode( EgtGetHeadId( EMT.HEAD), GDB_MD.HIDDEN)
OnSimulToolDeselect()
EgtLoadTool( EMT.HEAD, 1, EMT.TOOL)
ShowToolInTcPos( EMT.TCPOS, false)
OnSimulToolSelect( dPosA)
-- recupero i dati dato che ho scaricato motosega e preso quelli dell'utensile di default
EmtModifyAxisHome( 'Z2', GetChainSawZHomeFromVirtualAxis( dPosA))
EmtModifyAxisHome( 'C2', GetChainSawCHomeFromVirtualAxis( dPosA))
EmtModifyAxisHome( 'B2', ParkCSawB2)
B2Home = EgtGetAxisHomePos( 'B2')
C2Home = EgtGetAxisHomePos( 'C2')
Z2Home = EgtGetAxisHomePos( 'Z2')
EMT.CHSAW_OUT = nil
end
-- se motosega configurata per lavorazioni di fianco o circa orizzontale
if dPosA == 0 or abs( EMT.R2) < 10 then
SimulMoveAxes( 'X2', EMT.L2, MCH_SIM_STEP.RAPID, 'C2', EMT.R1, MCH_SIM_STEP.COLLROT)
@@ -1221,7 +1305,8 @@ function OnSimulMoveEnd()
-- se Split o Presplit lascio agganciata solo la pinza Y2 alla fine dei movimenti
local sNextTool = GetNextTool( EMT.MCHID)
-- vado in home se è ultimo movimento ed è ultima lavorazione, se sono con motosega e devo cambiare utensile, oppure se ho la lama
local bToXhome = ( IsLastPath( EMT.PATHID) and not sNextTool) or ( EMT.HEAD == 'H23' and EMT.TOOL ~= sNextTool) or ( EMT.HEAD == 'H13' and EMT.TOOL ~= sNextTool) or EMT.HEAD == 'H12' or EMT.HEAD == 'H22'
local bToXhome = ( IsLastPath( EMT.PATHID) and not sNextTool) or ( EMT.HEAD == 'H23' and EMT.TOOL ~= sNextTool) or ( EMT.HEAD == 'H13' and EMT.TOOL ~= sNextTool) or
( EMT.HEAD == 'H12' and EMT.TOOL ~= sNextTool ) or ( EMT.HEAD == 'H22' and EMT.TOOL ~= sNextTool) or EMT.MCHSPLIT
-- eseguo
ExecMoveZmax( EMT.MCHSPLIT, bToXhome)
EMT.TO_ZMAX = nil
@@ -1531,7 +1616,7 @@ function ExecMoveZmax( bMchSplit, btoXHome)
else
SimulMoveAxes( 'Z1', HomeZ, MCH_SIM_STEP.RAPID, 'B1', HomeB, MCH_SIM_STEP.COLLROT)
if EMT.SB > 650 and abs( EMT.R3) < 0.1 then
SimulMoveAxes( 'Z1', ParkCSawZ1, MCH_SIM_STEP.RAPID, 'B1', ParkB1, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'Z1', ParkCSawZ1, MCH_SIM_STEP.RAPID)
end
SimulMoveAxes( 'X1', HomeX, MCH_SIM_STEP.RAPID, 'C1', HomeC, MCH_SIM_STEP.COLLROT)
end
@@ -1555,7 +1640,15 @@ function ExecMoveZmax( bMchSplit, btoXHome)
else
SimulMoveAxes( 'Z1', HomeZ, MCH_SIM_STEP.RAPID, 'B1', HomeB, MCH_SIM_STEP.COLLROT)
if EMT.SB > 650 and abs( EMT.R3) < 0.1 then
SimulMoveAxes( 'Z1', ParkCSawZ1, MCH_SIM_STEP.RAPID, 'B1', ParkB1, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'Z1', ParkCSawZ1, MCH_SIM_STEP.RAPID)
end
if btoXHome then
EgtUnloadTool( EMT.HEAD, 1)
ShowToolInTcPos( EMT.TCPOS, true)
EMT.PREVTOOL_H1 = nil
EMT.PREVHEAD_H1 = nil
EMT.PREVTCPOS_H1 = nil
EMT.CHSAW_OUT = true
end
SimulMoveAxes( 'X1', HomeX, MCH_SIM_STEP.RAPID, 'C1', HomeC, MCH_SIM_STEP.COLLROT)
end
@@ -1582,9 +1675,9 @@ function ExecMoveZmax( bMchSplit, btoXHome)
else
SimulMoveAxes( 'Z2', HomeZ, MCH_SIM_STEP.RAPID, 'B2', HomeB, MCH_SIM_STEP.COLLROT)
if EMT.SB > 650 and abs( EMT.R3) < 0.1 then
SimulMoveAxes( 'Z2', ParkCSawZ2, MCH_SIM_STEP.RAPID, 'B2', ParkB2, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'Z2', ParkCSawZ2, MCH_SIM_STEP.RAPID)
end
SimulMoveAxes( 'X2', HomeX, MCH_SIM_STEP.RAPID, 'C2', HomeC, MCH_SIM_STEP.COLLROT)
SimulMoveAxes( 'X2', HomeX, MCH_SIM_STEP.RAPID, 'C2', HomeC, MCH_SIM_STEP.COLLROT)
end
end
EMT.ZMAX = true
@@ -1619,10 +1712,14 @@ function ExecUnloading()
EgtMove( nLayId, vtMove, GDB_RT.GLOB)
EgtSetLevel( vMillId, GDB_LV.USER)
-- aggiungo gli spigoli
local nFirstId, nCount = EgtVolZmapGetEdges( vMillId, nLayId)
if nFirstId then
for nId = nFirstId, nFirstId + nCount - 1 do
EgtSetColor( nId, Color3d( 96, 96, 96))
if EgtVolZmapSetShowEdges then
EgtVolZmapSetShowEdges( vMillId, true)
else
local nFirstId, nCount = EgtVolZmapGetEdges( vMillId, nLayId)
if nFirstId then
for nId = nFirstId, nFirstId + nCount - 1 do
EgtSetColor( nId, Color3d( 96, 96, 96))
end
end
end
-- rilascio Vmill
@@ -2119,18 +2216,19 @@ end
---------------------------------------------------------------------
-- *** ESTIMATION T&L ***
---------------------------------------------------------------------
local RAPID_X_FEED = 70000 -- mm/min
local RAPID_Y_FEED = 100000 -- mm/min
local RAPID_Z_FEED = 32000 -- mm/min
local RAPID_C_FEED = 15000 -- deg/min
local RAPID_B_FEED = 15000 -- deg/min
local RAPID_MIN_T = 0.1 -- s
local LOAD_T = 2 -- s
local CHAR_ONE_MOVE_T = 1 -- s
local ROTATION_T = 40 -- s
local SPLIT_T = 6 -- s
local UNLOAD_T = 4 -- s
local FALL_T = 2 -- s
local ESTIMATION_RAPID_COEFF = EstimationRapidMultiplier or 1
local RAPID_X_FEED = 70000 / ESTIMATION_RAPID_COEFF -- mm/min
local RAPID_Y_FEED = 100000 / ESTIMATION_RAPID_COEFF -- mm/min
local RAPID_Z_FEED = 32000 / ESTIMATION_RAPID_COEFF -- mm/min
local RAPID_C_FEED = 15000 / ESTIMATION_RAPID_COEFF -- deg/min
local RAPID_B_FEED = 15000 / ESTIMATION_RAPID_COEFF -- deg/min
local RAPID_MIN_T = 0.1 * ESTIMATION_RAPID_COEFF -- s
local LOAD_T = 2 * ESTIMATION_RAPID_COEFF -- s
local CHAR_ONE_MOVE_T = 1 * ESTIMATION_RAPID_COEFF -- s
local ROTATION_T = 40 * ESTIMATION_RAPID_COEFF -- s
local SPLIT_T = 6 * ESTIMATION_RAPID_COEFF -- s
local UNLOAD_T = 4 * ESTIMATION_RAPID_COEFF -- s
local FALL_T = 2 * ESTIMATION_RAPID_COEFF -- s
---------------------------------------------------------------------
function OnEstimStart()
@@ -2196,9 +2294,9 @@ function OnEstimDispositionEnd()
-- Se disposizione inizio o rimanenza
if IsStartOrRestPhase( EMT.PHASE) then
;
-- se altrimenti disposizione intermedia, eventuale rotazione
elseif IsMidPhase( EMT.PHASE) then
-- recupero le rotazioni delle fasi corrente e precedente
-- se altrimenti disposizione intermedia o finale dopo separazione e rotazione, eventuale rotazione
elseif IsMidPhase( EMT.PHASE) or IsMid2Phase( EMT.PHASE) or IsEnd2Phase( EMT.PHASE) then
-- recupero le rotazioni delle fasi corrente e precedente
local nRot = GetPhaseRot( EMT.PHASE)
local nPrevRot = GetPhaseRot( EMT.PHASE - 1)
-- verifico se sono diverse
@@ -2654,7 +2752,12 @@ function GetNextTool( nMchId)
-- recupero lavorazione successiva
local nNextMchId = EgtGetNextActiveOperation( nMchId)
while nNextMchId do
if EgtGetOperationType( nNextMchId) ~= MCH_OY.DISP then
-- se la prossima lavorazione è lo start di un altro pezzo, faccio finta che cambia utensile in modo che vada in parcheggio con utensili speciali
if EgtGetOperationType( nNextMchId) == MCH_OY.DISP then
if IsStartOrRestPhase( EMT.PHASE+1) then
return nil
end
else
break
end
nNextMchId = EgtGetNextActiveOperation( nNextMchId)
+41 -29
View File
@@ -824,6 +824,13 @@ end
---------------------------------------------------------------------
function SpecApplyPath( bPreSplit, bSplitting, bPreCut, bCutting, bUnload, bPreRotMch)
-- mi salvo info lavorazione su una lista
local AuxInfoMach = {}
AuxInfoMach.bPreSplit = bPreSplit
AuxInfoMach.bSplitting = bSplitting
AuxInfoMach.bPreCut = bPreCut
AuxInfoMach.bCutting = bCutting
AuxInfoMach.bUnload = bUnload
-- Assegno flag di pezzo separato dal resto del grezzo
SPLIT = IsEndPhase( EMC.PHASE) or IsMid2Phase( EMC.PHASE) or IsEnd2Phase( EMC.PHASE)
@@ -921,7 +928,7 @@ function SpecApplyPath( bPreSplit, bSplitting, bPreCut, bCutting, bUnload, bPreR
local dPosT = LoadT
if IsFirstMachiningAfterRotation( EMC.MCHID) then dPosT = dPosT + TurnerOffs end
local vCmd = SpecCalcLoad( dPosT, dDistFront, max( dDistBack, MinJoin + EgtIf( SPLIT, EMC.TCING, 0), EMC.LB - ( MaxY1 - MinY1) + 6))
local vCmd2 = SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1DeltaMaxSP, dY2DeltaMinUL, nChar)
local vCmd2 = SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1DeltaMaxSP, dY2DeltaMinUL, nChar, AuxInfoMach)
if bSplitting and EMC.ERR == 18 then
table.insert( vCmd, { 22, dRollBack, -dRollFront})
end
@@ -934,7 +941,7 @@ function SpecApplyPath( bPreSplit, bSplitting, bPreCut, bCutting, bUnload, bPreR
-- Se altrimenti carri entrambi diponibili, eseguo calcoli per carrelli
elseif not IsEndPhase( EMC.PHASE) then
local vCmd = SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1DeltaMaxSP, dY2DeltaMinUL, nChar)
local vCmd = SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1DeltaMaxSP, dY2DeltaMinUL, nChar, AuxInfoMach)
-- Se non ci sono spostamenti, confermo i parametri di aggancio e di posizione roller
if SpecTestOnlyRemarkInCmds( vCmd) then
table.insert( vCmd, { 21, EgtIf( EMC.Y1DELTA, EMC.Y1DELTA, 0), EgtIf( EMC.Y2DELTA, EMC.Y2DELTA, 0)})
@@ -1116,8 +1123,12 @@ function SpecialCalcMachiningEncumbrance( nMchId, bPreCut)
end
b3Enc = EgtGetBBoxGlob( EgtGetAxisId( 'C2'), GDB_BB.ONLY_VISIBLE)
end
local dRollFront = max( b3Enc:getMax():getX(), MIN_FRONT_ENG_V) + SIC_V
local dRollBack = max( -b3Enc:getMin():getX(), MIN_BACK_ENG_V) + SIC_V
-- Forzo la distanza di sicurezza da utensile
local nSecRollerDist = EgtGetValInNotes( EgtTdbGetCurrToolParam( MCH_TP.USERNOTES), 'SECDIST', 'i') or SIC_V
local dRollFront = max( b3Enc:getMax():getX(), MIN_FRONT_ENG_V) + nSecRollerDist
local dRollBack = max( -b3Enc:getMin():getX(), MIN_BACK_ENG_V) + nSecRollerDist
EgtOutLog( ' RollFront = ' .. EgtNumToString( dRollFront, 1) .. ' RollBack = ' .. EgtNumToString( dRollBack, 1), 3)
-- Calcolo della posizione della Punta Utensile rispetto allo Zero Macchina
local ptTip
@@ -1258,7 +1269,7 @@ function SpecCalcLoad( dPosT, dDistFront, dDistBack)
end -- SpecAdjustLoad [L]
---------------------------------------------------------------------
function SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1DeltaMaxSP, dY2DeltaMinUL, nChar)
function SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1DeltaMaxSP, dY2DeltaMinUL, nChar, AuxInfoMach)
local MinFrontJoin = MinJoin + EMC.HCING + EMC.HOVM
local MyMinOther = MinOther + EgtIf( EMC.CNT == 1, AggLoad, 0)
@@ -1297,13 +1308,11 @@ function SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1Del
WorkTab.dV2PosF = -dRollFront
WorkTab.bV2CloseF = false
-- aggiuntivo per non avere problemi con pezzi a caduta
if WorkTab.dY1DeltaMaxF - WorkTab.dY1DeltaMinF > 5 * BD.CHAR_EXTRA_DIST then
WorkTab.dY1DeltaMinF = WorkTab.dY1DeltaMinF + 4 * BD.CHAR_EXTRA_DIST
elseif WorkTab.dY1DeltaMaxF - WorkTab.dY1DeltaMinF > 2.5 * BD.CHAR_EXTRA_DIST then
WorkTab.dY1DeltaMinF = WorkTab.dY1DeltaMinF + 2 * BD.CHAR_EXTRA_DIST
elseif WorkTab.dY1DeltaMaxF - WorkTab.dY1DeltaMinF > 1.5 * BD.CHAR_EXTRA_DIST then
WorkTab.dY1DeltaMinF = WorkTab.dY1DeltaMinF + BD.CHAR_EXTRA_DIST
-- dopo che si è calcolato il minimo e massimo dell'intervallo, verifico che in testa rimanga almeno il minimo per poter fare passaggio pinze e scaricare
if AuxInfoMach and ( AuxInfoMach.bSplitting or AuxInfoMach.bCutting) then
if WorkTab.dY1DeltaMaxF - WorkTab.dY1DeltaMinF > 1.5 * BD.CHAR_EXTRA_DIST and WorkTab.dY1DeltaMaxF > EMC.LT + BD.MINRAW_S + BD.CHAR_EXTRA_DIST then
WorkTab.dY1DeltaMinF = max( min( EMC.LT + BD.MINRAW_S, WorkTab.dY1DeltaMaxF - 1), WorkTab.dY1DeltaMinF)
end
end
-- verifico validità intervallo ammesso per Y1
@@ -1342,13 +1351,11 @@ function SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1Del
WorkTab.dV2PosF = -dRollFront
WorkTab.bV2CloseF = false
-- aggiuntivo per minimizzare scambi carrelli
if WorkTab.dY1DeltaMaxF - WorkTab.dY1DeltaMinF > 5 * BD.CHAR_EXTRA_DIST then
WorkTab.dY1DeltaMinF = WorkTab.dY1DeltaMinF + 4 * BD.CHAR_EXTRA_DIST
elseif WorkTab.dY1DeltaMaxF - WorkTab.dY1DeltaMinF > 2.5 * BD.CHAR_EXTRA_DIST then
WorkTab.dY1DeltaMinF = WorkTab.dY1DeltaMinF + 2 * BD.CHAR_EXTRA_DIST
elseif WorkTab.dY1DeltaMaxF - WorkTab.dY1DeltaMinF > 1.5 * BD.CHAR_EXTRA_DIST then
WorkTab.dY1DeltaMinF = WorkTab.dY1DeltaMinF + BD.CHAR_EXTRA_DIST
-- dopo che si è calcolato il minimo e massimo dell'intervallo, verifico che in testa rimanga almeno il minimo per poter fare passaggio pinze e scaricare
if AuxInfoMach and ( AuxInfoMach.bSplitting or AuxInfoMach.bCutting) then
if WorkTab.dY1DeltaMaxF - WorkTab.dY1DeltaMinF > 1.5 * BD.CHAR_EXTRA_DIST and WorkTab.dY1DeltaMaxF > EMC.LT + BD.MINRAW_S + BD.CHAR_EXTRA_DIST then
WorkTab.dY1DeltaMinF = max( min( EMC.LT + BD.MINRAW_S, WorkTab.dY1DeltaMaxF - 1), WorkTab.dY1DeltaMinF)
end
end
-- verifico validità intervallo ammesso per Y1
@@ -1652,19 +1659,24 @@ function SpecAdjustCarriages( WorkTab)
local bCloseV = false
if WorkTab.dY1DeltaI then
if WorkTab.dY1DeltaI <= MinJoin + WorkTab.dV1PosI - WorkTab.dV2PosI + 2 * AGG_V + EMC.HCING + EMC.HOVM + EgtIf( EMC.CNT == 1, AggLoad, 0) then
bCloseV = true
bCloseV = true
end
end
if WorkTab.dY2DeltaI then
if EMC.LB - WorkTab.dY2DeltaI <= MinJoin + WorkTab.dV1PosI - WorkTab.dV2PosI + 2 * AGG_V + EgtIf( SPLIT, EMC.TCING, 0) + EgtIf( EMC.CNT == 1, AggLoad, 0) then
bCloseV = true
bCloseV = true
end
end
if WorkTab.dY2DeltaMinF then
if EMC.LB - WorkTab.dY2DeltaMinF <= MinJoin + WorkTab.dV1PosI - WorkTab.dV2PosI + 2 * AGG_V + EgtIf( SPLIT, EMC.TCING, 0) + EgtIf( EMC.CNT == 1, AggLoad, 0) then
bCloseV = true
bCloseV = true
end
end
-- se i pezzi del cliente sono molto storti, si forza la chiusura per evitare che vada a sbattere. Se parametro non presente, si chiude solo se necessario
if ForceToCloseRollersGate then
bCloseV = true
end
WorkTab.bCloseV = bCloseV
EgtOutLog( ' Tool : '..( EgtIf( bChangedTool, 'CHANGED', 'same')).. ' CloseV : '..( EgtIf( bCloseV, 'TRUE', 'false')), 1)
@@ -1820,7 +1832,7 @@ local function MaxDispl( TabI, vCmd, sType)
-- allontano (Y1+T) e (Y2)
dY1a = MaxY1
dY2a = MinY2
dTa = ( MaxY1 - TabI.dY1PosI) + dTa
dTa = ( dY1a - TabI.dY1PosI) + dTa
-- **[M2]** = allontanamento dei trascinatori con Y2 in presa
elseif sType == 'M2' then
EmitComment( vCmd, '[M2]')
@@ -1831,7 +1843,7 @@ local function MaxDispl( TabI, vCmd, sType)
-- allontano (Y2+T) e (Y1)
dY1a = MaxY1
dY2a = MinY2
dTa = ( MinY2 - TabI.dY2PosI) + dTa
dTa = ( dY2a - TabI.dY2PosI) + dTa
-- **[M3]** = accentramento dei trascinatori con Y1 in presa
elseif sType == 'M3' then
EmitComment( vCmd, '[M3]')
@@ -1841,7 +1853,7 @@ local function MaxDispl( TabI, vCmd, sType)
-- accentro (Y1+T) e (Y2)
dY1a = TabI.MyMinY1V1
dY2a = TabI.MaxY2V2
dTa = ( TabI.MyMinY1V1 - TabI.dY1PosI) + dTa
dTa = ( dY1a - TabI.dY1PosI) + dTa
-- **[M4]** = accentramento dei trascinatori con Y2 in presa
elseif sType == 'M4' then
EmitComment( vCmd, '[M4]')
@@ -1852,7 +1864,7 @@ local function MaxDispl( TabI, vCmd, sType)
-- accentro (Y2+T) e (Y1)
dY1a = TabI.MyMinY1V1
dY2a = TabI.MaxY2V2
dTa = ( TabI.MaxY2V2 - TabI.dY2PosI) + dTa
dTa = ( dY2a - TabI.dY2PosI) + dTa
end
--
table.insert( vCmd, { 3, 'Y1', dY1a, 'Y2', dY2a, 'T', dTa, EMC.CNT})
@@ -2178,7 +2190,7 @@ local function PosY1Y2B( TabI, vCmd)
end
end
nCnt = nCnt + 1
if nCnt > 5 then return end
if nCnt > 10 then return end
until ( not bXW)
-- chiusura/parcheggio dei trascinatori in funzioni chiamanti
local dY1Delta = TabI.dY1PosI - TabI.dTPosI
@@ -2317,7 +2329,7 @@ local function PosY2Y1B( TabI, vCmd)
end
end
nCnt = nCnt + 1
if nCnt > 5 then return end
if nCnt > 10 then return end
until ( not bXW)
-- la chiusura delle morse è fatta sopra
local dY1Delta = TabI.dY1PosI - TabI.dTPosI
@@ -2389,7 +2401,7 @@ function SpecAdjustCarrA( WorkTab)
dY1DeltaF = PosY1Y2B( TabValI, vCmd)
else
--[A(1)A] **ALLONTANAMENTO** (dall'origine) del trascinatore Y1
EmitComment( vCmd, '[AY1A]')
EmitComment( vCmd, '[A-Y1A]')
dY1DeltaF = PosY1Y2A( TabValI, vCmd)
end
-- chiudo Y1
+27 -4
View File
@@ -50,12 +50,30 @@
-- 2024/02/29 ver 2.6c1 Allineamento con common ver. 2.6c1
-- 2024/03/04 ver 2.6c2 Modificato log con nome macchina
-- Allineamento con common ver. 2.6c2
-- 2024/03/05 ver 2.6c3 Allineamento con common ver. 2.6c3
-- In mlde aggiunto parametro EstimationRapidMultiplier per correggere la stima tempi su macchine vecchie. Letto anche da TS3v7 come COEFF_STIMATEMPI.
-- 2024/03/28 ver 2.6d1 Allineamento con common ver. 2.6d1
-- 2024/04/12 ver 2.6d2 Allineamento con common ver. 2.6d2
-- Aggiunto parametro ForceToCloseRollersGate
-- 2024/04/30 ver 2.6e1 Allineamento con common ver. 2.6e1
-- Aggiunta variabile WoodDensity per gestione WOOD_DENSITY
-- 2024/06/03 ver 2.6f1 Aggiunta funzione GetSetupInfo a BeamData per nuovo automatismo
-- Allineamento con common ver. 2.6f1
-- 2024/07/10 ver 2.6g1 Allineamento con common ver. 2.6g1
-- 2024/07/16 ver 2.6g2 Allineamento con common ver. 2.6g2
-- 2024/07/17 ver 2.6g3 Allineamento con common ver. 2.6g3
-- 2024/07/22 ver 2.6g4 Gestione pezzi fino a 30 metri
-- Allineamento con common ver. 2.6g4
-- 2024/07/31 ver 2.6g5 Allineamento con common ver. 2.6g5
-- Aggiunta file note tool e machining
-- 2024/08/01 ver 2.6h1 Allineamento con common ver. 2.6h1
-- 2024/08/07 ver 2.6h2 Allineamento con common ver. 2.6h2
-- Intestazioni
require( 'EmtGenerator')
EgtEnableDebug( false)
PP_VER = '2.6c2'
PP_VER = '2.6h2'
MIN_MACH_VER = '2.5k1'
MACH_NAME = 'Essetre-PF'
@@ -140,7 +158,7 @@ ParkZ1 = -535
ParkC1 = 90
ParkB1 = 90
LimX1RotSaw = 800
LimX1PlRotSaw = 1920
LimX1PlRotSaw = 1970
MinX2 = 0
MaxX2 = 2035
MinZ2 = -1550
@@ -173,7 +191,7 @@ DeltaTabZ = -1060.0 -- per TPA la quota è dal centro di rotazione (va aggi
DeltaRulliTraveZ = 980
DeltaRulliTappetoZ = -485
DimTabY = 500
DimTabX = 24000
DimTabX = 30000
Delta2TabY = 1550.0
Delta2TabZ = -1060.0 -- per TPA la quota è dal centro di rotazione (va aggiunto MillOffs)
Head2X = 0
@@ -186,6 +204,8 @@ AutomaticRotation = true
OptimizedLoadBeam = true
AutoRotMinLen = 0
CoeffVM = 0.5
EstimationRapidMultiplier = 1
ForceToCloseRollersGate = false
-- Aggiornamento con dati da TechnoEssetre7
local sTs3Data = EgtGetStringFromIni( 'Beam', 'DATA_DIR', "C:\\TechnoEssetre7\\EgtData", EgtGetIniFile()).."\\Essetre-PF.data"
@@ -269,6 +289,9 @@ if EgtExistsFile( sData) then
if Machine.Offsets.SAW2OFFSZ then Saw2OffsZ = Machine.Offsets.SAW2OFFSZ end
if Machine.Offsets.DEFTCPOS1 then DefTcPos1 = ( 'T' .. Machine.Offsets.DEFTCPOS1) end
if Machine.Offsets.DEFTCPOS2 then DefTcPos2 = ( 'T' .. Machine.Offsets.DEFTCPOS2) end
if Machine.Offsets.COEFF_STIMATEMPI and Machine.Offsets.COEFF_STIMATEMPI > 0 then EstimationRapidMultiplier = Machine.Offsets.COEFF_STIMATEMPI end
if Machine.Offsets.CHIUDI_PINZE_2_3_SCAMBIO then ForceToCloseRollersGate = Machine.Offsets.CHIUDI_PINZE_2_3_SCAMBIO == 1 end
if Machine.Offsets.WOOD_DENSITY then WoodDensity = Machine.Offsets.WOOD_DENSITY end
-- aggiustamenti
MinY1 = MinV1 + MinDeltaYV
MaxY1 = MaxMchY1
@@ -630,7 +653,7 @@ EmtAxis {
Type = MCH_AT.LINEAR,
Dir = - X_AX(),
Pos = Point3d(0.0,2450.0,-958.0),
Stroke = {-20000, 20000},
Stroke = {-30000, 30000},
Home = LoadT,
Geo = 'T_AXIS/GEO'}
EmtTable {
BIN
View File
Binary file not shown.
+50
View File
@@ -0,0 +1,50 @@
; Commento per evitare BOM con UTF-8
;Index = Type, Description, Default Value
; Type : b=boolean, d=double, l=lenght, s=string
[Drilling]
[Sawing]
[Milling]
0=d,MaxElev,0
1=d,OutRaw,0
2=d,SideElev,0
3=d,TrimExt,0
4=sr,VtFaceUse,0,0,0
[Pocketing]
0=d,MaxElev,0
1=b,Open,0
2=d,OpenMinSave,0
3=d,OpenOutRaw,0
4=d,MaxOptSize,0
[Mortising]
0=d,MaxElev,0
[Chiseling]
[SawRoughing]
[SawFinishing]
[GenMachining]
0=l,LinTol,0.1
1=l,MaxLen,2
2=s,Type,ZigZag
3=d,SideAng,90
4=l,Step,10
5=l,OffsProj,0
6=l,LiTang,0
7=l,LiOrth,0
8=l,LiElev,0
9=l,LoTang,0
10=l,LoOrth,0
11=l,LoElev,0
12=b,DirFromGuide,1
[SurfRoughing]
[SurfFinishing]
0=b,SkipMaxDown,1
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+41
View File
@@ -0,0 +1,41 @@
; Commento per evitare BOM con UTF-8
; Index, Type, Description, Value
; Index = 0,1,..,n
; Type : d=double, l=lenght, s=string, b=boolean, dr=double recalc, sr= string recalc, lr=lenght recalc, br=boolean recalc, th=toolholder
; Description : STEP, SIDESTEP, ...
[DRILL_STD]
0=th,TH,
1=d,STEP
2=s,DOUBLE
[SAW_STD]
0=th,TH,
1=d,STEP
2=d,SIDESTEP
3=b,LONGCUT
[SAW_FLAT]
0=th,TH,
1=d,STEP
2=d,SIDESTEP
3=b,LONGCUT
[MILL_STD]
0=th,TH,
1=d,STEP
2=d,SIDESTEP
3=d,SIDEDEPTH
4=s,DOUBLE
[MILL_NOTIP]
0=th,TH,
1=d,STEP
2=d,SIDESTEP
3=d,SIDEDEPTH
4=s,DOUBLE
[MORTISE_STD]
0=b,MORTISE
1=d,STEP
2=d,SIDESTEP
+70 -2
View File
@@ -1,7 +1,75 @@
==== Essetre_StdPF Update Log ====
==== Common_ONE-PF Update Log ====
Versione 2.6h2 (07/08/2024)
- (SIM) Allineata simulazione a generazione in primo movimento rapido approccio al pezzo.
Versione 2.6h1 (01/08/2024)
- (GEN) Corretto segno posizione X di sicurezza per rotazione assi rotanti.
Versione 2.6g5 (31/07/2024)
- (SIM-GEN) Se motosega allineata ad asse B per tagli di fianco, corretto movimento che manda testa a parcheggio. Pezzi più alti di 650 va solo in Zmax. Ticket#1943
- (SIM-GEN) Gestione movimenti speciali per pezzi molto alti. Se HomeZ < primo punto lavorazione, allora vado al punto Z lavorazione prima di approcciare il pezzo in X. Ticket#1943
- (GEN) Gestione creazione piano generico in caso il primo movimento della lavorazione sia un arco. Ticket#1891
- (SIM-GEN) Modifica limite inferirore intervallo di pinzaggio per garantire, se possibile, il passaggio pezzo a pinza 2. Da Common-PF1250.
- (GEN) Corretta scrittura ISO per parcheggiare morsa 3 dopo ribaltamento. Ticket#1922,#1733
Versione 2.6g4 (19/07/2024)
- (SIM-GEN) Aumentato numero iterazioni per scambio carrelli (da 5 a 10), per pezzi lunghi 30m.
Versione 2.6g3 (17/07/2024)
- (GEN) Correzione modifica precedente (2.6g2). Con lama precedente e motosega successiva, andava a parcheggio con lama alla quota della motosega. Ticket#1880
Versione 2.6g2 (16/07/2024)
- (GEN) Per preselezione o movimenti in home, non si scrive più 'ET0' perchè non è più supportato. Ticket#1926
Versione 2.6g1 (10/07/2024)
- (GEN) Se prima lavorazione con motosega, dopo G151 di attesa carrelli si ribadiscono tutti gli assi. Ticket#1924
Versione 2.6f1 (03/06/2024)
- (GEN) Aggiunta possibilità di scrivere nome utensile doppio anche in lavorazione con parametro "TOOLDOUBLE". Note sulla lavorazione hanno precedenza su note utensile.
Versione 2.6e1 (30/04/2024)
- (GEN) Chiamando la macchina con un nome che termini con '.TEST' si abilita come macchina per test interni, equivalente a settare 'IS_TEST_MACHINE' (che comunque rimane)
- (SIM) In log collisioni, si scrive anche ID del gruppo per facilitare riconoscimento in caso di collisione
- (MLDE-GEN) Gestione facoltativa parametro WOOD_DENSITY settabile in Ts3. In MLDE, mettere il valore di WOOD_DENSITY nella nostra variabile 'WoodDensity'.
Versione 2.6d2 (12/04/2024)
- (MLDE-SIM-GEN) Aggiunta variabile FACOLTATIVA 'ForceToCloseRollersGate' ( che legge la variabile da TS3 'CHIUDI_PINZE_2_3_SCAMBIO') in mlde per forzare chiusura paratie rulli
durante scambio pinze per facilitare passaggio pezzi molto storti. Se non presente chiude solo se necessario.
Versione 2.6d1 (28/03/2024)
- (GEN) Rimosso da generazione funzione GetNextTool duplicata
- (SIM-GEN) Se fase successiva start di un altro pezzo, la GetNextTool restituisce nil, per forzare movimento home in caso di utensili speciali
- (MLDE-GEN) Aggiunto parametro 'IS_TEST_MACHINE' FACOLTATIVO. Se non esiste o 'false' è macchina standard, se 'true' è una macchina utilizzata per i test Egalware interni
- (SIM) Corretto movimento in simulazione se motosega su testa 2
Versione 2.6c9 (26/03/2024)
- (SIM) Corretta gestione cambio utensile con motosega. In alcuni casi non era coerente con generazione
- (GEN) In 'PreparePostRotation' si resetta sempre anche la paratia in uscita (Ticket#1733)
Versione 2.6c8 (22/03/2024)
- (SIM) Miglioramento visualizzazione spigoli VMILL alla fine della simulazione. Funzione: EgtVolZmapSetShowEdges. CAM5 ver. 2.6c2 FACOLTATIVA.
Versione 2.6c7 (11/03/2024)
- (SIM-GEN) Aggiunta gestione parametro "SECDIST". Distanza di sicurezza tra paratia con rulli e utensile/testa. Parametro da inserire nelle note utensile.
- (MLPE-GEN) Aggiunto parametro "WriteM05Command" (NON OBBLIGATORIO) per decidere se scrivere il comando M05 per arresto mandrino. Default a true.
Versione 2.6c6 (08/03/2024)
- (SIM-GEN) Gestione rotazioni 90° come su FAST, caso MID2 (split/cut prima delle rotazioni)
Versione 2.6c5 (07/03/2024)
- (GEN) Per ribaltamento, i comandi si differenziano per macchina. Sembra che ONE e PF abbiano comandi diversi. In attesa di conferma da parte di Essetre
- (SIM-GEN) Se cambiato utensile, si aprono sempre paratie
- (SIM) Spostato salvataggio dati utensile precedente in MachiningEnd, prima era in MachininsStart
Versione 2.6c4 (06/03/2024)
- (SIM-GEN) Alla fine del movimento a Z-MAX, in home con lama solo se si cambia utensile. Prima andava sempre in home se era lama, anche se non doveva cambiare utensile
Versione 2.6c3 (05/03/2024)
- (MLDE-SIM) Aggiunta variabile FACOLTATIVA 'EstimationRapidMultiplier' in mlde per regolare il tempo stimato di rapido su macchine vecchie. Se non presente default 1.
Versione 2.6c2 (04/03/2024)
- (MLDE-GEN) Aggiunta variabile 'MACH_NAME' in MLDE con nome macchina
- (MLDE-GEN) Aggiunta variabile 'MACH_NAME' in mlde con nome macchina
Versione 2.6c1 (29/02/2024)
- (SIM) Gestione rimozione VMILL per tagli a cubetti Zig-Zag
+1 -1
View File
@@ -3,7 +3,7 @@
local InfoCommon_STD_PP = {
NAME = 'Common_ONE-PF', -- nome script PP standard
VERSION = '2.6c2', -- versione script
VERSION = '2.6h2', -- versione script
MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel
}