Compare commits

...

87 Commits

Author SHA1 Message Date
andrea.villa 34ced69228 Corretto disegno porta utensile 2025-12-11 09:05:59 +01:00
andrea.villa b7f18cf0c0 Aggiunto tipo di lavorazione con aggregato flottante 2025-12-10 12:18:36 +01:00
andrea.villa 11f452bac8 - Allineamento con common ver. 2.7l1
- Nuovo porta-utensile
2025-12-10 10:09:04 +01:00
andrea.villa 5069b4fc4c Solido di collisione asse C spostato 3mm più in alto perchè con lama diametro 621mm ci passava talmente vicino che dava errore. 2025-11-20 14:54:44 +01:00
andrea.villa f1e3ff79b4 In NGE mancava manina portautensile in posizione T11 quando c'era aggregato BH 2025-11-18 16:06:34 +01:00
andrea.villa d6b602a59d Merge branch 'develop' 2025-11-18 15:57:56 +01:00
andrea.villa 0493ddfa66 Cambio versione per rilascio a Essetre dopo aggiunta gestione aggregato a T 2025-11-18 15:57:20 +01:00
andrea.villa 22ef746a36 Merge branch 'AggreT_TC2' into develop 2025-11-18 15:56:29 +01:00
andrea.villa d3ddf9f9c7 - Corretto tipo dato in MachNotes e ToolNotes
- Aggiunti tipi di lavorazione anche per aggregato
2025-11-14 12:08:21 +01:00
daniele.nicoli 97dcda8917 Aggiunta gestione CUT_SIC impostabile da TS3Data.lua 2025-11-13 10:42:08 +01:00
andrea.villa 0236d466b3 Merge branch 'master' into develop 2025-11-13 09:33:08 +01:00
andrea.villa 52e305aa48 Aggiunto caricamento Aggregato a T in caso di presenza secondo magazzino verticale. 2025-11-12 10:58:13 +01:00
andrea.villa e3c1ab71fe Merge branch 'NewTopColl' 2025-11-12 09:47:10 +01:00
andrea.villa 32e5f54761 Allineamento a common ver. 2.7k1 2025-11-10 16:19:30 +01:00
andrea.villa 04a7f180e8 Aggiornato .gitignore 2025-10-14 11:52:51 +02:00
andrea.villa fc8b39d260 Allineamento con common ver. 2.7j2 2025-10-08 16:13:35 +02:00
andrea.villa 0563e0c8ca Allineamento con common ver. 2.7j1 2025-10-06 16:00:02 +02:00
andrea.villa f8983fa6b4 Controllo collisione tra utensile e TOP testa C. Rilasciare dopo che è stata pubblicata nuova versioen CAM5 27j1 2025-09-25 12:41:02 +02:00
andrea.villa 726f04fabd Aggiunta lettura parametro MAX_HEIGHT_ROT_B_ABOVE da TS3 2025-09-23 14:39:42 +02:00
andrea.villa 6423ccf1b7 Allineamento con common ver.2.7i3 2025-09-23 11:40:54 +02:00
andrea.villa 6c3de96111 Allineamento con common ver. 2.7i2 2025-09-17 09:24:30 +02:00
andrea.villa 87438322e9 - Allineamento con common ver. 2.7i1
- Aggiunto tipo di lavorazione per automatismo
2025-09-08 08:49:53 +02:00
andrea.villa 64ef5eaa83 Cambiato accelerazioni di default 2025-07-01 08:46:41 +02:00
andrea.villa 95e7746eb6 Aggiunto lettura variabili accelerazioni pinze 2025-07-01 08:40:40 +02:00
andrea.villa 3de0fec055 Allineamento con common ver. 2.7g1 2025-07-01 08:18:12 +02:00
andrea.villa 6bd8510157 Allineamento con common ver. 2.7f3 2025-06-26 08:51:06 +02:00
andrea.villa 5c4fb776a1 Allineamento con common ver. 2.7f2 2025-06-19 16:51:57 +02:00
andrea.villa 61f7013cb2 Allineamento con common ver. 2.7f1 2025-06-18 17:58:41 +02:00
andrea.villa c4ecf572f3 Allineamento con common ver.2.7e1 2025-05-26 09:52:38 +02:00
andrea.villa ea25a546f1 Allineamento con common ver. 2.7d1 2025-04-14 08:51:38 +02:00
andrea.villa e3f0681e13 Allineamento con common ver. 2.7c1
Informazioni per lavorazioni a 5 assi
2025-03-26 12:22:03 +01:00
andrea.villa 44c4d04c69 Aggiunto parametro MAX_DIM_HTCUT_HBEAM a BeamData 2025-03-10 08:29:37 +01:00
andrea.villa 347270d828 Merge commit 'a02f606523ffdfb556b794cf7eddcb252b0cd8e9' 2025-02-20 16:48:29 +01:00
andrea.villa a02f606523 Allineamento con common ver. 2.7b1 2025-02-20 16:48:17 +01:00
andrea.villa 23f0376597 - in BeamData riportata GetChainsaWInitAngs a versione precedente 2025-02-20 15:37:38 +01:00
andrea.villa 168bb88652 Cambio versione in MLDE 2025-02-07 11:45:38 +01:00
andrea.villa a899576839 Piccola correzione in selezione motosega, l'asse B è già in posizione corretta. 2025-02-07 11:45:13 +01:00
andrea.villa 60ad88654d - Aggiunto secondo mazazzino
- Allineamento common ver. 2.7a3
- Gestione aggregato flottante
2025-02-03 10:26:18 +01:00
andrea.villa 5114ea7da4 Merge remote-tracking branch 'origin/master' into develop 2025-02-03 10:22:08 +01:00
luca.mazzoleni 098d4cb91d - corretto version aggiornato erroneamente
- aggiornata versione in mlde
2025-01-10 11:29:04 +01:00
luca.mazzoleni 243d0e5866 Aggiunto ToolHolder per punta D90 (FastRL Pagano) 2025-01-10 11:18:45 +01:00
andrea.villa 7fedf117c7 Allineamento con common ver. 2.7a3 2025-01-08 16:04:50 +01:00
andrea.villa 954fab86c4 Allineamento con common ver. 2.7a2 2025-01-08 12:07:43 +01:00
andrea.villa 7384e26b7c Merge remote-tracking branch 'origin/develop' 2025-01-07 14:51:36 +01:00
andrea.villa 4197cc437a - Gestione aggregato BlockHaus in versione ufficiale
- Allineamento con common ver. 2.7a1
2025-01-07 14:51:20 +01:00
andrea.villa d592576363 - Ripristinata scrittura cinematica macchina
- Aggregato ruotato di 180°
2024-12-13 09:11:32 +01:00
andrea.villa c6b492986f Corretto parametro cinematica macchina 2024-12-12 17:26:20 +01:00
andrea.villa b574dae2dd Piccola correzione in visualizzazione utensile su aggregato BH 2024-12-12 16:58:31 +01:00
andrea.villa c578e17bbb Merge branch 'NewAggregateBlockHaus' into develop 2024-12-12 14:53:47 +01:00
andrea.villa 7da8dffdae Cambio versione develop 2024-12-12 09:20:15 +01:00
andrea.villa 1bb7bb1ce2 In SetUp, la posizione 11 si chiama sempre con T11, anche se è montato aggregato BlockHaus 2024-12-12 09:19:26 +01:00
andrea.villa 06f0b344dd Merge remote-tracking branch 'origin/master' into develop 2024-12-12 08:32:58 +01:00
andrea.villa 35484099c0 In NUM si da errore se si utilizzano aggregati (mai gestiti) 2024-12-11 14:38:01 +01:00
luca.mazzoleni 2fab36a8a9 - in mlde correzioni ad aggregato speciale per fresa a disco
- in BeamData -> GetSetupInfo aggiunta testa H7 con aggregato speciale
2024-12-11 11:59:01 +01:00
andrea.villa 57b80c9006 Prima versione gestione aggregato tipo BlockHaus 2024-12-05 17:22:07 +01:00
andrea.villa d5d23a5da4 Merge branch 'hotfix/TAggrePosition' 2024-12-02 12:32:18 +01:00
andrea.villa e26c109857 Corretto posizione aggregato a T 2024-12-02 12:32:06 +01:00
andrea.villa 55f7c325f6 Allineamento con common ver. 2.6l1 2024-12-02 08:30:32 +01:00
andrea.villa 024f281613 Commit per cambio versione 2024-11-12 08:39:40 +01:00
andrea.villa 80ca00eaa8 Merge remote-tracking branch 'origin/develop' 2024-11-12 08:37:05 +01:00
andrea.villa 1170351c83 Allineamento con common ver. 2.6k1 2024-11-12 08:36:51 +01:00
andrea.villa 7aca339e8d Merge remote-tracking branch 'origin/AggregatoT' into develop 2024-11-12 08:35:27 +01:00
andrea.villa 7d13d2604b Gestione completa aggregato a T 2024-11-12 08:35:18 +01:00
andrea.villa d7916832ed NGE con solidi Aggregato a T 2024-11-07 16:54:19 +01:00
andrea.villa 24cb48df12 Merge remote-tracking branch 'origin/master' into develop 2024-11-07 16:53:24 +01:00
andrea.villa 979d625b23 - Allineamento con Common ver. 2.6j10 2024-10-25 14:38:03 +02:00
andrea.villa 16e36eff78 - Allineamento con Common ver. 2.6j9 2024-10-22 11:22:45 +02:00
andrea.villa 009869eb9f - Allineamento con Common ver. 2.6j8
- Aggiunto LEN_SHORT_PART tra i parametri configurabili da TS3
2024-10-21 08:48:14 +02:00
andrea.villa ee56eaab7d Allineamento con Common ver. 2.6j7 2024-10-18 10:24:41 +02:00
andrea.villa 60459649c2 Allineamento con common ver. 2.6j6 2024-10-17 16:12:31 +02:00
andrea.villa bb83671c7e - Allineamento con common ver. 2.6j5
- Tolti i commenti iniziali da quando è stato creato progetto GIT
2024-10-17 09:40:55 +02:00
andrea.villa 21abd1b45f Aggiunta lettura alcune variabili impostabili da TS3 2024-10-15 10:27:36 +02:00
andrea.villa e6c85e29a4 - Allineamento con common ver. 2.6j4 2024-10-15 09:22:38 +02:00
andrea.villa 8fcef852dc - Allineamento con common ver. 2.6j3 2024-10-11 15:04:29 +02:00
luca.mazzoleni 1adb18760f #critical# in BeamData corretta lettura ROT90 da TS3 2024-10-04 09:54:58 +02:00
andrea.villa 807a077f4b - Allineamento con common ver. 2.6j2
- Aggiunta lettura parametro ROT90 da TS3 in BeamData
2024-10-03 10:34:35 +02:00
andrea.villa 85a8d62e99 - Allineamento con common ver. 2.6j1 2024-10-01 08:19:07 +02:00
andrea.villa 2374f2e69d - Allineamento con common ver. 2.6i6 2024-09-25 13:34:07 +02:00
andrea.villa 2a6a45baa4 Merge remote-tracking branch 'origin/master' 2024-09-25 13:34:00 +02:00
luca.mazzoleni d82c2f2ff8 update gitignore e YAML 2024-09-25 13:11:42 +02:00
andrea.villa f1593774b0 Piccola modifica BeamData 2024-09-24 17:48:59 +02:00
andrea.villa 9989b780cc - Allineamento con common ver. 2.6i5
- Aggiunta parametri NEWCLAMPING, FASTCLAMPING e GAIN_RECLAMPING
2024-09-24 17:48:16 +02:00
luca.mazzoleni 8f10d1557c update gitignore e YAML 2024-09-24 13:08:49 +02:00
luca.mazzoleni 0938e8d8f2 update YAML 2024-09-24 11:20:31 +02:00
luca.mazzoleni 111842be44 update YAML per modifica percorsi 2024-09-23 11:45:56 +02:00
luca.mazzoleni 543bf3661c - Modificato YAML per comunicazione versioni a LiMan.
- Aggiunta PP_NVER, versione macchina in formato numerico.
2024-09-18 15:24:41 +02:00
andrea.villa 352e1b9741 - Allineamento con common ver. 2.6i2 2024-09-16 10:44:08 +02:00
22 changed files with 2410 additions and 630 deletions
+1
View File
@@ -1,6 +1,7 @@
/Tools
/Machinings
/SetUp
/Beam/AISetup
/Beam/Ts3Data.bak
/Beam/CutData.lua
/Beam/DrillData.lua
+100 -18
View File
@@ -2,19 +2,27 @@ 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'
DEST_MACHINES_PATH_R: 'R:\EgtData\Machines\zTestYAML'
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
@@ -38,12 +46,29 @@ variables:
echo "-----------------------"
echo " Copia macchina su R"
echo "-----------------------"
ROBOCOPY /MIR "$env:SRC_PATH" "$env:DEST_MACHINES_PATH_R\$env:MACH_NAME\" /XD "bin"
ROBOCOPY "$env:TEST_PATH" "$env:DEST_MACHINES_PATH_R\$env:MACH_NAME_TEST\" /E /XD "bin"
ROBOCOPY /MIR "$env:BASE_PATH" "$env:DEST_MACHINES_PATH_R\Deploy\$env:MACH_NAME\$env:MACH_VERS\" /XD "bin" /XD "$env:MACH_NAME_TEST"
$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
- |
@@ -53,7 +78,8 @@ variables:
echo "-----------------------"
echo " Copia macchina su R - DEV"
echo "-----------------------"
ROBOCOPY /MIR "$env:BASE_PATH" "$env:DEST_MACHINES_PATH_R\Deploy\$env:MACH_NAME\_DEV\$env:MACH_VERS\" /XD "bin" /XD "$env:MACH_NAME_TEST"
$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
@@ -66,8 +92,15 @@ variables:
echo "-----------------------"
echo " Recupero file non git da R e copia su macchina virtuale"
echo "-----------------------"
ROBOCOPY "$env:LAST_MACHINE_PATH" "$env:SRC_PATH" /E /XF "*.bat" /XF "*.yml" /XF ".gitignore" /XD ".git" /XF "UpdateLog.txt" /XD ".vscode"
ROBOCOPY "$env:LAST_MACHINE_PATH" "$env:SRC_PATH\bin\$env:MACH_NAME\" /E /XF "*.bat" /XF "*.yml" /XF ".gitignore" /XD ".git" /XF "UpdateLog.txt" /XD ".vscode"
# 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
@@ -86,22 +119,25 @@ variables:
echo "-----------------------"
echo " Compilazione file *.lua 32/64bit"
echo "-----------------------"
$FileList = Get-ChildItem("Common_*")
$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
# helper recupero nome macchina e costruttore
.machName-fix: &machName-fix
- |
echo "-----------------------"
echo " Recupero nome macchina"
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
@@ -109,12 +145,22 @@ variables:
echo "-----------------------"
echo " Calcolo versione"
echo "-----------------------"
# calcolo versione formato stringa
$fPath = "$env:MACH_NAME.mlde";
$vLine = Select-String -path $fPath -Pattern 'PP_VER';
$vLine = Select-String -path $fPath -Pattern '^PP_VER';
$comp = $vLine -split "=";
$env:MACH_VERS = $comp[1].Replace("'","").Trim()
# display versione
Write-Output $env:MACH_VERS;
# 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
@@ -126,7 +172,7 @@ variables:
$commitAuthor = $commitAuthor[0].Trim()
$env:MACH_VERS = $commitAuthor
# display versione
Write-Output $env:MACH_VERS;
Write-Output $env:MACH_VERS
# helper creazione folders
.folder-fix: &folder-fix
@@ -134,8 +180,8 @@ variables:
echo "-----------------------"
echo " Creazione cartelle su macchina virtuale"
echo "-----------------------"
$env:LAST_MACHINE_PATH = "$env:MACHINES_PATH_R\$env:MACH_NAME";
Write-Output $env:LAST_MACHINE_PATH;
$env: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";
@@ -158,6 +204,39 @@ variables:
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
@@ -186,6 +265,8 @@ LuaCompile:build:
- *LuaCompile
- *ZipClean
- *ReplicaR
- *ReplicaStor01
- *SendToVersionsLog
LuaCompileDev:build:
stage: build
@@ -233,4 +314,5 @@ LuaCompileDev:build:
# script:
# - *LuaCompile
# - *ZipClean
# - *ReplicaR
# - *ReplicaR
+73 -15
View File
@@ -6,10 +6,13 @@ EgtOutLog( ' FAST-BeamData started', 1)
-- Tabella per definizione modulo
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)
GO_FAST = 0, -- flag abilitazione modalità veloce (0=no, 1=carrelli, 2=anche cambio utensili)
RIGHT_LOAD = true, -- flag carico da destra
ROT90 = false, -- flag abilitazione rotazione 90 gradi
ROT180 = true, -- flag abilitazione rotazione 180 gradi
NEWCLAMPING = false, -- flag abilitazione nuovo metodo riposizionamento carrelli
FASTCLAMPING= true, -- flag abilitazione riduzione numero riposizionamenti al carico e durante grande trascinamento
MIN_WIDTH = 40, -- larghezza minima del grezzo
MIN_HEIGHT = 40, -- altezza minima del grezzo
MAX_WIDTH = 240, -- larghezza massima del grezzo
@@ -18,7 +21,7 @@ local BeamData = {
MAX_HEIGHT2 = 625, -- altezza massima per seconda larghezza massima del grezzo
LEN_SHORT_PART = 1200, -- lunghezza massima pezzo corto
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.4, -- sovramateriale intermedio (spessore lama)
@@ -44,7 +47,7 @@ local BeamData = {
MILL_OVERLAP = 5, -- sovrapposizione tra due mezze fresature
MAX_DIST_HTFEA = 50.0, -- massima distanza di feature da testa o coda per essere considerata tale
MAX_LEN_HTFEA = 2000.0, -- massima lunghezza di feature di testa o coda
LONGCUT_ENDLEN = 600, -- lunghezza lavoro estremi iniziale e finale
LONGCUT_ENDLEN = 600, -- lunghezza lavoro estremi iniziale e finale (std=600)
LONGCUT_MAXLEN = 1200, -- lunghezza massima sezione di taglio longitudinale
MAX_LEN_RIDGELAP_FROM_BOTTOM = 141, -- massima lunghezza ridgelap lavorabile da sotto
MAX_LEN_RIDGELAP_FROM_BOTTOM_HBEAM = 96, -- massima lunghezza ridgelap lavorabile da sotto con trave alta
@@ -55,6 +58,7 @@ local BeamData = {
RAW_OFFSET = 2000, -- spostamento grezzo rimanente dopo split
VICE_MINH = 110, -- altezza minima della morsa
VICE_MAXH = 370, -- altezza massima zona pinzaggio orizzontale
ENABLE_TOOL_BETWEEN_VICES = false, -- abilita calcolo pinze permettendo di avere l'utensile tra di esse (ovviamente lontano da bordi in Y)
OFFSET_DRILL_TENON = 0, -- offset fori su tenoni verso base degli stessi (0=non fare)
USER_HOLE_DIAM = 0, -- diametro foro per L20
MAX_TOOL_LEN_FOR_HOR_MACH = 311, -- massima lunghezza utensile per poter fare forature (fresature) oltre i 10 gradi dalla verticale
@@ -69,7 +73,11 @@ local BeamData = {
MAX_LEN_BH_FROM_BOTTOM = 195, -- massima lunghezza lavorabile da un lato di block haus da sotto
MAX_DIST_BH_FROM_BOTTOM = 395, -- massima distanza tra naso mandrino e sopra della trave senza collisione
BH_MACHINE = false, -- flag che indica la tipologia di macchina configurata BlockHaus
ANG_TRASM = false -- presenza rinvio angolare per lavorazioni da sotto
ANG_TRASM = false, -- presenza rinvio angolare per lavorazioni da sotto
PRECUT_HEAD = true, -- flag abilitazione pretaglio grezzo a zero in testa
PRECUT_TAIL = true, -- flag abilitazione pretaglio grezzo a zero in coda
MIN_HEIGHT_ADDED_CUTS = 400, -- altezza minima pezzo per effettuare tagli orizzontali aggiuntivi in testa e coda
GAIN_RECLAMPING = 1000 -- in caso di scarso pinzaggio, mm da recuperare con pinzaggio ulteriore prima di spostare
}
-- Aggiornamento con dati da TechnoEssetre7
@@ -85,15 +93,32 @@ if EgtExistsFile( sData) then
local Machine = dofile( sData)
if Machine then
if Machine.Offsets then
BeamData.ANG_TRASM = ( Machine.Offsets.SECSUP and Machine.Offsets.SECSUP >= 3)
BeamData.BH_MACHINE = ( Machine.Offsets.BLOCKHAUS == 1)
BeamData.MINRAW_S = max( BeamData.MINRAW_S, Machine.Offsets.MINRAW_S or BeamData.MINRAW_S)
BeamData.MINRAW_L = max( BeamData.MINRAW_L, Machine.Offsets.MINRAW_L or BeamData.MINRAW_L)
BeamData.CUT_EXTRA = Machine.Offsets.CUT_EXTRA or BeamData.CUT_EXTRA
BeamData.CUT_EXTRA_MIN = Machine.Offsets.CUT_EXTRA_MIN or BeamData.CUT_EXTRA_MIN
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
BeamData.ANG_TRASM = ( Machine.Offsets.SECSUP and Machine.Offsets.SECSUP >= 3)
BeamData.BH_MACHINE = ( Machine.Offsets.BLOCKHAUS == 1)
BeamData.MINRAW_S = max( BeamData.MINRAW_S, Machine.Offsets.MINRAW_S or BeamData.MINRAW_S)
BeamData.MINRAW_L = max( BeamData.MINRAW_L, Machine.Offsets.MINRAW_L or BeamData.MINRAW_L)
BeamData.CUT_EXTRA = Machine.Offsets.CUT_EXTRA or BeamData.CUT_EXTRA
BeamData.CUT_EXTRA_MIN = Machine.Offsets.CUT_EXTRA_MIN or BeamData.CUT_EXTRA_MIN
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
BeamData.LONGCUT_ENDLEN = Machine.Offsets.LONGCUT_ENDLEN or BeamData.LONGCUT_ENDLEN
BeamData.LONGCUT_MAXLEN = Machine.Offsets.LONGCUT_MAXLEN or BeamData.LONGCUT_MAXLEN
BeamData.ADVANCE_TAIL_OFFS = Machine.Offsets.ADVANCE_TAIL_OFFS or BeamData.ADVANCE_TAIL_OFFS
BeamData.LEN_VERY_SHORT_PART = Machine.Offsets.LEN_VERY_SHORT_PART or BeamData.LEN_VERY_SHORT_PART
BeamData.LEN_SHORT_PART = Machine.Offsets.LEN_SHORT_PART or BeamData.LEN_SHORT_PART
BeamData.MAX_DIM_HTCUT_HBEAM = Machine.Offsets.MAX_DIM_HTCUT_HBEAM or BeamData.MAX_DIM_HTCUT_HBEAM
BeamData.MAX_HEIGHT2 = Machine.Offsets.MAX_HEIGHT2 or BeamData.MAX_HEIGHT2
BeamData.OVM_MID = Machine.Offsets.OVM_MID or BeamData.OVM_MID
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
if Machine.Offsets.MIN_HEIGHT_ADDED_CUTS then BeamData.MIN_HEIGHT_ADDED_CUTS = min( Machine.Offsets.MIN_HEIGHT_ADDED_CUTS, BeamData.MIN_HEIGHT_ADDED_CUTS) end
if Machine.Offsets.NEWCLAMPING ~= nil then BeamData.NEWCLAMPING = ( Machine.Offsets.NEWCLAMPING == 1) end
if Machine.Offsets.FASTCLAMPING ~= nil then BeamData.FASTCLAMPING = ( Machine.Offsets.FASTCLAMPING == 1) end
if Machine.Offsets.ROT90 ~= nil then BeamData.ROT90 = ( Machine.Offsets.ROT90 == 1) end
if Machine.Offsets.ROT180 ~= nil then BeamData.ROT180 = ( Machine.Offsets.ROT180 == 1) end
if Machine.Offsets.CUT_SIC then BeamData.CUT_SIC = EgtClamp( Machine.Offsets.CUT_SIC, 15, 50) end
end
if Machine.Trave then
BeamData.MIN_WIDTH = Machine.Trave.XMIN or BeamData.MIN_WIDTH
@@ -114,10 +139,10 @@ if EgtExistsFile( sData) then
BeamData.MAX_LEN_SCRAP_START = 100000
end
BeamData.USER_HOLE_DIAM = Machine.User.L020_DIAM_HOLE or BeamData.USER_HOLE_DIAM
BeamData.ENABLE_TOOL_BETWEEN_VICES = ( Machine.User.ENABLE_TOOL_BETWEEN_VICES == 1) or BeamData.ENABLE_TOOL_BETWEEN_VICES
end
end
end
---------------------------------------------------------------------
local function GetMaxLenRidgeLapFromBottom( dHRaw)
if dHRaw < BeamData.MIN_DIM_HBEAM then
@@ -157,7 +182,7 @@ end
BeamData.GetBlockedAxis = GetBlockedAxis
---------------------------------------------------------------------
local function GetChainSawInitAngs( vtN, vtO)
local function GetChainSawInitAngs( vtN, vtO, nInd)
if vtN:getY() > 0 and vtO:getX() > 0 then
return 'C=0'
else
@@ -165,6 +190,7 @@ local function GetChainSawInitAngs( vtN, vtO)
end
end
BeamData.GetChainSawInitAngs = GetChainSawInitAngs
---------------------------------------------------------------------
local function GetSetupInfo( sHead)
local SetupInfo = {}
@@ -195,11 +221,43 @@ local function GetSetupInfo( sHead)
SetupInfo.bIsBottomHead = true
SetupInfo.bIsTopHead = not SetupInfo.bIsBottomHead
SetupInfo.dMaxPositiveAngle = 0
-- aggregato speciale per fresa a disco tipo BH
elseif sHead == 'H7' then
SetupInfo.bToolOnAggregate = true
SetupInfo.bIsTopHead = true
SetupInfo.bIsBottomHead = not SetupInfo.bIsTopHead
end
return SetupInfo
end
BeamData.GetSetupInfo = GetSetupInfo
---------------------------------------------------------------------
local function GetMaxMatReductionBladeCut( sHead, vtDir)
local MaxMatReductionBladeCut = 0
-- la lama è montata solo su H2, non si controllano altre teste
if sHead == 'H2' then
if BeamData.NEWTOPC == nil or BeamData.NEWTOPC then
MaxMatReductionBladeCut = -65
end
if AreSameVectorApprox( vtDir, X_AX()) then
MaxMatReductionBladeCut = MaxMatReductionBladeCut + 175
elseif AreSameVectorApprox( vtDir, -X_AX()) then
MaxMatReductionBladeCut = MaxMatReductionBladeCut + 175
elseif AreSameVectorApprox( vtDir, Y_AX()) then
MaxMatReductionBladeCut = MaxMatReductionBladeCut + 175
elseif AreSameVectorApprox( vtDir, -Y_AX()) then
MaxMatReductionBladeCut = MaxMatReductionBladeCut + 175
elseif AreSameVectorApprox( vtDir, Z_AX()) then
MaxMatReductionBladeCut = 80
elseif AreSameVectorApprox( vtDir, -Z_AX()) then
MaxMatReductionBladeCut = 80
end
MaxMatReductionBladeCut = MaxMatReductionBladeCut + BeamData.COLL_SIC
end
return MaxMatReductionBladeCut + BeamData.COLL_SIC
end
BeamData.GetMaxMatReductionBladeCut = GetMaxMatReductionBladeCut
---------------------------------------------------------------------
return BeamData
+29 -19
View File
@@ -4,9 +4,11 @@
[Drill]
1=Drill
2=Pocket
3=AngleDrill
4=Predrill
2=Drill_AT
3=Pocket
4=Pocket_AT
5=AngleDrill
6=Predrill
[Milling]
1=Prof
@@ -14,25 +16,33 @@
3=Tenon
4=DtTenon
5=DtMortise
6=BirdsMouth
7=Chamfer
8=Mark
9=Text
10=Decor01
11=Long2Cut
12=Long2CutDown
13=LongSmallCut
14=BHSideMill
15=CleanCorner
16=ProfTCone
17=Long2CutSide
18=SmallToolContour
19=AntiSplintMillCut
6=DtMortise_AT
7=BirdsMouth
8=Chamfer
9=Mark
10=Text
11=Text_AT
12=Decor01
13=Long2Cut
14=Long2CutDown
15=LongSmallCut
16=BHSideMill
17=CleanCorner
18=ProfTCone
19=Long2CutSide
20=SmallToolContour
21=AntiSplintMillCut
22=Prof_end
23=SideMillAsBlade
24=FloatingAggregate
[Pocketing]
1=Pocket
2=OpenPocket
3=Mortise
2=Pocket_AT
3=OpenPocket
4=OpenPocket_AT
5=Mortise
6=Mortise_AT
[Sawing]
1=Sawing
+116 -25
View File
@@ -3,9 +3,10 @@
-- carico librerie
local INFO_STD_PP = require( 'Version')
local BD = require( 'BeamData')
-- Variabili di modulo
local CSP_INFO = INFO_STD_PP.NAME..' ver.'..INFO_STD_PP.VERSION..' by EgalWare s.r.l.'
local CSP_INFO = INFO_STD_PP.NAME..'_'..NumericalControl..' ver.'..INFO_STD_PP.VERSION..' by EgalWare s.r.l.'
local MACHINE_INFO = MACH_NAME..' ver.'..PP_VER
local TEST_USE = false
@@ -26,7 +27,9 @@ function OnStart()
--EMT.LINEINC = 1 -- incremento numerazione linee
--EMT.Ft = 'F' -- token per feed
--EMT.St = 'S' -- token per speed
EMT.FMAXPINZE = 154000 -- feed massima pinze
EMT.FMAXPINZE = EgtClamp( MaxFeedPinze or 154000, 20000, 160000) -- 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
end
---------------------------------------------------------------------
@@ -52,6 +55,7 @@ function OnProgramStart()
end
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
EmtOutput( 'M28')
@@ -103,6 +107,7 @@ function OnProgramEnd()
EMT.FALL = nil
EMT.RELOAD = nil
EMT.RELOAD2 = nil
EmtOutput( '(FOOTER)')
-- Se modalità test, termino il programma
if TEST_USE then
EmtOutput( 'M02')
@@ -180,16 +185,12 @@ function OnDispositionEnd()
local STrave = EMT.ST
local HOverM = EMT.HOVM
-- calcolo dati pinze
local MinAccPinze = 0.3
local MaxAccPinze = 4
local KgMtCubo= WoodDensity or 550 -- densità legno in Kg / metro cubo
local Massa = ( HTrave * STrave * LBarra * KgMtCubo ) / 1000000000
local FMaxPinze = EMT.FMAXPINZE
local ForzaAtrito = 700 / 2 -- Serve per regolare P32 (700 valore reale pistone)
local TempoAcc = ( ( Massa * FMaxPinze) / ( 60 * ForzaAtrito) / 1000)
if ( TempoAcc < MinAccPinze) then TempoAcc = MinAccPinze end
if ( TempoAcc > MaxAccPinze) then TempoAcc = MaxAccPinze end
local AccPinze = FMaxPinze / ( 60 * TempoAcc)
local AccPinze = EgtClamp( FMaxPinze / ( 60 * TempoAcc), EMT.MINACC, EMT.MAXACC)
local RidFeed = 100 / Massa * 100
if ( RidFeed > 100) then RidFeed = 100 end
if IdTrave >= 0 then
@@ -249,9 +250,9 @@ function OnDispositionEnd()
EmtOutput( sOut)
-- altrimenti recupero rimanenza
else
EmtOutput( 'G112 EC1'..' Y'..EmtLenToString( LoadT, 3).. ' EY'..EmtLenToString( EMT.YPOS, 3)..' EV'..EmtLenToString( ParkV, 3) ..' EF'..GetFmaxClamp())
EmtOutput( 'G112 EC1'..' Y'..EmtLenToString( EMT.TPOS, 3).. ' EY'..EmtLenToString( EMT.YPOS, 3)..' EV'..EmtLenToString( ParkV, 3) ..' EF'..GetFmaxClamp())
-- aggiorno dati aggancio carrelli alla trave
EMT.YDELTA = EMT.YPOS - LoadT
EMT.YDELTA = EMT.YPOS - EMT.TPOS
EMT.VDELTA = nil
end
-- eventuale preparazione per rotazione immediata
@@ -495,6 +496,7 @@ function OnMachiningEnd()
EMT.U_STD = nil
EMT.PREVTOOL = EMT.TOOL
EMT.PREVHEAD = EMT.HEAD
EMT.PREVET = GetET( EMT.HEAD, EMT.TCPOS, EMT.R3)
end
---------------------------------------------------------------------
@@ -602,6 +604,8 @@ end
---------------------------------------------------------------------
function OnRapid()
-- recupero prossimo utensile
EMT.NEXTTOOL, EMT.NEXTHEAD, EMT.NEXTTCPOS = FindNextTool()
MyBackupAxes()
-- se primo movimento della lavorazione, gestione speciale
if EMT.MCHFIRST and not EMT.OPEISDISP then
@@ -623,15 +627,32 @@ function OnRapid()
end
end
local sET = GetET( EMT.HEAD, EMT.TCPOS, EMT.R3)
local bGoToHome = false
-- se gli assi rotanti cambiano parecchio, con motosega si va in parcheggio
if EMT.PREVHEAD == 'H3' and EMT.HEAD == 'H3' and sET == EMT.PREVET and ( abs( EMT.R2pp - EMT.R2) > 25 or abs( EMT.R1pp - EMT.R1) > 25) then
bGoToHome = true
end
-- ricavo i dati per la lavorazione
local sEE = ' EE' .. EgtIf( bZmax, '3', '4')
local sEL = ' EL' .. EmtLenToString( EgtIf( EMT.HEAD ~= 'H3', EMT.TLEN, ( EMT.TDIST or ChSawLen)), 3)
local sER = ' ER' .. EmtLenToString( EgtIf( EMT.HEAD ~= 'H3', EMT.TDIAM / 2, EMT.TLEN), 3)
local sES = ' ES'..EgtNumToString( EMT.S, 0)
-- primo posizionamento
local MyZHome = EgtGetAxisHomePos( 'Z')
local bZmax = ( #EMT.AUXSTR > 0 or EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1)
-- se avevo motosega, torno in zona sicura senza ruotare assi rotanti
if EMT.PREVHEAD == 'H3' and EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
if not EMT.LOAD and EMT.PREVHEAD == 'H3' and EMT.FLAG2 == 1 then
local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
' B' .. EmtLenToString( EMT.R2pp, 3) .. ' C' .. EmtLenToString( EMT.R1pp, 3) ..
' EE' .. EgtIf( bZmax, '3', '4') .. EMT.PREVsEL .. EMT.PREVsER .. EMT.PREVsET .. EMT.PREVsES
EmtOutput( sOutPreMove)
sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
' B' .. EgtNumToString( 0, 3) .. ' C' .. EgtNumToString( EMT.R1pp, 3) .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOutPreMove)
EmtOutput( 'G101 ET1001')
EmtOutput( 'G101 ET2001')
end
@@ -641,18 +662,21 @@ function OnRapid()
EmtOutput( '( *** ' .. sOut .. ' *** )')
end
-- ricavo i dati per la lavorazione
local sEE = ' EE' .. EgtIf( bZmax, '3', '4')
local sEL = ' EL' .. EmtLenToString( EgtIf( EMT.HEAD ~= 'H3', EMT.TLEN, ( EMT.TDIST or ChSawLen)), 3)
local sER = ' ER' .. EmtLenToString( EgtIf( EMT.HEAD ~= 'H3', EMT.TDIAM / 2, EMT.TLEN), 3)
local sET = GetET( EMT.HEAD, EMT.TCPOS, EMT.R3)
local sES = ' ES'..EgtNumToString( EMT.S, 0)
-- se carico motosega, ruoto in zona sicura prima di approcciare la lavorazione
if EMT.HEAD == 'H3' and EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
if not EMT.LOAD and ( EMT.HEAD == 'H3' or ( bZmax and EMT.TTOTLEN > 200)) and
( EMT.ST > BeamHeightForFixRot or ( EMT.HEAD == 'H1' and EMT.TTOTLEN > 350) or bGoToHome) and EMT.FLAG2 == 1 then
local sEEPreMove = ' EE' .. EgtIf( bZmax, '3', '4')
local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
EmtGetAxis( 'R2') .. EmtGetAxis( 'R1') .. sEE .. sEL .. sER .. sET .. sES
local sOutPreMove
if EMT.HEAD == 'H3' and bGoToHome then
sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
' B' .. EgtNumToString( 0, 3) .. ' C' .. EgtNumToString( EMT.R1pp, 3) .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOutPreMove)
sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
' B' .. EgtNumToString( 0, 3) .. ' C' .. EgtNumToString( EMT.R1, 3) .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOutPreMove)
end
sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
' B' .. EgtNumToString( EMT.R2, 3) .. ' C' .. EgtNumToString( EMT.R1, 3) .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOutPreMove)
EmtOutput( 'G101 ET1001')
EmtOutput( 'G101 ET2001')
@@ -833,12 +857,47 @@ function OnRapid()
EmtAdjustRotaryAxes()
EmitZmax()
EMT.ZMAX = true
-- se pezzi alti e devo cambiare utensile su testa con CU, porto la testa vicino al cambio utensile
if EMT.ST > BeamHeightForFixRot and EMT.HEAD == 'H1' and EMT.TOOL ~= EMT.NEXTTOOL and EMT.NEXTHEAD ~= 'H2' then
local dBAxis = 90
local dCAxis = EgtIf( BD.RIGHT_LOAD, 90, -90)
local sEE = ' EE3'
local sEL = ' EL' .. EmtLenToString( EgtIf( EMT.HEAD ~= 'H3', EMT.TLEN, ( EMT.TDIST or ChSawLen)), 3)
local sER = ' ER' .. EmtLenToString( EgtIf( EMT.HEAD ~= 'H3', EMT.TDIAM / 2, EMT.TLEN), 3)
local sET = GetET( EMT.HEAD, EMT.TCPOS, EMT.R3)
local sES = ' ES'..EgtNumToString( EMT.S, 0)
local sOut = 'G101' .. EmtGetAxis( 'L2') .. EmtGetAxis( 'L3') ..' B' .. EgtNumToString( dBAxis, 3) ..
' C' .. EgtNumToString( dCAxis, 3) .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOut)
EmtOutput( 'G101 ET1001')
EmtOutput( 'G101 ET2001')
sOut = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. EmtGetAxis( 'L3') ..' B' .. EgtNumToString( dBAxis, 3) ..
' C' .. EgtNumToString( dCAxis, 3) .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOut)
EmtOutput( 'G101 ET1001')
EmtOutput( 'G101 ET2001')
end
-- se altrimenti movimento in Home
elseif EMT.FLAG == 4 then
-- non previsto
-- se altrimenti rotazione a Z max
-- se altrimenti rotazione a Z max per lavorazione successiva
elseif EMT.FLAG == 5 then
-- viene gestito all'inizio della lavorazione successiva
EMT.REFLOC = nil
EMT.IPLGL = false
MyAdjustLinearAxes()
EmtAdjustRotaryAxes()
EmtResetPrev()
-- ricavo i dati per la lavorazione
local sEE = ' EE3'
local sEL = ' EL' .. EmtLenToString( EgtIf( EMT.HEAD ~= 'H3', EMT.TLEN, ( EMT.TDIST or ChSawLen)), 3)
local sER = ' ER' .. EmtLenToString( EgtIf( EMT.HEAD ~= 'H3', EMT.TDIAM / 2, EMT.TLEN), 3)
local sET = GetET( EMT.HEAD, EMT.TCPOS, EMT.R3)
local sES = ' ES'..EgtNumToString( EMT.S, 0)
local sOut = 'G101' .. EmtGetAxis( 'L2') .. EmtGetAxis( 'L3') ..
EmtGetAxis( 'R2') .. EmtGetAxis( 'R1') .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOut)
EmtOutput( 'G101 ET1001')
EmtOutput( 'G101 ET2001')
-- altrimenti errore
else
EmtSetLastError( 1212, "Unknown Rapid flag")
@@ -941,6 +1000,35 @@ function OnArc()
EmtUpdatePrev()
end
---------------------------------------------------------------------
function FindNextTool()
-- salvo stato iniziale
local CurrMachId = EgtGetCurrMachining()
local CurrTool = EgtTdbGetCurrToolParam( MCH_TP.NAME)
-- cerco lavorazione con utensile su gruppo testa indicato
local sTool, sHead, sTcPos
local OpId = EgtGetNextActiveOperation( CurrMachId or EMT.MCHID)
while OpId do
local nType = EgtGetOperationType( OpId)
if nType ~= MCH_OY.NONE and nType ~= MCH_OY.DISP then
if EgtSetCurrMachining( OpId) then
sTool = EgtGetMachiningParam( MCH_MP.TOOL)
if EgtTdbSetCurrTool( sTool) then
sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
sTcPos = EgtTdbGetCurrToolParam( MCH_TP.TCPOS)
break
end
end
end
OpId = EgtGetNextActiveOperation( OpId)
end
-- ripristino stato iniziale
EgtSetCurrMachining( CurrMachId or GDB_ID.NULL)
EgtTdbSetCurrTool( CurrTool or '')
-- restituisco risultato
return sTool, sHead, sTcPos
end
---------------------------------------------------------------------
function CalcCharStatus( sCmd, bSkipPress)
-- aperto
@@ -1465,10 +1553,13 @@ function MyAdjustLinearAxes()
if EMT.REFLOC then
local vtE
if EMT.HEAD ~= 'H3' then
-- su NUM aggregati non gestiti
if EMT.HEAD == 'H5' or EMT.HEAD == 'H6' or EMT.HEAD == 'H7' then
EmtSetLastError( 1211, "Aggregates not managed")
elseif EMT.HEAD ~= 'H3' then
local Len = EMT.TLEN + EgtIf( EMT.HEAD == 'H1', MillOffs, abs( SawOffs))
local LenRef = MillOffs
vtE = Vector3d( EMT.EXTR) * Len - Z_AX() * LenRef
vtE = Vector3d( EMT.TDIR) * Len - Z_AX() * LenRef
else
local LenAux = ( EMT.TDIST or ChSawLen) + MillOffs
local LenRef = MillOffs
@@ -1580,7 +1671,7 @@ end
---------------------------------------------------------------------
function GetET( sHead, sTcPos, dAxR3)
if sHead == 'H1' then
if sHead == 'H1' or sHead == 'H5' or sHead == 'H6' or sHead == 'H7' then
return ' E'..sTcPos
elseif sHead == 'H2' then
return ' ET42'
+134 -55
View File
@@ -3,9 +3,10 @@
-- carico librerie
local INFO_STD_PP = require( 'Version')
local BD = require( 'BeamData')
-- Variabili di modulo
local CSP_INFO = INFO_STD_PP.NAME..' ver.'..INFO_STD_PP.VERSION..' by EgalWare s.r.l.'
local CSP_INFO = INFO_STD_PP.NAME..'_'..NumericalControl..' ver.'..INFO_STD_PP.VERSION..' by EgalWare s.r.l.'
local MACHINE_INFO = MACH_NAME..' ver.'..PP_VER
local TEST_USE = false
@@ -26,7 +27,9 @@ function OnStart()
--EMT.LINEINC = 1 -- incremento numerazione linee
--EMT.Ft = 'F' -- token per feed
--EMT.St = 'S' -- token per speed
EMT.FMAXPINZE = 154000 -- feed massima pinze
EMT.FMAXPINZE = EgtClamp( MaxFeedPinze or 154000, 20000, 160000) -- 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
end
---------------------------------------------------------------------
@@ -52,6 +55,7 @@ function OnProgramStart()
end
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
EmtOutput( 'M28')
@@ -107,6 +111,7 @@ function OnProgramEnd()
EMT.FALL = nil
EMT.RELOAD = nil
EMT.RELOAD2 = nil
EmtOutput( '(FOOTER)')
-- Se modalità test, termino il programma
if TEST_USE then
EmtOutput( 'M02')
@@ -144,7 +149,11 @@ function OnToolData()
local sPos = 'N2' .. tostring(nPos)
local sOut = 'L11=' .. EmtLenToString( EMT.SMAX, 3) .. ' L12=' .. EmtLenToString( AngTr1Offs, 1)..' G76H9998.1'..sPos..sPos
EmtOutput( sOut)
-- altro non previsto
-- emissione dati sega a catena
elseif EMT.HEAD == 'H7' then
local sOut = 'L11='..EgtNumToString( EMT.SMAX, 0)..' L12='..EmtLenToString( ( 154.5), 1)..' G76H9998.1N121N121'
EmtOutput( sOut)
-- altro non previsto
end
end
@@ -198,9 +207,9 @@ function OnDispositionEnd()
local BtlInfoId = EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo') or EgtGetCurrMachGroup() or GDB_ID.NULL
local nLoad90 = EgtGetInfo( BtlInfoId, 'LOAD90', 'i') or 0
-- calcolo dati pinze
local AccPinze, AccMaxPinze, RidFeed, TempoAcc = CalcDinamicaPinze( HTrave, STrave, LBarra)
local AccPinz1, AccMaxPinz1, RidFeed1, TempoAcc1 = CalcDinamicaPinze( HTrave, STrave, LBarra - LTrave)
local AccPinz2, AccMaxPinz2, RidFeed2, TempoAcc2 = CalcDinamicaPinze( HTrave, STrave, LTrave)
local AccPinze, AccMaxPinze, RidFeed, TempoAcc = CalcDinamicaPinze_NUM( HTrave, STrave, LBarra)
local AccPinz1, AccMaxPinz1, RidFeed1, TempoAcc1 = CalcDinamicaPinze_NUM( HTrave, STrave, LBarra - LTrave)
local AccPinz2, AccMaxPinz2, RidFeed2, TempoAcc2 = CalcDinamicaPinze_NUM( HTrave, STrave, LTrave)
if IdTrave >= 0 then
local sOut = '( SN='..IdTrave..' LBarra='..EmtLenToString( LBarra, 3)..' L='..EmtLenToString( LTrave, 3)..
' H='..EmtLenToString( HTrave, 3)..' S='..EmtLenToString( STrave, 3)..' Acc='..EgtNumToString( TempoAcc, 1)..
@@ -264,9 +273,9 @@ function OnDispositionEnd()
EmtOutput( sOut)
-- altrimenti recupero rimanenza
else
EmtOutput( 'G112 EC1'..' Y'..EmtLenToString( LoadT, 3).. ' EY'..EmtLenToString( EMT.YPOS, 3)..' EV'..EmtLenToString( ParkV, 3) ..' EF'..GetFmaxClamp())
EmtOutput( 'G112 EC1'..' Y'..EmtLenToString( EMT.TPOS, 3).. ' EY'..EmtLenToString( EMT.YPOS, 3)..' EV'..EmtLenToString( ParkV, 3) ..' EF'..GetFmaxClamp())
-- aggiorno dati aggancio carrelli alla trave
EMT.YDELTA = EMT.YPOS - LoadT
EMT.YDELTA = EMT.YPOS - EMT.TPOS
EMT.VDELTA = nil
end
-- eventuale preparazione per rotazione immediata
@@ -488,7 +497,7 @@ function OnMachiningEnd()
end
for i = 1, #EMT.AUXSTR do
local sOut = EMT.AUXSTR[i]
if EMT.AUXTYPE == 'S' then
if EMT.AUXTYPE == 'S' and sOut:find( 'G101 ') then
sOut = sOut .. ' EH1'
elseif EMT.AUXTYPE == 'U' and not EMT.CHY_ON and not sOut:find( 'ET') then
sOut = sOut .. ' ET2'
@@ -535,6 +544,7 @@ function OnMachiningEnd()
EMT.PREVTOOL = EMT.TOOL
EMT.PREVHEAD = EMT.HEAD
EMT.PREVR3 = EMT.R3
EMT.PREVET = GetET( EMT.HEAD, EMT.TCPOS, EMT.R3)
end
---------------------------------------------------------------------
@@ -642,6 +652,8 @@ end
---------------------------------------------------------------------
function OnRapid()
-- recupero prossimo utensile
EMT.NEXTTOOL, EMT.NEXTHEAD, EMT.NEXTTCPOS = FindNextTool()
MyBackupAxes()
-- se primo movimento della lavorazione, gestione speciale
if EMT.MCHFIRST and not EMT.OPEISDISP then
@@ -664,22 +676,12 @@ function OnRapid()
end
end
-- primo posizionamento
local MyZHome = EgtGetAxisHomePos( 'Z')
local bZmax = ( #EMT.AUXSTR > 0 or EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1)
-- se avevo motosega, torno in zona sicura senza ruotare assi rotanti
if EMT.PREVHEAD == 'H3' and EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
' B' .. EmtLenToString( EMT.R2pp, 3) .. ' C' .. EmtLenToString( EMT.R1pp, 3) ..
' EE' .. EgtIf( bZmax, '3', '4') .. EMT.PREVsEL .. EMT.PREVsER .. EMT.PREVsET .. EMT.PREVsES
EmtOutput( sOutPreMove)
EmtOutput( 'G101 ET1001')
EmtOutput( 'G101 ET2001')
end
local sET = GetET( EMT.HEAD, EMT.TCPOS, EMT.R3)
if not EMT.LOAD then
local sOut = string.gsub( string.gsub( EMT.MCHNAME..'/'..EMT.TOOL, '%(', '-'), '%)', '-')
EmtOutput( '( *** ' .. sOut .. ' *** )')
local bGoToHome = false
-- se gli assi rotanti cambiano parecchio, con motosega si va in parcheggio
if EMT.PREVHEAD == 'H3' and EMT.HEAD == 'H3' and sET == EMT.PREVET and ( abs( EMT.R2pp - EMT.R2) > 25 or abs( EMT.R1pp - EMT.R1) > 25) then
bGoToHome = true
end
-- ricavo i dati per la lavorazione
@@ -690,7 +692,7 @@ function OnRapid()
if EMT.HEAD == 'H3' then
sEL = sEL..EmtLenToString( ( EMT.TDIST or ChSawLen), 3)
-- se aggregato
elseif EMT.HEAD == 'H5' or EMT.HEAD == 'H6' then
elseif EMT.HEAD == 'H5' or EMT.HEAD == 'H6' or EMT.HEAD == 'H7' then
sEL = sEL..EmtLenToString( AngTr1Offs, 3)
-- se testa normale ( H1 or H2)
else
@@ -702,21 +704,51 @@ function OnRapid()
if EMT.HEAD == 'H3' then
sER = sER..EmtLenToString( EMT.TLEN, 3)
-- se aggregato
elseif EMT.HEAD == 'H5' or EMT.HEAD == 'H6' then
elseif EMT.HEAD == 'H5' or EMT.HEAD == 'H6' or EMT.HEAD == 'H7' then
sER = sER..EmtLenToString( EMT.TLEN + AngTr1Len, 3)
-- se testa normale ( H1 or H2)
else
sER = sER..EmtLenToString( EMT.TDIAM / 2, 3)
end
local sET = GetET( EMT.HEAD, EMT.TCPOS, EMT.R3)
local sES = ' ES'..EgtNumToString( EMT.S, 0)
-- se carico motosega, ruoto in zona sicura prima di approcciare la lavorazione
if EMT.HEAD == 'H3' and EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
local sEEPreMove = ' EE' .. EgtIf( bZmax, '3', '4')
-- primo posizionamento
local MyZHome = EgtGetAxisHomePos( 'Z')
local bZmax = ( #EMT.AUXSTR > 0 or EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1)
-- se avevo motosega, torno in zona sicura senza ruotare assi rotanti
if not EMT.LOAD and EMT.PREVHEAD == 'H3' and EMT.FLAG2 == 1 then
local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
EmtGetAxis( 'R2') .. EmtGetAxis( 'R1') .. sEE .. sEL .. sER .. sET .. sES
' B' .. EmtLenToString( EMT.R2pp, 3) .. ' C' .. EmtLenToString( EMT.R1pp, 3) ..
' EE' .. EgtIf( bZmax, '3', '4') .. EMT.PREVsEL .. EMT.PREVsER .. EMT.PREVsET .. EMT.PREVsES
EmtOutput( sOutPreMove)
sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
' B' .. EgtNumToString( 0, 3) .. ' C' .. EgtNumToString( EMT.R1, 3) .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOutPreMove)
EmtOutput( 'G101 ET1001')
EmtOutput( 'G101 ET2001')
end
if not EMT.LOAD then
local sOut = string.gsub( string.gsub( EMT.MCHNAME..'/'..EMT.TOOL, '%(', '-'), '%)', '-')
EmtOutput( '( *** ' .. sOut .. ' *** )')
end
-- se carico motosega, ruoto in zona sicura prima di approcciare la lavorazione
if not EMT.LOAD and ( EMT.HEAD == 'H3' or ( bZmax and EMT.TTOTLEN > 200)) and
( EMT.ST > BeamHeightForFixRot or ( EMT.HEAD == 'H1' and EMT.TTOTLEN > 350) or bGoToHome) and EMT.FLAG2 == 1 then
local sEEPreMove = ' EE' .. EgtIf( bZmax, '3', '4')
local sOutPreMove
if EMT.HEAD == 'H3' and bGoToHome then
sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
' B' .. EgtNumToString( 0, 3) .. ' C' .. EgtNumToString( EMT.R1pp, 3) .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOutPreMove)
sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
' B' .. EgtNumToString( 0, 3) .. ' C' .. EgtNumToString( EMT.R1, 3) .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOutPreMove)
end
sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
' B' .. EgtNumToString( EMT.R2, 3) .. ' C' .. EgtNumToString( EMT.R1, 3) .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOutPreMove)
EmtOutput( 'G101 ET1001')
EmtOutput( 'G101 ET2001')
@@ -907,12 +939,47 @@ function OnRapid()
EmtAdjustRotaryAxes()
EmitZmax( false)
EMT.ZMAX = true
-- se pezzi alti e devo cambiare utensile su testa con CU, porto la testa vicino al cambio utensile
if EMT.ST > BeamHeightForFixRot and EMT.HEAD == 'H1' and EMT.TOOL ~= EMT.NEXTTOOL and EMT.NEXTHEAD ~= 'H2' then
local dBAxis = 90
local dCAxis = EgtIf( BD.RIGHT_LOAD, 90, -90)
local sEE = ' EE3'
local sEL = ' EL' .. EmtLenToString( EgtIf( EMT.HEAD ~= 'H3', EMT.TLEN, ( EMT.TDIST or ChSawLen)), 3)
local sER = ' ER' .. EmtLenToString( EgtIf( EMT.HEAD ~= 'H3', EMT.TDIAM / 2, EMT.TLEN), 3)
local sET = GetET( EMT.HEAD, EMT.TCPOS, EMT.R3)
local sES = ' ES'..EgtNumToString( EMT.S, 0)
local sOut = 'G101' .. EmtGetAxis( 'L2') .. EmtGetAxis( 'L3') ..' B' .. EgtNumToString( dBAxis, 3) ..
' C' .. EgtNumToString( dCAxis, 3) .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOut)
EmtOutput( 'G101 ET1001')
EmtOutput( 'G101 ET2001')
sOut = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. EmtGetAxis( 'L3') ..' B' .. EgtNumToString( dBAxis, 3) ..
' C' .. EgtNumToString( dCAxis, 3) .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOut)
EmtOutput( 'G101 ET1001')
EmtOutput( 'G101 ET2001')
end
-- se altrimenti movimento in Home
elseif EMT.FLAG == 4 then
-- non previsto
-- se altrimenti rotazione a Z max
-- se altrimenti rotazione a Z max per lavorazione successiva
elseif EMT.FLAG == 5 then
-- viene gestito all'inizio della lavorazione successiva
EMT.REFLOC = nil
EMT.IPLGL = false
MyAdjustLinearAxes()
EmtAdjustRotaryAxes()
EmtResetPrev()
-- ricavo i dati per la lavorazione
local sEE = ' EE3'
local sEL = ' EL' .. EmtLenToString( EgtIf( EMT.HEAD ~= 'H3', EMT.TLEN, ( EMT.TDIST or ChSawLen)), 3)
local sER = ' ER' .. EmtLenToString( EgtIf( EMT.HEAD ~= 'H3', EMT.TDIAM / 2, EMT.TLEN), 3)
local sET = GetET( EMT.HEAD, EMT.TCPOS, EMT.R3)
local sES = ' ES'..EgtNumToString( EMT.S, 0)
local sOut = 'G101' .. EmtGetAxis( 'L2') .. EmtGetAxis( 'L3') ..
EmtGetAxis( 'R2') .. EmtGetAxis( 'R1') .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOut)
EmtOutput( 'G101 ET1001')
EmtOutput( 'G101 ET2001')
-- altrimenti errore
else
EmtSetLastError( 1212, "Unknown Rapid flag")
@@ -979,7 +1046,7 @@ end
---------------------------------------------------------------------
function OnArc()
-- con aggregato non si possono fare archi. Deve essere tutto spezzato
if EMT.HEAD == 'H5' or EMT.HEAD == 'H6' then
if EMT.HEAD == 'H5' or EMT.HEAD == 'H6' or EMT.HEAD == 'H7' then
EmtSetLastError( 1211, "With aggregate, the arcs must be splitted")
end
@@ -1021,25 +1088,32 @@ function OnArc()
end
---------------------------------------------------------------------
function CalcDinamicaPinze( dH, dS, dL)
local MinTempoAcc = 0.3 -- [s]
local MaxTempoAcc = 4.0 -- [s]
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 AccPinze = FMaxPinze / ( 60 * TempoAcc)
local RidFeed = 100 / Massa * 100
if RidFeed > 100 then
RidFeed = 100
elseif RidFeed < 10 then
RidFeed = 10
function FindNextTool()
-- salvo stato iniziale
local CurrMachId = EgtGetCurrMachining()
local CurrTool = EgtTdbGetCurrToolParam( MCH_TP.NAME)
-- cerco lavorazione con utensile su gruppo testa indicato
local sTool, sHead, sTcPos
local OpId = EgtGetNextActiveOperation( CurrMachId or EMT.MCHID)
while OpId do
local nType = EgtGetOperationType( OpId)
if nType ~= MCH_OY.NONE and nType ~= MCH_OY.DISP then
if EgtSetCurrMachining( OpId) then
sTool = EgtGetMachiningParam( MCH_MP.TOOL)
if EgtTdbSetCurrTool( sTool) then
sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
sTcPos = EgtTdbGetCurrToolParam( MCH_TP.TCPOS)
break
end
end
end
OpId = EgtGetNextActiveOperation( OpId)
end
return AccPinze, AccMaxPinze, RidFeed, TempoAcc
-- ripristino stato iniziale
EgtSetCurrMachining( CurrMachId or GDB_ID.NULL)
EgtTdbSetCurrTool( CurrTool or '')
-- restituisco risultato
return sTool, sHead, sTcPos
end
---------------------------------------------------------------------
@@ -1569,17 +1643,22 @@ function MyAdjustLinearAxes()
if EMT.HEAD == 'H1' or EMT.HEAD == 'H2' then
local Len = EMT.TLEN + EgtIf( EMT.HEAD == 'H1', MillOffs, abs( SawOffs))
local LenRef = MillOffs
vtE = Vector3d( EMT.EXTR) * Len - Z_AX() * LenRef
vtE = Vector3d( EMT.TDIR) * Len - Z_AX() * LenRef
elseif EMT.HEAD == 'H3' then
local LenAux = ( EMT.TDIST or ChSawLen) + MillOffs
local LenRef = MillOffs
local vtAux = EgtGetCalcAuxDirFromAngles( EMT.R1, EMT.R2, EMT.R3)
vtE = vtAux * LenAux - Z_AX() * LenRef
elseif EMT.HEAD == 'H5' then
elseif EMT.HEAD == 'H5' or EMT.HEAD == 'H6' then
local LenAux = AngTr1Offs + MillOffs
local LenRef = MillOffs
local vtAux = EgtGetCalcAuxDirFromAngles( EMT.R1, EMT.R2, EMT.R3)
vtE = vtAux * LenAux - Z_AX() * LenRef
elseif EMT.HEAD == 'H7' then
local LenAux = AngTrBHOffs + MillOffs
local LenRef = MillOffs
local vtAux = EgtGetCalcAuxDirFromAngles( EMT.R1, EMT.R2, EMT.R3)
vtE = vtAux * LenAux - Z_AX() * LenRef
else
EmtSetLastError( 1211, 'Head not allowed ' .. EMT.HEAD)
end
@@ -1674,7 +1753,7 @@ end
---------------------------------------------------------------------
function GetET( sHead, sTcPos, dAxR3)
if sHead == 'H1' or sHead == 'H5' or sHead == 'H6' then
if sHead == 'H1' or sHead == 'H5' or sHead == 'H6' or sHead == 'H7' then
return ' E'..sTcPos
elseif sHead == 'H2' then
return ' ET42'
+148 -62
View File
@@ -3,9 +3,10 @@
-- carico librerie
local INFO_STD_PP = require( 'Version')
local BD = require( 'BeamData')
-- Variabili di modulo
local CSP_INFO = INFO_STD_PP.NAME..' ver.'..INFO_STD_PP.VERSION..' by EgalWare s.r.l.'
local CSP_INFO = INFO_STD_PP.NAME..'_'..NumericalControl..' ver.'..INFO_STD_PP.VERSION..' by EgalWare s.r.l.'
local MACHINE_INFO = MACH_NAME..' ver.'..PP_VER
local TEST_USE = false
@@ -20,14 +21,19 @@ function OnStart()
EMT.USETO1 = false -- abilitazione uso origine tavola
EMT.MODAL = true -- abilitazione emissione modale
EMT.INCHES = false -- unità di misura mm/inches
EMT.DECNUM = 5 -- numero di decimali dopo la virgola
EMT.DECNUM = 4 -- numero di decimali dopo la virgola
EMT.DECVERS = 6 -- numero di decimali dopo la virgola per versori
EMT.DECRAD = 4 -- numero di decimali dopo la virgola per raggio
EMT.DECMACRO = 3 -- numero di decimali dopo la virgola per macro
EMT.NUM = false -- abilitazione numerazione linee
--EMT.Nt = 'N' -- token per la numerazione di linea
--EMT.LINENBR = 0 -- numero di linea
--EMT.LINEINC = 1 -- incremento numerazione linee
--EMT.Ft = 'F' -- token per feed
--EMT.St = 'S' -- token per speed
EMT.FMAXPINZE = 154000 -- feed massima pinze
--EMT.Nt = 'N' -- token per la numerazione di linea
--EMT.LINENBR = 0 -- numero di linea
--EMT.LINEINC = 1 -- incremento numerazione linee
--EMT.Ft = 'F' -- token per feed
--EMT.St = 'S' -- token per speed
EMT.FMAXPINZE = EgtClamp( MaxFeedPinze or 154000, 20000, 160000) -- feed massima pinze
EMT.MAXACC = MaxAcc or 4000 -- accelerazione massima pinze. In realtà è il tempo in millisecondi, quindi MAXACC corrisponde al tempo massimo per raggiungere la velocità desiderata
EMT.MINACC = MinAcc or 300 -- accelerazione minima pinze. In realtà è il tempo in millisecondi, quindi MINACC corrisponde al tempo massimo per raggiungere la velocità desiderata
end
---------------------------------------------------------------------
@@ -50,6 +56,7 @@ function OnProgramStart()
end
ParkLine( sPrefixCommentLine..'('.. CSP_INFO..')')
ParkLine( sPrefixCommentLine..'('.. MACHINE_INFO..')')
ParkLine( '(HEADER)')
-- Se modalità test, aggiungo linee per muovere tappeto e alzare la testa (in automatico viene fatto dal main residente)
if TEST_USE then
@@ -107,6 +114,7 @@ function OnProgramEnd()
EMT.FALL = nil
EMT.RELOAD = nil
EMT.RELOAD2 = nil
EmtOutput( '(FOOTER)')
-- Termino il programma
EmtOutput( 'M02')
end
@@ -115,8 +123,8 @@ end
function OnToolData()
-- emissione dati utensili
if EMT.HEAD == 'H1' then
local sOut = 'M992 P1=' .. EMT.TCPOS:gsub( 'T', '') .. ' P2=' .. EmtLenToString( EMT.TLEN, 3) .. ' P3=' .. EmtLenToString( EMT.TDIAM, 3) ..
' P4=' .. EmtLenToString( EMT.SMAX, 3) .. ' P5=' .. EmtLenToString( EMT.TTOTLEN, 3)
local sOut = 'M992 P1=' .. EMT.TCPOS:gsub( 'T', '') .. ' P2=' .. EmtLenToString( EMT.TLEN, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( EMT.TDIAM, EMT.DECMACRO) ..
' P4=' .. EmtLenToString( EMT.SMAX, EMT.DECMACRO) .. ' P5=' .. EmtLenToString( EMT.TTOTLEN, EMT.DECMACRO)
ParkLine( sOut)
-- cerco posizione di attrezzaggio del primo utensile di lavorazione
if EMT.TOOL == EMT.TOOL_1 and EMT.TLEN_1 < LONG_TOOL_MINLEN then
@@ -124,14 +132,14 @@ function OnToolData()
end
-- emissione dati lama
elseif EMT.HEAD == 'H2' then
local sOut = 'M992 P1=' .. EMT.TCPOS:gsub( 'T', '') .. ' P2=' .. EmtLenToString( EMT.TLEN, 3) .. ' P3=' .. EmtLenToString( EMT.TDIAM, 3) ..
' P4=' .. EmtLenToString( EMT.SMAX, 3) .. ' P5=' .. EmtLenToString( EMT.TTOTLEN, 3)
local sOut = 'M992 P1=' .. EMT.TCPOS:gsub( 'T', '') .. ' P2=' .. EmtLenToString( EMT.TLEN, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( EMT.TDIAM, EMT.DECMACRO) ..
' P4=' .. EmtLenToString( EMT.SMAX, EMT.DECMACRO) .. ' P5=' .. EmtLenToString( EMT.TTOTLEN, EMT.DECMACRO)
ParkLine( sOut)
-- emissione dati sega a catena
elseif EMT.HEAD == 'H3' then
if EMT.TDIST and abs( EMT.TDIST) < 0.1 then EMT.TDIST = nil end
local sData = ' P2=' .. EmtLenToString( ( EMT.TDIST or ChSawLen), 3) .. ' P3=' .. EmtLenToString( EMT.TLEN, 3) ..
' P4=' .. EmtLenToString( EMT.SMAX, 3) .. ' P5=' .. EmtLenToString( ( EMT.TDIST or ChSawLen), 3)
local sData = ' P2=' .. EmtLenToString( ( EMT.TDIST or ChSawLen), EMT.DECMACRO) .. ' P3=' .. EmtLenToString( EMT.TLEN, EMT.DECMACRO) ..
' P4=' .. EmtLenToString( EMT.SMAX, EMT.DECMACRO) .. ' P5=' .. EmtLenToString( ( EMT.TDIST or ChSawLen), EMT.DECMACRO)
if EMT.TCPOS == 'T101' then
ParkLine( 'M992 P1=101' .. sData)
ParkLine( 'M992 P1=102' .. sData)
@@ -147,10 +155,15 @@ function OnToolData()
elseif EMT.HEAD == 'H5' or EMT.HEAD == 'H6' then
local nPos = EgtIf( EMT.HEAD == 'H5', 91, 93)
if EMT.EXIT == 2 then nPos = nPos + 1 end
local sOut = 'M992 P1=' .. EgtNumToString( nPos, 0) .. ' P2=' .. EmtLenToString( EMT.TLEN, 3) .. ' P3=' .. EmtLenToString( EMT.TDIAM, 3) ..
' P4=' .. EmtLenToString( EMT.SMAX, 3) .. ' P5=' .. EmtLenToString( EMT.TTOTLEN, 3)
local sOut = 'M992 P1=' .. EgtNumToString( nPos, 0) .. ' P2=' .. EmtLenToString( EMT.TLEN, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( EMT.TDIAM, EMT.DECMACRO) ..
' P4=' .. EmtLenToString( EMT.SMAX, EMT.DECMACRO) .. ' P5=' .. EmtLenToString( EMT.TTOTLEN, EMT.DECMACRO)
ParkLine( sOut)
-- altro non previsto
-- emissione dati sega a catena
elseif EMT.HEAD == 'H7' then
local sOut = 'M992 P1=' .. EMT.TCPOS:gsub( 'T', '') .. ' P2=' .. EmtLenToString( EMT.TLEN, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( EMT.TDIAM, EMT.DECMACRO) ..
' P4=' .. EmtLenToString( EMT.SMAX, EMT.DECMACRO) .. ' P5=' .. EmtLenToString( EMT.TTOTLEN, EMT.DECMACRO)
ParkLine( sOut)
-- altro non previsto
else
EmtSetLastError( 1211, 'Head not allowed ' .. EMT.HEAD)
end
@@ -212,14 +225,14 @@ function OnDispositionEnd()
local HOverM = EMT.HOVM
-- calcolo dati pinze
local TempAccPinze, TempMinAccPinze, RidFeed = CalcDinamicaPinze( HTrave, STrave, LBarra)
local TempAccPinz1, TempMinAccPinz1, RidFeed1 = CalcDinamicaPinze( HTrave, STrave, LBarra - LTrave)
local TempAccPinz2, TempMinAccPinz2, RidFeed2 = CalcDinamicaPinze( HTrave, STrave, LTrave)
local TempAccPinze, TempMinAccPinze, RidFeed = CalcDinamicaPinze_TPA( HTrave, STrave, LBarra)
local TempAccPinz1, TempMinAccPinz1, RidFeed1 = CalcDinamicaPinze_TPA( HTrave, STrave, LBarra - LTrave)
local TempAccPinz2, TempMinAccPinz2, RidFeed2 = CalcDinamicaPinze_TPA( HTrave, STrave, LTrave)
if IdTrave >= 0 then
local sPrt = '( *** Part '.. EgtNumToString( IdTrave, 0) ..' ***)'
local sOut = '( SN=' .. IdTrave .. ' LBarra=' .. EmtLenToString( LBarra, 3) .. ' L='..EmtLenToString( LTrave, 3) ..
' H=' .. EmtLenToString( HTrave, 3) .. ' S=' .. EmtLenToString( STrave, 3) .. ' )'
local sOut = '( SN=' .. IdTrave .. ' LBarra=' .. EmtLenToString( LBarra, EMT.DECMACRO) .. ' L='..EmtLenToString( LTrave, EMT.DECMACRO) ..
' H=' .. EmtLenToString( HTrave, EMT.DECMACRO) .. ' S=' .. EmtLenToString( STrave, EMT.DECMACRO) .. ' )'
EMT.PRODID = EgtGetInfo( BtlInfoId, 'PRODID', 'i') or 0
EMT.PATTID = EgtGetInfo( BtlInfoId, 'PATTID', 'i') or 0
EMT.CUTID = EgtGetInfo( EMT.IDT, 'CUTID', 'i') or 0
@@ -262,9 +275,9 @@ function OnDispositionEnd()
' P4=' .. EmtLenToString( HOverM, 2) .. ' P5=' .. tostring( nLoad90) .. ' P6=' .. EmtLenToString( EgtIf( IdTrave >= 0, LTrave, LBarra), 2) ..
' P7=' .. EgtNumToString( TempAccPinze, 2) .. ' P8=' .. EgtNumToString( TempAccPinz2, 2) .. ' P9=' .. EgtNumToString( TempAccPinz1, 2)
EmtOutput( sOut)
EmtOutput( 'M112'..' P1='..EmtLenToString( LoadT, 3).. ' P5=1 P6='..EmtLenToString( EMT.YPOS, 3)..' P7='..EmtLenToString( ParkV, 3) ..' P9='..GetFmaxClamp())
EmtOutput( 'M112'..' P1='..EmtLenToString( EMT.TPOS, 3).. ' P5=1 P6='..EmtLenToString( EMT.YPOS, 3)..' P7='..EmtLenToString( ParkV, 3) ..' P9='..GetFmaxClamp())
-- aggiorno dati aggancio carrelli alla trave
EMT.YDELTA = EMT.YPOS - LoadT
EMT.YDELTA = EMT.YPOS - EMT.TPOS
EMT.VDELTA = nil
end
-- eventuale preparazione per rotazione immediata
@@ -625,6 +638,8 @@ end
---------------------------------------------------------------------
function OnRapid()
-- recupero prossimo utensile
EMT.NEXTTOOL, EMT.NEXTHEAD, EMT.NEXTTCPOS = FindNextTool()
MyBackupAxes()
-- se primo movimento della lavorazione, gestione speciale
if EMT.MCHFIRST and not EMT.OPEISDISP then
@@ -643,14 +658,26 @@ function OnRapid()
bHeadFirst = false
end
end
local bGoToHome = false
-- se gli assi rotanti cambiano parecchio, con motosega si va in parcheggio
if EMT.PREVHEAD == 'H3' and EMT.HEAD == 'H3' and EMT.TCPOS == EMT.PREVTCPOS and ( abs( EMT.R2pp - EMT.R2) > 25 or abs( EMT.R1pp - EMT.R1) > 25) then
bGoToHome = true
end
-- primo posizionamento
local MyZHome = EgtGetAxisHomePos( 'Z')
local bZmax = ( #EMT.AUXSTR > 0 or EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1)
-- se avevo motosega, torno in zona sicura senza ruotare assi rotanti
if EMT.PREVHEAD == 'H3' and EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
local sOutPreMove = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, 3) .. ' P3=' .. EmtLenToString( MyZHome, 3) ..
' P4=' .. EgtNumToString( EMT.R2pp, 3) .. ' P5=' .. EgtNumToString( EMT.R1pp, 3) ..
' P6=' .. EgtNumToString( EMT.PREVTCPOS, 3) .. ' P7=' .. EgtNumToString( EMT.PREVS, 0) ..
if not EMT.LOAD and EMT.PREVHEAD == 'H3' and EMT.FLAG2 == 1 then
local sOutPreMove = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( MyZHome, EMT.DECMACRO) ..
' P4=' .. EgtNumToString( EMT.R2pp, EMT.DECMACRO) .. ' P5=' .. EgtNumToString( EMT.R1pp, EMT.DECMACRO) ..
' P6=' .. EgtNumToString( EMT.PREVTCPOS, EMT.DECMACRO) .. ' P7=' .. EgtNumToString( EMT.PREVS, 0) ..
' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4')
EmtOutput( sOutPreMove)
sOutPreMove = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( MyZHome, EMT.DECMACRO) ..
' P4=' .. EgtNumToString( 0, EMT.DECMACRO) .. ' P5=' .. EgtNumToString( EMT.R1pp, EMT.DECMACRO) ..
' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) ..
' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4')
EmtOutput( sOutPreMove)
EmtOutput( 'M101 P1=2')
@@ -663,9 +690,23 @@ function OnRapid()
end
-- se carico motosega, ruoto in zona sicura prima di approcciare la lavorazione
if EMT.HEAD == 'H3' and EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
local sOutPreMove = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, 3) .. ' P3=' .. EmtLenToString( MyZHome, 3) ..
' P4=' .. EgtNumToString( EMT.R2, 3) .. ' P5=' .. EgtNumToString( EMT.R1, 3) ..
if not EMT.LOAD and ( EMT.HEAD == 'H3' or ( bZmax and EMT.TTOTLEN > 200)) and
( EMT.ST > BeamHeightForFixRot or ( EMT.HEAD == 'H1' and EMT.TTOTLEN > 350) or bGoToHome) and EMT.FLAG2 == 1 then
local sOutPreMove
if EMT.HEAD == 'H3' and bGoToHome then
sOutPreMove = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( MyZHome, EMT.DECMACRO) ..
' P4=' .. EgtNumToString( 0, EMT.DECMACRO) .. ' P5=' .. EgtNumToString( EMT.R1pp, EMT.DECMACRO) ..
' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) ..
' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4')
EmtOutput( sOutPreMove)
sOutPreMove = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( MyZHome, EMT.DECMACRO) ..
' P4=' .. EgtNumToString( 0, EMT.DECMACRO) .. ' P5=' .. EgtNumToString( EMT.R1, EMT.DECMACRO) ..
' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) ..
' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4')
EmtOutput( sOutPreMove)
end
sOutPreMove = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( MyZHome, EMT.DECMACRO) ..
' P4=' .. EgtNumToString( EMT.R2, EMT.DECMACRO) .. ' P5=' .. EgtNumToString( EMT.R1, EMT.DECMACRO) ..
' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) ..
' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4')
EmtOutput( sOutPreMove)
@@ -679,8 +720,8 @@ function OnRapid()
if EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
MyZPos = MyZHome
end
local sOut = 'M101 P1=1' .. ' P2=' .. EmtLenToString( EMT.L2, 3) .. ' P3=' .. EmtLenToString( MyZPos, 3) ..
' P4=' .. EgtNumToString( EMT.R2, 3) .. ' P5=' .. EgtNumToString( EMT.R1, 3) ..
local sOut = 'M101 P1=1' .. ' P2=' .. EmtLenToString( EMT.L2, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( MyZPos, EMT.DECMACRO) ..
' P4=' .. EgtNumToString( EMT.R2, EMT.DECMACRO) .. ' P5=' .. EgtNumToString( EMT.R1, EMT.DECMACRO) ..
' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) ..
' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4')
if EMT.LOAD then
@@ -730,7 +771,7 @@ function OnRapid()
sV = EmtLenToString( ParkV)
sB = '2'
end
sOut = 'M112 P1='..EmtLenToString( EMT.L1, 3)..' P3='..sA..' P4='..sB..' P5=0 P6='..sY..' P7='..sV..' P9='..GetFmaxClamp()
sOut = 'M112 P1='..EmtLenToString( EMT.L1, EMT.DECMACRO)..' P3='..sA..' P4='..sB..' P5=0 P6='..sY..' P7='..sV..' P9='..GetFmaxClamp()
ParkLine( sOut)
EMT.LOAD = false
-- emissione prime linee speciali e linee parcheggiate
@@ -781,7 +822,7 @@ function OnRapid()
sOut = 'M101 P1=3'
EmtOutput( sOut)
end
sOut = 'M112 P1=' .. EmtLenToString( EMT.L1, 3) ..' P3='..sA..' P4='..sB..' P6='..sY..' P7='..sV..' P9=' .. GetFmaxClamp()
sOut = 'M112 P1=' .. EmtLenToString( EMT.L1, EMT.DECMACRO) ..' P3='..sA..' P4='..sB..' P6='..sY..' P7='..sV..' P9=' .. GetFmaxClamp()
EmtOutput( sOut)
if not bHeadFirst then
sOut = 'M101 P1=2'
@@ -849,12 +890,42 @@ function OnRapid()
EmtAdjustRotaryAxes()
EmitZmax( true)
EMT.ZMAX = true
-- se pezzi alti e devo cambiare utensile su testa con CU, porto la testa vicino al cambio utensile
if EMT.ST > BeamHeightForFixRot and EMT.HEAD == 'H1' and EMT.TOOL ~= EMT.NEXTTOOL and EMT.NEXTHEAD ~= 'H2' then
local dBAxis = 90
local dCAxis = EgtIf( BD.RIGHT_LOAD, 90, -90)
local sOut = 'M101 P1=1' .. ' P2=' .. EmtLenToString( EMT.L2, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( EMT.L3, EMT.DECMACRO) ..
' P4=' .. EgtNumToString( dBAxis, EMT.DECMACRO) .. ' P5=' .. EgtNumToString( dCAxis, EMT.DECMACRO) ..
' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) ..
' P8=0' .. ' P9=0' .. ' P10=3'
EmtOutput( sOut)
EmtOutput( 'M101 P1=2')
EmtOutput( 'M101 P1=3')
sOut = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( EMT.L3, EMT.DECMACRO) ..
' P4=' .. EgtNumToString( dBAxis, EMT.DECMACRO) .. ' P5=' .. EgtNumToString( dCAxis, EMT.DECMACRO) ..
' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) ..
' P8=0' .. ' P9=0' .. ' P10=3'
EmtOutput( sOut)
EmtOutput( 'M101 P1=2')
EmtOutput( 'M101 P1=3')
end
-- se altrimenti movimento in Home
elseif EMT.FLAG == 4 then
-- non previsto
-- se altrimenti rotazione a Z max
-- se altrimenti rotazione a Z max per lavorazione successiva
elseif EMT.FLAG == 5 then
-- viene gestito all'inizio della lavorazione successiva
EMT.REFLOC = nil
EMT.IPLGL = false
MyAdjustLinearAxes()
EmtAdjustRotaryAxes()
EmtResetPrev()
local sOut = 'M101 P1=1' .. ' P2=' .. EmtLenToString( EMT.L2, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( EMT.L3, EMT.DECMACRO) ..
' P4=' .. EgtNumToString( EMT.R2, EMT.DECMACRO) .. ' P5=' .. EgtNumToString( EMT.R1, EMT.DECMACRO) ..
' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) ..
' P8=0' .. ' P9=0' .. ' P10=3'
EmtOutput( sOut)
EmtOutput( 'M101 P1=2')
EmtOutput( 'M101 P1=3')
-- altrimenti errore
else
error( "Unknown Rapid flag")
@@ -969,7 +1040,7 @@ function OnArc()
--local sCen = ' ' .. EMT.C1t .. EmtLenToString(EMT.C1,3) ..
-- ' ' .. EMT.C2t .. EmtLenToString(EMT.C2,3)
-- raggio
local sRad = ' ' .. EMT.RRt .. EmtLenToString( EMT.RR, EMT.DECNUM)
local sRad = ' ' .. EMT.RRt .. EmtLenToString( EMT.RR, EMT.DECRAD)
-- aggiungo feed
local sFeed = EmtGetFeed()
-- tipo arco
@@ -982,25 +1053,32 @@ function OnArc()
end
---------------------------------------------------------------------
function CalcDinamicaPinze( dH, dS, dL)
local MinTempoAcc = 0.3 -- [s]
local MaxTempoAcc = 4.0 -- [s]
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 AccPinze = FMaxPinze / ( 60 * TempoAcc)
local RidFeed = 100 / Massa * 100
if RidFeed > 100 then
RidFeed = 100
elseif RidFeed < 10 then
RidFeed = 10
function FindNextTool()
-- salvo stato iniziale
local CurrMachId = EgtGetCurrMachining()
local CurrTool = EgtTdbGetCurrToolParam( MCH_TP.NAME)
-- cerco lavorazione con utensile su gruppo testa indicato
local sTool, sHead, sTcPos
local OpId = EgtGetNextActiveOperation( CurrMachId or EMT.MCHID)
while OpId do
local nType = EgtGetOperationType( OpId)
if nType ~= MCH_OY.NONE and nType ~= MCH_OY.DISP then
if EgtSetCurrMachining( OpId) then
sTool = EgtGetMachiningParam( MCH_MP.TOOL)
if EgtTdbSetCurrTool( sTool) then
sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
sTcPos = EgtTdbGetCurrToolParam( MCH_TP.TCPOS)
break
end
end
end
OpId = EgtGetNextActiveOperation( OpId)
end
return TempoAcc * 1000, MinTempoAcc * 1000, RidFeed
-- ripristino stato iniziale
EgtSetCurrMachining( CurrMachId or GDB_ID.NULL)
EgtTdbSetCurrTool( CurrTool or '')
-- restituisco risultato
return sTool, sHead, sTcPos
end
---------------------------------------------------------------------
@@ -1572,18 +1650,24 @@ function MyAdjustLinearAxes()
if EMT.HEAD == 'H1' or EMT.HEAD == 'H2' then
local Len = EMT.TLEN + EgtIf( EMT.HEAD == 'H1', MillOffs, abs( SawOffs))
local LenRef = MillOffs
vtE = Vector3d( EMT.EXTR) * Len - Z_AX() * LenRef
vtE = Vector3d( EMT.TDIR) * Len - Z_AX() * LenRef
elseif EMT.HEAD == 'H3' then
local LenAux = ( EMT.TDIST or ChSawLen) + MillOffs
local LenRef = MillOffs
local vtAux = EgtGetCalcAuxDirFromAngles( EMT.R1, EMT.R2, EMT.R3)
vtE = vtAux * LenAux - Z_AX() * LenRef
elseif EMT.HEAD == 'H5' then
elseif EMT.HEAD == 'H5' or EMT.HEAD == 'H6' then
local Len = EMT.TLEN + AngTr1Len
local LenAux = MillOffs + AngTr1Offs
local LenRef = MillOffs
local vtAux = EgtGetCalcAuxDirFromAngles( EMT.R1, EMT.R2)
vtE = Vector3d( EMT.EXTR) * Len + vtAux * LenAux - Z_AX() * LenRef
vtE = Vector3d( EMT.TDIR) * Len + vtAux * LenAux - Z_AX() * LenRef
elseif EMT.HEAD == 'H7' then
local Len = EMT.TLEN + AngTrBHLen
local LenAux = MillOffs + AngTrBHOffs
local LenRef = MillOffs
local vtAux = EgtGetCalcAuxDirFromAngles( EMT.R1, EMT.R2)
vtE = Vector3d( EMT.TDIR) * Len + vtAux * LenAux - Z_AX() * LenRef
else
EmtSetLastError( 1211, 'Head not allowed ' .. EMT.HEAD)
end
@@ -1620,6 +1704,8 @@ function AdjustToolKinematic()
return EgtIf( EMT.EXIT == 1, '11', '12')
elseif EMT.HEAD == 'H6' then
return EgtIf( EMT.EXIT == 1, '21', '22')
elseif EMT.HEAD == 'H7' then
return '31'
else
EmtSetLastError( 1211, 'Head not allowed ' .. EMT.HEAD)
end
@@ -1692,9 +1778,9 @@ function CalcInterpPlane()
local vtY = EMT.IPLGLFR:getVersY()
local vtZ = EMT.IPLGLFR:getVersZ()
EMT.IPLGLSTR = ' X0 Y' .. EmtLenToString( xS, EMT.DECNUM) .. ' Z0' ..
' A' .. EgtNumToString( - vtX:getY(), 6) .. ' B' .. EgtNumToString( vtX:getX(), 6) .. ' C' .. EgtNumToString( vtX:getZ(), 6) ..
' I' .. EgtNumToString( - vtY:getY(), 6) .. ' J' .. EgtNumToString( vtY:getX(), 6) .. ' K' .. EgtNumToString( vtY:getZ(), 6) ..
' P' .. EgtNumToString( - vtZ:getY(), 6) .. ' Q' .. EgtNumToString( vtZ:getX(), 6) .. ' R' .. EgtNumToString( vtZ:getZ(), 6)
' A' .. EgtNumToString( - vtX:getY(), EMT.DECVERS) .. ' B' .. EgtNumToString( vtX:getX(), EMT.DECVERS) .. ' C' .. EgtNumToString( vtX:getZ(), EMT.DECVERS) ..
' I' .. EgtNumToString( - vtY:getY(), EMT.DECVERS) .. ' J' .. EgtNumToString( vtY:getX(), EMT.DECVERS) .. ' K' .. EgtNumToString( vtY:getZ(), EMT.DECVERS) ..
' P' .. EgtNumToString( - vtZ:getY(), EMT.DECVERS) .. ' Q' .. EgtNumToString( vtZ:getX(), EMT.DECVERS) .. ' R' .. EgtNumToString( vtZ:getZ(), EMT.DECVERS)
EMT.IPLGL = true
end
+286 -77
View File
@@ -7,9 +7,6 @@ EgtEnableDebug( false)
-- carico librerie
local BD = require( 'BeamData')
LONG_TOOL_MINLEN = 221
BIG_TOOL_DIAM = 300
---------------------------------------------------------------------
-- *** GENERATION ***
---------------------------------------------------------------------
@@ -82,6 +79,14 @@ function OnSimulStart()
for j = 1, #( vTools or {}) do
if vTools[j] ~= '' then
EgtLoadTool( vTcPos[i], j, vTools[j])
-- Aggiunto controllo lunghezza lama minima * 0.9 per ricavare la tolleranza del VMILL
if EgtTdbSetCurrTool(vTools[j]) then -- set utensile corrente
if EgtTdbGetCurrToolParam( MCH_TP.TYPE) == MCH_TY.SAW_STD or EgtTdbGetCurrToolParam( MCH_TP.TYPE) == MCH_TY.SAW_FLAT then -- controllo tipo utensile sega
local dCurrSawLen = EgtTdbGetCurrToolParam( MCH_TP.LEN) * 0.9
-- se non definito o minore del valore precedente aggiorna la tolleranza
EMT.VMILLTOL = EgtIf( not EMT.VMILLTOL or dCurrSawLen < EMT.VMILLTOL, dCurrSawLen, EMT.VMILLTOL)
end
end
end
end
ShowToolInTcPos( vTcPos[i], true)
@@ -105,6 +110,7 @@ function OnSimulStart()
AddToCollisionCheck( 'B', 'COLLISION', EMT.COLLOBJ)
AddToCollisionCheck( 'C', 'COLLISION', EMT.COLLOBJ)
AddToCollisionCheck( 'H5', 'COLLISION', EMT.COLLOBJ)
AddToCollisionCheck( 'H6', 'COLLISION', EMT.COLLOBJ)
AddToolToCollisionCheck( 'H2', 1, EMT.COLLOBJ)
AddToolHolderToCollisionCheck( 'H2', 1, EMT.COLLOBJ)
DumpCollisionCheck( EMT.COLLOBJ, 'Collision Objects :', 4)
@@ -117,7 +123,8 @@ function OnSimulStart()
{ Grp = 'V', Sub = 'COLLISION', Name = 'VOL2'},
{ Grp = 'PV', Sub = 'COLLISION', Name = 'VOL'},
{ Grp = 'Base', Sub = 'COLLISION', Name = 'SIDE1'},
{ Grp = 'Base', Sub = 'COLLISION', Name = 'SIDE2'}}
{ Grp = 'Base', Sub = 'COLLISION', Name = 'SIDE2'},
{ Grp = 'C', Sub = 'COLLISION2', Name = 'C_TOP'}}
EgtOutLog( 'MCODET Objects :', 4)
local nMcdNullCnt = 0
for i = 1, #McdData do
@@ -152,7 +159,8 @@ function OnSimulDispositionStarting()
EmtUnlinkAllRawPartsFromGroups()
if EMT.PHASE > 1 then
if IsStartOrRestPhase( EMT.PHASE) then
EgtSetAxisPos( 'T', LoadT)
local ParkT = GetParkT()
EgtSetAxisPos( 'T', ParkT)
end
end
end
@@ -166,20 +174,20 @@ function OnSimulDispositionStart()
-- Determino dimensioni del grezzo
local nSolId = EgtGetFirstNameInGroup( EgtGetFirstRawPart() or GDB_ID.NULL, 'RawSolid') or GDB_ID.NULL
local b3Sol = EgtGetBBoxGlob( nSolId, GDB_BB.STANDARD)
EMT.LB = 0
EMT.SB = 0
EMT.HB = 0
EMT.LT = 0
EMT.ST = 0
EMT.HT = 0
if b3Sol then
EMT.LB = b3Sol:getDimX()
EMT.SB = b3Sol:getDimY()
EMT.HB = b3Sol:getDimZ()
EMT.LT = b3Sol:getDimX()
EMT.ST = b3Sol:getDimY()
EMT.HT = b3Sol:getDimZ()
end
-- Carico primo utensile sulla testa 1
local sTool, nTlen = FindFirstToolOnHead( 'H1')
if sTool and nTlen < LONG_TOOL_MINLEN then
EMT.TOOL_1 = sTool
else
EMT.TOOL_1 = GetDefaultToolName()
EMT.TOOL_1 = GetDefaultToolName()
end
EgtLoadTool( 'H1', 1, EMT.TOOL_1)
EMT.TCPOS_1 = GetToolTcPos( EMT.TOOL_1)
@@ -189,7 +197,7 @@ function OnSimulDispositionStart()
EMT.VMILL = {}
if not EMT.SIM1ST and EgtGetInfo( EgtGetCurrMachGroup(), 'Vm', 'b') then
local nLastOrd = GetPhaseOrd( EgtGetPhaseCount())
local nPartRawId = EgtGetFirstRawPart()
local nPartRawId = EgtGetFirstRawPart()
while nPartRawId do
-- se è lo scarto finale tagliato a pezzi, esco
local nRawOrd = EgtGetInfo( nPartRawId, 'ORD', 'i')
@@ -211,21 +219,26 @@ 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.71
if dArea < CoeffVM * 0.15e6 then
dTol = 0.71
elseif dArea < CoeffVM * 0.3e6 then
dTol = 1.01
elseif dArea < CoeffVM * 0.6e6 then
dTol = 1.51
elseif dArea < CoeffVM * 1.2e6 then
dTol = 1.97
elseif dArea < CoeffVM * 2.4e6 then
dTol = 2.81
elseif dArea < CoeffVM * 4.8e6 then
dTol = 3.77
if EmtGetVMillStep then
dTol = EmtGetVMillStep( b3Raw:getDimX(), b3Raw:getDimY(), b3Raw:getDimZ(), dTol)
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
dTol = min( dTol, EMT.VMILLTOL or dTol) -- imposto dTol al valore minore tra quello per volume e quello per spessore lama
-- creo lo Zmap
local VMillId = EgtVolZmapBox( nPartRawId, b3Raw:getMin(), b3Raw:getDimX(), b3Raw:getDimY(), b3Raw:getDimZ(), dTol, true, GDB_RT.GLOB)
if VMillId then
@@ -358,6 +371,8 @@ function OnSimulDispositionStart()
EgtOutText( 'Barra non ruotata')
end
end
-- verifico posizione di carico
local ParkT = GetParkT()
-- indice primo grezzo della fase
local nOrd = GetPhaseOrd( EMT.PHASE)
-- ricerco vettore movimento per i successivi
@@ -365,7 +380,7 @@ function OnSimulDispositionStart()
local nRawId = EgtGetFirstRawPart()
while nRawId do
if EgtGetInfo( nRawId, 'ORD', 'i') == nOrd + 1 then
vtMove = Vector3d( - LoadT - EgtGetRawPartBBox( nRawId):getMax():getX(), 0, 0)
vtMove = Vector3d( - ParkT - EgtGetRawPartBBox( nRawId):getMax():getX(), 0, 0)
break
end
nRawId = EgtGetNextRawPart( nRawId)
@@ -386,6 +401,8 @@ function OnSimulDispositionStart()
end
-- altrimenti fase finale, aggancio primo grezzo alla tavola e gli altri in posizione carico al carro Y
else
-- verifico posizione di carico
local ParkT = GetParkT()
-- indice primo grezzo della fase
local nOrd = GetPhaseOrd( EMT.PHASE)
-- ricerco vettore movimento per i successivi
@@ -393,7 +410,7 @@ function OnSimulDispositionStart()
local nRawId = EgtGetFirstRawPart()
while nRawId do
if EgtGetInfo( nRawId, 'ORD', 'i') == nOrd + 1 then
vtMove = Vector3d( - LoadT - EgtGetRawPartBBox( nRawId):getMax():getX(), 0, 0)
vtMove = Vector3d( - ParkT - EgtGetRawPartBBox( nRawId):getMax():getX(), 0, 0)
break
end
nRawId = EgtGetNextRawPart( nRawId)
@@ -456,8 +473,10 @@ function OnSimulToolSelect( dPosA)
EMT.TOTDIAM = EgtTdbGetCurrToolParam( MCH_TP.TOTDIAM)
-- se non è chiamato da altro script (non c'è parametro)
if not dPosA then
-- se attivo Vmill
SetToolForVmill( EMT.TOOL, EMT.HEAD, EMT.EXIT, EMT.VMILL)
-- se utensile non flottante, abilito per Vmill
if not EMT.TFLOAT then
EmtSetToolForVmill( EMT.TOOL, EMT.HEAD, EMT.EXIT, EMT.VMILL)
end
-- se attivo Collision Check
EMT.SAFEDIST = COLL_SAFE_DIST
if EMT.COLLOBJ then
@@ -477,8 +496,8 @@ function OnSimulToolSelect( dPosA)
EMT.A1n = 'Y'
EMT.A2n = 'V'
end
-- carico utensile se non lama su sua testa o dummy
if EMT.HEAD ~= 'H2' and EMT.HEAD ~= 'H4' then
-- carico utensile se non lama
if EMT.HEAD ~= 'H2' then
-- se sega a catena, imposto subito angolo scelto per asse virtuale A
if EMT.HEAD == 'H3' then
if not dPosA then
@@ -506,6 +525,17 @@ function OnSimulToolSelect( dPosA)
EgtSetAxisPos( 'C', EgtIf( BD.RIGHT_LOAD, 180, 0))
end
EgtSetAxisPos( 'B', 0)
-- se aggregato per fresa tipo blockhaus
elseif EMT.HEAD == 'H7' then
EgtSetAxisPos( 'C', EgtIf( BD.RIGHT_LOAD, 180, 0))
end
-- se TC 1
if GetTCSet( EMT.TCPOS) == 1 then
EgtSetAxisPos( 'B', 90)
else
if EMT.HEAD ~= 'H3' then
EgtSetAxisPos( 'B', -90)
end
end
-- se punta lunga
if EMT.TOTLEN > LONG_TOOL_MINLEN then
@@ -513,8 +543,7 @@ function OnSimulToolSelect( dPosA)
if EMT.TCPOS == 'T111' then
EgtSetAxisPos( 'B', 0)
end
end
-- breve pausa
end -- breve pausa
EgtPause( 100)
EgtOutText( '')
EMT.TOOL_1 = EMT.TOOL
@@ -529,27 +558,31 @@ function OnSimulToolDeselect()
-- se prossimo utensile non definito, è disposizione ed esco
if EMT.NEXTTOOL == '' then return end
-- se cambia uscita su rinvio non devo fare alcunché
if EMT.HEAD == 'H5' and EMT.NEXTHEAD == 'H5' then return end
if ( EMT.HEAD == 'H5' and EMT.NEXTHEAD == 'H5') or ( EMT.HEAD == 'H6' and EMT.NEXTHEAD == 'H6') then return end
-- se sega a catena o rinvio o punta lunga o utensile di grosso diametro, devo cambiare
if EMT.HEAD == 'H3' or EMT.HEAD == 'H5' or ( EMT.HEAD == 'H1' and ( EMT.TOTLEN > LONG_TOOL_MINLEN or EMT.TOTDIAM > BIG_TOOL_DIAM)) then
if EMT.HEAD == 'H3' or EMT.HEAD == 'H5' or EMT.HEAD == 'H6' or EMT.HEAD == 'H7' or ( EMT.HEAD == 'H1' and ( EMT.TOTLEN > LONG_TOOL_MINLEN or EMT.TOTDIAM > BIG_TOOL_DIAM)) then
EgtOutText( 'Tool change in progress...')
-- movimento scarico sega a catena
if EMT.HEAD == 'H3' then
-- se avevo motosega, torno in zona sicura senza ruotare assi rotanti
if EMT.HB > BeamHeightForFixRot then
SimulMoveAxis( 'X', SafeXRotAxes, MCH_SIM_STEP.RAPID)
end
SimulMoveAxis( 'X', SafeXRotAxes, MCH_SIM_STEP.RAPID)
-- raddrizzo asse B prima di ruotare il C
SimulMoveAxis( 'B', 0, MCH_SIM_STEP.COLLROT)
local dPosA = EgtGetAxisPos( 'A')
if abs( dPosA) < 0.1 then
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.COLLROT, 'C', EgtIf( BD.RIGHT_LOAD, 180, 0), MCH_SIM_STEP.COLLROT)
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.COLLROT, 'C', EgtIf( BD.RIGHT_LOAD, -180, 0), MCH_SIM_STEP.COLLROT)
else
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.COLLROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.COLLROT)
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.COLLROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, 270), MCH_SIM_STEP.COLLROT)
end
SimulMoveAxis( 'X', 0, MCH_SIM_STEP.RAPID)
-- movimento scarico rinvio
elseif EMT.HEAD == 'H5' then
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.COLLROT, 'C', -90, MCH_SIM_STEP.COLLROT)
elseif EMT.HEAD == 'H5' or EMT.HEAD == 'H6' then
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.COLLROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'X', 0, MCH_SIM_STEP.RAPID)
-- movimento scarico aggregato BlockHaus
elseif EMT.HEAD == 'H7' then
SimulMoveAxis( 'X', 0, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'B', 90, MCH_SIM_STEP.COLLROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.COLLROT)
-- movimento scarico punta lunga su T111
elseif EMT.TOTLEN > LONG_TOOL_MINLEN then
-- se su cambio utensile T111
@@ -559,7 +592,11 @@ function OnSimulToolDeselect()
-- altrimenti posizioni standard rastrelliera
else
SimulMoveAxis( 'X', 0, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'B', 90, MCH_SIM_STEP.COLLROT, 'C', -90, MCH_SIM_STEP.COLLROT)
if GetTCSet( EMT.TCPOS) == 1 then
SimulMoveAxes( 'B', 90, MCH_SIM_STEP.COLLROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.COLLROT)
else
SimulMoveAxes( 'B', -90, MCH_SIM_STEP.COLLROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.COLLROT)
end
end
-- movimento scarico utensile di grosso diametro (su T111)
else
@@ -573,24 +610,40 @@ function OnSimulToolDeselect()
-- nascondo utensile su testa e lo visualizzo su TcPos
EgtSetMode( EgtGetHeadId( EMT.HEAD), GDB_MD.HIDDEN)
ShowToolInTcPos( EMT.TCPOS_1, true)
-- movimento per carico utensile
if EMT.NEXTHEAD ~= 'H3' and EMT.NEXTHEAD ~= 'H5' then
SimulMoveAxes( 'B', 90, MCH_SIM_STEP.RAPROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.RAPROT)
if EMT.NEXTHEAD ~= 'H3' and EMT.NEXTHEAD ~= 'H5' and EMT.NEXTHEAD ~= 'H6' then
SimulMoveAxes( 'B', EgtIf( GetTCSet( EMT.TCPOS) == 1, 90, -90), MCH_SIM_STEP.RAPROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.RAPROT)
else
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.RAPROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.RAPROT)
if EMT.NEXTHEAD == 'H3' then
local dPosA = EgtGetAxisPos( 'A')
if abs( dPosA) < 0.1 then
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.RAPROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, 270), MCH_SIM_STEP.RAPROT)
else
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.COLLROT, 'C', EgtIf( BD.RIGHT_LOAD, -180, 0), MCH_SIM_STEP.COLLROT)
end
else
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.RAPROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.RAPROT)
end
end
-- se segue lama, carico utensile di default
if EMT.NEXTHEAD == 'H2' then
local sDefTool = GetDefaultToolName()
EgtLoadTool( 'H1', 1, sDefTool)
EMT.TOOL_1 = sDefTool
EMT.TCPOS_1 = GetToolTcPos( EMT.TOOL_1)
-- se TC 1
if GetTCSet( EMT.TCPOS_1) == 1 then
EgtSetAxisPos( 'B', 90)
else
EgtSetAxisPos( 'B', -90)
end
EgtLoadTool( 'H1', 1, sDefTool)
-- lo nascondo sul portautensili
ShowToolInTcPos( EMT.TCPOS_1, false)
end
EgtOutText( '')
-- deposito utensile se prossimo non lama su sua testa o dummy
elseif EMT.NEXTHEAD ~= 'H2' and EMT.NEXTHEAD ~= 'H4' then
-- deposito utensile se prossimo non lama su sua testa
elseif EMT.NEXTHEAD ~= 'H2' then
if EMT.NEXTTOOL ~= EMT.TOOL_1 then
EgtOutText( 'Tool change in progress...')
-- simulo movimento
@@ -600,7 +653,7 @@ function OnSimulToolDeselect()
EgtPause( 100)
ShowToolInTcPos( EMT.TCPOS_1, true)
-- se segue sega a catena
if EMT.NEXTHEAD == 'H3' or EMT.NEXTHEAD == 'H5' then
if EMT.NEXTHEAD == 'H3' or EMT.NEXTHEAD == 'H5' or EMT.NEXTHEAD == 'H6' then
-- se non lama, nascondo l'utensile corrente
if EMT.HEAD ~= 'H2' then
EgtSetStatus( EgtGetHeadId( EMT.HEAD), GDB_ST.OFF)
@@ -662,6 +715,7 @@ function OnSimulMachiningEnd()
EMT.FALL = false
end
EMT.PREVHEAD = EMT.HEAD
EMT.PREVTOOL = EMT.TOOL
EMT.PREVEXIT = EMT.EXIT
end
@@ -747,31 +801,84 @@ function OnSimulMoveStart()
VerifyVStroke( EMT.A2)
-- se inizio lavorazione
if EMT.MCHFIRST then
local bGoToHome = false
-- se gli assi rotanti cambiano parecchio, con motosega si va in parcheggio
if EMT.PREVHEAD == 'H3' and EMT.HEAD == 'H3' and EMT.TOOL == EMT.PREVTOOL and abs( EMT.R3p - EMT.R3) < 100 * GEO.EPS_SMALL and ( abs( EMT.R2p - EMT.R2) > 25 or abs( EMT.R1p - EMT.R1) > 25) then
bGoToHome = true
end
EgtOutText( '')
EMT.MCHFIRST = false
local bZmax = ( EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1)
-- con pezzi alti aggiorno gli assi rotanti prima di muovermi sopra il pezzo
if not EMT.LOAD and EMT.MOVE == 0 and EMT.HB > BeamHeightForFixRot and EMT.FLAG2 == 1 then
-- se motosega mi muovo a X di sicurezza per ruotare
if EMT.HEAD == 'H3'then
if not EMT.LOAD and EMT.MOVE == 0 and ( EMT.HEAD == 'H3' or ( bZmax and EMT.TOTLEN > 200)) and
( EMT.HT > BeamHeightForFixRot or ( EMT.HEAD == 'H1' and EMT.TOTLEN > 350) or bGoToHome) and EMT.FLAG2 == 1 then
-- se motosega mi muovo a X di sicurezza per ruotare, prima si raddrizza B e poi C in posizione
if EMT.HEAD == 'H3' or bGoToHome then
SimulMoveAxis( 'X', SafeXRotAxes, MCH_SIM_STEP.RAPID)
SimulMoveAxis( 'B', 0, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'C', EMT.R1, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'B', EMT.R2, MCH_SIM_STEP.COLLROT)
elseif ( bZmax and EMT.TOTLEN > 200) then
SimulMoveAxes( 'X', SafeXRotAxes, MCH_SIM_STEP.RAPID, 'C', EMT.R1, MCH_SIM_STEP.COLLROT, 'B', EMT.R2, MCH_SIM_STEP.COLLROT)
end
end
EMT.POSTROT = nil
end
-- se aggregato flottante su inizio attacco va compresso
if EMT.TFLOAT and not EMT.TFLOAT_CMP and EMT.MOVE == 1 and EgtGetName( EMT.MOVEID) == 'LI' then
-- recupero lunghezza
local dOffsL = - EgtGetMachiningParam( MCH_MP.OFFSL)
-- imposto compressione della parte flottante
SetFloatPos( EMT.HEAD, dOffsL)
-- imposto dati utensile in posizione compressa
EmtSetToolForVmill( EMT.TOOL, EMT.HEAD, EMT.EXIT, EMT.VMILL, 2, -dOffsL)
-- dichiaro che è compresso (assegnando Id entità di movimento)
EMT.TFLOAT_CMP = EMT.MOVEID
end
end
---------------------------------------------------------------------
function OnSimulMoveEnd()
-- se termine di passata con lama
if EMT.FLAG == 301 then
-- rimozione eventuali sfridi
ExecRemoveScraps()
end
-- se utensile flottante e movimento di compressione
if EMT.TFLOAT and EMT.MOVEID == EMT.TFLOAT_CMP then
-- verifico ci sia stata collisione tra ghiera flottante (portautensile e pezzo)
if not EMT.TFLOAT_TH_COMPR_COLL then
local sErr = 'CUTID='..tostring( EMT.CUTID)..'; TASKID='..tostring( EMT.TASKID)..'; Mach='..EMT.MCHNAME..'; Floating Ring not compressed on approach'
EmtSetLastError( 1222, sErr)
EgtOutLog( 'Error : ' .. sErr, 1)
else
EgtOutLog( 'Floating Ring compressed on approach (MOVEID='..EgtNumToString( EMT.MOVEID)..')', 1)
end
EMT.TFLOAT_TH_COMPR_COLL = nil
end
-- se aggregato flottante su fine uscita va rilasciato
if EMT.TFLOAT and EMT.TFLOAT_CMP and EMT.MOVE == 1 and EgtGetName( EMT.MOVEID) == 'LO' and EgtGetName( EgtGetNext( EMT.MOVEID) or GDB_ID.NULL) ~= 'LO' then
-- reset compressione della parte flottante
SetFloatPos( EMT.HEAD, 0)
-- dichiaro che è rilasciato
EMT.TFLOAT_CMP = nil
end
end
---------------------------------------------------------------------
function OnSimulCollision()
-- se prima collisione della lavorazione, la segnalo
if EMT.MCHNAME ~= EMT.LAST_MCHNAME_COLLIDE then
-- speciale per utensile flottante (suo holder contro il grezzo)
if EMT.TFLOAT and EMT.TFLOAT_CMP and EMT.SIMCOBIND == 1002 and EMT.SIMVMID == EMT.VMILL[1] then
if EMT.MOVEID == EMT.TFLOAT_CMP then
EMT.TFLOAT_TH_COMPR_COLL = true
end
return
end
-- standard
local Class = ''
if EMT.SIMCOBIND == 1001 then
Class = 'T_H1'
@@ -838,14 +945,14 @@ function ExecAuxCmd( sCmd)
elseif Cmd[1] == '11' then
local dPY = MaxOpen
if Cmd[2] ~= '0' then
dPY = EgtIf( EMT.ROT == -1, EMT.HB, EMT.SB)
dPY = EgtIf( EMT.ROT == -1, EMT.HT, EMT.ST)
end
SimulMoveAxis( 'PY', dPY, MCH_SIM_STEP.RAPID)
SetPYLight( Cmd[2] ~= '0')
elseif Cmd[1] == '12' then
local dPV = MaxOpen
if Cmd[2] ~= '0' then
dPV = EgtIf( EMT.ROT == -1, EMT.HB, EMT.SB)
dPV = EgtIf( EMT.ROT == -1, EMT.HT, EMT.ST)
end
SimulMoveAxis( 'PV', dPV, MCH_SIM_STEP.RAPID)
SetPVLight( Cmd[2] ~= '0')
@@ -892,7 +999,7 @@ function ExecRemoveScraps()
for i = nPart, 1, -1 do
if i ~= nPartMax then
local b3Vmill = EgtVolZmapGetPartBBoxGlob( vMillId, i - 1, GDB_BB.STANDARD)
if b3Vmill:getDimX() < 1200 then
if b3Vmill:getDimX() < 1250 then
EgtRemoveVolZmapPart( vMillId, i - 1)
end
end
@@ -912,14 +1019,14 @@ function ExecUnloading()
-- li sposto per lasciare spazio al nuovo pezzo
local nId = EgtGetFirstInGroup( nVmGrpId)
while nId do
EgtMove( nId, Vector3d( 0, EgtIf( BD.RIGHT_LOAD, ( EMT.SB + 50.0), -( EMT.SB + 50.0)), 0), GDB_RT.GLOB)
EgtMove( nId, Vector3d( 0, EgtIf( BD.RIGHT_LOAD, ( EMT.ST + 50.0), -( EMT.ST + 50.0)), 0), GDB_RT.GLOB)
nId = EgtGetNext( nId)
end
-- creo un nuovo layer e vi inserisco il nuovo pezzo
local nLayId = EgtGroup( nVmGrpId, EgtGetGlobFrame( vMillId))
EgtRelocate( vMillId, nLayId)
local vtMove = Vector3d( 0, EgtIf( BD.RIGHT_LOAD, 450, -450), 0)
if EMT.FALL then vtMove = Vector3d( -500, 0, EgtIf( BD.RIGHT_LOAD, 750, -750)) end
if EMT.FALL then vtMove = Vector3d( 0, EgtIf( BD.RIGHT_LOAD, 500, -500), -750) end
EgtMove( nLayId, vtMove, GDB_RT.GLOB)
EgtSetLevel( vMillId, GDB_LV.USER)
-- aggiungo gli spigoli
@@ -1113,22 +1220,35 @@ end
---------------------------------------------------------------------
-- *** ESTIMATION T&L ***
---------------------------------------------------------------------
local RAPID_X_FEED = 75000 -- mm/min
local RAPID_Y_FEED = 100000 -- mm/min
local RAPID_Z_FEED = 50000 -- mm/min
local RAPID_C_FEED = 15000 -- deg/min
local RAPID_B_FEED = 15000 -- deg/min
local RAPID_MIN_T = 0.1 -- s
local LOAD_T = 2 -- s
local CHAR_ONE_MOVE_T = 1 -- s
local ROTATION_T = 40 -- s
local SPLIT_T = 6 -- s
local UNLOAD_T = 4 -- s
local FALL_T = 2 -- s
local ESTIMATION_RAPID_COEFF = EstimationRapidMultiplier or 1
local RAPID_X_FEED = 100000 / ESTIMATION_RAPID_COEFF -- mm/min
local RAPID_Y_FEED = 100000 / ESTIMATION_RAPID_COEFF -- mm/min
local RAPID_Z_FEED = 100000 / ESTIMATION_RAPID_COEFF -- mm/min
local RAPID_C_FEED = 12000 / ESTIMATION_RAPID_COEFF -- deg/min
local RAPID_B_FEED = 12000 / ESTIMATION_RAPID_COEFF -- deg/min
local RAPID_MIN_T = 0.1 * ESTIMATION_RAPID_COEFF -- s
local LOAD_T = 2 * ESTIMATION_RAPID_COEFF -- s
local CHAR_ONE_MOVE_T = 1 * ESTIMATION_RAPID_COEFF -- s
local ROTATION_T = 40 * ESTIMATION_RAPID_COEFF -- s
local SPLIT_T = 6 * ESTIMATION_RAPID_COEFF -- s
local UNLOAD_T = 4 * ESTIMATION_RAPID_COEFF -- s
local FALL_T = 2 * ESTIMATION_RAPID_COEFF -- s
---------------------------------------------------------------------
function OnEstimStart()
EMT.INCHES = not EgtUiUnitsAreMM() -- unità di misura mm/inches
-- TPA
if NumericalControl == 'TPA' then
EMT.FMAXPINZE = EgtClamp( MaxFeedPinze or 154000, 20000, 160000) -- feed massima pinze
EMT.MAXACC = MaxAcc or 4000 -- accelerazione massima pinze. In realtà è il tempo in millisecondi, quindi MAXACC corrisponde al tempo massimo per raggiungere la velocità desiderata
EMT.MINACC = MinAcc or 300 -- accelerazione minima pinze. In realtà è il tempo in millisecondi, quindi MINACC corrisponde al tempo massimo per raggiungere la velocità desiderata
-- NUM_PLUS e NUM
else
EMT.FMAXPINZE = EgtClamp( MaxFeedPinze or 154000, 20000, 160000) -- 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
end
end
---------------------------------------------------------------------
@@ -1214,6 +1334,15 @@ function OnEstimDispositionEnd()
EMT.OPEISDISP = false
end
---------------------------------------------------------------------
function OnEstimRawMoveData()
-- se start del pezzo
if IsStartOrRestPhase( EMT.PHASE) then
EMT.SPLIT = false
end
OnRawMoveData()
end
---------------------------------------------------------------------
function OnEstimToolSelect()
-- reset indice utensile in tabella lunghezze
@@ -1270,6 +1399,12 @@ function OnEstimMachiningEnd()
EMT.TLE_NAME = nil
EMT.TLE_TIME = nil
end
EMT.MCHUSERNOTES = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
EMT.MCHSPLIT = ( EMT.MCHUSERNOTES:find( 'Split;', 1, true) ~= nil)
if EMT.MCHSPLIT then
EMT.SPLIT = true
end
end
---------------------------------------------------------------------
@@ -1400,15 +1535,15 @@ function OnEstimRapid()
EMT.MCHEXTLEN = EMT.MCHEXTLEN + dLen
-- calcolo tempo
local dTime = RAPID_MIN_T
local dT1 = abs( dL1) / RAPID_X_FEED * 60
local dT1 = CalcMoveTime( abs( dL1), EMT.FMAXPINZE, EMT.SPLIT)
if dT1 > dTime then dTime = dT1 end
local dT2 = abs( dL2) / RAPID_Y_FEED * 60
local dT2 = abs( dL2) / ( RAPID_X_FEED / 60) -- CalcMoveTime( abs( dL2), RAPID_X_FEED, EMT.SPLIT)
if dT2 > dTime then dTime = dT2 end
local dT3 = abs( dL3) / RAPID_Z_FEED * 60
local dT3 = abs( dL3) / ( RAPID_Z_FEED * 60) -- CalcMoveTime( abs( dL3), RAPID_Z_FEED, EMT.SPLIT)
if dT3 > dTime then dTime = dT3 end
local dT4 = abs( dR1) / RAPID_C_FEED * 60
local dT4 = abs( dR1) / ( RAPID_C_FEED / 60)
if dT4 > dTime then dTime = dT4 end
local dT5 = abs( dR2) / RAPID_B_FEED * 60
local dT5 = abs( dR2) / ( RAPID_B_FEED / 60)
if dT5 > dTime then dTime = dT5 end
EMT.MCHEXTTIME = EMT.MCHEXTTIME + dTime
EgtOutLog( string.format( ' G0 Len=%.0f Rot=%.0f° Time=%.2f', dLen, abs( dR1) + abs( dR2), dTime), 5)
@@ -1426,7 +1561,7 @@ function OnEstimLinear()
local dLen = sqrt( dL1 * dL1 + dL2 * dL2 + dL3 * dL3)
EMT.MCHCUTLEN = EMT.MCHCUTLEN + dLen
-- calcolo tempo
local dTime = dLen / EMT.F * 60
local dTime = dLen / ( EMT.F / 60) -- CalcMoveTime( dLen, EMT.F, EMT.SPLIT)
EMT.MCHCUTTIME = EMT.MCHCUTTIME + dTime
EgtOutLog( string.format( ' G1 Len=%.0f Time=%.2f', dLen, dTime), 5)
-- aggiorno valori come precedenti
@@ -1563,6 +1698,80 @@ function GetPhaseRot( nPhase)
return ( EgtGetInfo( EgtGetPhaseDisposition( nPhase) or GDB_ID.NULL, 'ROT', 'i') or 0)
end
---------------------------------------------------------------------
function GetParkT()
local dTmp = EgtGetInfo( EMT.DISPID, 'TPOS', 'd') or EgtGetInfo( EMT.DISPID, 'TPARK', 'd')
if dTmp then
return dTmp
else
return LoadT
end
end
---------------------------------------------------------------------
function CalcDinamicaPinze_TPA( dH, dS, dL)
local MinTempoAcc = EMT.MINACC -- [ms] ~300
local MaxTempoAcc = EMT.MAXACC -- [ms] ~4000
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 = EgtClamp( ( Massa * FMaxPinze) / ( 60 * ForzaAttrito), MinTempoAcc, MaxTempoAcc)
local RidFeed = 100 / Massa * 100
if RidFeed > 100 then
RidFeed = 100
elseif RidFeed < 10 then
RidFeed = 10
end
return TempoAcc, MinTempoAcc, RidFeed
end
---------------------------------------------------------------------
function CalcDinamicaPinze_NUM( dH, dS, dL)
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)
local AccMaxPinze = EMT.MAXACC
local AccPinze = EgtClamp( FMaxPinze / ( 60 * TempoAcc), EMT.MINACC, EMT.MAXACC)
local RidFeed = 100 / Massa * 100
if RidFeed > 100 then
RidFeed = 100
elseif RidFeed < 10 then
RidFeed = 10
end
return AccPinze, AccMaxPinze, RidFeed, TempoAcc
end
---------------------------------------------------------------------
function CalcMoveTime( dPathLen, dFeed, bIsSplitted)
local dTime
local dFeedInSec = dFeed / 60
if NumericalControl == 'TPA' then
local dTempoAcc, _, _ = CalcDinamicaPinze_TPA( EMT.HT, EMT.ST, EgtIf( bIsSplitted, EMT.LT, EMT.LB))
dTempoAcc = dTempoAcc / 1000
-- se si raggiunge la velocità massima
if dPathLen >= dFeedInSec * dTempoAcc then
dTime = dTempoAcc * 2 + ( ( dPathLen - dFeedInSec * dTempoAcc) / dFeedInSec)
else
dTime = 2 * sqrt( (dPathLen * dTempoAcc) / dFeedInSec)
end
else
local dAcc, _, _, _ = CalcDinamicaPinze_NUM( EMT.HT, EMT.ST, EgtIf( bIsSplitted, EMT.LT, EMT.LB))
-- Caso 1: dFeed raggiunta
if dPathLen >= ( dFeedInSec ^ 2) / dAcc then
dTime = ( dFeedInSec / dAcc) + ( dPathLen / dFeedInSec)
-- Caso 2: dFeed non raggiunta
else
dTime = 2 * sqrt( dPathLen / dAcc)
end
end
return dTime
end
---------------------------------------------------------------------
-- *** END GENERAL ***
---------------------------------------------------------------------
+998 -225
View File
File diff suppressed because it is too large Load Diff
+20 -2
View File
@@ -21,6 +21,11 @@ H1.1:MILL_NOTIP=MillNoTip.nge
H1.1:SAW_FLAT=TcSaw.nge
H2.1=Saw.nge
H3.1=ChainSaw.nge
H5.1=AngTransm.nge
H5.2=AngTransm.nge
H6.1=AngTransm.nge
H6.2=AngTransm.nge
H7.1=AngTransmBH.nge
[Machinings]
Drilling=1
@@ -29,8 +34,15 @@ Milling=1
Pocketing=1
Mortising=1
Chiseling=0
SawRoughing=0
SawFinishing=0
GenMachining=0
SurfRoughing=1
SurfFinishing=1
5AxMilling=1
[5AxMilling]
5AxScript1=5AxProject
5AxScript2=5AxPocketProject
5AxScript3=5AxCylProject
[Machining]
InitScript=InitMach.lua
@@ -46,6 +58,12 @@ H1=6608
H2=6615
; Chainsaw
H3=6616
; Angular transmission
H5=6603
; Angular transmission
H6=6603
; Angular transmission
H7=6617
[SetUp]
Default=Standard
+297 -89
View File
@@ -3,41 +3,17 @@
-- 2022/07/22 Ver.2.4g2 DS Modifiche per ribaltamento pezzo con molto scarto iniziale.
-- 2023/01/16 Ver.2.5a1 DS/LM Modificata posizione home della testa H3.
-- 2023/01/23 Ver.2.5a2 DS Allineamento con FAST (per problemi scorrimento carrelli rispetto a trave).In simulazione corretta visualizzazione Sega a catena.
-- 2023/07/26 Ver.2.5g1 DS Per NUM aggiunta gestione rotazione in alto su pezzi alti (G101 EH1) come per TPA in versione 2.3f2.
-- 2023/07/26 Ver.2.5g2 DS Per NUM tolta segnalazione errore rotazione a Zmax per pezzi alti non gestita (era su EMT.FLAG == 5).
-- 2023/09/29 ver 2.5i1 In BeamData e mlde aggiunta la lettura di alcuni parametri da Ts3Data.
-- 2024/01/17 Ver.2.6a1 DS Aggiunta gestione BlockHouse come in FAST.
-- 2024/02/09 Ver 2.6b1 LM In BeamData aggiunta funzione GetBlockedAxis che sostituisce la GetChainSawBlockedAxis.
-- 2024/02/22 Ver 2.6b2 LM In mlse corretto calcolo pinzaggio quando testa vicina.
-- 2024/02/23 ver 2.6c1 Rimossa chiamata funzione EgtGetSourceDir
-- Prima versione post common
-- Allineamento con common ver. 2.6c3
-- 2024/02/23 ver 2.6c2 Aggiornamento BeamData per visualizzazione in simulazione
-- 2024/02/27 ver 2.6c3 Allineamento con common ver. 2.6c4. Aggiunto parametro 'SafeXRotAxes' per rotazione motosega con pezzi alti
-- Parametro 'SecondSupport' gestito come intero
-- 2024/02/29 ver 2.6c4 Allineamento con common ver. 2.6c4
-- 2024/03/04 ver 2.6c5 Modificato log con nome macchina
-- Allineamento con common ver. 2.6c6
-- 2024/03/12 ver 2.6c6 Allineamento con common ver. 2.6c7
-- Migliorie alla geometria macchina e suo caricamento
-- 2024/03/28 ver 2.6d1 Allineamento con common ver. 2.6c8
-- 2024/03/28 ver 2.6d2 Allineamento con common ver. 2.6d2
-- 2024/04/30 ver 2.6e1 Allineamento con common ver. 2.6e1
-- Aggiunta variabile WoodDensity per gestione WOOD_DENSITY
-- 2024/05/06 ver 2.6e2 Allineamento con common ver. 2.6e2
-- 2024/05/06 ver 2.6e3 Allineamento con common ver. 2.6e3
-- Aggiunte variabili MinJoin(xx) per gestione MIN_JOIN_(xx)
-- 2024/06/03 ver 2.6f1 Aggiunta funzione GetSetupInfo a BeamData per nuovo automatismo
-- 2024/07/03 ver 2.6g1 Allineamento con common ver. 2.6g1
-- 2024/09/02 ver 2.6i1 Allineamento con common ver. 2.6i1, Rimossi file "Common-"
-- 2024/09/02 ver 2.6i2 Corretto file YML per compilare file "Common_"
-------------------------------------
-- NOTE VERSIONI SUCCESSIVE IN GIT --
-------------------------------------
require( 'EmtGenerator')
EgtEnableDebug( false)
PP_VER = '2.6i2'
MIN_MACH_VER = '2.5k1'
MACH_NAME = 'Essetre-FASTrl'
PP_VER = '2.7l2'
PP_NVER = '2.7.12.2'
MIN_MACH_VER = '2.7j1'
MACH_NAME = string.match( EgtGetCurrMachineDir(), "[^\\]+$") -- si ricava il nome della macchina dal direttorio
-- Carico i dati globali
local sMachDir = EgtGetCurrMachineDir()
@@ -81,6 +57,8 @@ SawCOffs = 0
ChSawLen = 90.0
AngTr1Offs = 170
AngTr1Len = 150
AngTrBHOffs = 154.5
AngTrBHLen = 90
TurnerOffs = 200.0
DeltaTabY = -898.0
DeltaTabZ = -1017.8 + MillOffs -- per TPA : -1013.3 + MillOffs -- per NUM : -838.4
@@ -95,9 +73,15 @@ SecondSupport = 0
SpecialBH = false
MaxUnloadLen = 0
BeamHeightForFixRot = 9999 -- per abilitare assegnare 500
CoeffVM = 0.5
NewTopC = true
SafeXRotAxes = -150
AggreBlockHaus = false
SecondToolChanger = false
EstimationRapidMultiplier = 1
-- costanti dimensioni utensili
LONG_TOOL_MINLEN = 221
BIG_TOOL_DIAM = 300
-- leggo e aggiorno con parametri da BeamData
if BD then
@@ -118,14 +102,14 @@ if EgtExistsFile( sData) then
if Machine then
if Machine.Offsets then
NumericalControl = EgtIf( Machine.Offsets.TIPO_CN == 0, 'NUM', 'TPA')
if Machine.Offsets.MIN_X then MaxX = -Machine.Offsets.MIN_X end
if Machine.Offsets.MAX_X then MinX = -Machine.Offsets.MAX_X end
MinZ = Machine.Offsets.MIN_Z or MinZ
MaxZ = Machine.Offsets.MAX_Z or MaxZ
MinB = Machine.Offsets.MIN_B or MinB
MaxB = Machine.Offsets.MAX_B or MaxB
MinC = Machine.Offsets.MIN_C or MinC
MaxC = Machine.Offsets.MAX_C or MaxC
if Machine.Offsets.MAX_X then MinX = - Machine.Offsets.MAX_X end
if Machine.Offsets.MIN_X then MaxX = - Machine.Offsets.MIN_X end
if Machine.Offsets.MIN_Z then MinZ = Machine.Offsets.MIN_Z end
if Machine.Offsets.MAX_Z then MaxZ = Machine.Offsets.MAX_Z end
if Machine.Offsets.MIN_B then MinB = Machine.Offsets.MIN_B end
if Machine.Offsets.MAX_B then MaxB = Machine.Offsets.MAX_B end
if Machine.Offsets.MIN_C then MinC = Machine.Offsets.MIN_C end
if Machine.Offsets.MAX_C then MaxC = Machine.Offsets.MAX_C end
MinY = Machine.Offsets.MIN_Y or Machine.Offsets.MINY or MinY
MaxY = Machine.Offsets.MAX_Y or Machine.Offsets.MAXY or MaxY
ParkY = Machine.Offsets.PARKYY or ParkY
@@ -142,6 +126,8 @@ if EgtExistsFile( sData) then
AngTr1Len = Machine.Offsets.OFFSETX_RINV_1 or AngTr1Len
--if Machine.Offsets.OFFSETZ_RINV_2 then AngTr2Offs = Machine.Offsets.OFFSETZ_RINV_2 - EgtIf( NumericalControl == 'TPA', MillOffs, 0) end
--AngTr2Len = Machine.Offsets.OFFSETX_RINV_2 or AngTr2Len
if Machine.Offsets.OFFSETZ_RINV_BH then AngTrBHOffs = Machine.Offsets.OFFSETZ_RINV_BH - EgtIf( NumericalControl == 'TPA', MillOffs, 0) end
AngTrBHLen = Machine.Offsets.OFFSETX_RINV_BH or AngTrBHLen
TurnerOffs = Machine.Offsets.OFFSETRIB or TurnerOffs
if Machine.Offsets.OFFSETX then DeltaTabY = - Machine.Offsets.OFFSETX end
if Machine.Offsets.OFFSETZ then DeltaTabZ = Machine.Offsets.OFFSETZ + EgtIf( NumericalControl == 'TPA', MillOffs, 0) end
@@ -156,11 +142,23 @@ if EgtExistsFile( sData) then
if Machine.Offsets.MIN_JOIN_LS then MinJoinLS = Machine.Offsets.MIN_JOIN_LS end
if Machine.Offsets.MIN_JOIN_SL then MinJoinSL = Machine.Offsets.MIN_JOIN_SL end
if Machine.Offsets.MIN_JOIN_LL then MinJoinLL = Machine.Offsets.MIN_JOIN_LL 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.NEWTOPC then NewTopC = ( Machine.Offsets.NEWTOPC == 1) end
if Machine.Offsets.AGGRE_BH then AggreBlockHaus = ( Machine.Offsets.AGGRE_BH == 1) end
if Machine.Offsets.SEC_TC then SecondToolChanger = ( Machine.Offsets.SEC_TC == 1) end
if Machine.Offsets.COEFF_STIMATEMPI and Machine.Offsets.COEFF_STIMATEMPI > 0 then EstimationRapidMultiplier = Machine.Offsets.COEFF_STIMATEMPI end
if Machine.Offsets.MAX_HEIGHT_ROT_B_ABOVE then BeamHeightForFixRot = Machine.Offsets.MAX_HEIGHT_ROT_B_ABOVE end
end
end
end
if SpecialBH then SecondSupport = 0 end
-- compongo i gruppi appartenenti alla base
local sBaseAux = {'BASE/SOLID', 'BASE/TC', 'BASE/SIGN', 'BASE/COLLISION'}
if SecondToolChanger then table.insert( sBaseAux, 5, 'BASE/TC2') end
EmtGeneral {
File='Essetre-FASTrl.nge',
Offset = Vector3d( 0, -1150.16, -1500.0),
@@ -174,7 +172,7 @@ EmtGeneral {
local BaseId = EmtBase {
Name = 'Base',
Geo='BASE/GEO',
Aux={'BASE/SOLID', 'BASE/TC', 'BASE/SIGN', 'BASE/COLLISION'}}
Aux = sBaseAux}
local XId = EmtAxis {
Name = 'X',
Parent = 'Base',
@@ -205,7 +203,7 @@ local CId = EmtAxis {
Stroke = {MinC, MaxC},
Home = 0,
Geo = 'C_AXIS/GEO',
Aux = {'C_AXIS/SOLID', 'C_AXIS/COLLISION'}}
Aux = {'C_AXIS/SOLID', 'C_AXIS/COLLISION', 'C_AXIS/COLLISION2'}}
if NewTopC then
local vtMove = Vector3d( 65,0,0)
local SolidArmId = EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( CId, 'SOLID'), 'ARM')
@@ -220,9 +218,13 @@ if NewTopC then
local CollTopId = EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( CId, 'COLLISION'), 'TOP')
EgtMove( CollTopId, vtMove, GDB_RT.GLOB)
EgtSetName( CollTopId, 'BOX')
local RefId = CollTopId + EgtGetInfo( CollTopId, 'Frame', 'i')
EgtSetInfo( RefId, 'CollSkip', 'C_TOP')
else
local CollTopId = EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( CId, 'COLLISION'), 'TOP')
EgtSetName( CollTopId, 'BOX')
local RefId = CollTopId + EgtGetInfo( CollTopId, 'Frame', 'i')
EgtSetInfo( RefId, 'CollSkip', 'C_TOP')
end
EmtAxis {
Name = 'B',
@@ -293,6 +295,48 @@ EgtSetInfo( H3Id, 'ZMAXONROT', '1,5')
if BeamHeightForFixRot < 1000 then
EgtSetInfo( H3Id, 'ROTATZMAX', '1')
end
-- Eventuale rinvio angolare
if SecondSupport >= 3 then
local H5Id = EmtHead {
Name = 'H5',
Parent = 'B',
HSet = 'H1',
Type = MCH_HT.MULTI,
ExitNbr = 2,
Pos1 = Point3d( 0, -AngTr1Len, -AngTr1Offs),
TDir1 = Y_AX(),
Pos2 = Point3d( 0, AngTr1Len, -AngTr1Offs),
TDir2 = -Y_AX(),
ADir = Z_AX(),
Rot1W = 0.2,
Rot2Stroke = { -120, 120},
OthColl = { 'H2', 'B/SOLID', 'C/SOLID'},
Geo = 'H5_HEAD/GEO',
Aux = {'H5_HEAD/SOLID', 'H5_HEAD/COLLISION'}}
EgtSetInfo( H5Id, 'AGB_TYPE', 2)
EgtSetInfo( H5Id, 'AGB_DMAX', 240)
EgtSetInfo( H5Id, 'AGB_ENCH', 44)
EgtSetInfo( H5Id, 'AGB_ENCV', 380)
EgtSetInfo( H5Id, 'AGB_MDIR', -Y_AX())
EgtSetInfo( H5Id, 'ZMAXONROT', '1,15')
end
-- Eventuale aggregato per lavorazioni BlockHaus
if AggreBlockHaus then
local H7Id = EmtHead {
Name = 'H7',
Parent = 'B',
HSet = 'H1',
Type = MCH_HT.STD,
Pos = Point3d( AngTrBHLen, 0, -AngTrBHOffs),
TDir = -X_AX(),
ADir = Z_AX(),
Rot1W = 0.2,
SolCh = MCH_SCC.ADIR_NEAR,
OthColl = {'H2', 'B/SOLID', 'C/SOLID'},
Geo = 'H7_HEAD/GEO',
Aux = {'H7_HEAD/SOLID', 'H7_HEAD/COLLISION'}}
EgtSetInfo( H7Id, 'ZMAXONROT', '1,15')
end
-- Morse
local YId = EmtAxis {
Name = 'Y',
@@ -422,47 +466,155 @@ EmtTcPos {
TDir = X_AX(),
ADir = Y_AX(),
Geo = 'BASE/T10'}
EmtTcPos {
Name = 'T11',
Parent = 'Base',
Pos = Point3d( -523.8, -88.0, -877.5),
TDir = X_AX(),
ADir = Y_AX(),
Geo = 'BASE/T11'}
if not SpecialBH then
if AggreBlockHaus then
EmtTcPos {
Name = 'T101',
Name = 'T11',
Parent = 'Base',
Pos = Point3d( 510.4, -113.2, -160.8),
TDir = -X_AX(),
ADir = Z_AX(),
Geo = 'BASE/T101'}
Pos = Point3d( -678.3, 1.963, -877.5),
TDir = -Y_AX(),
ADir = X_AX(),
Geo = 'BASE/T121',
Aux = 'BASE/T121_HS'}
else
EmtTcPos {
Name = 'T101',
Name = 'T11',
Parent = 'Base',
Pos = Point3d( 510.4, -113.2, -1160.8),
Pos = Point3d( -523.8, -88.0, -877.5),
TDir = X_AX(),
ADir = Y_AX(),
Geo = 'BASE/T11'}
end
-- ToolChanger 2
if SecondToolChanger then
EmtTcPos {
Name = 'T21',
Parent = 'Base',
Pos = Point3d( 503.2, -88.0, 172.5),
TDir = -X_AX(),
ADir = Z_AX(),
Geo = 'BASE/T101S'}
end
if SecondSupport == 1 then
ADir = -Y_AX(),
Geo = 'BASE/T21'}
EmtTcPos {
Name = 'T111',
Name = 'T22',
Parent = 'Base',
Pos = Point3d( 510.4, -113.2, -329.8),
TDir = Z_AX(),
ADir = -X_AX(),
Geo = 'BASE/T111'}
end
if SpecialBH then
Pos = Point3d( 503.2, -88.0, 67.5),
TDir = -X_AX(),
ADir = -Y_AX(),
Geo = 'BASE/T22'}
EmtTcPos {
Name = 'T111',
Name = 'T23',
Parent = 'Base',
Pos = Point3d( 810.4, -113.2, -329.8),
TDir = -Y_AX(),
ADir = -X_AX(),
Geo = 'BASE/T111S'}
Pos = Point3d( 503.2, -88.0, -37.5),
TDir = -X_AX(),
ADir = -Y_AX(),
Geo = 'BASE/T23'}
EmtTcPos {
Name = 'T24',
Parent = 'Base',
Pos = Point3d( 503.2, -88.0, -142.5),
TDir = -X_AX(),
ADir = -Y_AX(),
Geo = 'BASE/T24'}
EmtTcPos {
Name = 'T25',
Parent = 'Base',
Pos = Point3d( 503.2, -88.0, -247.5),
TDir = -X_AX(),
ADir = -Y_AX(),
Geo = 'BASE/T25'}
EmtTcPos {
Name = 'T26',
Parent = 'Base',
Pos = Point3d( 503.2, -88.0, -352.5),
TDir = -X_AX(),
ADir = -Y_AX(),
Geo = 'BASE/T26'}
EmtTcPos {
Name = 'T27',
Parent = 'Base',
Pos = Point3d( 503.2, -88.0, -457.5),
TDir = -X_AX(),
ADir = -Y_AX(),
Geo = 'BASE/T27'}
EmtTcPos {
Name = 'T28',
Parent = 'Base',
Pos = Point3d( 503.2, -88.0, -562.5),
TDir = -X_AX(),
ADir = -Y_AX(),
Geo = 'BASE/T28'}
else
if not SpecialBH then
EmtTcPos {
Name = 'T101',
Parent = 'Base',
Pos = Point3d( 510.4, -113.2, -160.8),
TDir = -X_AX(),
ADir = Z_AX(),
Geo = 'BASE/T101'}
end
if SecondSupport == 1 then
-- supporto per punta
EmtTcPos {
Name = 'T111',
Parent = 'Base',
Pos = Point3d( 510.4, -113.2, -329.8),
TDir = Z_AX(),
ADir = -X_AX(),
Geo = 'BASE/T111'}
elseif SecondSupport == 2 then
-- supporto per mortasatrice
local TcpSsId = EmtTcPos {
Name = 'T111',
Parent = 'Base',
Pos = Point3d( 510.4, -113.2, -430.8),
TDir = X_AX(),
ADir = Z_AX(),
Geo = 'BASE/T111M'}
EgtSetInfo( TcpSsId, 'Mortiser', true)
end
if SpecialBH then
EmtTcPos {
Name = 'T111',
Parent = 'Base',
Pos = Point3d( 810.4, -113.2, -329.8),
TDir = -Y_AX(),
ADir = -X_AX(),
Geo = 'BASE/T111S'}
end
end
-- motosega in caso di magazzino 2 o SpecialBH
if SpecialBH or SecondToolChanger then
local TcpSsId = EmtTcPos {
Name = 'T101',
Parent = 'Base',
Pos = Point3d( 510.4, -113.2, -1160.8),
TDir = -X_AX(),
ADir = Z_AX(),
Geo = 'BASE/T101S'}
-- spostamento in caso di magazzino 2
if SecondToolChanger then
EgtMove( TcpSsId, Vector3d( 0, 0, 140), GDB_RT.GLOB)
end
end
if SecondSupport == 3 then
-- supporto per rinvio angolare
local TcpSsId = EmtTcPos {
Name = 'T91',
Parent = 'Base',
ExitNbr = 2,
Pos1 = Point3d( 710.4+150, -113.2, -329.8-170),
TDir1 = -X_AX(),
Pos2 = Point3d( 710.4-150, -113.2, -329.8-170),
TDir2 = X_AX(),
ADir = Z_AX(),
Geo = 'BASE/T91',
Aux = 'BASE/T91_HS'}
if SecondToolChanger then
EgtMove( TcpSsId, Vector3d( 0, 0, -900), GDB_RT.GLOB)
end
end
-- Aggiusto posizioni geometriche
@@ -494,24 +646,33 @@ PVLightId = EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( PVId, 'SOLID') or GD
---------------------------------------------------------------------
function OnSetHead()
-- se testa lama
if EMC.HEAD == 'H2' then
EmtModifyAxisDirection( 'B', VectorFromRotated( X_AX(), Z_AX(), -SawCOffs))
EmtModifyAxisHome( 'C', 0)
-- se sega a catena
elseif EMC.HEAD == 'H3' then
EmtModifyAxisDirection( 'B', X_AX())
EmtModifyAxisHome( 'C', 180)
local dDist = EgtIf( EMC.DIST and abs( EMC.DIST) > 1, EMC.DIST, ChSawLen)
EmtModifyExitPosition( EMC.HEAD, EMC.EXIT, Point3d( 0, 0, -dDist))
if not EMC.VER or EMC.VER < '2.5h2' then
local vtMove = Point3d( 0, 0, -dDist) - Point3d( EMC.EXITPOS)
local ExitId = EgtGetFirstNameInGroup( EgtGetHeadId( EMC.HEAD), 'T'..tostring( EMC.EXIT))
EgtMove( ExitId, vtMove)
if EMC.HEAD == 'H1' then
if EMC.TOTLEN and EMC.TOTLEN < LONG_TOOL_MINLEN then
EmtModifyAxisStroke( 'B', {MinB, MaxB})
else
EmtModifyAxisStroke( 'B', {-140, 140})
end
-- altrimenti
else
EmtModifyAxisDirection( 'B', X_AX())
EmtModifyAxisHome( 'C', 0)
EmtModifyAxisStroke( 'B', {MinB, MaxB})
if EMC.HEAD == 'H2' then
EmtModifyAxisDirection( 'B', VectorFromRotated( X_AX(), Z_AX(), -SawCOffs))
EmtModifyAxisHome( 'C', 0)
-- se sega a catena
elseif EMC.HEAD == 'H3' then
EmtModifyAxisDirection( 'B', X_AX())
EmtModifyAxisHome( 'C', 180)
local dDist = EgtIf( EMC.DIST and abs( EMC.DIST) > 1, EMC.DIST, ChSawLen)
EmtModifyExitPosition( EMC.HEAD, EMC.EXIT, Point3d( 0, 0, -dDist))
if not EMC.VER or EMC.VER < '2.5h2' then
local vtMove = Point3d( 0, 0, -dDist) - Point3d( EMC.EXITPOS)
local ExitId = EgtGetFirstNameInGroup( EgtGetHeadId( EMC.HEAD), 'T'..tostring( EMC.EXIT))
EgtMove( ExitId, vtMove)
end
-- altrimenti
else
EmtModifyAxisDirection( 'B', X_AX())
EmtModifyAxisHome( 'C', 0)
end
end
end
@@ -553,6 +714,52 @@ function GetPVLight()
return ( EgtGetInfo( PVLightId, 'On') == '1')
end
---------------------------------------------------------------------
---------------------------- Cambio Utensile ------------------------
function GetTCSet( sTcPos)
-- TC 1
if sTcPos == 'T1' or sTcPos == 'T2' or sTcPos == 'T3' or sTcPos == 'T4' or sTcPos == 'T5' or
sTcPos == 'T6' or sTcPos == 'T7' or sTcPos == 'T8' or sTcPos == 'T9' or sTcPos == 'T10' or sTcPos == 'T11' then
return 1
-- TC 2
elseif sTcPos == 'T21' or sTcPos == 'T22' or sTcPos == 'T23' or sTcPos == 'T24' or
sTcPos == 'T25' or sTcPos == 'T26' or sTcPos == 'T27' or sTcPos == 'T28' then
return 2
end
end
---------------------------------------------------------------------
-- Funzione per impostare la posizione del rinvio flottante
function SetFloatPos( sHead, dPos)
-- recupero Id testa
local nHeadId = EgtGetHeadId( sHead)
if not nHeadId then return false end
-- se ci sono entita' flottanti nel ToolHolder
local nRefId = EgtGetFirstNameInGroup( nHeadId, '_T1')
local vtTool = EgtFR( nRefId, GDB_ID.ROOT):getVersZ()
local nObjId = EgtGetFirstGroupInGroup( EgtGetFirstNameInGroup( nHeadId, 'T1'))
local FloatEntities = EgtGetInfoInGroup( nObjId, 'Float')
if FloatEntities and #FloatEntities > 0 then
-- il porta-utensile flottante non puo' comprimersi piu' di 10mm
if dPos > 10 then
local sErr = 'Floating Ring compressed more than 10mm'
EmtSetLastError( 1222, sErr)
EgtOutLog( 'Error : ' .. sErr, 1)
end
local dFloat = EgtGetInfo( FloatEntities[1], 'Float', 'd')
if abs( dPos - dFloat) > 10 * GEO.EPS_SMALL then
local vtMove = ( dPos - dFloat) * vtTool
-- sposto tutte le entita' flottanti
for i = 1, #FloatEntities do
EgtMove( FloatEntities[i], vtMove, GDB_RT.GLOB)
EgtSetInfo( FloatEntities[i], 'Float', dPos)
end
end
return true
end
return false
end
---------------------------------------------------------------------
-- Funzione per resettare tutte le attivazioni della macchina
function OnResetMachine()
@@ -560,6 +767,7 @@ function OnResetMachine()
EmtUnlinkAllFixturesFromGroups()
SetPYLight( false)
SetPVLight( false)
SetFloatPos( 'H1', 0)
-- nascondo Vmill
local nRawId = EgtGetFirstRawPart()
while nRawId do
Binary file not shown.
+28 -20
View File
@@ -7,21 +7,22 @@
[Sawing]
[Milling]
0=d,MaxElev,0
0=l,MaxElev,0
1=d,OutRaw,0
2=d,SideElev,0
2=l,SideElev,0
3=d,TrimExt,0
4=sr,VtFaceUse,0,0,0
4=s,VtFaceUse,0,0,0
5=s,EdgesFaceUse,0
[Pocketing]
0=d,MaxElev,0
0=l,MaxElev,0
1=b,Open,0
2=d,OpenMinSave,0
2=d,OpenMinSafe,0
3=d,OpenOutRaw,0
4=d,MaxOptSize,0
4=l,MaxOptSize,0
[Mortising]
0=d,MaxElev,0
0=l,MaxElev,0
[Chiseling]
@@ -30,21 +31,28 @@
[SawFinishing]
[GenMachining]
0=l,LinTol,0.1
1=l,MaxLen,2
2=s,Type,ZigZag
3=d,SideAng,90
4=l,Step,10
5=l,OffsProj,0
6=l,LiTang,0
7=l,LiOrth,0
8=l,LiElev,0
9=l,LoTang,0
10=l,LoOrth,0
11=l,LoElev,0
12=b,DirFromGuide,1
[SurfRoughing]
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
+31 -6
View File
@@ -1,4 +1,4 @@
-- Gestione attrezzaggio per Essetre-FAST - 2020/04/26
-- Gestione attrezzaggio per Essetre-FAST - 2022/06/16
-- Intestazioni
require( 'EgtBase')
@@ -24,7 +24,7 @@ local INVALIDPOS = ""
local POS = "Pos"
-- Geom Set
local GS = {}
local GS = {{"H1", "H7"}}
-- Configurazione posizioni
local PositionTable={{Pos = "Pos1", TcPos = "T1", Head = "H1", Group = "G1"},
@@ -39,13 +39,38 @@ local PositionTable={{Pos = "Pos1", TcPos = "T1", Head = "H1", Group = "G1"},
{Pos = "Pos10", TcPos = "T10", Head = "H1", Group = "G1"},
{Pos = "Pos11", TcPos = "T11", Head = "H1", Group = "G1"},
{Pos = "Pos12", TcPos = "T42", Head = "H2", Group = "G1"},
{Pos = "Pos13", TcPos = "T101", Head = "H3", Group = "G1"}}
{Pos = "Pos13", TcPos = "T101", Head = "H3", Group = "G2"}}
if EgtGetTcPosId( 'T111') then
table.insert( PositionTable, {Pos = "Pos14", TcPos = "T111", Head = "H1", Group = "G1"})
local IsTC2Active = ( EgtGetFirstNameInGroup( EgtGetBaseId( 'Base'), 'TC2') ~= nil)
if IsTC2Active then
local PositionTableTC2={{Pos = "Pos14", TcPos = "T21", Head = "H1", Group = "G3"},
{Pos = "Pos15", TcPos = "T22", Head = "H1", Group = "G3"},
{Pos = "Pos16", TcPos = "T23", Head = "H1", Group = "G3"},
{Pos = "Pos17", TcPos = "T24", Head = "H1", Group = "G3"},
{Pos = "Pos18", TcPos = "T25", Head = "H1", Group = "G3"},
{Pos = "Pos19", TcPos = "T26", Head = "H1", Group = "G3"},
{Pos = "Pos20", TcPos = "T27", Head = "H1", Group = "G3"},
{Pos = "Pos21", TcPos = "T28", Head = "H1", Group = "G3"}}
if EgtGetHeadId( 'H5') then
table.insert( PositionTableTC2, {Pos = "Pos22", TcPos = "T91", Head = "H5", Group = "G2"})
end
EgtJoinTables( PositionTable, PositionTableTC2)
else
local SecSuppId = EgtGetTcPosId( 'T111')
if SecSuppId then
local bMortiser = EgtGetInfo( SecSuppId, 'Mortiser', 'b')
if bMortiser then
table.insert( PositionTable, {Pos = "Pos14", TcPos = "T111", Head = "H3", Group = "G2"})
else
table.insert( PositionTable, {Pos = "Pos14", TcPos = "T111", Head = "H1", Group = "G2"})
end
end
if EgtGetHeadId( 'H5') then
table.insert( PositionTable, {Pos = "Pos14", TcPos = "T91", Head = "H5", Group = "G2"})
end
end
local UsePositionHead = true
local UsePositionHead = false
local function IsInGeomSet( ToolHead, PosHead)
for GsIndex = 1, #GS do
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+18 -16
View File
@@ -6,36 +6,38 @@
[DRILL_STD]
0=th,TH,
1=d,STEP
2=s,DOUBLE
1=l,STEP
2=tl,DOUBLE
[SAW_STD]
0=th,TH,
1=d,STEP
2=d,SIDESTEP
1=l,STEP
2=l,SIDESTEP
3=b,LONGCUT
[SAW_FLAT]
0=th,TH,
1=d,STEP
2=d,SIDESTEP
1=l,STEP
2=l,SIDESTEP
3=b,LONGCUT
[MILL_STD]
0=th,TH,
1=d,STEP
2=d,SIDESTEP
3=d,SIDEDEPTH
4=s,DOUBLE
1=l,STEP
2=l,SIDESTEP
3=l,SIDEDEPTH
4=tl,DOUBLE
5=lr,TOOL_OVERHANG
[MILL_NOTIP]
0=th,TH,
1=d,STEP
2=d,SIDESTEP
3=d,SIDEDEPTH
4=s,DOUBLE
1=l,STEP
2=l,SIDESTEP
3=l,SIDEDEPTH
4=tl,DOUBLE
5=lr,TOOL_OVERHANG
[MORTISE_STD]
0=b,MORTISE
1=d,STEP
2=d,SIDESTEP
1=l,STEP
2=l,SIDESTEP
+130
View File
@@ -1,5 +1,135 @@
==== Common_FAST Update Log ====
Versione 2.7l1 (10/12/2025)
- (SIM) Aggiornata risoluzione VMillTol in funzione dello spessore lama
- (EST) Modifiche a calcolo stima tempi, da verificare.
- (SIM) Corretto movimento in simulazione che non rispettava movimento generato.
- (GEN) Con controllo NUM/NUM_PLUS nella scrittura della coordinata tolto il simbolo '='
- (SIM) Aggiunto controllo C in base a carico Dx o Sx durante il cambio utensile
Versione 2.7k1 (10/11/2025)
- (GEN) Corretto set variabili info utensile prima del movimento in home in caso di pezzi alti per NUM/NUM_PLUS.
Versione 2.7j2 (08/10/2025)
- (SIM-GEN) Quando si scarica motosega, si raddrizza prima l'asse B e poi si muove il C. Ora sempre e non solo se pezzo alto.
Versione 2.7j1 (06/10/2025)
- (SIM-GEN) Quando si scarica motosega, si raddrizza prima l'asse B e poi si muove il C.
- (MLDE-SIM) Controllo collisione tra utensile e TOP testa C. Serve CAM5 2.7j1
Versione 2.7i3 (23/09/2025)
- (MLDE-ALL) Spostate costanti dimensioni utensili in MLDE.
Versione 2.7i2 (17/09/2025)
- (EST) Stima tempi considerando accelerazioni
- (SIM) Prelievo e deposito motosega con gli angoli comunicati da Essetre
Versione 2.7i1 (08/09/2025)
- (SIM-GEN) Se lavorazione precedente e successiva con motosega e si cambiano assi rotanti, vado in parcheggio per ruotare. Ticket#1844
- (SIM-GEN) Per NEWCLAMPING, corretto un caso di riposizionemento allo scarico dove la pinza V poteva andare in posizione direttamente, ma cercava di fare passo pellegrino. Ticket#2572
Versione 2.7g1 (01/07/2025)
- (GEN) Aggiunti parametri FMAXPINZE, MAXACC, MINACC configurabili da TS3. Ticket#2052
Versione 2.7f3 (26/06/2025)
- (SIM-GEN) Aggiunti 10mm di sicurezza in caso di primo pinzaggio per stare oltre tolleranza riqualifica laser di 50mm. Ticket#2504
Versione 2.7f2 (19/06/2025)
- (GEN) Se in separazione il pezzo è andato più lontano della posizione standard, viene riletta. Ticket#2498
Versione 2.7f1 (18/06/2025)
- (SIM-GEN) Se utensile più lungo di 350mm, si va in posizione sicurezza come per la motosega. Ticket#2438
Versione 2.7e1 (26/05/2025)
- (SIM) Aumentata dimensione massima per la quale si rimuove uno scarto dal VMILL. Ticket#1438
- (SIM) In simulazione, corretto selezione utensile per punte lunghe. Ticket#2438
Versione 2.7d1 (14/04/2025)
- (GEN) Corretto movimento iniziale in caso di motosega, si controlla solo se non è il carico. Ticket#2385
Versione 2.7c1 (26/03/2025)
- (GEN) All'inizio del codice ISO si scrive nel commento anche il controllo numerico utilizzato per la generazione.
- (GEN) Aggiunta commenti HEADER e FOOTER per comunicazione con linea o altre macchine, da parte di Essetre.
- (GEN) In MyAdjustLinearAxes si utilizza TDIR per calcolarsi gli offset per compatibilità con lavorazioni a 5 assi.
Versione 2.7b1 (20/02/2025)
- (SIM-GEN) Aggiunta possibilità di settare HCING/TCING nelle note di ogni singola lavorazione per gestire parte non pinzabile del pezzo. Funziona solo con nuovo pinzaggio.
- (SIM-GEN) Piccola correzione calcolo posizione carrelli con nuova strategia di pinzaggio.
- (SIM-GEN) Caricamento libreria EmtGenMachining. Si fa una require con PCALL perchè la libreria è opzionale e non è detto che ci sia. In installazione CAM5 dalla 2.7a1
- (GEN) Per controllo TPA, modifica al numero di decimali.
- (SIM) Aggiunta gestione per ToolHolder flottante
Versione 2.7a3 (08/01/2025)
- (GEN) Dopo separazione, in NUM_PLUS, si srive EH1 solo se macro G101, perchè altrimenti non è prevista. Ticket#2239
Versione 2.7a2 (08/01/2025)
- (MLDE-SIM) Aggiunta gestione FACOLTATIVA 'EstimationRapidMultiplier' in MLDE per regolare il tempo stimato. Se non presente in MLDE, default 1.
- (SIM) Aggiunta gestione qualità VMILL da impostazioni macchina
Versione 2.7a1 (07/01/2025)
- (MLDE-SIM-GEN) Nuovo aggregato 90° (H7) per fresa tipo BlockHaus. Ticket#2142
- (SIM-GEN) Aumentati limiti massimi di pinzaggio minimo
Versione 2.6l1 (02/12/2024)
- (SIM) Corretto movimento VMILL durante scarico pezzo piccolo a caduta
- (SIM-GEN) Per decidere posizione parcheggio barra dopo separazione, si considera lunghezza coda del pezzo in lavoro per evitare collisioni. Ticket#2168
Versione 2.6k1 (11/11/2024)
- (GEN) Aggiunta gestione aggregato a T per NUM
- (SIM) Tolta gestione testa dummy H4
- (SIM-GEN) Aggiustato parametro in calcolo ingombro lavorazione. Ticket#2163
Versione 2.6j10 (25/10/2024)
- (SIM-GEN) Miglioria 2.6j9. Si ribadisce pinza in presa sempre, all'inizio, in base a quella attiva
Versione 2.6j9 (22/10/2024)
- (SIM-GEN) Miglioria 2.6j6. Oltre al passo pellegrino si ribadisce anche quando è scambio diretto
Versione 2.6j8 (21/10/2024)
- (SIM-GEN) Corretto problema tolleranza aggiunto con versione 2.6j7
Versione 2.6j7 (18/10/2024)
- (SIM-GEN) In nuova disposizione carrelli, aggiunta tolleranza di 100 EPS quando si calcola minimo posizionamento
Versione 2.6j6 (17/10/2024)
- (GEN) Si ribadisce che la pinza era in presa, prima di cominciare con lo scambio del passo del pellegrino. Ticket#2121
Versione 2.6j5 (17/10/2024)
- (SIM-GEN) Piccola correzione nuovo riposizionamento. Nel taglio dello scarto finale riposizionava nel vuoto. Ticket#2115
Versione 2.6j4 (15/10/2024)
- (SIM-GEN) Piccola correzione nuovo riposizionamento. Non considerava i 50mm di tolleranza su primo pinzaggio dopo ribaltamento
- (SIM-GEN) Gestione attivazione pressore verticale in nuovo riposizionamento
Versione 2.6j3 (11/10/2024)
- (GEN) Corretta scrittura macro start/attesa movimenti per NUM. Veniva scritto codice per TPA.
Versione 2.6j2 (03/10/2024)
- (SIM-GEN) Piccola correzione calcolo posizione carrello durante riposizionamento, nuova gestione
Versione 2.6j1 (01/10/2024)
- (SIM-GEN) Sistemato calcolo in nuova disposzione carrelli
Versione 2.6i6 (25/09/2024)
- (GEN) Migliorata gestione movimenti per portare testa vicino a cambio utensile se trave alta. Ticket#2066
Versione 2.6i5 (24/09/2024)
- (SIM-GEN) Tolto controllo su lunghezza maggiore di 200mm introdotto con 2.6i2 perchè non completamente funzionante
- (GEN) Gestione in OnRapid() di EMT.FLAG=5 (rotazione a Z max per lavorazione successiva). Ora allineata alla simulazione
Versione 2.6i4 (24/09/2024)
- (SIM-GEN) Aggiunto ripinzaggio extra in caso servisse un grande spostamento e si sta pinzando poco.
L'aggiunta del ripinzaggio dipende da FASTCLAMPING (che deve essere disattiva). Viene aggiunta GAIN_RECLAMPING per decidere il guadagno in mm del ripinzaggio.
Versione 2.6i3 (23/09/2024)
- (SIM-GEN) Aggiunta nuova strategia riposizionamento morse
- (SIM-GEN) Aggiunta lettura flag NEWCLAMPING in BeamData, per abilitare nuova strategia riposizionamento. Se false o nil, funziona con metodo vecchio.
- (SIM-GEN) Aggiunta lettura flag FASTCLAMPING. Se false, al carico prende al massimo 1000mm, per evitare collisioni durante ciclo di lettura laser e prima lavorazione.
Versione 2.6i2 (16/09/2024)
- (SIM-GEN) Se utensili più lunghi di 200mm, si ruota in home e poi si approccia il pezzo. Ticket#2038
- (SIM-GEN) Aumentata distanza ingombro da 650mm a 660mm. In casi di utensile abbastanza lungo poteva andare in colisione. Ticket#2041
Versione 2.6i1 (02/09/2024)
- (MLDE-SIM-GEN) Rinominato file da "Common-" a "Common_" per uniformità con i file common delle altre macchine. Serve modifica a MLDE macchina.
+1 -1
View File
@@ -3,7 +3,7 @@
local InfoCommon_STD_PP = {
NAME = 'Common_FAST', -- nome script PP standard
VERSION = '2.6i1', -- versione script
VERSION = '2.7l1', -- versione script
MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel
}