Compare commits

...

49 Commits

Author SHA1 Message Date
andrea.villa 2a44fc8635 - Allineamento con common ver. 2.6e3
- Aggiunte variabili MinJoin(xx) per gestione MIN_JOIN_(xx)
2024-05-06 16:43:11 +02:00
andrea.villa 5e7c3d7681 - Allineamento con common ver. 2.6e2 2024-05-06 14:55:14 +02:00
andrea.villa 3f4feabbd9 - Allineamento con common ver. 2.6e1
- Aggiunta variabile WoodDensity per gestione WOOD_DENSITY
2024-04-30 16:57:22 +02:00
andrea.villa 90d7c59e97 - Allineamento con common ver. 2.6d2 2024-04-18 10:51:03 +02:00
luca.mazzoleni 2b3d65fd56 Merge branch 'develop' 2024-04-16 16:57:09 +02:00
luca.mazzoleni 0ea9ef4266 Merge branch 'master' 2024-04-16 16:31:09 +02:00
luca.mazzoleni 2510bf8379 Merge branch 'develop' 2024-04-16 16:22:59 +02:00
luca.mazzoleni 6c6e883a4c update yaml 2024-04-16 16:22:24 +02:00
luca.mazzoleni 2be44e3499 update yaml 2024-04-16 16:16:28 +02:00
luca.mazzoleni db4f901e2b update yaml 2024-04-16 16:11:31 +02:00
luca.mazzoleni 99300bbb53 update yaml 2024-04-16 16:09:49 +02:00
luca.mazzoleni a9134f502d in yaml modifica compilazione per dev 2024-04-16 16:08:37 +02:00
luca.mazzoleni d226d1a5c1 in yaml aggiunta compilazione in R anche per develop 2024-04-16 16:01:46 +02:00
luca.mazzoleni 5ea1bd718d Merge branch 'develop' 2024-04-16 15:05:14 +02:00
luca.mazzoleni 5146f304b6 yaml lanciato solo per master 2024-04-16 15:05:01 +02:00
luca.mazzoleni 313a621eab update yaml 2024-04-16 13:15:17 +02:00
luca.mazzoleni 34d1b6ea9c update yaml 2024-04-16 13:07:13 +02:00
luca.mazzoleni 5c55da537e update yaml 2024-04-16 12:16:29 +02:00
luca.mazzoleni 123c1d57fa Merge branch 'develop' 2024-04-16 11:53:29 +02:00
luca.mazzoleni 6f52a41cb0 modifica yaml e test 2024-04-16 11:34:59 +02:00
luca.mazzoleni cb1f97ba3b modifica yaml e test 2024-04-16 11:25:16 +02:00
luca.mazzoleni b660adc8e8 modifica yaml e test 2024-04-16 11:01:04 +02:00
luca.mazzoleni f0b2ce3720 yaml:
- copia sorgenti e zip compilati in percorso di prova in S, ordinati per versione
- copia sorgenti in R, in percorso di prova, ultima versione macchina e macchina di test
2024-04-16 10:56:55 +02:00
andrea.villa 975bc40d2b Merge remote-tracking branch 'origin/develop' 2024-04-15 15:53:28 +02:00
andrea.villa 01105a8c6a Allineamento con common ver. 2.6d1 2024-04-15 15:53:15 +02:00
andrea.villa 3c1a1e5407 In MyAdjustLinearAxes corretta compensazione aggregato in X-Y 2024-04-15 12:21:34 +02:00
andrea.villa e5ae54cc98 - Corretto calcolo piano con aggregato da sotto
- lista iniziale con N2xx
2024-04-15 11:28:48 +02:00
andrea.villa 09e2dd991d Per NUM_PLUS, in G114 per aggregato 2 uscite si scrive solo la sua lunghezza, senza pivot (come per TPA) 2024-04-15 09:26:39 +02:00
andrea.villa 66c94aece6 Da testare: aggiunta gestione aggregato doppia uscita per controllo NUM_PLUS. 2024-04-15 09:01:46 +02:00
andrea.villa 9f2e302d32 Merge remote-tracking branch 'origin/master' into develop 2024-04-15 08:59:56 +02:00
luca.mazzoleni a1f053e1d8 - aggiunto YAML con compilazione in S 2024-04-12 16:04:10 +02:00
andrea.villa 48105a3f4f Allineamento con common ver. 2.6c8 2024-03-28 16:53:00 +01:00
Dario Sassi 45ab9ee317 Essetre-FAST 2.6c9 :
- modificato disegno e mlde per reale posizione supporto di rinvio H5
- modifica a mlse per dare possibilità di lavorare da X- tra le pinze, con abilitazione da flag (User.ENABLE_TOOL_BETWEEN_VICES == 1).
2024-03-28 15:33:44 +01:00
andrea.villa 011de630f7 Allineamento con common ver. 2.6c7 2024-03-12 13:17:16 +01:00
Dario Sassi 326de943b7 Essetre-FAST 2.6c7 :
- migliorie alla geometria macchina e suo caricamento.
2024-03-09 12:51:04 +01:00
luca.mazzoleni b52feb5fd2 Merge branch 'develop' 2024-03-08 18:11:59 +01:00
luca.mazzoleni 81ae21d006 Merge branch 'master' into develop 2024-03-08 18:11:04 +01:00
luca.mazzoleni 7948ed102e - aggiunti utensili custom 2024-03-08 18:10:31 +01:00
andrea.villa 60f987b23f - Modificato log con nome macchina
- Allineamento con common ver. 2.6c6
2024-03-04 10:49:43 +01:00
luca.mazzoleni e647919eaa - in compilazione rimossi i simboli di debug 2024-02-29 18:22:38 +01:00
andrea.villa 0bc8997ae2 Merge remote-tracking branch 'origin/develop' 2024-02-29 08:26:55 +01:00
andrea.villa 408fb467d1 Gestione rimozione VMILL per tagli a cubetti a zig-zag 2024-02-29 08:26:39 +01:00
andrea.villa 7ce5c020fc Piccola correzione calcolo accelerazione pinze 2024-02-28 14:33:59 +01:00
andrea.villa 23a5b99a90 Gestione accelerazioni pinze in M115 ( solo per TPA) 2024-02-28 12:54:05 +01:00
andrea.villa 9acba47f91 Allineamento con common ver. 2.6c5 2024-02-28 12:07:32 +01:00
andrea.villa 3c327abd4d Merge branch 'master' into develop 2024-02-27 15:07:34 +01:00
andrea.villa 4709c55227 Allineamento con common ver. 2.6c4. Aggiunto parametro 'SafeXRotAxes' per rotazione motosega con pezzi alti 2024-02-27 15:06:44 +01:00
luca.mazzoleni b01a097fb2 Merge branch 'master' into develop 2024-02-27 12:12:15 +01:00
andrea.villa 672cc5ff90 Allineamento con common ver. 2.6c3 2024-02-23 11:58:21 +01:00
18 changed files with 686 additions and 166 deletions
+236
View File
@@ -0,0 +1,236 @@
variables:
VERS_MAIN: '1.0'
MACH_NAME: ''
MACH_NAME_TEST: ''
NEW_REL: ''
NET_SHARE_X: '\\10.74.82.201\EgwTech'
NET_SHARE_Z: '\\10.74.82.201\Artifacts'
NET_SHARE_S: '\\10.74.82.201\Scambio'
NET_SHARE_R: '\\10.74.82.201\EgwTech'
NET_USERQ: 'steamw\egalware'
MACH_VERS: '0.0.0.0'
TEMP_PATH: 'C:\MachinesDeploy'
MACHINES_PATH_R: 'R:\EgtData\Machines'
DEST_MACHINES_PATH_R: 'R:\EgtData\Machines\zTestYAML'
SRC_PATH: ''
BASE_PATH: ''
TEST_PATH: ''
#Note compilazione LUA:
# lua54 -o bin\$FileName -s $FileName: -o = output, -s = NON include i debug symbols
# helper copia script verso cartella di rete S:\ delle cartelle bin
.ReplicaS: &ReplicaS
- |
net use S: /delete
SLEEP 2
net use S: $env:NET_SHARE_S /u:$env:NET_USERQ $SDRIVE_PASSWD
ROBOCOPY /MIR $env:BASE_PATH S:\LucaM\MachinesDeploy\$env:MACH_NAME\$env:MACH_VERS\ /XD "bin" /XD "$env:MACH_NAME_TEST"
SLEEP 2
net use S: /delete
# helper copia script verso cartella di rete R:\
.ReplicaR: &ReplicaR
- |
net use R: /delete
SLEEP 2
net use R: $env:NET_SHARE_R /u:$env:NET_USERQ $ZDRIVE_PASSWD
echo "-----------------------"
echo " Copia macchina su R"
echo "-----------------------"
ROBOCOPY /MIR "$env:SRC_PATH" "$env:DEST_MACHINES_PATH_R\$env:MACH_NAME\" /XD "bin"
ROBOCOPY "$env:TEST_PATH" "$env:DEST_MACHINES_PATH_R\$env:MACH_NAME_TEST\" /E /XD "bin"
ROBOCOPY /MIR "$env:BASE_PATH" "$env:DEST_MACHINES_PATH_R\Deploy\$env:MACH_NAME\$env:MACH_VERS\" /XD "bin" /XD "$env:MACH_NAME_TEST"
SLEEP 2
net use R: /delete
# helper copia script verso cartella di rete R:\ per develop
.ReplicaR_DEV: &ReplicaR_DEV
- |
net use R: /delete
SLEEP 2
net use R: $env:NET_SHARE_R /u:$env:NET_USERQ $ZDRIVE_PASSWD
echo "-----------------------"
echo " Copia macchina su R - DEV"
echo "-----------------------"
ROBOCOPY /MIR "$env:BASE_PATH" "$env:DEST_MACHINES_PATH_R\Deploy\$env:MACH_NAME\_DEV\$env:MACH_VERS\" /XD "bin" /XD "$env:MACH_NAME_TEST"
SLEEP 2
net use R: /delete
#helper copia sorgenti da R a percorso temporaneo
.CreateBaseFolder: &CreateBaseFolder
- |
net use R: /delete
SLEEP 2
net use R: $env:NET_SHARE_R /u:$env:NET_USERQ $ZDRIVE_PASSWD
echo "-----------------------"
echo " Recupero file non git da R e copia su macchina virtuale"
echo "-----------------------"
ROBOCOPY "$env:LAST_MACHINE_PATH" "$env:SRC_PATH" /E /XF "*.bat" /XF "*.yml" /XF ".gitignore" /XD ".git" /XF "UpdateLog.txt" /XD ".vscode"
ROBOCOPY "$env:LAST_MACHINE_PATH" "$env:SRC_PATH\bin\$env:MACH_NAME\" /E /XF "*.bat" /XF "*.yml" /XF ".gitignore" /XD ".git" /XF "UpdateLog.txt" /XD ".vscode"
SLEEP 2
net use R: /delete
# helper compilazione LUA a 32 e 64 bit
.LuaCompile: &LuaCompile
- |
Set-Alias lua54 C:\Tools\Lua32\luac54
echo "-----------------------"
echo " Copia file su macchina virtuale"
echo "-----------------------"
ROBOCOPY . "$env:SRC_PATH" /E /XF "*.bat" /XF "*.yml" /XF ".gitignore" /XD ".git" /XF "UpdateLog.txt" /XD ".vscode"
ROBOCOPY . "$env:TEST_PATH" /E /XF "*.bat" /XF "*.yml" /XF ".gitignore" /XD ".git" /XF "UpdateLog.txt" /XD ".vscode"
Rename-Item -Path "$env:TEST_PATH\$env:MACH_NAME.mlde" -NewName "$env:MACH_NAME_TEST.mlde"
Rename-Item -Path "$env:TEST_PATH\$env:MACH_NAME.ini" -NewName "$env:MACH_NAME_TEST.ini"
ROBOCOPY . "$env:SRC_PATH\bin\$env:MACH_NAME\" /E /XF "*.bat" /XF "*.yml" /XF ".gitignore" /XD ".git" /XF "UpdateLog.txt" /XD ".vscode"
echo "-----------------------"
echo " Compilazione file *.lua 32/64bit"
echo "-----------------------"
$FileList = Get-ChildItem("Common-*")
ForEach ($File in $FileList) {
$FileName = Split-Path $File -leaf
lua54 -o $env:SRC_PATH\bin\$env:MACH_NAME\$FileName -s $FileName
echo "lua54 -o bin\$FileName -s $FileName"
}
# helper recupero nome macchina
.machName-fix: &machName-fix
- |
echo "-----------------------"
echo " Recupero nome macchina"
echo "-----------------------"
$fileName = dir *.mlde
$env:MACH_NAME = $fileName.BaseName
$env:MACH_NAME_TEST = $env:MACH_NAME + ".TEST"
# helper calcolo versione
.version-fix: &version-fix
- |
echo "-----------------------"
echo " Calcolo versione"
echo "-----------------------"
$fPath = "$env:MACH_NAME.mlde";
$vLine = Select-String -path $fPath -Pattern 'PP_VER';
$comp = $vLine -split "=";
$env:MACH_VERS = $comp[1].Replace("'","").Trim()
# display versione
Write-Output $env:MACH_VERS;
# helper calcolo versione se develop
.version-fix_DEV: &version-fix_DEV
- |
echo "-----------------------"
echo " Calcolo versione - DEV"
echo "-----------------------"
$commitAuthor = $CI_COMMIT_AUTHOR -split " "
$commitAuthor = $commitAuthor[0].Trim()
$env:MACH_VERS = $commitAuthor
# display versione
Write-Output $env:MACH_VERS;
# helper creazione folders
.folder-fix: &folder-fix
- |
echo "-----------------------"
echo " Creazione cartelle su macchina virtuale"
echo "-----------------------"
$env:LAST_MACHINE_PATH = "$env:MACHINES_PATH_R\$env:MACH_NAME";
Write-Output $env:LAST_MACHINE_PATH;
$env:SRC_PATH = "$env:TEMP_PATH\$env:MACH_NAME\$env:MACH_VERS\$env:MACH_NAME";
$env:BASE_PATH = "$env:TEMP_PATH\$env:MACH_NAME\$env:MACH_VERS";
$env:TEST_PATH = "$env:TEMP_PATH\$env:MACH_NAME\$env:MACH_VERS\$env:MACH_NAME_TEST";
Write-Output $env:BASE_PATH;
if (Test-Path $env:BASE_PATH) { Remove-Item -Path "$env:BASE_PATH\*" -R -Force };
Write-Output $env:TEST_PATH;
# helper compressione e pulizia folders
.ZipClean: &ZipClean
- |
" Compressione file su macchina virtuale"
$7zipPath = $env:ProgramFiles+"\7-Zip\7z.exe";
if (-not (Test-Path -Path $7zipPath -PathType Leaf)) {
throw "7 zip file '$7zipPath' not found"
}
Set-Alias 7zip $7zipPath
$Target = "$env:BASE_PATH\$env:MACH_NAME.zip"
cd "$env:SRC_PATH\bin\"
$Source = "*"
7zip a -tzip $Target $Source
Write-Output "called ZIP $Source --> $Target"
# helper esecuzione test
.RunTest: &RunTest
- |
Write-Output "Test done!"
stages:
- build
# - test
# - deploy
LuaCompile:build:
stage: build
only:
- main
- master
tags:
- win
before_script:
- *machName-fix
- *version-fix
- *folder-fix
script:
- *CreateBaseFolder
- *LuaCompile
- *ZipClean
- *ReplicaR
LuaCompileDev:build:
stage: build
only:
- develop
tags:
- win
before_script:
- *machName-fix
- *version-fix_DEV
- *folder-fix
script:
- *CreateBaseFolder
- *LuaCompile
- *ZipClean
- *ReplicaR_DEV
# LuaCompile:test:
# stage: test
# needs: ["LuaCompile:build"]
# only:
# - main
# - master
# - develop
# tags:
# - win
# before_script:
# - *version-fix
# - *folder-fix
# script:
# - *LuaCompile
# - *RunTest
# LuaCompile:deploy:
# stage: deploy
# needs: ["LuaCompile:test"]
# only:
# - main
# - master
# tags:
# - win
# before_script:
# - *version-fix
# - *folder-fix
# script:
# - *LuaCompile
# - *ZipClean
# - *ReplicaR
+5 -2
View File
@@ -1,4 +1,4 @@
-- BeamData.lua by Egaltech s.r.l. 2022/03/20
-- BeamData.lua by Egaltech s.r.l. 2024/03/28
-- Raccolta dati generali per Travi
EgtOutLog( ' FAST-BeamData started', 1)
@@ -43,7 +43,7 @@ local BeamData = {
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 (std=600)
LONGCUT_MAXLEN = 1200, -- lunghezza massima sezione di taglio longitudinale (std=1200)
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
DIM_TO_CENTER_STRIP = 0, -- larghezza minima trave per inseriemento codolo nel centro del trave; 0 = automatico
@@ -52,6 +52,8 @@ local BeamData = {
RAWCOL = { 255, 160, 32, 30}, -- colore del grezzo
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
@@ -111,6 +113,7 @@ 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
+1
View File
@@ -50,3 +50,4 @@ Name=User
3=d,OPTIMIZATIONS_LENGTH_SLICES,100,SLICES_LENGTH
4=l,L020_DIAM_HOLE,20,L020_HOLE_DIAM
5=l,L040_OFFSET_P1,0,L040_ON_TENON_OFFSET
6=d,ENABLE_TOOL_BETWEEN_VICES,0,ENABLE_TOOL_BETWEEN_VICES
+1
View File
@@ -8,6 +8,7 @@
3=Pocket
4=Pocket_AT
5=AngleDrill
6=Predrill
[Milling]
1=Prof
+52 -12
View File
@@ -6,7 +6,7 @@ local INFO_STD_PP = require( 'Version')
-- Variabili di modulo
local CSP_INFO = INFO_STD_PP.NAME..' ver.'..INFO_STD_PP.VERSION..' by EgalWare s.r.l.'
local MACHINE_INFO = 'PP_VER ver.'..PP_VER
local MACHINE_INFO = MACH_NAME..' ver.'..PP_VER
local TEST_USE = false
---------------------------------------------------------------------
@@ -41,13 +41,17 @@ function OnProgramStart()
local BtlInfoId = EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo') or EgtGetCurrMachGroup() or GDB_ID.NULL
local nPatt = EgtGetInfo( BtlInfoId, 'PATTID', 'i') or 40
EmtOutput( '%'..EgtNumToString( nPatt, 0)..'.0')
-- aggiungo prefisso per commentae commenti iniziali se la macchina è utilizzata per fare i test
local sPrefixCommentLine = '' ; if IS_TEST_MACHINE or EgtEndsWith( EgtGetCurrMachineDir(), '.TEST') then sPrefixCommentLine = '//' end
if EMT.INFO then
EmtOutput( '('..EMT.INFO..')')
EmtOutput( sPrefixCommentLine..'('..EMT.INFO..')')
else
EmtOutput( '(Program Start)')
end
EmtOutput( '('.. CSP_INFO..')')
EmtOutput( '('.. MACHINE_INFO..')\n')
EmtOutput( sPrefixCommentLine..'('.. CSP_INFO..')')
EmtOutput( sPrefixCommentLine..'('.. MACHINE_INFO..')\n')
-- Se modalità test, aggiungo linee per muovere tappeto e alzare la testa (in automatico viene fatto dal main residente)
if TEST_USE then
EmtOutput( 'M28')
@@ -178,7 +182,7 @@ function OnDispositionEnd()
-- calcolo dati pinze
local MinAccPinze = 0.3
local MaxAccPinze = 4
local KgMtCubo= 550 -- densità legno in Kg / metro cubo
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)
@@ -490,6 +494,7 @@ function OnMachiningEnd()
EMT.AUXTYPE = nil
EMT.U_STD = nil
EMT.PREVTOOL = EMT.TOOL
EMT.PREVHEAD = EMT.HEAD
end
---------------------------------------------------------------------
@@ -499,6 +504,11 @@ function OnPathStart()
-- primo posizionamento sempre in globale
EMT.REFLOC = nil
EMT.IPLGL = false
-- salvo precedenti rotanti
EMT.R1pp = EMT.R1p
EMT.R2pp = EMT.R2p
-- reset valori precedenti (per forzare emissione di tutti gli assi del 1° movimento)
EmtResetPrev()
EMT.AUXCMD = {}
@@ -609,25 +619,55 @@ function OnRapid()
if not EMT.ZMAX and #EMT.AUXSTR > 0 then
EmitZmax()
EMT.ZMAX = true
bHeadFirst = false
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
if not EMT.LOAD then
local sOut = string.gsub( string.gsub( EMT.MCHNAME..'/'..EMT.TOOL, '%(', '-'), '%)', '-')
EmtOutput( '( *** ' .. sOut .. ' *** )')
end
-- primo posizionamento
EmtResetPrev()
local bZmax = ( #EMT.AUXSTR > 0 or EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1)
-- 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)
local sOut = 'G101' .. EmtGetAxis( 'L2') .. EmtGetAxis( 'L3') ..
EmtGetAxis( 'R2') .. EmtGetAxis( 'R1') .. sEE .. sEL .. sER .. sET .. sES
if EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
sOut = sOut .. ' EH1'
-- 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')
local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
EmtGetAxis( 'R2') .. EmtGetAxis( 'R1') .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOutPreMove)
EmtOutput( 'G101 ET1001')
EmtOutput( 'G101 ET2001')
end
EmtResetPrev()
-- se sono su pezzi alti e movimento da emettere, per sicurezza a Z massima
local MyZPos = EMT.L3
if EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
MyZPos = MyZHome
end
local sOut = 'G101' .. EmtGetAxis( 'L2') .. ' Z' .. EmtLenToString( MyZPos, 3) ..
EmtGetAxis( 'R2') .. EmtGetAxis( 'R1') .. sEE .. sEL .. sER .. sET .. sES
-- faccio backup dati in caso mi servano per lavorazione successiva
EMT.PREVsEE = sEE ; EMT.PREVsEL = sEL ; EMT.PREVsER = sER ; EMT.PREVsET = sET ; EMT.PREVsES = sES
if EMT.LOAD or bHeadFirst then
sOut = sOut..' L0=0'
EmtOutput( sOut)
+107 -19
View File
@@ -6,7 +6,7 @@ local INFO_STD_PP = require( 'Version')
-- Variabili di modulo
local CSP_INFO = INFO_STD_PP.NAME..' ver.'..INFO_STD_PP.VERSION..' by EgalWare s.r.l.'
local MACHINE_INFO = 'PP_VER ver.'..PP_VER
local MACHINE_INFO = MACH_NAME..' ver.'..PP_VER
local TEST_USE = false
---------------------------------------------------------------------
@@ -41,13 +41,17 @@ function OnProgramStart()
local BtlInfoId = EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo') or EgtGetCurrMachGroup() or GDB_ID.NULL
local nPatt = EgtGetInfo( BtlInfoId, 'PATTID', 'i') or 40
EmtOutput( '%'..EgtNumToString( nPatt, 0)..'.0')
-- aggiungo prefisso per commentae commenti iniziali se la macchina è utilizzata per fare i test
local sPrefixCommentLine = '' ; if IS_TEST_MACHINE or EgtEndsWith( EgtGetCurrMachineDir(), '.TEST') then sPrefixCommentLine = '//' end
if EMT.INFO then
EmtOutput( '('..EMT.INFO..')')
EmtOutput( sPrefixCommentLine..'('..EMT.INFO..')')
else
EmtOutput( '(Program Start)')
end
EmtOutput( '('.. CSP_INFO..')')
EmtOutput( '('.. MACHINE_INFO..')\n')
EmtOutput( sPrefixCommentLine..'('.. CSP_INFO..')')
EmtOutput( sPrefixCommentLine..'('.. MACHINE_INFO..')\n')
-- Se modalità test, aggiungo linee per muovere tappeto e alzare la testa (in automatico viene fatto dal main residente)
if TEST_USE then
EmtOutput( 'M28')
@@ -133,6 +137,14 @@ function OnToolData()
if EMT.TDIST and abs( EMT.TDIST) < 0.1 then EMT.TDIST = nil end
local sOut = 'L11='..EgtNumToString( EMT.SMAX, 0)..' L12='..EmtLenToString( ( EMT.TDIST or ChSawLen), 1)..' G76H9998.1N301N304'
EmtOutput( sOut)
-- emissione dati rinvio
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 sPos = 'N2' .. tostring(nPos)
local sOut = 'L11=' .. EmtLenToString( EMT.SMAX, 3) .. ' L12=' .. EmtLenToString( AngTr1Offs, 1)..' G76H9998.1'..sPos..sPos
EmtOutput( sOut)
-- altro non previsto
end
end
@@ -151,7 +163,7 @@ function OnDispositionStart()
' EG'..EmtLenToString( SawOffs, 2)..' EI'..EmtLenToString( ParkY, 2)..' EL'..EmtLenToString( ParkV, 2)..
' EM'..EmtLenToString( TurnerOffs, 2)..' EN'..EmtLenToString( -DeltaTabY, 2)..' EO'..EmtLenToString( DeltaTabZ, 2)
if SecondSupport >= 3 then
sOut = sOut ..' EP'..EmtLenToString( AngTr1Len, 2) ..' EQ'..EmtLenToString( AngTr1Offs + MillOffs,2)
sOut = sOut ..' EP'..EmtLenToString( AngTr1Len, 2) ..' EQ'..EmtLenToString( AngTr1Offs,2)
end
EmtOutput( '\n' .. sOut .. '\n')
-- carico barra
@@ -418,6 +430,10 @@ function OnMachiningStart()
-- sistemazione speed
if EMT.HEAD == 'H2' then
EMT.S = EMT.S * 6
elseif EMT.HEAD == 'H5' and EMT.EXIT == 1 then
EMT.S = -EMT.S
elseif EMT.HEAD == 'H6' and EMT.EXIT == 1 then
EMT.S = -EMT.S
end
-- determino subito se taglio di separazione di pezzo a caduta
EMT.PREFALLCUT = nil
@@ -517,6 +533,7 @@ function OnMachiningEnd()
EMT.AUXTYPE = nil
EMT.U_STD = nil
EMT.PREVTOOL = EMT.TOOL
EMT.PREVHEAD = EMT.HEAD
EMT.PREVR3 = EMT.R3
end
@@ -527,6 +544,11 @@ function OnPathStart()
-- primo posizionamento sempre in globale
EMT.REFLOC = nil
EMT.IPLGL = false
-- salvo precedenti rotanti
EMT.R1pp = EMT.R1p
EMT.R2pp = EMT.R2p
-- reset valori precedenti (per forzare emissione di tutti gli assi del 1° movimento)
EmtResetPrev()
EMT.AUXCMD = {}
@@ -638,25 +660,78 @@ function OnRapid()
EmitZmax( EMT.TOOL ~= EMT.PREVTOOL)
EMT.ZMAX = true
EMT.PREVTOOL = EMT.TOOL
bHeadFirst = false
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
if not EMT.LOAD then
local sOut = string.gsub( string.gsub( EMT.MCHNAME..'/'..EMT.TOOL, '%(', '-'), '%)', '-')
EmtOutput( '( *** ' .. sOut .. ' *** )')
end
-- primo posizionamento
EmtResetPrev()
local bZmax = ( #EMT.AUXSTR > 0 or EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1)
-- 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 sEL = ' EL'
-- se motosega
if EMT.HEAD == 'H3' then
sEL = sEL..EmtLenToString( ( EMT.TDIST or ChSawLen), 3)
-- se aggregato
elseif EMT.HEAD == 'H5' or EMT.HEAD == 'H6' then
sEL = sEL..EmtLenToString( AngTr1Offs, 3)
-- se testa normale ( H1 or H2)
else
sEL = sEL..EmtLenToString( EMT.TLEN, 3)
end
local sER = ' ER'
-- se motosega
if EMT.HEAD == 'H3' then
sER = sER..EmtLenToString( EMT.TLEN, 3)
-- se aggregato
elseif EMT.HEAD == 'H5' or EMT.HEAD == 'H6' 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)
local sOut = 'G101' .. EmtGetAxis( 'L2') .. EmtGetAxis( 'L3') ..
EmtGetAxis( 'R2') .. EmtGetAxis( 'R1') .. sEE .. sEL .. sER .. sET .. sES
if EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
sOut = sOut .. ' EH1'
-- 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')
local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
EmtGetAxis( 'R2') .. EmtGetAxis( 'R1') .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOutPreMove)
EmtOutput( 'G101 ET1001')
EmtOutput( 'G101 ET2001')
end
EmtResetPrev()
-- se sono su pezzi alti e movimento da emettere, per sicurezza a Z massima
local MyZPos = EMT.L3
if EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
MyZPos = MyZHome
end
local sOut = 'G101' .. EmtGetAxis( 'L2') .. ' Z' .. EmtLenToString( MyZPos, 3) ..
EmtGetAxis( 'R2') .. EmtGetAxis( 'R1') .. sEE .. sEL .. sER .. sET .. sES
-- faccio backup dati in caso mi servano per lavorazione successiva
EMT.PREVsEE = sEE ; EMT.PREVsEL = sEL ; EMT.PREVsER = sER ; EMT.PREVsET = sET ; EMT.PREVsES = sES
if EMT.LOAD or bHeadFirst then
sOut = sOut .. ' L0=0'
if EMT.LOAD or #EMT.AUXSTR > 0 then
@@ -903,6 +978,11 @@ end
---------------------------------------------------------------------
function OnArc()
-- con aggregato non si possono fare archi. Deve essere tutto spezzato
if EMT.HEAD == 'H5' or EMT.HEAD == 'H6' then
EmtSetLastError( 1211, "With aggregate, the arcs must be splitted")
end
MyBackupAxes()
EMT.TLAST = EMT.L1
-- non modale su archi
@@ -940,7 +1020,7 @@ end
function CalcDinamicaPinze( dH, dS, dL)
local MinTempoAcc = 0.3 -- [s]
local MaxTempoAcc = 4.0 -- [s]
local KgMtCubo= 550 -- densità legno [Kg / metro cubo]
local KgMtCubo= WoodDensity or 550 -- densità legno [Kg / metro cubo]
local Massa = ( dH * dS * dL * KgMtCubo ) / 1e9 -- massa [Kg]
local FMaxPinze = EMT.FMAXPINZE -- Feed massima pinze [mm/min]
local ForzaAttrito = 350 * 9.8 * 0.2 -- Forza chiusura pinze [Kgf] * g * Coeff_Attrito -> [N]
@@ -1482,16 +1562,24 @@ function MyAdjustLinearAxes()
if EMT.REFLOC then
local vtE
if EMT.HEAD ~= 'H3' then
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
else
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
local LenAux = AngTr1Offs + 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
EMT.L1 = EMT.L1 - vtE:getX()
EMT.L2 = EMT.L2 - DeltaTabY - vtE:getY()
EMT.L3 = EMT.L3 - DeltaTabZ - vtE:getZ()
@@ -1531,7 +1619,7 @@ function CalcInterpPlane()
local ptS = Point3d( xS, 0, 0)
-- calcolo per piano generico
local vtE
if EMT.HEAD ~= 'H3' then
if EMT.HEAD == 'H1' or EMT.HEAD == 'H2' then
vtE = Vector3d( EMT.EXTR)
else
vtE = EgtGetCalcAuxDirFromAngles( EMT.R1, EMT.R2, EMT.R3)
@@ -1582,7 +1670,7 @@ end
---------------------------------------------------------------------
function GetET( sHead, sTcPos, dAxR3)
if sHead == 'H1' then
if sHead == 'H1' or sHead == 'H5' or sHead == 'H6' then
return ' E'..sTcPos
elseif sHead == 'H2' then
return ' ET42'
+81 -24
View File
@@ -6,7 +6,7 @@ local INFO_STD_PP = require( 'Version')
-- Variabili di modulo
local CSP_INFO = INFO_STD_PP.NAME..' ver.'..INFO_STD_PP.VERSION..' by EgalWare s.r.l.'
local MACHINE_INFO = 'PP_VER ver.'..PP_VER
local MACHINE_INFO = MACH_NAME..' ver.'..PP_VER
local TEST_USE = false
---------------------------------------------------------------------
@@ -38,14 +38,18 @@ end
---------------------------------------------------------------------
function OnProgramStart()
-- aggiungo prefisso per commentae commenti iniziali se la macchina è utilizzata per fare i test
local sPrefixCommentLine = '' ; if IS_TEST_MACHINE or EgtEndsWith( EgtGetCurrMachineDir(), '.TEST') then sPrefixCommentLine = '//' end
-- Intestazioni
if EMT.INFO then
ParkLine( '('..EMT.INFO..')')
ParkLine( sPrefixCommentLine..'('..EMT.INFO..')')
else
ParkLine( '(Program Start)')
end
ParkLine( '('.. CSP_INFO..')')
ParkLine( '('.. MACHINE_INFO..')')
ParkLine( sPrefixCommentLine..'('.. CSP_INFO..')')
ParkLine( sPrefixCommentLine..'('.. MACHINE_INFO..')')
-- Se modalità test, aggiungo linee per muovere tappeto e alzare la testa (in automatico viene fatto dal main residente)
if TEST_USE then
@@ -206,19 +210,12 @@ function OnDispositionEnd()
local HTrave = EMT.HT
local STrave = EMT.ST
local HOverM = EMT.HOVM
-- calcolo dati pinze
local MinAccPinze = 0.3
local MaxAccPinze = 4
local KgMtCubo= 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 RidFeed = 100 / Massa * 100
if ( RidFeed > 100) then RidFeed = 100 end
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)
if IdTrave >= 0 then
local sPrt = '( *** Part '.. EgtNumToString( IdTrave, 0) ..' ***)'
local sOut = '( SN=' .. IdTrave .. ' LBarra=' .. EmtLenToString( LBarra, 3) .. ' L='..EmtLenToString( LTrave, 3) ..
@@ -247,7 +244,8 @@ function OnDispositionEnd()
-- se carico barra
if EMT.LOAD or EMT.RELOAD then
sOut = 'M115 P1=' .. EmtLenToString( LBarra, 2) .. ' P2=' .. EmtLenToString( HTrave, 2) .. ' P3=' .. EmtLenToString( STrave, 2) ..
' P4=' .. EmtLenToString( HOverM, 2) .. ' P5=' .. tostring( nLoad90) .. ' P6=' .. EmtLenToString( LTrave, 2)
' P4=' .. EmtLenToString( HOverM, 2) .. ' P5=' .. tostring( nLoad90) .. ' P6=' .. EmtLenToString( LTrave, 2) ..
' P7=' .. EgtNumToString( TempAccPinze, 2) .. ' P8=' .. EgtNumToString( TempAccPinz2, 2) .. ' P9=' .. EgtNumToString( TempAccPinz1, 2)
if EMT.LOAD then
ParkLine( sOut)
SetStartValue( 1, LBarra)
@@ -261,7 +259,8 @@ function OnDispositionEnd()
-- altrimenti recupero rimanenza
else
sOut = 'M115 P1=' .. EmtLenToString( LBarra, 2) .. ' P2=' .. EmtLenToString( HTrave, 2) .. ' P3=' .. EmtLenToString( STrave, 2) ..
' P4=' .. EmtLenToString( HOverM, 2) .. ' P5=' .. tostring( nLoad90) .. ' P6=' .. EmtLenToString( EgtIf( IdTrave >= 0, LTrave, LBarra), 2)
' 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())
-- aggiorno dati aggancio carrelli alla trave
@@ -511,6 +510,8 @@ function OnMachiningEnd()
EMT.AUXTYPE = nil
EMT.U_STD = nil
EMT.PREVTOOL = EMT.TOOL
EMT.PREVHEAD = EMT.HEAD
EMT.PREVS = EMT.S
end
---------------------------------------------------------------------
@@ -521,6 +522,11 @@ function OnPathStart()
-- primo posizionamento sempre in globale
EMT.REFLOC = nil
EMT.IPLGL = false
-- salvo precedenti rotanti
EMT.R1pp = EMT.R1p
EMT.R2pp = EMT.R2p
-- reset valori precedenti (per forzare emissione di tutti gli assi del 1° movimento)
EmtResetPrev()
EMT.AUXCMD = {}
@@ -634,22 +640,49 @@ function OnRapid()
if not ( EMT.LOAD or EMT.RELOAD) then
if not EMT.ZMAX and #EMT.AUXSTR > 0 then
EmitZmax()
bHeadFirst = false
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 = '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) ..
' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4')
EmtOutput( sOutPreMove)
EmtOutput( 'M101 P1=2')
EmtOutput( 'M101 P1=3')
end
if not EMT.LOAD then
local sOut = string.gsub( string.gsub( EMT.MCHNAME..'/'..EMT.TOOL, '%(', '['), '%)', ']')
EmtOutput( '( * ' .. sOut .. ' * )')
end
-- primo posizionamento
-- 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) ..
' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) ..
' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4')
EmtOutput( sOutPreMove)
EmtOutput( 'M101 P1=2')
EmtOutput( 'M101 P1=3')
end
-- resetto valori precedenti
EmtResetPrev()
local bZmax = ( #EMT.AUXSTR > 0 or EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1)
local sOut = 'M101 P1=1' .. ' P2=' .. EmtLenToString( EMT.L2, 3) .. ' P3=' .. EmtLenToString( EMT.L3, 3) ..
local MyZPos = EMT.L3
-- se sono su pezzi alti e movimento da emettere, per sicurezza a Z massima
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) ..
' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) ..
' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4')
if EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
sOut = sOut .. ' P12=1'
end
if EMT.LOAD then
ParkLine( sOut)
else
@@ -948,6 +981,28 @@ function OnArc()
EmtUpdatePrev()
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
end
return TempoAcc * 1000, MinTempoAcc * 1000, RidFeed
end
---------------------------------------------------------------------
function CalcCharStatus( sCmd, bSkipPress)
-- aperto
@@ -1613,6 +1668,8 @@ function AdjustTcPos( bLen3)
sPos = '0' .. sPos
end
end
-- salvo posizione
EMT.PREVTCPOS = sPos
return sPos
end
+89 -76
View File
@@ -1,4 +1,4 @@
-- Processore macchina Essetre-FAST by EgalWare s.r.l. 2024/02/23
-- Processore macchina Essetre-FAST by EgalWare s.r.l. 2024/03/09
-- Intestazioni
require( 'EmtGenerator')
@@ -130,7 +130,7 @@ function OnSimulStart()
local nId = EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( nGrpId or GDB_ID.NULL, McdData[i].Sub) or GDB_ID.NULL, McdData[i].Name)
if nId then
table.insert( EMT.MCODET, nId)
EgtOutLog( 'Element ' .. McdData[i].Grp .. '/' .. McdData[i].Sub .. '/' .. McdData[i].Name .. ' is ok', 4)
EgtOutLog( 'Element ' .. McdData[i].Grp .. '/' .. McdData[i].Sub .. '/' .. McdData[i].Name .. ' (' .. tostring( nId) .. ') is ok', 4)
else
nMcdNullCnt = nMcdNullCnt + 1
EgtOutLog( 'Element ' .. McdData[i].Grp .. '/' .. McdData[i].Sub .. '/' .. McdData[i].Name .. ' is null', 4)
@@ -503,7 +503,7 @@ function OnSimulToolSelect( dPosA)
-- imposto il valore di A
EgtSetAxisPos( 'A', dPosA)
if abs( dPosA) < 0.1 then
EgtSetAxisPos( 'C', 0)
EgtSetAxisPos( 'C', EgtIf( BD.RIGHT_LOAD, 180, 0))
end
EgtSetAxisPos( 'B', 0)
end
@@ -533,39 +533,40 @@ function OnSimulToolDeselect()
-- 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
EgtOutText( 'Tool change in progress...')
local RapSimStep = 4 * EMT.SIMSTEP
local RapSimRotStep = RapSimStep / 10
local CollSimRotStep = min( RapSimRotStep, 5)
-- 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
local dPosA = EgtGetAxisPos( 'A')
if abs( dPosA) < 0.1 then
SimulMoveAxes( 'B', 0, CollSimRotStep, 'C', EgtIf( RIGHT_LOAD, 180, 0), CollSimRotStep)
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.COLLROT, 'C', EgtIf( BD.RIGHT_LOAD, 180, 0), MCH_SIM_STEP.COLLROT)
else
SimulMoveAxes( 'B', 0, CollSimRotStep, 'C', EgtIf( RIGHT_LOAD, 90, -90), CollSimRotStep)
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.COLLROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.COLLROT)
end
SimulMoveAxis( 'X', 0, RapSimStep)
SimulMoveAxis( 'X', 0, MCH_SIM_STEP.RAPID)
-- movimento scarico rinvio
elseif EMT.HEAD == 'H5' then
SimulMoveAxes( 'B', 0, CollSimRotStep, 'C', -90, CollSimRotStep)
SimulMoveAxis( 'X', 0, RapSimStep)
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.COLLROT, 'C', -90, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'X', 0, MCH_SIM_STEP.RAPID)
-- movimento scarico punta lunga su T111
elseif EMT.TOTLEN > LONG_TOOL_MINLEN then
-- se su cambio utensile T111
if EMT.TCPOS == 'T111' then
SimulMoveAxis( 'X', 0, RapSimStep)
SimulMoveAxes( 'B', 0, CollSimRotStep, 'C', 0, CollSimRotStep)
SimulMoveAxis( 'X', 0, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.COLLROT, 'C', 0, MCH_SIM_STEP.COLLROT)
-- altrimenti posizioni standard rastrelliera
else
SimulMoveAxis( 'X', 0, RapSimStep)
SimulMoveAxes( 'B', 90, CollSimRotStep, 'C', -90, CollSimRotStep)
SimulMoveAxis( 'X', 0, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'B', 90, MCH_SIM_STEP.COLLROT, 'C', -90, MCH_SIM_STEP.COLLROT)
end
-- movimento scarico utensile di grosso diametro (su T111)
else
local dPosB = EgtGetAxisPos( 'B')
local dNewB = EgtIf( dPosB < 0, -90, 90)
SimulMoveAxes( 'B', dNewB, CollSimRotStep, 'C', EgtIf( RIGHT_LOAD, 180, 0), CollSimRotStep)
SimulMoveAxis( 'X', 0, RapSimStep)
SimulMoveAxes( 'B', dNewB, MCH_SIM_STEP.COLLROT, 'C', EgtIf( BD.RIGHT_LOAD, 180, 0), MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'X', 0, MCH_SIM_STEP.RAPID)
end
-- breve pausa
EgtPause( 100)
@@ -574,9 +575,9 @@ function OnSimulToolDeselect()
ShowToolInTcPos( EMT.TCPOS_1, true)
-- movimento per carico utensile
if EMT.NEXTHEAD ~= 'H3' and EMT.NEXTHEAD ~= 'H5' then
SimulMoveAxes( 'B', 90, RapSimRotStep, 'C', EgtIf( RIGHT_LOAD, 90, -90), RapSimRotStep)
SimulMoveAxes( 'B', 90, MCH_SIM_STEP.RAPROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.RAPROT)
else
SimulMoveAxes( 'B', 0, RapSimRotStep, 'C', EgtIf( RIGHT_LOAD, 90, -90), RapSimRotStep)
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.RAPROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.RAPROT)
end
-- se segue lama, carico utensile di default
if EMT.NEXTHEAD == 'H2' then
@@ -592,12 +593,9 @@ function OnSimulToolDeselect()
elseif EMT.NEXTHEAD ~= 'H2' and EMT.NEXTHEAD ~= 'H4' then
if EMT.NEXTTOOL ~= EMT.TOOL_1 then
EgtOutText( 'Tool change in progress...')
local RapSimStep = 4 * EMT.SIMSTEP
local RapSimRotStep = RapSimStep / 10
local CollSimRotStep = min( RapSimRotStep, 10)
-- simulo movimento
SimulMoveAxes( 'B', 90, CollSimRotStep, 'C', EgtIf( RIGHT_LOAD, 90, -90), CollSimRotStep)
SimulMoveAxis( 'X', 0, RapSimStep)
SimulMoveAxes( 'B', 90, MCH_SIM_STEP.COLLROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'X', 0, MCH_SIM_STEP.RAPID)
-- breve pausa
EgtPause( 100)
ShowToolInTcPos( EMT.TCPOS_1, true)
@@ -608,7 +606,7 @@ function OnSimulToolDeselect()
EgtSetStatus( EgtGetHeadId( EMT.HEAD), GDB_ST.OFF)
end
-- eseguo movimento opportuno
SimulMoveAxes( 'B', 0, RapSimRotStep, 'C', EgtIf( RIGHT_LOAD, 90, -90), RapSimRotStep)
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.RAPROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.RAPROT)
-- se altrimenti lama su cambio utensile
elseif EMT.NEXTHEAD == 'H1' and SpecialBH and EMT.NEXTTCPOS == 'T111' then
-- se non lama, nascondo l'utensile corrente
@@ -616,7 +614,7 @@ function OnSimulToolDeselect()
EgtSetStatus( EgtGetHeadId( EMT.HEAD), GDB_ST.OFF)
end
-- eseguo movimento opportuno
SimulMoveAxes( 'B', -90, RapSimRotStep, 'C', 0, RapSimRotStep)
SimulMoveAxes( 'B', -90, MCH_SIM_STEP.RAPROT, 'C', 0, MCH_SIM_STEP.RAPROT)
end
else
EMT.TOOL_1 = nil
@@ -673,35 +671,8 @@ end
---------------------------------------------------------------------
function OnSimulPathEnd()
-- se attivo VMILL, lavorazione ed è richiesto di eliminare gli sfridi
if EMT.VMILL and #EMT.VMILL > 0 and not EMT.OPEISDISP and EMT.VMRS then
EgtOutLog( 'OnSimulPathEnd', 5)
local vMillId = EMT.VMILL[1]
local nPart = EgtVolZmapPartCount( vMillId)
if nPart > 1 then
-- ricerca del pezzo con massimo volume
local nPartMax = 0
local dVolMax = 0
for i = 1, nPart do
local dVol = EgtVolZmapPartVolume( vMillId, i - 1)
if dVol > dVolMax then
dVolMax = dVol
nPartMax = i
end
end
-- eliminazione di tutti i pezzi piccoli
for i = nPart, 1, -1 do
if i ~= nPartMax then
local b3Vmill = EgtVolZmapGetPartBBoxGlob( vMillId, i - 1, GDB_BB.STANDARD)
if b3Vmill:getDimX() < 1200 then
EgtRemoveVolZmapPart( vMillId, i - 1)
end
end
end
-- aggiorno visualizzazione
EgtDraw()
end
end
-- rimozione eventuali sfridi
ExecRemoveScraps()
end
---------------------------------------------------------------------
@@ -779,17 +750,23 @@ function OnSimulMoveStart()
EgtOutText( '')
EMT.MCHFIRST = false
-- 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 then
local RapSimStep = 4 * EMT.SIMSTEP
SimulMoveAxes( 'C', EMT.R1, RapSimStep/10, 'B', EMT.R2, RapSimStep/10)
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
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
end
---------------------------------------------------------------------
--function OnSimulMoveEnd()
--end
function OnSimulMoveEnd()
if EMT.FLAG == 301 then
-- rimozione eventuali sfridi
ExecRemoveScraps()
end
end
---------------------------------------------------------------------
function OnSimulCollision()
@@ -814,7 +791,6 @@ end
---------------------------------------------------------------------
function ExecAuxCmd( sCmd)
local RapSimStep = 4 * EMT.SIMSTEP
local Cmd = EgtSplitString( sCmd)
if Cmd[1] == '0' then
if Cmd[2] == 'Unloading' then
@@ -824,7 +800,7 @@ function ExecAuxCmd( sCmd)
end
EgtOutText( EgtIf( Cmd[3], Cmd[3], Cmd[2]))
elseif Cmd[1] == '1' then
if not SimulMoveAxis( Cmd[2], tonumber( Cmd[3]), RapSimStep) then
if not SimulMoveAxis( Cmd[2], tonumber( Cmd[3]), MCH_SIM_STEP.RAPID) then
if VerifyYVStroke( Cmd[2], tonumber( Cmd[3])) == nil then
EgtOutLog( 'Error on ExecAuxCmd : ' .. sCmd)
end
@@ -838,8 +814,8 @@ function ExecAuxCmd( sCmd)
-- Verifico movimento carrello con trave agganciata
VerifyOneChariotSlide( Cmd[2], Cmd[3], Cmd[4], Cmd[5])
-- Eseguo il movimento
local _, bOk, bOk2 = SimulMoveAxes( Cmd[2], tonumber( Cmd[3]), RapSimStep,
Cmd[4], tonumber( Cmd[5]), RapSimStep)
local _, bOk, bOk2 = SimulMoveAxes( Cmd[2], tonumber( Cmd[3]), MCH_SIM_STEP.RAPID,
Cmd[4], tonumber( Cmd[5]), MCH_SIM_STEP.RAPID)
if not ( bOk and bOk2) then
local nI = EgtIf( not bOk, 2, 4)
if VerifyYVStroke( Cmd[nI], tonumber( Cmd[nI+1])) == nil then
@@ -850,9 +826,9 @@ function ExecAuxCmd( sCmd)
-- Verifico movimento carrelli con trave agganciata
VerifyTwoChariotsSlide( Cmd[2], Cmd[3], Cmd[4], Cmd[5], Cmd[6], Cmd[7])
-- Eseguo il movimento
local _, bOk, bOk2, bOk3 = SimulMoveAxes( Cmd[2], tonumber( Cmd[3]), RapSimStep,
Cmd[4], tonumber( Cmd[5]), RapSimStep,
Cmd[6], tonumber( Cmd[7]), RapSimStep)
local _, bOk, bOk2, bOk3 = SimulMoveAxes( Cmd[2], tonumber( Cmd[3]), MCH_SIM_STEP.RAPID,
Cmd[4], tonumber( Cmd[5]), MCH_SIM_STEP.RAPID,
Cmd[6], tonumber( Cmd[7]), MCH_SIM_STEP.RAPID)
if not ( bOk and bOk2 and bOk3) then
local nI = EgtIf( not bOk, 2, EgtIf( not bOk2, 4, 6))
if VerifyYVStroke( Cmd[nI], tonumber( Cmd[nI+1])) == nil then
@@ -864,14 +840,14 @@ function ExecAuxCmd( sCmd)
if Cmd[2] ~= '0' then
dPY = EgtIf( EMT.ROT == -1, EMT.HB, EMT.SB)
end
SimulMoveAxis( 'PY', dPY, RapSimStep)
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)
end
SimulMoveAxis( 'PV', dPV, RapSimStep)
SimulMoveAxis( 'PV', dPV, MCH_SIM_STEP.RAPID)
SetPVLight( Cmd[2] ~= '0')
elseif Cmd[1] == '21' then
local nYDelta = tonumber( Cmd[2])
@@ -894,6 +870,39 @@ function ExecAuxCmd( sCmd)
end
end
---------------------------------------------------------------------
function ExecRemoveScraps()
-- se attivo VMILL, lavorazione ed è richiesto di eliminare gli sfridi
if EMT.VMILL and #EMT.VMILL > 0 and not EMT.OPEISDISP and EMT.VMRS then
EgtOutLog( 'OnSimulPathEnd', 5)
local vMillId = EMT.VMILL[1]
local nPart = EgtVolZmapPartCount( vMillId)
if nPart > 1 then
-- ricerca del pezzo con massimo volume
local nPartMax = 0
local dVolMax = 0
for i = 1, nPart do
local dVol = EgtVolZmapPartVolume( vMillId, i - 1)
if dVol > dVolMax then
dVolMax = dVol
nPartMax = i
end
end
-- eliminazione di tutti i pezzi piccoli
for i = nPart, 1, -1 do
if i ~= nPartMax then
local b3Vmill = EgtVolZmapGetPartBBoxGlob( vMillId, i - 1, GDB_BB.STANDARD)
if b3Vmill:getDimX() < 1200 then
EgtRemoveVolZmapPart( vMillId, i - 1)
end
end
end
-- aggiorno visualizzazione
EgtDraw()
end
end
end
---------------------------------------------------------------------
function ExecUnloading()
if EMT.VMILL and #EMT.VMILL > 0 then
@@ -903,21 +912,25 @@ function ExecUnloading()
-- li sposto per lasciare spazio al nuovo pezzo
local nId = EgtGetFirstInGroup( nVmGrpId)
while nId do
EgtMove( nId, Vector3d( 0, EgtIf( RIGHT_LOAD, ( EMT.SB + 50.0), -( EMT.SB + 50.0)), 0), GDB_RT.GLOB)
EgtMove( nId, Vector3d( 0, EgtIf( BD.RIGHT_LOAD, ( EMT.SB + 50.0), -( EMT.SB + 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( RIGHT_LOAD, 450, -450), 0)
if EMT.FALL then vtMove = Vector3d( -500, 0, EgtIf( RIGHT_LOAD, 750, -750)) end
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
EgtMove( nLayId, vtMove, GDB_RT.GLOB)
EgtSetLevel( vMillId, GDB_LV.USER)
-- aggiungo gli spigoli
local nFirstId, nCount = EgtVolZmapGetEdges( vMillId, nLayId)
if nFirstId then
for nId = nFirstId, nFirstId + nCount - 1 do
EgtSetColor( nId, Color3d( 96, 96, 96))
if EgtVolZmapSetShowEdges then
EgtVolZmapSetShowEdges( vMillId, true)
else
local nFirstId, nCount = EgtVolZmapGetEdges( vMillId, nLayId)
if nFirstId then
for nId = nFirstId, nFirstId + nCount - 1 do
EgtSetColor( nId, Color3d( 96, 96, 96))
end
end
end
-- rilascio Vmill
+18 -11
View File
@@ -1,4 +1,4 @@
-- Special Operations macchina Essetre-FAST by EgalWare s.r.l. 2024/02/23
-- Special Operations macchina Essetre-FAST by EgalWare s.r.l. 2024/03/28
-- Intestazioni
require( 'EmtGenerator')
@@ -32,11 +32,11 @@ local DELTA_TOL_FIXED = 50
local DeltaTol = DELTA_TOL_S
local DELTA_SIC = 1
local AGG_LOAD = 50
local MIN_JOIN_VV = 75
local MIN_JOIN_SS = 100
local MIN_JOIN_LS = 290
local MIN_JOIN_SL = 100
local MIN_JOIN_LL = 400
local MIN_JOIN_VV = EgtClamp( MinJoinVV or 75, 60, 150)
local MIN_JOIN_SS = EgtClamp( MinJoinSS or 100, 80, 200)
local MIN_JOIN_LS = EgtClamp( MinJoinLS or 290, 250, 400)
local MIN_JOIN_SL = EgtClamp( MinJoinSL or 100, 80, 200)
local MIN_JOIN_LL = EgtClamp( MinJoinLL or 400, 300, 600)
local MinJoin = MIN_JOIN_SS
local MinOther = abs( MinY) + abs( MaxV) + MinJoin
@@ -445,6 +445,7 @@ function OnPostApplyMachining()
EMC.YDELTA = nil
EMC.VDELTA = nil
EMC.HCING_IGNORE = true
EMC.CNT = 1
elseif IsStartOrRestPhase( EMC.PHASE) then
-- carico le posizioni
local dPosT = EgtGetInfo( nPrevOpeId, 'TPOS', 'd')
@@ -461,6 +462,7 @@ function OnPostApplyMachining()
EMC.VDELTA = nil
end
EMC.HCING_IGNORE = true
EMC.CNT = nil
else
-- aggiornamento posizioni (da lavorazione precedente a disposizione)
local nPrev2OpeId = EgtGetPrevActiveOperation( nPrevOpeId)
@@ -478,8 +480,8 @@ function OnPostApplyMachining()
if #vAxes > 0 then EMC.TPOS = vAxes[1] end
EMC.YDELTA = EgtGetInfo( nLastPathId, 'YDELTA', 'd')
EMC.VDELTA = EgtGetInfo( nLastPathId, 'VDELTA', 'd')
EMC.CNT = nil
end
EMC.CNT = nil
-- altrimenti precedente operazione è lavorazione
else
-- aggiornamento posizioni
@@ -796,6 +798,7 @@ function SpecialCalcMachiningEncumbrance( nMchId, bPreCut)
local bAngTrasm = ( sHead == 'H5' or sHead == 'H6')
local dTLen = EgtTdbGetCurrToolParam( MCH_TP.LEN)
local dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
local dThLen = EgtTdbGetCurrToolThLength()
-- Se sega a catena, devo correggere il versore Aux per farlo coincidere con la direzione del braccio C
if bChain then
if abs( vAxes[6] or 0) < 1 then
@@ -811,7 +814,7 @@ function SpecialCalcMachiningEncumbrance( nMchId, bPreCut)
if nExit == 2 then vtAux = -vtAux end
end
-- Calcolo limiti derivanti dalla lavorazione
local dDistFront, dDistBack = SpecCalcEncumbrance( vtTool, vtAux, ptMin, ptMax, bSaw, bChain, dTLen, dTDiam)
local dDistFront, dDistBack = SpecCalcEncumbrance( vtTool, vtAux, ptMin, ptMax, bSaw, bChain, dTLen, dTDiam, dThLen)
return dDistFront, dDistBack
end
@@ -870,7 +873,7 @@ function GetFinalCutPmax( nMchId)
end
---------------------------------------------------------------------
function SpecCalcEncumbrance( vtTool, vtArm, ptMin, ptMax, bSaw, bChain, dTLen, dTDiam)
function SpecCalcEncumbrance( vtTool, vtArm, ptMin, ptMax, bSaw, bChain, dTLen, dTDiam, dThLen)
-- Quota in Z dal punto di inclinazione dei carrelli
local dCompZ = sqrt( 1 - vtTool:getZ() * vtTool:getZ())
local dZup = ptMin:getZ() - 0.5 * dCompZ * dTDiam - ( EMC.ZMIN + 130)
@@ -905,7 +908,7 @@ function SpecCalcEncumbrance( vtTool, vtArm, ptMin, ptMax, bSaw, bChain, dTLen,
elseif abs( vtTool:getZ()) < 0.93 then
if vtTool:getX() > 0 and abs( vtTool:getY()) < 0.2 and ptMax:getZ() > EMC.ZMIN + BD.VICE_MINH then
dHeadBack = 180
elseif vtTool:getX() > -0.05 then
elseif vtTool:getX() > -0.06 then
dHeadBack = 50 + 0.5 * dTDiam * sqrt( 1 - vtTool:getX() * vtTool:getX())
elseif vtTool:getX() > -0.3 then
dHeadBack = 250
@@ -996,7 +999,7 @@ function SpecCalcEncumbrance( vtTool, vtArm, ptMin, ptMax, bSaw, bChain, dTLen,
elseif abs( vtTool:getZ()) < 0.93 then
if vtTool:getX() < 0 and abs( vtTool:getY()) < 0.2 and ptMax:getZ() > EMC.ZMIN + BD.VICE_MINH then
dHeadFront = 180
elseif vtTool:getX() < 0.05 then
elseif vtTool:getX() < 0.06 then
dHeadFront = 50 + 0.5 * dTDiam * sqrt( 1 - vtTool:getX() * vtTool:getX())
elseif vtTool:getX() < 0.3 then
dHeadFront = 250
@@ -1055,6 +1058,10 @@ function SpecCalcEncumbrance( vtTool, vtArm, ptMin, ptMax, bSaw, bChain, dTLen,
(( vtTool:getY() > 0 and ptHeadMin:getY() > 80) or ( vtTool:getY() < 0 and ptHeadMax:getY() < -EMC.SB - 80)) then
dHeadFront = 130
end
-- per forature di coda abbastanza lontane dai bordi pezzo in Y
if BD.ENABLE_TOOL_BETWEEN_VICES and not bChain and vtTool:getX() < -0.999 and ptHeadMax:getY() + dTDiam / 2 < -15 and ptHeadMin:getY() - dTDiam / 2 > -EMC.SB + 15 then
dHeadFront = - ( dTLen - dThLen - 15)
end
-- per interferenza con triangolo di rinforzo sulla pinza V
if ( vtTool:getZ() < 0.25 and vtTool:getX() > -0.10 and vtTool:getY() > 0 and vtArm:getX() > 0.707 and not BD.RIGHT_LOAD) or
( vtTool:getZ() < 0.25 and vtTool:getX() > -0.10 and vtTool:getY() < 0 and vtArm:getX() > 0.707 and BD.RIGHT_LOAD) then
+5 -5
View File
@@ -25,11 +25,11 @@ REM copio i sorgenti nel percorso temporaneo per i compilati
ROBOCOPY . %fullPathSource%\bin\%machineName%\ /E /XF "Compile.bat" /XF ".gitignore" /XD ".git" /XF "UpdateLog.txt"
REM copio i file compilati nel percorso temporaneo per i compilati
\EgtProg\Dll32\luac54 -o %fullPathSource%\bin\%machineName%\Common-FAST.mlpe Common-FAST.mlpe
\EgtProg\Dll32\luac54 -o %fullPathSource%\bin\%machineName%\Common-FAST.mlse Common-FAST.mlse
\EgtProg\Dll32\luac54 -o %fullPathSource%\bin\%machineName%\Common-FAST.NUM.mlpe Common-FAST.NUM.mlpe
\EgtProg\Dll32\luac54 -o %fullPathSource%\bin\%machineName%\Common-FAST.NUM_PLUS.mlpe Common-FAST.NUM_PLUS.mlpe
\EgtProg\Dll32\luac54 -o %fullPathSource%\bin\%machineName%\Common-FAST.TPA.mlpe Common-FAST.TPA.mlpe
\EgtProg\Dll32\luac54 -o %fullPathSource%\bin\%machineName%\Common-FAST.mlpe -s Common-FAST.mlpe
\EgtProg\Dll32\luac54 -o %fullPathSource%\bin\%machineName%\Common-FAST.mlse -s Common-FAST.mlse
\EgtProg\Dll32\luac54 -o %fullPathSource%\bin\%machineName%\Common-FAST.NUM.mlpe -s Common-FAST.NUM.mlpe
\EgtProg\Dll32\luac54 -o %fullPathSource%\bin\%machineName%\Common-FAST.NUM_PLUS.mlpe -s Common-FAST.NUM_PLUS.mlpe
\EgtProg\Dll32\luac54 -o %fullPathSource%\bin\%machineName%\Common-FAST.TPA.mlpe -s Common-FAST.TPA.mlpe
REM comprimo i file compilati in uno zip pronto per essere distribuito
tar.exe acvf %fullPathZip%\%machineName%.zip -C %fullPathSource%\bin\ %machineName%\*.*
+40 -8
View File
@@ -1,4 +1,4 @@
-- Descrizione macchina Essetre-FAST by EgalTech s.r.l. 2024/01/19
-- Descrizione macchina Essetre-FAST by EgalTech s.r.l. 2024/03/28
-- 2021/12/29 DS ver 2.3l4 Per NUM non va considerato MillOffs negli offset in Z.
-- 2022/01/27 DS ver 2.4a2 Modifiche per tagli testa/coda su pezzi alti.
-- 2022/02/10 DS ver 2.4a3 Ridotto di 10mm pinzaggio con pezzi alti ma sottili.
@@ -38,13 +38,29 @@
-- Allineamento con common ver. 2.6c1
-- 2024/02/23 AV ver 2.6c2 Rimossa chiamata funzione EgtGetSourceDir
-- Allineamento con common ver. 2.6c2
-- 2024/02/23 AV ver 2.6c3 Allineamento con common ver. 2.6c3
-- 2024/02/27 AV ver 2.6c4 Allineamento con common ver. 2.6c4. Aggiunto parametro 'SafeXRotAxes' per rotazione motosega con pezzi alti
-- 2024/02/29 AV ver 2.6c5 Allineamento con common ver. 2.6c5
-- 2024/03/04 AV ver 2.6c6 Modificato log con nome macchina
-- Allineamento con common ver. 2.6c6
-- 2024/03/09 DS ver 2.6c7 Migliorie alla geometria macchina e suo caricamento.
-- 2024/03/12 AV ver 2.6c8 Allineamento con common ver. 2.6c7.
-- 2024/03/28 DS ver 2.6c9 Modificata posizione supporto rinvio.
-- 2024/03/28 AV ver 2.6d1 Allineamento con common ver. 2.6c8
-- 2024/04/15 AV ver 2.6d2 Allineamento con common ver. 2.6d1
-- 2024/04/18 AV ver 2.6d3 Allineamento con common ver. 2.6d2
-- 2024/04/30 AV ver 2.6e1 Allineamento con common ver. 2.6e1
-- Aggiunta variabile WoodDensity per gestione WOOD_DENSITY
-- 2024/05/06 AV ver 2.6e2 Allineamento con common ver. 2.6e2
-- 2024/05/06 AV ver 2.6e3 Allineamento con common ver. 2.6e3
-- Aggiunte variabili MinJoin(xx) per gestione MIN_JOIN_(xx)
require( 'EmtGenerator')
EgtEnableDebug( false)
PP_VER = '2.6c2'
PP_VER = '2.6e3'
MIN_MACH_VER = '2.5k1'
MACH_NAME = 'Essetre-FAST'
-- Carico i dati globali
local sMachDir = EgtGetCurrMachineDir()
@@ -60,7 +76,7 @@ if INFO_STD_PP.MIN_MACH_VER_PP_COMMON > MIN_MACH_VER then
MIN_MACH_VER = INFO_STD_PP.MIN_MACH_VER_PP_COMMON
end
EgtOutLog ( '**PP_VER ver.'..PP_VER..'**'..INFO_STD_PP.NAME..' ver.'..INFO_STD_PP.VERSION, 1)
EgtOutLog ( '** ' .. MACH_NAME..' '..PP_VER..' ** ( '..INFO_STD_PP.NAME..': '..INFO_STD_PP.VERSION..' - MinMach: '.. MIN_MACH_VER ..') **', 1)
-- Parametri macchina
NumericalControl = 'TPA' -- NUM o TPA o NUM_PLUS
@@ -104,6 +120,7 @@ MaxUnloadLen = 0
BeamHeightForFixRot = 9999 -- per abilitare assegnare 500
CoeffVM = 0.5
NewTopC = true
SafeXRotAxes = 150
-- leggo e aggiorno con parametri da BeamData
if BD then
@@ -162,6 +179,12 @@ if EgtExistsFile( sData) then
if Machine.Offsets.RIB_AUTO then AutomaticRotation = ( Machine.Offsets.RIB_AUTO == 1) end
if Machine.Offsets.NOULOAD then MaxUnloadLen = Machine.Offsets.NOULOAD end
if Machine.Offsets.DEFTCPOS then DefTcPos = ( 'T' .. Machine.Offsets.DEFTCPOS) end
if Machine.Offsets.WOOD_DENSITY then WoodDensity = Machine.Offsets.WOOD_DENSITY end
if Machine.Offsets.MIN_JOIN_VV then MinJoinVV = Machine.Offsets.MIN_JOIN_VV end
if Machine.Offsets.MIN_JOIN_SS then MinJoinSS = Machine.Offsets.MIN_JOIN_SS end
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
end
end
end
@@ -213,9 +236,18 @@ local CId = EmtAxis {
Geo = 'C_AXIS/GEO',
Aux = {'C_AXIS/SOLID', 'C_AXIS/COLLISION'}}
if NewTopC then
local SolidTopId = EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( CId, 'SOLID'), 'TOP')
local vtMove = Vector3d( 65,0,0)
local SolidArmId = EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( CId, 'SOLID'), 'ARM')
if EgtSurfTmMoveFacet then
EgtSurfTmMoveFacet( SolidArmId, 11, vtMove, GDB_RT.GLOB)
else
EgtSurfTmMoveVertex( SolidArmId, 23, EgtSurfTmGetVertex( SolidArmId, 23, GDB_RT.GLOB) + vtMove, GDB_RT.GLOB)
EgtSurfTmMoveVertex( SolidArmId, 25, EgtSurfTmGetVertex( SolidArmId, 25, GDB_RT.GLOB) + vtMove, GDB_RT.GLOB)
EgtSurfTmMoveVertex( SolidArmId, 35, EgtSurfTmGetVertex( SolidArmId, 35, GDB_RT.GLOB) + vtMove, GDB_RT.GLOB)
EgtSurfTmMoveVertex( SolidArmId, 36, EgtSurfTmGetVertex( SolidArmId, 36, GDB_RT.GLOB) + vtMove, GDB_RT.GLOB)
end
local CollTopId = EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( CId, 'COLLISION'), 'TOP')
EgtMove( { SolidTopId, CollTopId}, Vector3d( 65,0,0), GDB_RT.GLOB)
EgtMove( CollTopId, vtMove, GDB_RT.GLOB)
EgtSetName( CollTopId, 'BOX')
else
local CollTopId = EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( CId, 'COLLISION'), 'TOP')
@@ -494,9 +526,9 @@ elseif SecondSupport == 3 then
Name = 'T91',
Parent = 'Base',
ExitNbr = 2,
Pos1 = Point3d( -510.4-150, 113.2, -329.8-170),
Pos1 = Point3d( -710.4-150, 113.2, -329.8-170),
TDir1 = X_AX(),
Pos2 = Point3d( -510.4+150, 113.2, -329.8-170),
Pos2 = Point3d( -710.4+150, 113.2, -329.8-170),
TDir2 = -X_AX(),
ADir = Z_AX(),
Geo = 'BASE/T91',
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+49 -7
View File
@@ -1,11 +1,53 @@
==== Common_FAST Update Log ====
Versione 2.6c1 (23/02/2024)
- (ALL) Prima versione post-proc comune FAST e FASTrl
- (ALL) "BeamData" caricato come libreria con 'require' anziché come file con 'dofile'
- (SIM) Aggiunta funzioni "OnSimulInit" e "OnSimulExit" per orientare vista corretta in caso di macchina con carico destro. N.B.= serve CAM5 2.6b4
- (ALL) In BeamData aggiunto flag per direzione carico RIGHT_LOAD
- (ALL) Aggiornamento 'Compile.bat' con nuovi nomi file
Versione 2.6e3 (06/05/2024)
- (MLDE-SIM-GEN) Gestione facoltativa parametri MIN_JOIN_xx settabili in Ts3. Ticket#1794
Versione 2.6e2 (06/05/2024)
- (SIM-GEN) Modificata tolleranza calcolo ingombri lavorazioni per posizionamento pinze. Ticket#1790
Versione 2.6e1 (30/04/2024)
- (MLDE-GEN) Gestione facoltativa parametro WOOD_DENSITY settabile in Ts3. In MLDE, mettere il valore di WOOD_DENSITY nella nostra variabile 'WoodDensity'.
Versione 2.6d2 (18/04/2024)
- (SIM-GEN) In MLSE, quando c'è una rotazione, viene settato EMT.CNT=1 per considerare i 50mm di compensazione laser.
- (SIM) Nel file di log dove c'è stampa gruppi di collisione, viene scritto anche ID del gruppo
Versione 2.6d1 (15/04/2024)
- (GEN) Aggiunta gestione aggregato doppia uscita per controllo NUM_PLUS
- (GEN) Con aggregato con si possono fare archi, se OnArc con aggregato, dà errore.
- (GEN) Chiamando la macchina con un nome che termini con '.TEST' si abilita come macchina per test interni, equivalente a settare 'IS_TEST_MACHINE' (che comunque rimane)
Versione 2.6c8 (28/03/2024)
- (MLSE) Possibilità di lavorazione da X- tra le pinze, se abilitata da flag (User.ENABLE_TOOL_BETWEEN_VICES == 1).
- (MLDE-GEN) Aggiunto parametro 'IS_TEST_MACHINE' FACOLTATIVO. Se non esiste o 'false' è macchina standard, se 'true' è una macchina utilizzata per i test Egalware interni
Versione 2.6c7 (12/03/2024)
- (SIM) Miglioramento visualizzazione spigoli VMILL alla fine della simulazione. Funzione: EgtVolZmapSetShowEdges. N.B.= serve CAM5 2.6c2 NON OBBLIGATORIO
- (GEN) Corretto problema di movimento pinze assieme a discesa asse Z (Ticket #1710)
Versione 2.6c6 (04/03/2024)
- (MLDE-GEN) Aggiunta variabile 'MACH_NAME' in MLDE con nome macchina
Versione 2.6c5 (29/02/2024)
- (GEN) Aggiunto comando di wait fine M101/G101 in caso di movimento in zona sicurezza per motosega
- (GEN) Gestione accelerazioni pinze in M115 ( solo per TPA)
- (SIM) Gestione rimozione VMILL per tagli a cubetti a zig-zag
Versione 2.6c4 (27/02/2024)
- (MLDE-SIM-GEN) Con pezzi molto alti '> BeamHeightForFixRot', aggiunto parametro 'SafeXRotAxes' per ruotare motosega in zona sicura lontano dal pezzo
- (SIM) Nelle funzioni movimentaizone assi, utilizzate costanti 'MCH_SIM_STEP'
Versione 2.6c3 (23/02/2024)
- (SIM) Corretta lettura parametro RIGHT_LOAD
- (SIM-GEN) Rimossa chiamata funzione EgtGetSourceDir rimasta in MLPE
Versione 2.6c2 (23/02/2024)
- (ALL) Rimossa chiamata funzione EgtGetSourceDir
- (SIM-GEN) Rimossa chiamata funzione EgtGetSourceDir
Versione 2.6c1 (23/02/2024)
- (SIM-GEN) Prima versione post-proc comune FAST e FASTrl
- (SIM-GEN) "BeamData" caricato come libreria con 'require' anziché come file con 'dofile'
- (SIM) Aggiunta funzioni "OnSimulInit" e "OnSimulExit" per orientare vista corretta in caso di macchina con carico destro. N.B.= serve CAM5 2.6b4
- (SIM-GEN) In BeamData aggiunto flag per direzione carico RIGHT_LOAD
- (SIM-GEN) Aggiornamento 'Compile.bat' con nuovi nomi file
+2 -2
View File
@@ -1,9 +1,9 @@
-- Version.lua by EgalWare s.r.l. 2024/02/23
-- Version.lua by EgalWare s.r.l. 2024/03/28
-- Gestione della versione dei file comuni post-processori macchine FAST e FASTrl di Essetre
local InfoCommon_STD_PP = {
NAME = 'Common-FAST', -- nome script PP standard
VERSION = '2.6c1', -- versione script
VERSION = '2.6e3', -- versione script
MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel
}