Compare commits

...

48 Commits

Author SHA1 Message Date
andrea.villa 1e6bc44019 Tastatore portato a 170 2025-06-06 10:25:09 +02:00
andrea.villa 0909656a6c Azzeramento tastatura con EF0 2025-06-06 10:23:08 +02:00
andrea.villa 23e17d9623 Prima della macro tastatura, si manda la testa nel punto dal quale azionare il tastatore. Per il momento si tasta sempre al centro della trave in altezza se facce verticali, o al centro in larghezza se faccia sopra. La posizione della trave invece è quella di lavorazione. 2025-06-06 09:17:32 +02:00
andrea.villa 7ba04b6e17 - Migliorata gestione presenza Probe
- Probe settato false per default
2025-06-04 15:55:16 +02:00
andrea.villa 67401b8799 Piccola correzione calcolo accelerazioni 2025-06-04 15:46:54 +02:00
andrea.villa 8b9a77cdaf - Allineamento con common ver. 2.7f1
- Gestione parametri accelerazioni pinze
2025-06-04 15:43:07 +02:00
andrea.villa 9662b22f03 Proma versione gestione PROBE 2025-06-04 11:48:35 +02:00
andrea.villa 9bbc62bea8 Allineamento con common ver.2.7e1 2025-05-28 15:24:17 +02:00
andrea.villa 20fd75ba0b - Allineamento con common ver. 2.7d1
- Aggiornamento MachNotes
- Lettura PRECUT per automatismo
2025-04-28 13:36:12 +02:00
andrea.villa 2632d4d9c6 #critical# Allineamento con common 2.7c3 2025-03-26 08:04:47 +01:00
andrea.villa 496ec40fdb Allineamento con common ver. 2.7c2 2025-03-12 08:34:17 +01:00
andrea.villa 1bc286a92f Allineamento con common ver. 2.7c1 2025-03-05 11:54:52 +01:00
luca.mazzoleni 6da804fe40 - modificata GetSetupInfo 2025-02-28 09:25:29 +01:00
luca.mazzoleni fc157d1eba - in BeamData GetSetupInfo modificate informazioni testa 2025-02-25 10:46:15 +01:00
luca.mazzoleni 039510e5e5 - in BeamData -> GetSetupInfo aggiunte informazioni testa davanti/dietro (bIsFrontHead, bIsBackHead) 2025-02-18 17:24:57 +01:00
andrea.villa 52c8944f0e - Allineamento con common ver. 2.7b1
- Modifica NGE per collisioni con traversa
2025-02-07 13:01:41 +01:00
andrea.villa 1b1549498d Allineamento con common ver. 2.7a1 2025-01-07 16:35:13 +01:00
andrea.villa 4e57b18cb9 - Allineamento con common ver. 2.6l2
- In GetZExtra contemplato anche casi sotto-squadra
2024-12-09 12:46:57 +01:00
andrea.villa a545288258 - Allineamento common ver. 2.6l1
- Aggiunta variabile ROT180 per rotazioni nuovo automatismo
2024-12-02 08:43:36 +01:00
andrea.villa 61d0fa890f Allineamento con common ver. 2.6j3 2024-10-21 17:00:20 +02:00
andrea.villa 8d6d329b6b - Allineamento con common ver. 2.6j2
- Tolti i commenti iniziali da quando è stato creato progetto GIT
2024-10-17 12:34:40 +02:00
andrea.villa 47ac7ae18e - Allineamento con common ver. 2.6j1 2024-10-08 11:51:02 +02:00
luca.mazzoleni 5e143cb4ce update gitignore e YAML 2024-09-25 13:16:06 +02:00
luca.mazzoleni 5c7b8d6ebf update gitignore e YAML 2024-09-24 14:59:28 +02:00
luca.mazzoleni 5d68fa58c8 - Modificato YAML per comunicazione versioni a LiMan.
- Aggiunta PP_NVER, versione in formato numerico.
2024-09-18 17:22:19 +02:00
andrea.villa caa0f04779 Piccole migliorie dopo test autmatici 2024-09-13 15:27:03 +02:00
andrea.villa ee59374af0 - Allineamento con common ver. 2.6i2
- Inseriti in NGE solidi collisione TC
2024-09-13 11:59:31 +02:00
andrea.villa b7986674f5 - Allineamento con common ver. 2.6i1
- File YML con prefisso di ricerca "Common_" per compilazione
2024-09-02 10:39:06 +02:00
andrea.villa e651c59eca - Allineamento con common ver. 2.6h2 2024-08-07 10:31:10 +02:00
andrea.villa cfb08c7255 - Allineamento con common ver. 2.6h1 2024-08-01 12:58:36 +02:00
andrea.villa c8b36bb31e Tolto stato finale paratia carico 2024-07-31 17:29:41 +02:00
andrea.villa 766235ad22 Piccola correzione segni quote parcheggio 2024-07-31 15:24:40 +02:00
andrea.villa e1035be99e - Allineamento con common ver. 2.6g5 2024-07-31 11:11:18 +02:00
andrea.villa ce76a9b50d FixDeployAndCompile01 2024-07-23 09:26:22 +02:00
andrea.villa 7886853773 - Gestione pezzi fino a 30 metri
- Allineamento con common ver. 2.6g4
2024-07-22 15:58:12 +02:00
andrea.villa 2532cc5e8e Allineamento con common ver. 2.6g3 2024-07-17 16:03:25 +02:00
andrea.villa a622a562f4 Allineamento con common ver. 2.6g2 2024-07-16 08:06:18 +02:00
andrea.villa 3c7a21df10 Allineamento con common ver. 2.6g1 2024-07-10 16:24:30 +02:00
andrea.villa a94f892300 Modificato 'LimX1PlRotSaw' a 1970mm 2024-06-03 12:43:00 +02:00
andrea.villa 8d07babd5a - Aggiunta funzione GetSetupInfo a BeamData per nuovo automatismo
- Allineamento con common ver. 2.6f1
2024-06-03 12:34:22 +02:00
andrea.villa adc6ec3df6 - Allineamento con common ver. 2.6e1
- Aggiunta variabile WoodDensity per gestione WOOD_DENSITY
2024-04-30 17:19:45 +02:00
luca.mazzoleni ce8e591c2b Merge branch 'develop' 2024-04-16 17:09:45 +02:00
luca.mazzoleni 8afb0c87f8 in yaml aggiunta copia in R anche per develop (senza versione) 2024-04-16 17:09:34 +02:00
luca.mazzoleni 50d3492c94 Merge branch 'develop' 2024-04-16 15:13:06 +02:00
luca.mazzoleni 083ff233d5 yaml lanciato solo per master 2024-04-16 15:12:42 +02:00
luca.mazzoleni 9d46048e57 aggiunto yaml per compilazione e copia su R 2024-04-16 13:23:55 +02:00
andrea.villa 1499e19530 - Allineamento con common ver. 2.6d2
- Aggiunto parametro ForceToCloseRollersGate
2024-04-12 08:56:47 +02:00
andrea.villa 0baa5932f4 Allineamento con common ver. 2.6d1 2024-03-28 12:29:30 +01:00
12 changed files with 1322 additions and 276 deletions
+318
View File
@@ -0,0 +1,318 @@
variables:
VERS_MAIN: '1.0'
MACH_NAME: ''
MACH_NAME_TEST: ''
MANUFACTURER: ''
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_SHARE_H: '\\10.74.82.252\team drives'
NET_USERQ: 'steamw\egalware'
NET_USER_SERVICES: 'steamw\services'
MACH_VERS: '0.0.0.0'
TEMP_PATH: 'C:\MachinesDeploy'
MACHINES_PATH_R: 'R:\EgtData\Machines_GIT'
DEST_MACHINES_PATH_H: 'H:'
SRC_PATH: ''
BASE_PATH: ''
TEST_PATH: ''
URL_VERSIONS_LOG: "https://liman.egalware.com/ELM.API/api/release/save"
MACH_VERS_NUM: '0.0.0.0'
CRITICAL_STRING: "#critical#"
TOOLS_MACHINE_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 "-----------------------"
$customerPathR = $env:MACHINES_PATH_R + "\" + $env:MANUFACTURER
ROBOCOPY /MIR "$env:SRC_PATH" "$customerPathR\$env:MACH_NAME\" /XD "bin"
ROBOCOPY "$env:TEST_PATH" "$customerPathR\_TestMachines\$env:MACH_NAME_TEST\" /E /XD "bin"
ROBOCOPY /MIR "$env:BASE_PATH" "$customerPathR\_Deploy\$env:MACH_NAME\$env:MACH_VERS\" /XD "bin" /XD "$env:MACH_NAME_TEST"
SLEEP 2
net use R: /delete
# helper copia script verso drive condiviso
.ReplicaStor01: &ReplicaStor01
- |
net use H: /delete
SLEEP 2
net use H: $env:NET_SHARE_H /u:$env:NET_USER_SERVICES $SRVCS_PASSWD
echo "-----------------------"
echo " Copia macchina su stor01"
echo "-----------------------"
SLEEP 2
$customerPathH = $env:DEST_MACHINES_PATH_H + "\" + $env:MANUFACTURER + "\test"
$destinationPath = "$customerPathH\$env:MACH_NAME" + "\"
ROBOCOPY "$env:BASE_PATH" "$destinationPath\" *.zip
SLEEP 2
net use H: /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 "-----------------------"
$customerPathR = $env:MACHINES_PATH_R + "\" + $env:MANUFACTURER
ROBOCOPY /MIR "$env:BASE_PATH" "$customerPathR\_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 "-----------------------"
# test se la cartella con gli utensili esiste per questa macchina
if (!(Test-Path -Path $env:TOOLS_MACHINE_PATH)) {
echo "-----------------------"
echo "CANNOT FIND TOOLS FOR THIS MACHINE!!"
echo "-----------------------"
Exit 1}
ROBOCOPY "$env:TOOLS_MACHINE_PATH" "$env:SRC_PATH" /E /XF "*.bat" /XF "*.yml" /XF ".gitignore" /XD ".git" /XF "UpdateLog.txt" /XD ".vscode"
ROBOCOPY "$env:TOOLS_MACHINE_PATH" "$env:TEST_PATH" /E /XF "*.bat" /XF "*.yml" /XF ".gitignore" /XD ".git" /XF "UpdateLog.txt" /XD ".vscode"
ROBOCOPY "$env:TOOLS_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"
echo "-----------------------"
$FileList = Get-ChildItem * -Include( "*.mlpe", "*.mlse")
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"
}
# helper recupero nome macchina e costruttore
.machName-fix: &machName-fix
- |
echo "-----------------------"
echo " Recupero nome macchina e costruttore"
echo "-----------------------"
$fileName = dir *.mlde
$env:MACH_NAME = $fileName.BaseName
$env:MACH_NAME_TEST = $env:MACH_NAME + ".TEST"
$comp = $fileName.BaseName -split "-"
$env:MANUFACTURER = $comp[0]
Write-Output $env:MANUFACTURER
# helper calcolo versione
.version-fix: &version-fix
- |
echo "-----------------------"
echo " Calcolo versione"
echo "-----------------------"
# calcolo versione formato stringa
$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 formato stringa
Write-Output $env:MACH_VERS
# calcolo versione formato numerico
$fPath = "$env:MACH_NAME.mlde";
$vLine = Select-String -path $fPath -Pattern '^PP_NVER';
$comp = $vLine -split "=";
$env:MACH_VERS_NUM = $comp[1].Replace("'","").Trim()
# display versione formato numerico
Write-Output $env:MACH_VERS_NUM
# 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:TOOLS_MACHINE_PATH = "$env:MACHINES_PATH_R\$env:MANUFACTURER\_DefaultMachineSetup\$env:MACH_NAME"
Write-Output $env:TOOLS_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 invio notifica a log versioni online (LiMan)
.SendToVersionsLog: &SendToVersionsLog
- |
echo "-----------------------"
echo " Invio versione a log online"
echo "-----------------------"
$tags = ""
$date = ""
# se critico scrive tag
if ( $CI_COMMIT_MESSAGE | Select-String -Pattern $env:CRITICAL_STRING) {
$tags = "CRITICAL"
$date = (Get-Date).AddDays(1).toString("yyyy-MM-ddTHH:mm:ss.fffZ")
}
else
{
$date = (Get-Date).AddDays(3).toString("yyyy-MM-ddTHH:mm:ss.fffZ")
}
$body =
@{
codInst = "EgalWare"
codApp = $env:MACH_NAME
uplAppId = "UpdateManager"
masterKey = $LiMan_Key
tipo = "Machine"
versNum = $env:MACH_VERS_NUM
versText = $env:MACH_VERS
releaseDate = $date
relTags = $tags
}
$jsonBody = ConvertTo-Json -InputObject $body
echo $jsonBody
Invoke-WebRequest -Method Post -URI $env:URL_VERSIONS_LOG -ContentType "application/json" -Body $jsonBody -UseBasicParsing
# 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
- *ReplicaStor01
- *SendToVersionsLog
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
+51 -1
View File
@@ -8,13 +8,14 @@ local BeamData = {
RIGHT_LOAD = true, -- flag carico da destra
SIMUL_VIEW_DIR = 1, -- direzione di vista predefinita per la simulazione (1=NW, 2=SW, 3=NE, 4=SE)
ROT90 = false, -- flag abilitazione rotazione 90 gradi
ROT180 = true, -- flag abilitazione rotazione 180 gradi
MIN_WIDTH = 50, -- larghezza minima del grezzo
MIN_HEIGHT = 50, -- altezza minima del grezzo
MAX_WIDTH = 400, -- larghezza massima del grezzo
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)
@@ -67,6 +68,8 @@ local BeamData = {
KIOTP = 5, -- coefficiente moltiplicativo per attacco/uscita lama tangente anzichè perpendicolare
MAXDIAM_POCK_CORNER = 31, -- diametro massimo utensile ammesso per tasche con angoli interni
USE_LONGCUT = true, -- per i tagli longitudinali usare solo la lavorazione di lama LongCut
PRECUT_HEAD = true, -- flag abilitazione pretaglio grezzo a zero in testa
PRECUT_TAIL = true, -- flag abilitazione pretaglio grezzo a zero in coda
ADVANCE_TAIL_CUT = true, -- per spostare prima del taglio di separazione il taglio di coda su pezzi corti con robabile caduta
ADVANCE_TAIL_OFFS = 10, -- accorciamento taglio di coda avanzato (minimo 1)
DOUBLE_HEAD_DOVETAIL = false, -- flag abilitazione lavorazione mortase a coda di rondine in doppio
@@ -103,6 +106,8 @@ if EgtExistsFile( sData) then
BeamData.DIM_STRIP_SMALL = Machine.Offsets.DIM_STRIP_SMALL or BeamData.DIM_STRIP_SMALL
BeamData.DIM_TO_CENTER_STRIP = Machine.Offsets.DIM_TO_CENTER_STRIP or BeamData.DIM_TO_CENTER_STRIP
BeamData.MAXDIAM_POCK_CORNER = Machine.Offsets.MAXDIAM_POCK_CORNER or BeamData.MAXDIAM_POCK_CORNER
if Machine.Offsets.PRECUT_HEAD_DISABLE then BeamData.PRECUT_HEAD = ( Machine.Offsets.PRECUT_HEAD_DISABLE == 0) end
if Machine.Offsets.PRECUT_TAIL_DISABLE then BeamData.PRECUT_TAIL = ( Machine.Offsets.PRECUT_TAIL_DISABLE == 0) end
end
if Machine.Trave then
BeamData.MIN_WIDTH = Machine.Trave.XMIN or BeamData.MIN_WIDTH
@@ -206,5 +211,50 @@ local function GetChainSawInitAngs( vtN, vtO, nInd)
end
BeamData.GetChainSawInitAngs = GetChainSawInitAngs
---------------------------------------------------------------------
local function GetSetupInfo( sHead)
local SetupInfo = {}
-- dati comuni
SetupInfo.bIsCSymmetrical = true
SetupInfo.dCAxisEncumbrance = 180
SetupInfo.bToolOnAggregate = false
-- testa 5 assi da sopra, dietro
if sHead == 'H11' then
SetupInfo.HeadType = { bTop = true, bBottom = false}
SetupInfo.PreferredSide = { bFront = false, bBack = true}
SetupInfo.dMinNz = sin( -45)
-- testa 5 assi da sopra, davanti
elseif sHead == 'H21' then
SetupInfo.HeadType = { bTop = true, bBottom = false}
SetupInfo.PreferredSide = { bFront = true, bBack = false}
SetupInfo.dMinNz = sin( -45)
-- lama su testa 5 assi da sopra, dietro
elseif sHead == 'H12' then
SetupInfo.HeadType = { bTop = true, bBottom = false}
SetupInfo.PreferredSide = { bFront = false, bBack = true}
SetupInfo.dMinNz = sin( -45)
-- lama su testa 5 assi da sopra, davanti
elseif sHead == 'H22' then
SetupInfo.HeadType = { bTop = true, bBottom = false}
SetupInfo.PreferredSide = { bFront = true, bBack = false}
SetupInfo.dMinNz = sin( -45)
-- motosega 1
elseif sHead == 'H13' or sHead == 'H23' then
SetupInfo.HeadType = { bTop = true, bBottom = false}
SetupInfo.PreferredSide = {}
SetupInfo.dMinNz = 0
-- motosega 2
elseif sHead == 'H15' then
SetupInfo.HeadType = { bTop = false, bBottom = true}
SetupInfo.PreferredSide = {}
SetupInfo.dMaxNz = 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
+412 -145
View File
@@ -27,7 +27,13 @@ function OnStart()
--EMT.LINEINC = 1 -- incremento numerazione linee
--EMT.Ft = 'F' -- token per feed
--EMT.St = 'S' -- token per speed
EMT.FMAXPINZE = 102000 -- feed massima pinze
EMT.FMAXPINZE = EgtClamp( MaxFeedPinze or 102000, 20000, 102000) -- feed massima pinze
EMT.MAXACC = MaxAcc or ( EMT.FMAXPINZE / ( 60 * 0.3)) -- accelerazione massima pinze
EMT.MINACC = MinAcc or ( EMT.FMAXPINZE / ( 60 * 4)) -- accelerazione minima pinze
-- utensili default
EMT.PREVTCPOS_H1 = DefTcPos1
EMT.PREVTCPOS_H2 = DefTcPos2
end
---------------------------------------------------------------------
@@ -42,13 +48,18 @@ 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')
EmtOutput( '(HEADER)')
-- Se modalità test, aggiungo linee per muovere tappeto e alzare la testa (in automatico viene fatto dal main residente)
if TEST_USE then
EmitTestProgramStart()
@@ -96,6 +107,7 @@ function OnProgramEnd()
EMT.SPECSPLIT = nil
EMT.RELOAD = nil
EMT.RELOAD2 = nil
EmtOutput( '(FOOTER)')
-- Se modalità test, termino il programma
if TEST_USE then
EmtOutput( 'M02')
@@ -417,6 +429,7 @@ function OnMachiningStart()
EMT.MCHUSERNOTES = EgtGetMachiningParam( MCH_MP.USERNOTES)
EMT.MCHSPLIT = ( EMT.MCHUSERNOTES:find( 'Split;', 1, true) ~= nil)
EMT.MCHPRECUT = ( EMT.MCHUSERNOTES:find( 'Precut;', 1, true) ~= nil)
EMT.MCHCUT = ( EMT.MCHUSERNOTES:find( 'Cut;', 1, true) ~= nil)
-- se sega a catena, aggiusto subito angolo scelto per asse virtuale A
if EMT.HEAD == 'H13' or EMT.HEAD == 'H15' then
@@ -432,10 +445,18 @@ function OnMachiningStart()
local MyParkCSawC2 = GetChainSawCHomeFromVirtualAxis( dPosA)
EmtModifyAxisHome( 'C2', MyParkCSawC2)
end
-- gestione eventuale tastatura
local bProbing = EgtGetValInNotes( EMT.MCHUSERNOTES, 'PROBE', 'b') or EgtGetValInNotes( EMT.MCHUSERNOTES, 'START-PROBE', 'b')
if bProbing and Probe then
if VerifyToolProbeCompatibility() then
EMT.PROBE = true
EMT.EXECPROBE = true
end
end
-- 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
@@ -595,6 +616,38 @@ function OnMachiningEnd()
EMT.PREVTOOL = EMT.TOOL
EMT.PREVHEAD = EMT.HEAD
EMT.PREVTCPOS = EMT.TCPOS
-- se tastatura attiva, si disabilita la tastatura
if EMT.PROBE then
-- gestione eventuale tastatura
local bStopProbing = EgtGetValInNotes( EMT.MCHUSERNOTES, 'PROBE', 'b') or EgtGetValInNotes( EMT.MCHUSERNOTES, 'END-PROBE', 'b')
if bStopProbing then
EmtOutput( 'G145 Z-10 EF0')
EMT.PROBE = nil
end
end
-- se taglio finale, aggiorno lunghezza barra
if EMT.MCHCUT then
EMT.LB = EMT.LT + ( EMT.X_OFF or 0)
end
-- 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')
EMT.PREVHOMEB_H1 = EgtGetAxisHomePos( 'B1')
EMT.PREVHOMEC_H1 = EgtGetAxisHomePos( 'C1')
elseif nHSet == 2 then
EMT.PREVTOOL_H2 = EMT.TOOL
EMT.PREVHEAD_H2 = EMT.HEAD
EMT.PREVTCPOS_H2 = EMT.TCPOS
EMT.PREVHOMEX_H2 = EgtGetAxisHomePos( 'X2')
EMT.PREVHOMEB_H2 = EgtGetAxisHomePos( 'B2')
EMT.PREVHOMEC_H2 = EgtGetAxisHomePos( 'C2')
end
if EMT.DOU_TYPE and not EMT.ZMAX then EMT.DOU_TO_ZMAX = true end
EMT.DOU_TYPE = nil
end
@@ -658,6 +711,10 @@ function OnPathEnd()
if not EMT.ZMAX then
EmitResetMachining()
end
-- salvo dati precedenti
EMT.L2pp = EMT.L2o
EMT.AUXTYPE = nil
EMT.UNL = nil
EMT.PREROT = nil
@@ -777,6 +834,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
@@ -819,26 +882,50 @@ 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
if EMT.HEAD == 'H12' and ( EgtIf( 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
-- se vado in posizione speciale rotazione assi, poi devo ritornare alla X vera di lavoro
local dMoveXtoFinalPosition = false
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})
dZref = max( EMT.L3, dSafeZ1 + GetZExtra( EMT.HEAD, EMT.R2))
dMoveXtoFinalPosition = true
elseif not bMoveZbeforeX then
EmitMoveDataHead( 1, { X=dXref, Z=MyMaxZ1, B=ParkB1, C=ParkC1, S=Speed})
else
EmitMoveDataHead( 1, { X=-LimX1PlRotSaw, Z=MyMaxZ1, B=ParkB1, C=ParkC1, S=Speed})
dZref = max( EMT.L3, dSafeZ1 + GetZExtra( EMT.HEAD, EMT.R2))
dMoveXtoFinalPosition = true
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
if dMoveXtoFinalPosition then
EmitMoveDataHead( 1, { X=EMT.L2, S=Speed})
end
-- caso standard
else
EmitMoveDataHead( 1, { X=dXref, Z=dZref, B=ParkB1, C=ParkC1, S=Speed})
@@ -854,11 +941,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
@@ -886,31 +973,45 @@ 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
if EMT.HEAD == 'H12' and ( EgtIf( 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=-LimX1RotSawTC2, 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, { B=EMT.R2, S=Speed})
EmitMoveDataHead( 1, { Z=dZref, S=Speed})
EmitMoveDataHead( 1, { C=EMT.R1, S=Speed})
EmitMoveDataHead( 1, { B=EMT.R2, S=Speed})
end
-- altrimenti sega a catena
else
@@ -921,11 +1022,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
@@ -947,24 +1048,44 @@ 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
if EMT.HEAD == 'H22' and ( EgtIf( 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
-- 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, { C=EMT.R1, S=Speed})
EmitMoveDataHead( 2, { Z=dZref, B=EMT.R2, S=Speed})
-- altrimenti caso standard
-- 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=EMT.L2, Z=dZref, B=HomeB2, C=HomeC2, S=Speed})
EmitMoveDataHead( 2, { B=EMT.R2, S=Speed})
EmitMoveDataHead( 2, { C=EMT.R1, S=Speed})
EmitMoveDataHead( 2, { X=-LimX2RotSaw, Z=MyMaxZ2, B=HomeB2, C=HomeC2, S=Speed})
end
-- caso speciale per trave alta con rotazione lama pericolosa (tolto "and EMT.SB > 379")
if abs( PrevR1 - EMT.R1) > 1 and ( abs( HomeC2 - EMT.R1) > 30.1 or abs( HomeB2 - EMT.R2) > 30.1) then
if EMT.HEAD == 'H22' 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})
EmitMoveDataHead( 2, { B=EMT.R2, S=Speed})
EmitMoveDataHead( 2, { C=EMT.R1, S=Speed})
if bMoveZbeforeX then
EmitMoveDataHead( 2, { Z=EMT.L3, S=Speed})
end
end
end
-- altrimenti sega a catena
else
@@ -973,13 +1094,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
@@ -1045,10 +1166,11 @@ function OnRapid()
end
bToPresel = false
-- risalita a Zmax
EmitZmax( false, false, EMT.TO_XHOME, PrevR1, PrevR2)
EmitZmax( false, false, EMT.TO_XHOME, PrevR1, PrevR2, nil, true)
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'))
@@ -1060,43 +1182,38 @@ 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
-- se devo andare in home, ma lo sono già, non faccio nulla
if not EMT.XHOME then
local nHSet = GetHeadSet( EMT.HEAD)
local nPrevHSet = GetHeadSet( EMT.PREVHEAD)
if nPrevHSet == 1 then
local HomeX1 = EgtGetAxisHomePos( 'X1')
EmitMoveDataHead( 1, { X=-HomeX1, Z=MaxZ1, B=ParkB1, C=ParkC1, TPos='0'})
EmitMoveStartHead( 1, 'EA1')
else
local HomeX2 = EgtGetAxisHomePos( 'X2')
EmitMoveDataHead( 2, { X=-HomeX2, Z=MaxZ2, B=ParkB2, C=ParkC2, TPos='0'})
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
-- vado in parcheggio sempre con utensile precedente
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=EMT.PREVHOMEB_H1, C=EMT.PREVHOMEC_H1, TPos=AdjustTcPos( false, EMT.PREVTCPOS_H1)})
EmitMoveStartHead( 1, 'EA1')
EmitMoveWaitHead( 1)
else
local HomeX2 = EgtGetAxisHomePos( 'X2')
EmitMoveDataHead( 2, { X=-HomeX2, Z=MaxZ2, B=HomeR2, C=HomeR1})
EmitMoveDataHead( 2, { X=-EMT.PREVHOMEX_H2, Z=MaxZ2, B=EMT.PREVHOMEB_H2, C=EMT.PREVHOMEC_H2, TPos=AdjustTcPos( false, EMT.PREVTCPOS_H2)})
EmitMoveStartHead( 2, 'EA1')
EmitMoveWaitHead( 2)
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')
--EmitMoveWaitHead( 1)
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')
--EmitMoveWaitHead( 2)
end
end
end
EMT.TO_XHOME = nil
EMT.L1pp = nil
EMT.L3pp = nil
PrevR1 = HomeR1
PrevR2 = HomeR2
@@ -1141,23 +1258,48 @@ 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 ( -LimX1PlRotSaw)
local CurrZ1 = EMT.L3pp or MyMaxZ1
local CurrB1 = PrevR2
local CurrC1 = PrevR1
local bMoveZbeforeX = false
local dZref = EMT.L3
if EMT.HEAD == 'H12' and ( EgtIf( 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
-- se vado in posizione speciale rotazione assi, poi devo ritornare alla X vera di lavoro
local dMoveXtoFinalPosition = false
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})
dZref = max( EMT.L3, dSafeZ1 + GetZExtra( EMT.HEAD, EMT.R2))
dMoveXtoFinalPosition = true
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})
dZref = max( EMT.L3, dSafeZ1 + GetZExtra( EMT.HEAD, EMT.R2))
dMoveXtoFinalPosition = true
end
EmitMoveDataHead( 1, { X=dXref, Z=CurrZ1, B=CurrB1, C=CurrC1, TRad=dTRad, TLen=dTLen, S=Speed})
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
-- 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
if dMoveXtoFinalPosition then
EmitMoveDataHead( 1, { X=EMT.L2, S=Speed})
end
-- altrimenti caso standard
else
EmitMoveDataHead( 1, { Z=dZref, S=Speed})
@@ -1215,24 +1357,40 @@ 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 ( -LimX1PlRotSaw)
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( 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})
EmitMoveDataHead( 1, { C=EMT.R1, S=Speed})
EmitMoveDataHead( 1, { B=EMT.R2, S=Speed})
end
-- altrimenti sega a catena
else
@@ -1263,24 +1421,45 @@ 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 ( -LimX2RotSaw)
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( 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
-- 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})
-- altrimenti caso standard
-- 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, { Z=dZref, S=Speed})
EmitMoveDataHead( 2, { B=EMT.R2, S=Speed})
EmitMoveDataHead( 2, { C=EMT.R1, S=Speed})
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 abs( PrevR1 - EMT.R1) > 1 and ( abs( HomeC2 - EMT.R1) > 30.1 or abs( HomeB2 - EMT.R2) > 30.1) then
if EMT.HEAD == 'H22' 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})
EmitMoveDataHead( 2, { B=EMT.R2, S=Speed})
EmitMoveDataHead( 2, { C=EMT.R1, S=Speed})
if bMoveZbeforeX then
EmitMoveDataHead( 2, { Z=EMT.L3, S=Speed})
end
end
end
-- altrimenti sega a catena
else
@@ -1350,6 +1529,36 @@ function OnRapid()
EMT.RELOAD = false
EMT.RELOAD2 = nil
end
-- TODO DA SISTEMARE
-- se bisogna fare tastatura
if EMT.EXECPROBE then
EMT.EXECPROBE = nil
local dSecDistProbe = 10 -- 10 = distanza sicurezza tastatore
local dLenProbe = 170 -- 170 = lunghezza tastatore
local dOffHeadProbe = 75 -- offset naso mandrino / centro tastatore
local dPivot = EgtIf( GetHeadSet( EMT.HEAD) == 1, MillOffs, Mill2Offs)
local vtE = Vector3d( EMT.EXTR)
local sFace, ProbePosX, ProbePosZ
if AreSameVectorApprox( vtE, Y_AX()) then
ProbePosX = -( EMT.TABORI1[2] + EMT.HB + dSecDistProbe + dLenProbe + MillOffs)
ProbePosZ = EMT.TABORI1[3] - MillOffs + ( EMT.SB / 2) + EgtIf( EMT.R2 > 0, dOffHeadProbe, -dOffHeadProbe)
sFace = 2
elseif AreSameVectorApprox( vtE, -Y_AX()) then
ProbePosX = -( EMT.TABORI1[2] - dSecDistProbe - dLenProbe - MillOffs)
ProbePosZ = EMT.TABORI1[3] - MillOffs + ( EMT.SB / 2) + EgtIf( EMT.R2 > 0, dOffHeadProbe, -dOffHeadProbe)
sFace = 4
elseif AreSameVectorApprox( vtE, Z_AX()) then
ProbePosX = -( EMT.TABORI1[2] + ( EMT.HB / 2) + dOffHeadProbe)
ProbePosZ = EMT.TABORI1[3] + EMT.SB + dSecDistProbe + dLenProbe
sFace = 3
else
error( "PROBING DIRECTION NOT MANAGED")
end
EmitMoveDataHead( GetHeadSet( EMT.HEAD), { X=ProbePosX, Z=ProbePosZ})
local sProbeHead = ' ET' .. GetHeadSet( EMT.HEAD)
EmtOutput( 'G145 Z-10 EF'..sFace..sProbeHead)
end
-- se taglio di coda senza residuo da scaricare, emetto M175 per accelerare il carico della barra successiva
if EMT.MCHUSERNOTES and EMT.MCHUSERNOTES:find( 'Cut', 1, true) then
EmtOutput( 'M175')
@@ -1549,6 +1758,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
@@ -1585,14 +1832,14 @@ 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]
local TempoAcc = ( ( Massa * FMaxPinze) / ( 60 * ForzaAttrito) / 1000)
if ( TempoAcc < MinTempoAcc) then TempoAcc = MinTempoAcc end
if ( TempoAcc > MaxTempoAcc) then TempoAcc = MaxTempoAcc end
local AccMaxPinze = FMaxPinze / ( 60 * MinTempoAcc)
local AccMaxPinze = EMT.MAXACC or FMaxPinze / ( 60 * MinTempoAcc)
local AccPinze = FMaxPinze / ( 60 * TempoAcc)
local RidFeed = 100 / Massa * 100
if RidFeed > 100 then
@@ -1779,6 +2026,9 @@ function PrepareMoveChar( sCmd, nInd)
table.insert( EMT.MDCHAR, MDChar)
EMT.Y1POS = MoveY1 or EMT.Y1POS
EMT.TPOS = GetCmdAxMove( Cmd, 'T') or EMT.TPOS
if EMT.V1POS < 400 and ( EMT.HEAD == 'H12' or EMT.HEAD == 'H22') and EMT.ZMAX and not EMT.XHOME then
EMT.TO_XHOME = true
end
end
elseif Cmd[1] == '2' then
local MDChar = { IniStatY1=EMT.ISY1, FinStatY1=EMT.FSY1, IniStatY2=EMT.ISY2, FinStatY2=EMT.FSY2, BeamVise=EMT.BV}
@@ -1806,6 +2056,9 @@ function PrepareMoveChar( sCmd, nInd)
end
table.insert( EMT.MDCHAR, MDChar)
EMT.TPOS = GetCmdAxMove( Cmd, 'T') or EMT.TPOS
if EMT.V1POS < 400 and ( EMT.HEAD == 'H12' or EMT.HEAD == 'H22') and EMT.ZMAX and not EMT.XHOME then
EMT.TO_XHOME = true
end
elseif Cmd[1] == '3' then
local MDChar = { IniStatY1=EMT.ISY1, FinStatY1=EMT.FSY1, IniStatY2=EMT.ISY2, FinStatY2=EMT.FSY2, BeamVise=EMT.BV}
local MoveY1 = GetCmdAxMove( Cmd, 'Y1')
@@ -1832,6 +2085,9 @@ function PrepareMoveChar( sCmd, nInd)
end
table.insert( EMT.MDCHAR, MDChar)
EMT.TPOS = GetCmdAxMove( Cmd, 'T') or EMT.TPOS
if EMT.V1POS < 400 and ( EMT.HEAD == 'H12' or EMT.HEAD == 'H22') and EMT.ZMAX and not EMT.XHOME then
EMT.TO_XHOME = true
end
elseif Cmd[1] == '4' then
-- richiesta movimento a ZMAX già gestita
if Cmd[2] == '1' then
@@ -2066,8 +2322,11 @@ 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}
elseif EMT.SPECSPLIT then
-- 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 or EMT.SPLITROT 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
else
@@ -2510,6 +2769,9 @@ function EmitZmax( bReset, bEnd, bXhome, PrevR1, PrevR2, bSplitCut, bUsePrevDelt
end
-- gruppo della testa
local nHSet = GetHeadSet( EMT.HEAD)
local dXPos = EgtIf( bUsePrevDelta, EMT.L2pp or EMT.L2o, EMT.L2o)
-- reset stato di testa in home
EMT.XHOME = nil
-- se testa 1
if nHSet == 1 then
-- posizioni sicure
@@ -2528,13 +2790,13 @@ function EmitZmax( bReset, bEnd, bXhome, PrevR1, PrevR2, bSplitCut, bUsePrevDelt
if not HeadIsChainSaw( EMT.HEAD) then
-- eseguo la salita a Z1max (oriento solo se assi rotanti non già a posto)
if abs( dSafeC1 - PrevR1) > 0.1 or abs( dSafeB1 - PrevR2) > 0.1 then
local dZref = dSafeZ1 + GetZExtra( EMT.HEAD, PrevR2)
if EgtIf( not EgtGetHeadId( 'H21') or BD.RIGHT_LOAD, -EMT.L2o < -LimX1RotSaw, -EMT.L2o > -LimX1RotSaw) then
local dZref = dSafeZ1 + GetZExtra( EMT.HEAD, EgtClamp( PrevR2, -90, 90))
if EgtIf( BD.RIGHT_LOAD, -dXPos < -LimX1RotSaw, -dXPos > -LimX1RotSaw) then
dZref = dZref - EgtIf( not Mortiser, 100, 370)
end
dZref = min( dZref, dMaxZ1)
local MovH = { Z = EgtIf( dZref > EMT.L3o, dZref, EMT.L3o)}
MovH.X = -EMT.L2o ; MovH.B = EgtClamp( PrevR2, -90, 90) ; MovH.C = PrevR1 ;
MovH.X = -dXPos ; MovH.B = EgtClamp( PrevR2, -90, 90) ; MovH.C = PrevR1 ;
EmitMoveDataHead( 1, MovH)
if EMT.HEAD == 'H12' and ( abs( dSafeC1 - PrevR1) > 30.1 or abs( dSafeB1 - PrevR2) > 30.1) then
EmitMoveDataHead( 1, { Z=dMaxZ1, B=0})
@@ -2544,10 +2806,13 @@ function EmitZmax( bReset, bEnd, bXhome, PrevR1, PrevR2, bSplitCut, bUsePrevDelt
EmitMoveDataHead( 1, { Z=dMaxZ1})
else
local MovH = { Z = dMaxZ1}
MovH.X = -EMT.L2o ; MovH.B = PrevR2 ; MovH.C = PrevR1 ;
MovH.X = -dXPos ; MovH.B = PrevR2 ; MovH.C = PrevR1 ;
EmitMoveDataHead( 1, MovH)
end
if bXhome then EmitMoveDataHead( 1, { X=-dSafeX1}) end
if bXhome then
EMT.XHOME = true
EmitMoveDataHead( 1, { X=-dSafeX1})
end
EmitMoveStartHead( 1)
-- se lavorazione in doppio
if EMT.DOU_TYPE == 2 then
@@ -2557,14 +2822,15 @@ function EmitZmax( bReset, bEnd, bXhome, PrevR1, PrevR2, bSplitCut, bUsePrevDelt
-- altrimenti sega a catena
else
-- ribadisco movimento perchè in G141 si aspetta sempre tutti i valori
local MovH = { X = -EMT.L2o, Z = EMT.L3o, B = PrevR2, C = PrevR1}
local MovH = { X = -dXPos, Z = EMT.L3o, B = PrevR2, C = PrevR1}
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})
if EMT.R3 and abs( EMT.R3) < 0.1 then
EmitMoveDataHead( 1, { Z=ParkCSawZ1})
end
EmitMoveDataHead( 1, { X=-dSafeX1, C=dSafeC1})
if bXhome then
EMT.XHOME = true
EmitMoveDataHead( 1, { X=-ParkX1, Z=ParkCSawZ1, B=ParkB1, C=ParkC1, TPos=50})
end
EmitMoveStartHead( 1)
@@ -2579,9 +2845,9 @@ function EmitZmax( bReset, bEnd, bXhome, PrevR1, PrevR2, bSplitCut, bUsePrevDelt
local dZref = dSafeZ1 + GetZExtra( EMT.HEAD, PrevR2)
dZref = min( dZref, dMaxZ1)
local MovH = { Z = EgtIf( dZref > EMT.L3o, dZref, EMT.L3o)}
MovH.X = -EMT.L2o ; MovH.B = EgtClamp( PrevR2, -90, 90) ; MovH.C = PrevR1 ;
MovH.X = -dXPos ; MovH.B = EgtClamp( PrevR2, -90, 90) ; MovH.C = PrevR1 ;
EmitMoveDataHead( 1, MovH)
if EMT.HEAD == 'H12' and ( abs( dSafeC1 - PrevR1) > 30.1 or abs( dSafeB1 - PrevR2) > 30.1) then
if EMT.HEAD == 'H12' and ( abs( dSafeC1 - PrevR1) > 30.1 or abs( dSafeB1 - PrevR2) > 30.1) or not( bProgress) then
EmitMoveDataHead( 1, { Z=dMaxZ1, B=0})
end
EmitMoveDataHead( 1, { C=dSafeC1})
@@ -2589,23 +2855,27 @@ function EmitZmax( bReset, bEnd, bXhome, PrevR1, PrevR2, bSplitCut, bUsePrevDelt
EmitMoveDataHead( 1, { Z=dMaxZ1})
else
local MovH = { Z = dMaxZ1}
MovH.X = -EMT.L2o ; MovH.B = PrevR2 ; MovH.C = PrevR1 ;
MovH.X = -dXPos ; MovH.B = PrevR2 ; MovH.C = PrevR1 ;
EmitMoveDataHead( 1, MovH)
end
if bXhome then EmitMoveDataHead( 1, { X=-dSafeX1}) end
if bXhome then
EMT.XHOME = true
EmitMoveDataHead( 1, { X=-dSafeX1})
end
EmitMoveStartHead( 1)
EmitMoveWaitHead( 1)
-- altrimenti sega a catena
else
-- ribadisco movimento perchè in G141 si aspetta sempre tutti i valori
local MovH = { X = -EMT.L2o, Z = EMT.L3o, B = PrevR2, C = PrevR1}
local MovH = { X = -dXPos, Z = EMT.L3o, B = PrevR2, C = PrevR1}
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})
if EMT.R3 and abs( EMT.R3) < 0.1 then
EmitMoveDataHead( 1, { Z=ParkCSawZ1})
end
EmitMoveDataHead( 1, { X=-dSafeX1, C=dSafeC1})
if bXhome then
EMT.XHOME = true
EmitMoveDataHead( 1, { X=-ParkX1, Z=ParkCSawZ1, B=ParkB1, C=ParkC1, TPos=50})
end
EmitMoveStartHead( 1)
@@ -2632,7 +2902,7 @@ function EmitZmax( bReset, bEnd, bXhome, PrevR1, PrevR2, bSplitCut, bUsePrevDelt
local dZref = dSafeZ2 + GetZExtra( EMT.HEAD, PrevR2)
dZref = min( dZref, dMaxZ2)
local MovH = { Z = EgtIf( dZref > EMT.L3o, dZref, EMT.L3o)}
MovH.X = -EMT.L2o ; MovH.B = EgtClamp( PrevR2, -90, 90) ; MovH.C = PrevR1 ;
MovH.X = -dXPos ; MovH.B = EgtClamp( PrevR2, -90, 90) ; MovH.C = PrevR1 ;
EmitMoveDataHead( 2, MovH)
if EMT.HEAD == 'H22' and ( abs( dSafeC2 - PrevR1) > 30.1 or abs( dSafeB2 - PrevR2) > 30.1) then
EmitMoveDataHead( 2, { Z=dMaxZ2, B=0})
@@ -2642,23 +2912,27 @@ function EmitZmax( bReset, bEnd, bXhome, PrevR1, PrevR2, bSplitCut, bUsePrevDelt
EmitMoveDataHead( 2, { Z=dMaxZ2})
else
local MovH = { Z = dMaxZ2}
MovH.X = -EMT.L2o ; MovH.B = PrevR2 ; MovH.C = PrevR1 ;
MovH.X = -dXPos ; MovH.B = PrevR2 ; MovH.C = PrevR1 ;
EmitMoveDataHead( 2, MovH)
end
if bXhome then EmitMoveDataHead( 2, { X=-dSafeX2}) end
if bXhome then
EMT.XHOME = true
EmitMoveDataHead( 2, { X=-dSafeX2})
end
EmitMoveStartHead( 2)
EmitMoveWaitHead( 2)
-- altrimenti sega a catena
else
-- ribadisco movimento perchè in G141 si aspetta sempre tutti i valori
local MovH = { X = -EMT.L2o, Z = EMT.L3o, B = PrevR2, C = PrevR1}
local MovH = { X = -dXPos, Z = EMT.L3o, B = PrevR2, C = PrevR1}
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})
if EMT.R3 and abs( EMT.R3) < 0.1 then
EmitMoveDataHead( 2, { Z=ParkCSawZ2})
end
EmitMoveDataHead( 2, { X=-dSafeX2, C=dSafeC2})
if bXhome then
EMT.XHOME = true
EmitMoveDataHead( 2, { X=-ParkX2, Z=ParkCSawZ2, B=ParkB2, C=ParkC2, TPos=50})
end
EmitMoveStartHead( 2)
@@ -2755,12 +3029,26 @@ function EmitParkRoller( dPosT, bSplitCut, bUsePrevDelta)
local DiffY2 = MyParkY2 - dPosY2
--EmtOutput( string.format( 'PosT=%.3f DiffY1=%.3f DiffY2=%.3f', dPosT, DiffY1, DiffY2))
if bSplitCut then
local bYNoMove, bVNoMove
if DiffY1 > 0.1 then
bYNoMove = false
MDChar.Y1 = dPosY1 + DiffY1
else
bYNoMove = true
MDChar.Y1 = dPosY1
end
if DiffY2 < -0.1 then
bVNoMove = false
MDChar.Y2 = dPosY2 + DiffY2
dPosT = dPosT + DiffY2
else
bVNoMove = true
MDChar.Y2 = dPosY2
end
-- se anche solo una morsa è restata in posizione, le sposto comunque entrambe di 5mm per distanziare i pezzi separati
if bYNoMove or bVNoMove then
MDChar.Y1 = MDChar.Y1 + 30
MDChar.Y2 = MDChar.Y2 - 30
end
elseif DiffY1 > 0.1 and DiffY2 < -0.1 then
EmtSetLastError( 1201, 'Error Collision in ParkRoller')
@@ -2788,7 +3076,7 @@ function EmitParkRoller( dPosT, bSplitCut, bUsePrevDelta)
local dPosY1 = dPosT + dY1Delta
local DiffY1 = MyParkY1 - dPosY1
local dMoveY1 = EgtIf( DiffY1 > 0.1, dMoveV1, 0)
local dTryMoveY1 = ParkV1 - dPosT - EgtIf( bSplitCut or EMT.FALL, EMT.LT, 0)
local dTryMoveY1 = min( ParkV1 - dPosT - EgtIf( bSplitCut or EMT.FALL, EMT.LT, 0), MaxY1 - dPosY1 - 10)
if ( dPosT > ParkV2 - ExtraParkV and dPosT < ParkV1 and dPosY1 + dTryMoveY1 < MaxY1) then dMoveY1 = max( dMoveY1, dTryMoveY1) end
MDChar.Y1 = dPosY1 + dMoveY1
MDChar.MovType = 1
@@ -2799,7 +3087,7 @@ function EmitParkRoller( dPosT, bSplitCut, bUsePrevDelta)
local dPosY2 = dPosT + dY2Delta
local DiffY2 = MyParkY2 - dPosY2
local dMoveY2 = EgtIf( DiffY2 < -0.1, dMoveV2, 0)
local dTryMoveY2 = ParkV2 - dPosT - EMT.LT - EMT.DELTA_LT - EMT.HOVM
local dTryMoveY2 = max( ParkV2 - dPosT - EMT.LT - EMT.DELTA_LT - EMT.HOVM, MinY2 - dPosY2 + 10)
if ( dPosT + EMT.LT + EMT.DELTA_LT + EMT.HOVM < ParkV1 + ExtraParkV and dPosT + EMT.LT + EMT.DELTA_LT + EMT.HOVM > ParkV2 and dPosY2 + dTryMoveY2 > MinY2) then dMoveY2 = min( dMoveY2, dTryMoveY2) end
MDChar.Y2 = dPosY2 + dMoveY2
MDChar.MovType = 2
@@ -2824,28 +3112,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
@@ -2883,12 +3149,12 @@ function PreselectNextDiffHead( nMchId, sHead)
if nNextHSet ~= nHSet then
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'})
if sHead == 'H13' and nHSet ~= GetHeadSet( EMT.PREVHEAD_H1) then
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'})
elseif sHead == 'H23' and nHSet ~= GetHeadSet( EMT.PREVHEAD_H2) then
EmitMoveDataHead( 1, { X=-ParkX1, Z=MaxZ1, B=ParkB1, C=ParkC1, TPos=AdjustTcPos( false, EMT.PREVTCPOS_H1)})
EmitMoveStartHead( 1)
EmitMoveWaitHead( 1)
end
@@ -2921,15 +3187,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
@@ -3086,12 +3353,12 @@ end
function EmitBeamHeadData( BhData)
if not BhData.Pz5 then
local sOut = 'G152'
if BhData.T then sOut = sOut .. ' Y' .. EmtLenToString( BhData.T, 3) end
if BhData.Y1 then sOut = sOut .. ' EY' .. EmtLenToString( BhData.Y1, 3) end
if BhData.Y2 then sOut = sOut .. ' EV' .. EmtLenToString( BhData.Y2, 3) end
if BhData.V1 then sOut = sOut .. ' B' .. EmtLenToString( BhData.V1, 3) end
if BhData.V2 then sOut = sOut .. ' C' .. EmtLenToString( BhData.V2, 3) end
if BhData.W then sOut = sOut .. ' EW' .. EmtLenToString( BhData.W, 3) end
if BhData.T then sOut = sOut .. ' Y' .. EmtLenToString( BhData.T, 3) end
if BhData.Y1 then sOut = sOut .. ' EY' .. EmtLenToString( BhData.Y1, 3) end
if BhData.Y2 then sOut = sOut .. ' EV' .. EmtLenToString( BhData.Y2, 3) end
if BhData.V1 then sOut = sOut .. ' B' .. EmtLenToString( BhData.V1, 3) end
if BhData.V2 then sOut = sOut .. ' C' .. EmtLenToString( BhData.V2, 3) end
if BhData.W then sOut = sOut .. ' EW' .. EmtLenToString( BhData.W, 3) end
if BhData.ViseY1 then sOut = sOut .. ' EA' .. EgtNumToString( BhData.ViseY1, 0) end
if BhData.ViseY2 then sOut = sOut .. ' EB' .. EgtNumToString( BhData.ViseY2, 0) end
if BhData.SetHead then sOut = sOut .. ' EC' .. EgtNumToString( BhData.SetHead, 0) end
+228 -61
View File
@@ -24,7 +24,7 @@ end
---------------------------------------------------------------------
-- *** SIMULATION ***
---------------------------------------------------------------------
local COLL_SAFE_DIST = 4
local COLL_SAFE_DIST = 3
---------------------------------------------------------------------
function OnSimulInit()
@@ -119,7 +119,15 @@ function OnSimulStart()
{ Grp = 'Base', Sub = 'COLLISION', Name = 'TRAV'},
{ Grp = 'Base', Sub = 'COLLISION', Name = 'COL1'},
{ Grp = 'Base', Sub = 'COLLISION', Name = 'COL2'},
{ Grp = 'Base', Sub = 'BELT', Name = 'COLLISION'}}
{ Grp = 'Base', Sub = 'COLLISION', Name = 'TC1'},
{ Grp = 'Base', Sub = 'COLLISION', Name = 'TC2'},
{ Grp = 'Base', Sub = 'BELT', Name = 'COLLISION'},
{ Grp = 'X1', Sub = 'COLLISION', Name = 'STM'}}
if EgtGetHeadId( 'H21') then
table.insert( McdData, { Grp = 'X2', Sub = 'COLLISION', Name = 'STM'})
end
-- gruppo CHSAW si attiva solo se progress, one con BIT mortiser o PF
if Progress or Mortiser or EgtGetHeadId( 'H21') then
table.insert( McdData, { Grp = 'Base', Sub = 'COLLISION', Name = 'CHSAW'})
@@ -132,6 +140,10 @@ function OnSimulStart()
if Progress and EgtGetHeadId( 'H21') then
table.insert( McdData, { Grp = 'Base', Sub = 'COLLISION', Name = 'SAW1'})
end
-- se non è Progress ed è una ONE, aggiungo collisioni magazzino speciale
if not Progress and not EgtGetHeadId( 'H21') then
table.insert( McdData, { Grp = 'Base', Sub = 'COLLISION', Name = 'MTC'})
end
if Clamp5 then
table.insert( McdData, { Grp = 'W', Sub = 'COLLISION', Name = 'STM1'})
@@ -152,7 +164,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)
@@ -225,18 +237,24 @@ function OnSimulDispositionStart()
end
end
-- determino la risoluzione dello Zmap
local dArea = b3Raw:getDimX() * b3Raw:getDimY() + b3Raw:getDimX() * b3Raw:getDimZ() + b3Raw:getDimY() * b3Raw:getDimZ()
local dTol = 4.51
if dArea < CoeffVM * 0.5e6 then
dTol = 1.01
elseif dArea < CoeffVM * 1.2e6 then
dTol = 1.51
elseif dArea < CoeffVM * 2.5e6 then
dTol = 1.97
elseif dArea < CoeffVM * 5.0e6 then
dTol = 2.81
elseif dArea < CoeffVM * 10.0e6 then
dTol = 3.77
local dTol = 4.00
if EmtGetVMillStep then
dTol = EmtGetVMillStep( b3Raw:getDimX(), b3Raw:getDimY(), b3Raw:getDimZ(), 4.00)
else
local dArea = b3Raw:getDimX() * b3Raw:getDimY() + b3Raw:getDimX() * b3Raw:getDimZ() + b3Raw:getDimY() * b3Raw:getDimZ()
if dArea < 0.075e6 then
dTol = 0.71
elseif dArea < 0.15e6 then
dTol = 1.01
elseif dArea < 0.3e6 then
dTol = 1.51
elseif dArea < 0.6e6 then
dTol = 1.97
elseif dArea < 1.2e6 then
dTol = 2.81
elseif dArea < 2.4e6 then
dTol = 3.77
end
end
-- creo lo Zmap
local VMillId = EgtVolZmapBox( nPartRawId, b3Raw:getMin(), b3Raw:getDimX(), b3Raw:getDimY(), b3Raw:getDimZ(), dTol, true, GDB_RT.GLOB)
@@ -345,6 +363,8 @@ function OnSimulDispositionStart()
else
EgtOutText( 'Barra non ruotata')
end
-- forzo apertura rulli in caso fossero chiusi. Altrimenti all'apertura nell OnSimulMoveStart sposterebbe anche la trave
ExecParkRoller( nil, nil, nil, nil, nil, nil)
end
-- eseguo aggancio
local nRawId = EgtGetFirstRawPart()
@@ -508,6 +528,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)
@@ -515,6 +537,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)
@@ -652,10 +676,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
@@ -755,6 +779,12 @@ function OnSimulMachiningStart()
else
EMT.TASKID = 0
end
-- gestione eventuale tastatura
EMT.PROBE = nil
local bProbing = EgtGetValInNotes( EMT.MCHUSERNOTES, 'PROBE', 'b')
if bProbing then
EMT.PROBE = true
end
-- gestione eventuale lavorazione in doppio
local nDouType = EgtGetValInNotes( EMT.MCHUSERNOTES, 'DOUBLE', 'i')
if nDouType == 2 then
@@ -818,16 +848,19 @@ function OnSimulMachiningEnd()
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
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
@@ -947,6 +980,7 @@ function OnSimulMoveStart()
VerifyY2Stroke( EMT.A2)
VerifyV1Stroke( EMT.A3)
VerifyV2Stroke( EMT.A4)
-- se devo subito parcheggiare i rulli
local nRes = 0
if bParkV then
@@ -958,6 +992,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')
@@ -972,20 +1012,44 @@ 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 bMoveZbeforeX = false
local dZref = EMT.L3
if EMT.HEAD == 'H12' and ( EgtIf( 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
-- se vado in posizione speciale rotazione assi, poi devo ritornare alla X vera di lavoro
local dMoveXtoFinalPosition = false
local dXref = EMT.L2
if EMT.HEAD == 'H12' and -EMT.L2 < -LimX1PlRotSaw then
dXref = LimX1PlRotSaw
SimulMoveAxis( 'X1', dXref, MCH_SIM_STEP.RAPID)
dZref = max( EMT.L3, Z1Home + GetZExtra( EMT.HEAD, EMT.R2))
dMoveXtoFinalPosition = true
elseif not bMoveZbeforeX then
SimulMoveAxis( 'X1', dXref, MCH_SIM_STEP.RAPID)
else
SimulMoveAxis( 'X1', LimX1PlRotSaw, MCH_SIM_STEP.RAPID)
dZref = max( EMT.L3, Z1Home + GetZExtra( EMT.HEAD, EMT.R2))
dMoveXtoFinalPosition = true
end
SimulMoveAxis( 'X1', dXref, MCH_SIM_STEP.RAPID)
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
-- 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
if dMoveXtoFinalPosition then
SimulMoveAxis( 'X1', EMT.L2, MCH_SIM_STEP.RAPID)
end
-- caso standard
else
SimulMoveAxis( 'Z1', dZref, MCH_SIM_STEP.RAPID)
@@ -1029,21 +1093,34 @@ 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)
else
SimulMoveAxis( 'X1', LimX1RotSawTC2, 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)
SimulMoveAxis( 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'C1', EMT.R1, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
end
end
-- altrimenti sega a catena (H13 o H15)
@@ -1088,25 +1165,59 @@ 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
if EMT.HEAD == 'H22' and ( EgtIf( BD.RIGHT_LOAD, -EMT.L2 < -LimX1RotSaw, -EMT.L2 > -LimX1RotSaw) or EMT.R2 > 91) then
dZref = Z2Home + GetZExtra( EMT.HEAD, EMT.R2) - 100
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)
-- caso standard
-- 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)
else
SimulMoveAxis( 'Z2', dZref, MCH_SIM_STEP.RAPID)
SimulMoveAxis( 'B2', EMT.R2, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'C2', EMT.R1, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'X2', LimX2RotSaw, MCH_SIM_STEP.RAPID)
end
-- caso speciale per trave alta con rotazione lama pericolosa (tolto "and EMT.SB > 379")
if abs( C2Pos - EMT.R1) > 1 and ( abs( C2Home - EMT.R1) > 30.1 or abs( B2Home - EMT.R2) > 30.1) then
if EMT.HEAD == 'H22' 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)
SimulMoveAxis( 'B2', EMT.R2, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'C2', EMT.R1, MCH_SIM_STEP.COLLROT)
if bMoveZbeforeX then
SimulMoveAxis( 'Z2', EMT.L3, MCH_SIM_STEP.RAPID)
end
end
end
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)
@@ -1185,6 +1296,7 @@ function OnSimulMoveStart()
EMT.A4 = EgtIf( GetV2ToClose(), EMT.V2NEXTPOS, ParkV2)
end
EMT.ZMAX = nil
EMT.XHOME = nil
end
---------------------------------------------------------------------
@@ -1293,6 +1405,10 @@ function ExecAuxCmd( sCmd, bPathStart)
ExecOpenRoller( 1)
ExecOpenRoller( 2)
local sV1, MoveV1, sV2, MoveV2 = CalcMoveV1V2ForAuxCmd( Cmd)
-- se stringo i rulli e ho lama, verifico che sia in home
if MoveV1 and MoveV1 < 400 and ( EMT.HEAD == 'H12' or EMT.HEAD == 'H22') and EMT.ZMAX and not EMT.XHOME then
ExecMoveZmax( false, true)
end
local bOk, bOk1, bOk2, bOk3 = SimulMoveAxes( Cmd[2], tonumber( Cmd[3]), MCH_SIM_STEP.RAPID,
sV1, MoveV1, MCH_SIM_STEP.RAPID,
sV2, MoveV2, MCH_SIM_STEP.RAPID)
@@ -1315,6 +1431,10 @@ function ExecAuxCmd( sCmd, bPathStart)
ExecOpenRoller( 1)
ExecOpenRoller( 2)
local sV1, MoveV1, sV2, MoveV2 = CalcMoveV1V2ForAuxCmd( Cmd)
-- se stringo i rulli e ho lama, verifico che sia in home
if MoveV1 and MoveV1 < 400 and ( EMT.HEAD == 'H12' or EMT.HEAD == 'H22') and EMT.ZMAX and not EMT.XHOME then
ExecMoveZmax( false, true)
end
local bOk, bOk1, bOk2, bOk3, bOk4 = SimulMoveAxes( Cmd[2], tonumber( Cmd[3]), MCH_SIM_STEP.RAPID,
Cmd[4], tonumber( Cmd[5]), MCH_SIM_STEP.RAPID,
sV1, MoveV1, MCH_SIM_STEP.RAPID,
@@ -1338,6 +1458,10 @@ function ExecAuxCmd( sCmd, bPathStart)
ExecOpenRoller( 1)
ExecOpenRoller( 2)
local sV1, MoveV1, sV2, MoveV2 = CalcMoveV1V2ForAuxCmd( Cmd)
-- se stringo i rulli e ho lama, verifico che sia in home
if MoveV1 and MoveV1 < 400 and ( EMT.HEAD == 'H12' or EMT.HEAD == 'H22') and EMT.ZMAX and not EMT.XHOME then
ExecMoveZmax( false, true)
end
local bOk, bOk1, bOk2, bOk3, bOk4, bOk5 = SimulMoveAxes( Cmd[2], tonumber( Cmd[3]), MCH_SIM_STEP.RAPID,
Cmd[4], tonumber( Cmd[5]), MCH_SIM_STEP.RAPID,
Cmd[6], tonumber( Cmd[7]), MCH_SIM_STEP.RAPID,
@@ -1518,8 +1642,8 @@ function ExecMoveZmax( bMchSplit, btoXHome)
if GetHeadTCSet( EMT.HEAD, EMT.TCPOS) == 'Head1_TC1' then
if not HeadIsChainSaw( EMT.HEAD) then
if abs( HomeC - CurrC) > 0.1 or abs( HomeB - CurrB) > 0.1 then
local dZref = HomeZ + GetZExtra( EMT.HEAD, CurrB)
if EgtIf( not EgtGetHeadId( 'H21') or BD.RIGHT_LOAD, -CurrX < -LimX1RotSaw, -CurrX > -LimX1RotSaw) then
local dZref = HomeZ + GetZExtra( EMT.HEAD, EgtClamp( CurrB, -90, 90))
if EgtIf( BD.RIGHT_LOAD, -CurrX < -LimX1RotSaw, -CurrX > -LimX1RotSaw) then
dZref = dZref - EgtIf( not Mortiser, 100, 370)
end
SimulMoveAxes( 'Z1', EgtIf( dZref > CurrZ, dZref, CurrZ), MCH_SIM_STEP.RAPID, 'B1', EgtClamp( CurrB, -90, 90), MCH_SIM_STEP.COLLROT)
@@ -1531,6 +1655,7 @@ function ExecMoveZmax( bMchSplit, btoXHome)
end
SimulMoveAxis( 'Z1', MaxZ1, MCH_SIM_STEP.RAPID)
if btoXHome then
EMT.XHOME = true
SimulMoveAxis( 'X1', ParkX1, MCH_SIM_STEP.RAPID)
end
-- se lavorazione in doppio
@@ -1542,6 +1667,7 @@ function ExecMoveZmax( bMchSplit, btoXHome)
SimulMoveAxes( 'B2', ParkB2, MCH_SIM_STEP.COLLROT, 'C2', ParkC2, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'Z2', MaxZ2, MCH_SIM_STEP.RAPID)
if bToXHome then
EMT.XHOME = true
SimulMoveAxis( 'X2', ParkX2, MCH_SIM_STEP.RAPID)
end
EMT.DOU_TO_ZMAX = nil
@@ -1549,8 +1675,8 @@ function ExecMoveZmax( bMchSplit, btoXHome)
-- altrimenti sega a catena
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)
if EMT.R3 and abs( EMT.R3) < 0.1 then
SimulMoveAxis( 'Z1', ParkCSawZ1, MCH_SIM_STEP.RAPID)
end
SimulMoveAxes( 'X1', HomeX, MCH_SIM_STEP.RAPID, 'C1', HomeC, MCH_SIM_STEP.COLLROT)
end
@@ -1560,7 +1686,7 @@ function ExecMoveZmax( bMchSplit, btoXHome)
if abs( HomeC - CurrC) > 0.1 or abs( HomeB - CurrB) > 0.1 then
local dZref = HomeZ + GetZExtra( EMT.HEAD, CurrB)
SimulMoveAxes( 'Z1', EgtIf( dZref > CurrZ, dZref, CurrZ), MCH_SIM_STEP.RAPID, 'B1', EgtClamp( CurrB, -90, 90), MCH_SIM_STEP.COLLROT)
if EMT.HEAD == 'H12' and ( abs( HomeC - CurrC) > 30.1 or abs( HomeB - CurrB) > 30.1) then
if EMT.HEAD == 'H12' and ( abs( HomeC - CurrC) > 30.1 or abs( HomeB - CurrB) > 30.1) or not( bProgress) then
SimulMoveAxes( 'Z1', MaxZ1, MCH_SIM_STEP.RAPID, 'B1', 0, MCH_SIM_STEP.COLLROT)
end
SimulMoveAxis( 'C1', HomeC, MCH_SIM_STEP.COLLROT)
@@ -1568,13 +1694,23 @@ function ExecMoveZmax( bMchSplit, btoXHome)
end
SimulMoveAxis( 'Z1', MaxZ1, MCH_SIM_STEP.RAPID)
if btoXHome then
EMT.XHOME = true
SimulMoveAxis( 'X1', ParkX1, MCH_SIM_STEP.RAPID)
end
-- altrimenti sega a catena
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)
if EMT.R3 and abs( EMT.R3) < 0.1 then
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
EMT.XHOME = true
end
SimulMoveAxes( 'X1', HomeX, MCH_SIM_STEP.RAPID, 'C1', HomeC, MCH_SIM_STEP.COLLROT)
end
@@ -1595,15 +1731,16 @@ function ExecMoveZmax( bMchSplit, btoXHome)
end
SimulMoveAxis( 'Z2', MaxZ2, MCH_SIM_STEP.RAPID)
if btoXHome then
EMT.XHOME = true
SimulMoveAxis( 'X2', ParkX2, MCH_SIM_STEP.RAPID)
end
-- altrimenti sega a catena
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)
if EMT.R3 and abs( EMT.R3) < 0.1 then
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
@@ -1638,10 +1775,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
@@ -1726,8 +1867,20 @@ function ExecParkRoller( PosY1, PosY2, PosV1, PosV2, bSpliCut, bAgg)
local DiffY2 = MyParkY2 - PosY2
-- se appena eseguito taglio di separazione
if bSpliCut then
local dAddMove
-- se entrambe le morse si spostano vado in posizione calcolata
if DiffY1 > 0.1 and DiffY2 < -0.1 then
dAddMove = 0
-- se almeno una è rimasta ferma in posizione, allontano comunque di 30mm ulteriori
else
dAddMove = 30
end
local MoveY1 = max( DiffY1, 0.0)
local MoveY2 = min( DiffY2, 0.0)
MoveY1 = MoveY1 + dAddMove
MoveY2 = MoveY2 - dAddMove
-- aggancio i pezzi rimanenti all'asse Y1
LinkRemainingPartsToY1()
-- eseguo i movimenti
@@ -1775,7 +1928,7 @@ function ExecParkRoller( PosY1, PosY2, PosV1, PosV2, bSpliCut, bAgg)
local MoveV1 = ParkV1 - PosV1
local DiffY1 = MyParkY1 - PosY1
local MoveY1 = EgtIf( DiffY1 > 0.1, MoveV1, 0)
local TryMoveY1 = ParkV1 - PosT - EgtIf( bSpliCut or EMT.FALL, EMT.LT, 0) - EMT.HOVM
local TryMoveY1 = min( ParkV1 - PosT - EgtIf( bSpliCut or EMT.FALL, EMT.LT, 0) - EMT.HOVM, MaxY1 - PosY1 - 10)
if ( PosT > ParkV2 - ExtraParkV and PosT < ParkV1 and PosY1 + TryMoveY1 < MaxY1 and not EMT.W2DELTA) then MoveY1 = max( MoveY1, TryMoveY1) end
-- se appena eseguito taglio di separazione
if bSpliCut then
@@ -1805,7 +1958,7 @@ function ExecParkRoller( PosY1, PosY2, PosV1, PosV2, bSpliCut, bAgg)
local MoveV2 = ParkV2 - PosV2
local DiffY2 = MyParkY2 - PosY2
local MoveY2 = EgtIf( DiffY2 < -0.1, MoveV2, 0)
local TryMoveY2 = ParkV2 - PosT - EMT.LT - EMT.DELTA_LT - EMT.HOVM
local TryMoveY2 = max( ParkV2 - PosT - EMT.LT - EMT.DELTA_LT - EMT.HOVM, MinY2 - PosY2 + 10)
if ( PosT + EMT.LT + EMT.DELTA_LT + EMT.HOVM < ParkV1 + ExtraParkV and PosT + EMT.LT + EMT.DELTA_LT + EMT.HOVM > ParkV2 and PosY2 + TryMoveY2 > MinY2) then MoveY2 = min( MoveY2, TryMoveY2) end
if not SimulMoveAxes( 'T', PosT + MoveY2, MCH_SIM_STEP.RAPID,
'V1', ParkV1, MCH_SIM_STEP.RAPID,
@@ -2135,6 +2288,15 @@ function LoadNextTool( nHSet, sTcPosDef, bFirst)
return sTool
end
---------------------------------------------------------------------
function VerifyToolProbeCompatibility()
local bToolIsCompatible = false
if EMT.TTOTLEN < 160 and EMT.TTOTDIAM < 80 then
bToolIsCompatible = true
end
return bToolIsCompatible
end
---------------------------------------------------------------------
-- *** ESTIMATION T&L ***
---------------------------------------------------------------------
@@ -2674,7 +2836,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)
+46 -31
View File
@@ -73,7 +73,7 @@ function OnSpecialGetMaxZ()
EMC.MAXZ = ParkZ1 + CalcExtraZ( vtTpZm, vtT, vMZ)
end
elseif EMC.HEAD == 'H12' and sHead_TC == 'Head1_TC1' then
if vtTp:getX() > 0.3 and vtT:getX() > 0.3 then
if vtTp:getX() > 0.4 and vtT:getX() > 0.4 then
if bBSameSign and abs( EMC.R1 - EMC.R1p) < 165 then
EMC.MAXZ = MaxZ1 - EgtIf( abs( EMC.R2) < 90.1 and abs( EMC.R2p) < 90.1, 0, 130)
elseif vtTp:getZ() > 0.707 or vtT:getZ() > 0.707 then
@@ -95,7 +95,7 @@ function OnSpecialGetMaxZ()
EMC.MAXZ = ParkZ1 + CalcExtraZ( vtTpZm, vtT, vMZ)
end
elseif EMC.HEAD == 'H12' and sHead_TC == 'Head1_TC2' then
if vtTp:getX() > 0.3 and vtT:getX() > 0.3 then
if vtTp:getX() > 0.4 and vtT:getX() > 0.4 then
if bBSameSign and abs( EMC.R1 - EMC.R1p) < 165 then
EMC.MAXZ = MaxZ1 - EgtIf( abs( EMC.R2) < 90.1 and abs( EMC.R2p) < 90.1, 0, 130)
elseif vtTp:getZ() > 0.707 or vtT:getZ() > 0.707 then
@@ -124,7 +124,7 @@ function OnSpecialGetMaxZ()
EMC.MAXZ = ParkZ2 + CalcExtraZ( vtTpZm, vtT, vMZ)
end
elseif EMC.HEAD == 'H22' then
if vtTp:getX() > 0.3 and vtT:getX() > 0.3 then
if vtTp:getX() > 0.4 and vtT:getX() > 0.4 then
if bBSameSign and abs( EMC.R1 - EMC.R1p) < 165 then
EMC.MAXZ = MaxZ2 - EgtIf( abs( EMC.R2) < 90.1 and abs( EMC.R2p) < 90.1, 0, 130)
elseif vtTp:getZ() > 0.707 or vtT:getZ() > 0.707 then
@@ -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)})
@@ -1262,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)
@@ -1301,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
@@ -1346,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
@@ -1420,7 +1423,14 @@ function SpecCalcSplit( dLenRaw, dMaxLenLeft)
local vCmd = {}
EgtOutLog( ' *[S]', 1)
local bSplit = ( EMC.Y2DELTA ~= nil or EMC.W2DELTA ~= nil)
local ParkT = EgtIf( bSplit and dMaxLenLeft > ParkV1 - 50, LoadT, ParkV1)
local ParkT = ParkV1
if bSplit then
if dMaxLenLeft + 100 > LoadT then
ParkT = dMaxLenLeft + 300
elseif dMaxLenLeft + 100 > ParkV1 then
ParkT = LoadT
end
end
local sType = EgtIf( EMC.Y2DELTA, 'Split', EgtIf( EMC.W2DELTA, 'SpecSplit', 'Fall'))
table.insert( vCmd, { 0, sType})
if not bSplit then EnsureZmax( false, vCmd) end
@@ -1656,19 +1666,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)
@@ -1824,7 +1839,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]')
@@ -1835,7 +1850,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]')
@@ -1845,7 +1860,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]')
@@ -1856,7 +1871,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})
@@ -2182,7 +2197,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
@@ -2321,7 +2336,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
@@ -2393,7 +2408,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
BIN
View File
Binary file not shown.
+46 -34
View File
@@ -35,34 +35,17 @@
-- 2023/02/01 ver 2.5b1 Aggiunta gestione eventuale mortasatrice.
-- 2023/02/03 ver 2.5b2 Gestione controllo NUM (TIPO_CN = 0->Axium vecchio, 2->Flexium). Migliorata gestione Pinza5 (MAX_BACK_CLAMP_5).
-- 2023/03/03 ver 2.5c1 Correzione per lav.ne in doppio dopo taglio con sega a catena. In PartProgram al nome lavorazione aggiunto Double.
-- 2023/03/29 ver 2.5c5 Modificato approccio lame sempre come per pezzi alti. Migliorata fedeltà simulazione a generazione.
-- 2023/04/03 ver 2.5d1 Eliminata testa dummy 'H14' ( EgtMachKernel minimo 2.5d1).
-- 2023/04/21 ver 2.5d3 Riportate modifiche PF : DeltaW per Pinza5, in generazione CN corretta verifica movimenti pinze o rulli per G151/G152, corretta gestione AggLoad (falg * da mlse).
-- 2023/04/21 ver 2.5d4 Migliorato riposizionamento testa trave dopo scambio carrelli (ExtraParkV a 100).
-- 2023/06/08 ver 2.5f1 Riportate correzioni da PF (riposizionamento carrelli su split con pezzi a caduta, in genera CN controllo conservazione piano impostato).
-- In genera CN corretta risalita in Z come in simulazione (ticket #1294).
-- 2023/06/13 ver 2.5f2 Corretta distanza Back per aggiuntivo al carico prima di scambi carrelli.
-- 2023/06/26 ver 2.5f3 Tolte da teste per lame forzature risalite in Z. In generaz. CN aggiunto M05 su ultima lavorazione prima di SpecUnloading o Fall.
-- 2023/07/31 ver 2.5g1 Aggiunta apertura V1 allo scarico finale di barra con uso di entrambe Y1 e Y2 (#1399).
-- 2023/08/07 ver 2.5h1 In split prima di rotazione migliorato controllo spazio dietro per scambio carrelli. Ripristinata forzatura risalita in Z per lame se DeltaAng > 210 e HzPezzo > 610.
-- 2023/09/29 ver 2.5i1 In BeamData e mlde aggiunta la lettura di alcuni parametri da Ts3Data.
-- 2023/11/15 ver 2.5k1 In BeamData distanza sicurezza tagli CUT_SIC portata a 30.
-- 2023/12/05 ver 2.6a1 Prima versione con utilizzo post-processore standard per macchine ONE e PF
-- 2024/01/22 ver 2.6a2 Allineamento con common ver 2.6a2
-- 2024/01/23 ver 2.6a3 Allineamento con common ver 2.6a3
-- In BeamData, parametro VICE_MINH portato a 1000
-- 2024/02/19 ver 2.6b1 In BeamData aggiunta funzione GetBlockedAxis che sostituisce la GetChainSawBlockedAxis.
-- 2024/02/23 ver 2.6b2 Allineamento con common ver. 2.6b2; in mlde aggiunte chiamate EgtAddToPackagePath
-- 2024/02/23 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/11 ver 2.6c3 Allineamento con common ver. 2.6c7
-------------------------------------
-- NOTE VERSIONI SUCCESSIVE IN GIT --
-------------------------------------
-- Intestazioni
require( 'EmtGenerator')
EgtEnableDebug( false)
PP_VER = '2.6c3'
PP_VER = '2.7f1_DEV3'
PP_NVER = '2.7.6.1'
MIN_MACH_VER = '2.5k1'
MACH_NAME = 'Essetre-PFrl'
@@ -147,7 +130,7 @@ ParkZ1 = -535
ParkC1 = 90
ParkB1 = 90
LimX1RotSaw = 1900
LimX1PlRotSaw = 1900
LimX1PlRotSaw = 1970
ParkCSawX1 = 1350
ParkCSawX1S = ParkX1
ParkCSawZ1 = -100
@@ -171,7 +154,7 @@ ParkC2 = -90
ParkB2 = -90
MinDeltaX1X2 = 650
MinDistToolX1X2 = 40
LimX2RotSaw = 1900
LimX2RotSaw = 800
TurnerOffs = 120.0
AggLoad = 50
DeltaTabY = 1170.0
@@ -179,7 +162,7 @@ DeltaTabZ = -1010.0 -- per TPA la quota è dal centro di rotazione (va aggi
DeltaRulliTraveZ = 980
DeltaRulliTappetoZ = -485
DimTabY = 500
DimTabX = 24000
DimTabX = 30000
Delta2TabY = 1170.0
Delta2TabZ = -1010.0 -- per TPA la quota è dal centro di rotazione (va aggiunto MillOffs)
Head2X = 0
@@ -189,8 +172,12 @@ DefTcPos1 = 'T3'
DefTcPos2 = 'T13'
SecondSaw = false
AutomaticRotation = true
OptimizedLoadBeam = true
AutoRotMinLen = 0
CoeffVM = 0.5
EstimationRapidMultiplier = 1
ForceToCloseRollersGate = false
Probe = nil
-- Aggiornamento con dati da TechnoEssetre7
local sTs3Data = EgtGetStringFromIni( 'Beam', 'DATA_DIR', "C:\\TechnoEssetre7\\EgtData", EgtGetIniFile()).."\\Essetre-PFrl.data"
@@ -274,10 +261,17 @@ 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.MAXFEEDPINZE then MaxFeedPinze = Machine.Offsets.MAXFEEDPINZE end
if Machine.Offsets.MAXACC then MaxAcc = Machine.Offsets.MAXACC end
if Machine.Offsets.MINACC then MinAcc = Machine.Offsets.MINACC 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
if Machine.Offsets.PROBE then Probe = Machine.Offsets.PROBE end -- Tastatore su entrembe le teste. 1 = solo testa 1, 2 = solo testa 2, 3 = entrambe le teste
-- aggiustamenti
MinY1 = MinV1 + MinDeltaYV
MaxY1 = MaxMchY1
ParkV1 = MaxV1
ParkV1 = MaxV1
ParkY1 = ParkV1 + MinDeltaYV
MinY2 = MinMchY2
MaxY2 = MaxV2 - MinDeltaYV
@@ -321,7 +315,7 @@ local X1Id = EmtAxis {
Home = ParkX1,
Invert = true,
Geo = 'X1_AXIS/GEO',
Aux = 'X1_AXIS/SOLID'}
Aux = {'X1_AXIS/SOLID', 'X1_AXIS/COLLISION'}}
-- *** Testa 1 ***
EmtAxis {
Name = 'Z1',
@@ -345,6 +339,13 @@ EmtAxis {
Home = ParkC1,
Geo = 'C1_AXIS/GEO',
Aux = {'C1_AXIS/SOLID', 'C1_AXIS/COLLISION'}}
-- se tastatore presente
local sBAxisAuxGeom
if Probe == 1 or Probe == 3 then
sBAxisAuxGeom = {'B1_AXIS/SOLID', 'B1_AXIS/COLLISION', 'PROBE_B1/SOLID_PROBE', 'PROBE_B1/COLLISION_PROBE'}
else
sBAxisAuxGeom = {'B1_AXIS/SOLID', 'B1_AXIS/COLLISION'}
end
EmtAxis {
Name = 'B1',
Parent = 'C1',
@@ -355,7 +356,7 @@ EmtAxis {
Stroke = {MinB1, MaxB1},
Home = ParkB1,
Geo = 'B1_AXIS/GEO',
Aux = {'B1_AXIS/SOLID', 'B1_AXIS/COLLISION'}}
Aux = sBAxisAuxGeom }
-- Frese
local H11Id = EmtHead {
Name = 'H11',
@@ -421,7 +422,7 @@ local X2Id = EmtAxis {
Home = ParkX2,
Invert = true,
Geo = 'X2_AXIS/GEO',
Aux = 'X2_AXIS/SOLID'}
Aux = {'X2_AXIS/SOLID', 'X2_AXIS/COLLISION'}}
local Z2Id = EmtAxis {
Name = 'Z2',
Parent = 'X2',
@@ -444,6 +445,12 @@ local C2Id = EmtAxis {
Home = ParkC2,
Geo = 'C2_AXIS/GEO',
Aux = {'C2_AXIS/SOLID', 'C2_AXIS/COLLISION'}}
-- se presente tastatore
if Probe == 2 or Probe == 3 then
sBAxisAuxGeom = {'B2_AXIS/SOLID', 'B2_AXIS/COLLISION', 'PROBE_B2/SOLID_PROBE', 'PROBE_B2/COLLISION_PROBE'}
else
sBAxisAuxGeom = {'B2_AXIS/SOLID', 'B2_AXIS/COLLISION'}
end
local B2Id = EmtAxis {
Name = 'B2',
Parent = 'C2',
@@ -454,9 +461,10 @@ local B2Id = EmtAxis {
Stroke = {MinB2, MaxB2},
Home = ParkB2,
Geo = 'B2_AXIS/GEO',
Aux = {'B2_AXIS/SOLID', 'B2_AXIS/COLLISION'}}
Aux = sBAxisAuxGeom}
local vtMove2 = Vector3d( 0, Head2Y, Head2Z)
EgtMove( EgtGetFirstNameInGroup( X2Id, 'SOLID'), vtMove2, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( X2Id, 'COLLISION'), vtMove2, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( Z2Id, 'SOLID'), vtMove2, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( Z2Id, 'COLLISION'), vtMove2, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( C2Id, 'SOLID'), vtMove2, GDB_RT.GLOB)
@@ -635,7 +643,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 {
@@ -814,7 +822,9 @@ if Mortiser then
EgtMove( EgtGetFirstNameInGroup( BaseId, 'TC4') or GDB_ID.NULL, vtMovB, GDB_RT.GLOB)
end
EgtMove( EgtGetFirstNameInGroup( X1Id, 'SOLID'), vtMovB, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( X1Id, 'COLLISION'), vtMovB, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( X2Id, 'SOLID'), vtMovB, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( X2Id, 'COLLISION'), vtMovB, GDB_RT.GLOB)
local vtMovC = Vector3d( 0, 0, ( DeltaTabZ + DeltaRulliTappetoZ + 1495)) -- -( -1010 - 485)
EgtMove( EgtGetFirstNameInGroup( BaseId, 'BELT'), vtMovC, GDB_RT.GLOB)
local vtMove = Vector3d( 0, ( DeltaTabY - 1170.0), ( DeltaTabZ + 1010.0))
@@ -986,7 +996,7 @@ function GetZExtra( sHead, dAngV)
elseif abs( dAngV) < 60.1 then
return 200
elseif abs( dAngV) < 90.1 then
return 10
return 1
else
return 0
end
@@ -998,7 +1008,9 @@ function GetZExtra( sHead, dAngV)
elseif abs( dAngV) < 60.1 then
return 200
elseif abs( dAngV) < 90.1 then
return 10
return 1
elseif abs( dAngV) < 120 then
return -100
else
return 0
end
+61
View File
@@ -0,0 +1,61 @@
; 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=l,MaxElev,0
1=d,OutRaw,0
2=l,SideElev,0
3=d,TrimExt,0
4=s,VtFaceUse,0,0,0
5=s,EdgesFaceUse,0
6=b,PROBE,0
7=b,START-PROBE,0
8=b,END-PROBE,0
[Pocketing]
0=l,MaxElev,0
1=b,Open,0
2=d,OpenMinSafe,0
3=d,OpenOutRaw,0
4=l,MaxOptSize,0
[Mortising]
0=d,MaxElev,0
[Chiseling]
[SawRoughing]
[SawFinishing]
[GenMachining]
[SurfRoughing]
0=l,MaxElev,1000
1=b,PlaneZ,0
[SurfFinishing]
0=b,SkipMaxDown,1
[5AxMilling]
0=l,LinTol,0.01
1=l,MaxLen,10
2=s,Type,ZigZag
3=d,SideAng,90
4=l,Step,10
5=d,AngIni,-90
6=d,AngFin,90
7=l,LiTang,0
8=l,LiOrth,0
9=l,LiElev,0
10=l,LoTang,0
11=l,LoOrth,0
12=l,LoElev,0
13=b,DirFromGuide,0
14=b,SurfAvoid,0
+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
+116 -3
View File
@@ -1,7 +1,120 @@
==== Essetre_StdPF Update Log ====
==== Common_ONE-PF Update Log ====
Versione 2.7f1 (04/06/2025)
- (SIM) Aggiunta gestione qualità VMILL da impostazioni macchina. Tolto parametro 'CoeffVM'.
- (GEN) Prima versione gestione tastatore
- (GEN) Aggiunti parametri FMAXPINZE, MAXACC, MINACC configurabili da TS3. Ticket#2052
Versione 2.7e1 (28/05/2025)
- (SIM-GEN) Alla separazione si spostano i carrelli di 30mm aprendo il taglio. Ticket#2259,Ticket#2328
Versione 2.7d1 (16/04/2025)
- (SIM) Distanza di collisione portata a 3mm, qualità VMILL ridotta a 4mm. Ticket#2395
Versione 2.7c3 (25/03/2025)
- (GEN) Corretto movimento approccio alla lavorazione se utensile lama montata su magazzino 2. Ticket#2361
Versione 2.7c2 (12/03/2025)
- (SIM-GEN) Migliorato calcolo posizione barra dopo split. Tiene in considerazione ingombro lavorazioni pezzo. Ticket#2321
- (GEN) Aggiunta commenti HEADER e FOOTER per comunicazione con linea o altre macchine, da parte di Essetre.
- (SIm-GEN) Migliorato movimento approccio al pezzo con lama. Allineamento simulazione-generazione che facevano due movimenti leggermente diversi. Ticket#2335
Versione 2.7c1 (05/03/2025)
- (GEN) Corretto movimento in home utensile precedente. Ticket#2324
Versione 2.7b1 (07/02/2025)
- (SIM-GEN) In caso di Progress, alla deselezione utensile testa 1 su TC2 si fa movimento Z raddrizzando asse B. Ticket#2247
- (SIM-GEN) Estensione soluzione Ticket#2206. Ora si aprono di 5mm extra anche se solo una morsa resta in posizione. Ticket#2259
- (SIM) Migliorato controllo collisioni con traversa. Ora si considera asse X. Serve modifica NGE! Ticket#2257
Versione 2.7a2 (15/01/2024)
- (SIM-GEN) In caso di testa 1 su TC2 (ONE), si ruota prima la C e poi la B. Ticket#2247
Versione 2.7a1 (07/01/2024)
- (GEN) In separazione, quando si porta indietro il restante, si aprono le paratie rulli subito. Ticket#2214
- (SIM-GEN) Se entrambe le morse sono restate in posizione, le sposto comunque di 5mm per distanziare i pezzi separati. Ticket#2206
Versione 2.6l2 (09/12/2024)
- (SIM-GEN) Corretto problema introdotto in 2.6l1 per risolvere #2198. Ticket#2203
- (SIM-GEN) In MLSE modificato controllo direzione utensile per determinare Z massima. Ticket#2204
Versione 2.6l1 (02/12/2024)
- (SIM) Dopo scarico pezzo per ribaltamento, si aprono sempre i rulli. Ticket#2192
- (SIM-GEN) Nei movimenti si ricalcola la Z solo se la quota di lavoro è più in alta della posizione a ZHOME della testa. Ticket#2198
- (GEN) Se bisogna andare in home, ma la testa lo è già, non si scrive nulla
Versione 2.6j3 (21/10/2024)
- (GEN) Se richiesto movimento in home, si scrive sempre parcheggio in home dell'utensile precedente. Prima si scriveva solo per lama.
Versione 2.6j2 (17/10/2024)
- (SIM-GEN) Se motosega prelevata con A=0, alla fine la si porta sempre alla quota ZMAX, indipendentemente dall'altezza trave che era fissata a 650mm. Ora lo fa sempre.
Versione 2.6j1 (08/10/2024)
- (SIM-GEN) Corretto primo movimento di approccio al pezzo. Ticket#2093
- (SIM-GEN) Corretto movimento in Home in caso di lama e movimento rulliera di carico. Ticket#2054
- (GEN) In caso di movimento in Home non si fa più preselezione ma si tiene utensile vecchio. Ticket#1926
Versione 2.6i2 (13/09/2024)
- (GEN) Migliorato calcolo chiusura paratia rulli con aggiornamento lunghezza della barra in caso di ultimo taglio e grezzo residuo in coda. Ticket#2017
- (NGE-MLDE-GEN-SIM) Aggiunto solidi collisione TC. Corretto movimento a Y di sicurezza con lama. Ticket#2042
- (NGE-SIM) Aggiunta collisione magazzino motosega ONE
Versione 2.6i1 (02/09/2024)
- (SIM-GEN) Quando si aprono i rulli, se la trave non può seguire i rulli perchè la pinza andrebbe in extra-corsa, si sposta comunque la pinza fino al massimo della sua corsa. Ticket#1949
- (GEN) In preselezione. Se lavorazione motosega, non mando a parcheggio altra testa con utensile precedente, perchè subito dopo viene chiamata preselezione. Ticket#1961
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)
- (GEN) Aggiunta gestione parametro "SECDIST". Distanza di sicurezza tra paratia con rulli e utensile/testa. Parametro da inserire nelle note utensile.
- (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)
@@ -19,7 +132,7 @@ 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.6c7', -- versione script
VERSION = '2.7f1', -- versione script
MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel
}