Compare commits

..

168 Commits

Author SHA1 Message Date
andrea.villa 106d5242e4 - Aggiunta OnSpecialApplyMachining per calcolare i carrelli da subito
- Aggiungendo OnSpecialApplyMachining, ora la OnSpecialGetPrevMachiningOffset lavora correttamente. ATT: MIN_MACH -> 3.1b2
2026-03-17 15:13:15 +01:00
andrea.villa 440862314a Merge branch 'develop' 2026-03-04 10:30:50 +01:00
andrea.villa 54b0f5ed9a - Corretta chiamata di una variabile insesistente in caso di ONE
- Allineata simulazione a generazione
- Revert delle ultime modifiche
- Cambio versione per rilascio a cliente
2026-03-04 10:30:26 +01:00
daniele.nicoli 97a163579e - Corretto calcolo rimanenza durante ParkRoller.
- Applicato movimento a X intermedia->finale anche in caso di 'Head1_TC2'.
2026-02-27 09:06:38 +01:00
andrea.villa a90a4070b8 Merge remote-tracking branch 'origin/main' into develop 2026-02-20 08:56:14 +01:00
andrea.villa 835b0a2637 Merge branch 'develop' 2026-02-20 08:56:00 +01:00
andrea.villa 96faf7cd54 Cambio versione per rilascio a cliente 2026-02-20 08:52:27 +01:00
andrea.villa 797bf6f8eb Funzione rinominata in ToolPreSelectionSingleHead(), ora utilizza funzione in MLDE per capire se è motosega 2026-02-20 08:49:37 +01:00
daniele.nicoli 88c7786e84 Aggiunta funzione ToolPreSelection() per la preselezione utensile. Funziona solo con una testa. 2026-01-26 13:33:18 +01:00
andrea.villa 14fc485df7 Merge remote-tracking branch 'origin/main' into develop 2026-01-16 15:29:16 +01:00
andrea.villa 3dc7d36c7a Merge remote-tracking branch 'origin/develop' 2026-01-16 15:28:58 +01:00
andrea.villa 194a17102c - Piccola correzione modifiche fatte in precedenza
- Cambio versione per rilascio a cliente
2026-01-16 15:28:47 +01:00
daniele.nicoli 7ab3e14a66 Aggiunto controllo che evita collisioni durante lo svincolo in Z della sega a catena con l'aggiunta di un punto intermedio 2026-01-12 12:38:21 +01:00
daniele.nicoli 026718885e Merge branch 'main' into develop 2026-01-09 15:51:29 +01:00
andrea.villa 00aacc6594 Merge remote-tracking branch 'origin/develop' 2025-12-18 15:59:07 +01:00
andrea.villa 55de04f2be - Cambio versione per rilascio a cliente
- Corretta indentazione
2025-12-18 15:57:50 +01:00
daniele.nicoli 77589f595c Aggiunta funzione CheckClamping 2025-12-15 10:00:30 +01:00
daniele.nicoli be911ff558 modificati i limiti da 90 a 91 per evitare doppi movimenti dove non necessario 2025-12-12 14:55:05 +01:00
daniele.nicoli 997c5de5d9 Soluzione Ticket#2754
Divisione movimento B in approccio se > 90°
2025-12-12 14:41:39 +01:00
daniele.nicoli e6336d59a0 Aggiunto controllo post movimenti ausiliari dell' EMC.PREVOFFSX nella funzione OnSpecialGetPrevMachiningOffset(). Ticket#2727 2025-12-01 15:58:54 +01:00
daniele.nicoli 787b3348af Merge remote-tracking branch 'origin/main' into develop 2025-12-01 15:43:59 +01:00
andrea.villa 2a595eb68a Prima di andare allo scarico, si aggiunge movimento intermedio dove si aspetta che rulli scarico siano arrivati in posizione. 2025-11-28 15:39:15 +01:00
andrea.villa 4fa1dbab6e Merge remote-tracking branch 'origin/develop' 2025-11-20 16:55:23 +01:00
andrea.villa b8999246d5 - Piccole modifiche a calcolo tolleranza per VMILL
- Cambio versione per rilascio a cliente
2025-11-20 16:55:11 +01:00
daniele.nicoli 8df9d0fca3 Aggiornata risoluzione VMillTol in funzione dello spessore lama 2025-11-20 16:18:59 +01:00
andrea.villa a9ed23d74f Merge remote-tracking branch 'origin/main' into develop 2025-11-05 13:20:37 +01:00
andrea.villa 3c991ae8a0 Merge branch 'develop' 2025-11-05 13:20:20 +01:00
andrea.villa 3732923ad7 Allo scarico si resetta Y2DELTA 2025-11-05 13:18:47 +01:00
andrea.villa bf4bf9ba45 Aggiunta tolleranza in creazione piano di lavoro inclinato 2025-11-04 13:02:59 +01:00
andrea.villa bcfc3ca059 Corretto calcolo per decidere se serve aprire i rulli 2025-11-04 12:34:55 +01:00
andrea.villa 5761cb5d15 Merge remote-tracking branch 'origin/main' into develop 2025-10-23 07:44:43 +02:00
andrea.villa dc2d384733 In simulazione, corretta posizione parcheggio in caso di testa 1 su magazzino 2. In generazione era già corretta. 2025-10-23 07:44:18 +02:00
andrea.villa bf72eb5191 Merge remote-tracking branch 'origin/main' into develop 2025-10-21 10:44:20 +02:00
andrea.villa 69ca1baee3 Merge branch 'develop' 2025-10-21 10:43:58 +02:00
andrea.villa 0256bd8c09 Se SPLIT con pinza 5, corretto salvataggio posizione pinza 2. 2025-10-21 10:43:39 +02:00
andrea.villa f62422e7d6 Merge remote-tracking branch 'origin/main' into develop 2025-10-08 13:10:37 +02:00
andrea.villa 75c20c8c87 Salvataggio posizione Z su lavorazione precedente, sbagliava in caso di separazione 2025-10-08 13:10:20 +02:00
andrea.villa f50e41e1e3 Merge remote-tracking branch 'origin/main' into develop 2025-09-10 12:09:20 +02:00
andrea.villa 5d9161d084 Corretto calcolo tempi. Con controllo NUM arriva accelerazione e non tempo di accelerazione come per TPA. 2025-09-10 12:09:01 +02:00
andrea.villa 97549443d8 Merge branch 'main' into develop 2025-09-10 10:28:06 +02:00
andrea.villa 5b710e4ac7 Merge branch 'develop' 2025-09-10 10:27:50 +02:00
andrea.villa 1e415d2861 Piccola correzione risalita ZMAX dopo RELOAD del pezzo. Generazione allineata a simulazione. 2025-09-10 10:27:37 +02:00
andrea.villa 23f6b5b6d0 - Stima tempi considerando accelerazioni
- Se fase start o restart, si aggiorna la posizione in X dell'asse per calcolare il link corretto
2025-09-10 08:47:05 +02:00
andrea.villa 32672e81d8 Gestione aggregato BH 2025-09-10 08:33:55 +02:00
andrea.villa 618a67508f Piccole correzioni per gestire secondo TC su ONE 2025-08-29 16:51:17 +02:00
andrea.villa b9877d9df3 Merge remote-tracking branch 'origin/main' into develop 2025-08-28 12:10:42 +02:00
andrea.villa dfffc4f207 Merge branch 'develop' 2025-08-28 12:10:20 +02:00
andrea.villa bc137e869e - Corretto nome variabile e altre piccole modifiche per Progress
- Cambio versione per rilascio
2025-08-28 12:10:02 +02:00
andrea.villa 81d2f164d3 Migliorata gestione spegnimento utensile e disattivazione piano 2025-08-28 11:53:25 +02:00
andrea.villa ec2d3c17dc Merge remote-tracking branch 'origin/main' into develop 2025-08-20 13:12:21 +02:00
andrea.villa ae1b8fc06a Merge branch 'develop' 2025-08-20 13:11:55 +02:00
andrea.villa 9c1269b11b - Non si chiudono i rulli se tagli o pretagli di testa e coda
- Corretto movimento pinza 5 in caso di riposizionamento pinza 1
- Corretta quota assoluta posizione testa trave in caso di pinza 5 e testa rimasta bassa
- Se ultima lavorazione pezzo precedente ha stesso utensile della prima lavorazione pezzo successivo, la speed resta accesa
2025-08-20 13:11:37 +02:00
andrea.villa 23f22b559f Merge branch 'V1OpenOnTailCut' into develop 2025-08-20 13:03:29 +02:00
luca.mazzoleni 586ce999af - in generazione e simulazione non si chiudono i rulli se tagli o pretagli di testa e coda 2025-08-05 15:04:02 +02:00
andrea.villa 2998d6fa4e Merge remote-tracking branch 'origin/main' into develop 2025-07-23 12:12:23 +02:00
andrea.villa 5b016fd559 Aggiunto parametro configurabile da TS3 per massima sporgenza trave in coda per pinza 5 2025-07-23 12:12:02 +02:00
andrea.villa 3db068936c Merge branch 'main' into develop 2025-07-22 11:16:22 +02:00
andrea.villa 7394cd769b Merge remote-tracking branch 'origin/develop' 2025-07-22 11:16:06 +02:00
andrea.villa 9301eaa3b6 Commit per versione 2025-07-22 11:15:48 +02:00
andrea.villa 8e138131c4 Corretto lettura angolo di presa della motosega 2025-07-08 12:10:50 +02:00
andrea.villa 14c090b23f Merge remote-tracking branch 'origin/main' into develop 2025-07-08 10:35:55 +02:00
andrea.villa 0ed07e3541 Corretto movimento a parcheggio sega a catena 2025-07-08 10:35:37 +02:00
andrea.villa 880873c1d3 Merge remote-tracking branch 'origin/main' into develop 2025-07-01 10:04:55 +02:00
andrea.villa 830bd62c72 Merge remote-tracking branch 'origin/develop' 2025-07-01 10:04:37 +02:00
andrea.villa c01cc3f2d1 Aggiunta gestione massima lunghezza scarico 2025-07-01 10:04:22 +02:00
andrea.villa 0dba75296d Update Log 2025-06-10 11:48:36 +02:00
andrea.villa 8e707122b2 Corretto gestione accelerazioni 2025-06-10 11:47:58 +02:00
andrea.villa 3aebd1d297 Rimossa gestione PROBE inserita per sbaglio 2025-06-09 13:13:06 +02:00
andrea.villa b5ffbdea11 Cambio versione 2025-06-05 14:53:58 +02:00
andrea.villa b7fbaf80f9 Tolta tastatura da ramo develop mergiata per sbaglio 2025-06-05 14:50:41 +02:00
andrea.villa 6bc6420d01 Merge branch 'Probing' into develop 2025-06-04 13:27:49 +02:00
andrea.villa ee7c64627a Merge remote-tracking branch 'origin/main' into develop 2025-06-04 13:27:11 +02:00
andrea.villa 345224da78 Merge branch 'develop' 2025-06-04 13:26:54 +02:00
andrea.villa 240c837cd4 Cambio versione 2025-06-04 13:26:36 +02:00
andrea.villa aa2004042e Aggiunti parametri FMAXPINZE, MAXACC, MINACC configurabili da TS3 2025-06-04 13:24:54 +02:00
andrea.villa e3e9494411 Prima versione gestione tastatore 2025-06-04 13:05:35 +02:00
andrea.villa d495c3a2af Aggiunta gestione qualità VMILL da impostazioni macchina 2025-06-04 09:43:42 +02:00
andrea.villa 6d562d1ee6 Merge remote-tracking branch 'origin/main' into develop 2025-05-28 12:35:09 +02:00
andrea.villa 26efc4308b Commit per cambio versione 2025-05-28 12:34:04 +02:00
andrea.villa df13a4134e Merge branch 'develop' 2025-05-28 12:33:21 +02:00
andrea.villa 33fdb5a64f Alla separazione si spostano i carrelli di 30mm aprendo il taglio 2025-05-21 08:40:04 +02:00
andrea.villa 0b70495e30 Merge remote-tracking branch 'origin/main' into develop 2025-04-16 13:41:34 +02:00
andrea.villa a27d448f81 Merge remote-tracking branch 'origin/develop' 2025-04-16 13:41:22 +02:00
andrea.villa 984376affd Distanza di collisione portata a 3mm, qualità VMILL ridotta a 4mm 2025-04-16 13:41:10 +02:00
andrea.villa a21e44f2d8 Merge remote-tracking branch 'origin/main' into develop 2025-03-25 17:38:26 +01:00
andrea.villa 7c832dd546 Corretto movimento approccio alla lavorazione se utensile lama montata su magazzino 2 2025-03-25 17:38:04 +01:00
andrea.villa 357a317610 Merge remote-tracking branch 'origin/main' into develop 2025-03-12 08:27:55 +01:00
andrea.villa ac22b1bd85 Merge branch 'develop' 2025-03-12 08:27:36 +01:00
andrea.villa caa62668b3 Migliorato movimento approccio al pezzo con lama. Allineamento simulazione-generazione che facevano due movimenti leggermente diversi 2025-03-12 08:27:18 +01:00
andrea.villa b93f414964 Aggiunta commenti HEADER e FOOTER per comunicazione con linea o altre macchine, da parte di Essetre. 2025-03-10 08:59:35 +01:00
andrea.villa f7016c254a Migliorato calcolo posizione barra dopo split 2025-03-05 12:47:36 +01:00
andrea.villa c7a9e9dd36 Merge remote-tracking branch 'origin/main' into develop 2025-03-05 12:46:36 +01:00
andrea.villa 4d72475d2e Corretto movimento in home utensile precedente. 2025-03-05 12:46:24 +01:00
andrea.villa 945da649ff Merge branch 'main' into develop 2025-02-07 12:34:31 +01:00
andrea.villa 4b01c811c4 Merge branch 'develop' 2025-02-07 12:34:18 +01:00
andrea.villa adb7a7c1be Migliorato controllo collisioni con traversa. Ora si considera asse X. Serve modifica NGE! 2025-02-07 12:34:08 +01:00
andrea.villa 5fe00d81ac Estensione soluzione Ticket#2206. Ora si aprono di 5mm extra anche se solo una morsa resta in posizione 2025-01-23 09:04:57 +01:00
andrea.villa 66f06de42c In caso di Progress, alla deselezione utensile testa 1 su TC2 si fa movimento Z raddrizzando asse B 2025-01-16 09:19:49 +01:00
andrea.villa 55c15f027d Merge remote-tracking branch 'origin/main' into develop 2025-01-15 11:56:54 +01:00
andrea.villa e964c8ce3e Merge remote-tracking branch 'origin/develop' 2025-01-15 11:56:37 +01:00
andrea.villa 8f4c6a2ad2 In caso di testa 1 su TC2 (ONE), si ruota prima la C e poi la B 2025-01-15 11:56:28 +01:00
andrea.villa 8c43edfbff Merge remote-tracking branch 'origin/main' into develop 2025-01-07 14:39:32 +01:00
andrea.villa 23bc412e02 Merge remote-tracking branch 'origin/develop' 2025-01-07 14:39:12 +01:00
andrea.villa d9a688f082 Commit per versione 2025-01-07 14:38:58 +01:00
andrea.villa 3e1377c159 Se entrambe le morse sono restate in posizione, le sposto comunque di 5mm per distanziare i pezzi separati 2025-01-02 11:47:00 +01:00
andrea.villa 4586a2fcbe In separazione, quando si porta indietro il restante, si aprono le paratie rulli subito. 2024-12-12 15:52:42 +01:00
andrea.villa 333cb79179 Merge remote-tracking branch 'origin/main' into develop 2024-12-09 12:38:08 +01:00
andrea.villa 13ac6a5ee0 Merge branch 'develop' 2024-12-09 12:37:49 +01:00
andrea.villa 0f06de6ee5 - Corretto problema introdotto in 2.6l1
- In MLSE modificato controllo direzione utensile per determinare Z massima
2024-12-09 12:37:32 +01:00
andrea.villa a6076a694d Merge branch 'main' into develop 2024-12-02 08:33:18 +01:00
andrea.villa 347e215b7e Merge remote-tracking branch 'origin/develop' 2024-12-02 08:33:03 +01:00
andrea.villa 5c7f506108 Commit per versione 2024-12-02 08:32:51 +01:00
andrea.villa 07bc0c49f3 Aggiornato file di log 2024-11-29 16:58:50 +01:00
andrea.villa b2c70129c3 - Nei movimenti si ricalcola la Z solo se la quota di lavoro è più in alta della posizione a ZHOME della testa
- Se bisogna andare in home, ma la testa lo è già, non si scrive nulla
2024-11-29 16:41:45 +01:00
andrea.villa 9c80da84fe Dopo scarico pezzo per ribaltamento, si aprono sempre i rulli 2024-11-29 13:15:17 +01:00
andrea.villa 739dddd97a Revert "Rimossa gestione H15, ora si utilizza H13 con offset all'interno dell'utensile"
This reverts commit e2091aa8e6.
2024-10-30 08:53:15 +01:00
andrea.villa e2091aa8e6 Rimossa gestione H15, ora si utilizza H13 con offset all'interno dell'utensile 2024-10-30 08:33:43 +01:00
andrea.villa 26ecb4d05f Merge remote-tracking branch 'origin/main' into develop 2024-10-21 16:55:12 +02:00
andrea.villa 1120c84a03 Merge branch 'hotfix/AdjustHomeMovement' 2024-10-21 16:54:36 +02:00
andrea.villa 7eff40db37 Se richiesto movimento in home, si scrive sempre parcheggio in home dell'utensile precedente 2024-10-21 16:54:24 +02:00
andrea.villa 9c8106c92a Merge remote-tracking branch 'origin/main' into develop 2024-10-17 12:22:02 +02:00
andrea.villa 3e1a1270bb Commit per versione 2024-10-17 12:21:51 +02:00
andrea.villa 10e67aef11 Merge branch 'hotfix/CSawZmaxAllPieces' 2024-10-17 12:21:17 +02:00
andrea.villa c699e397f4 Se motosega prelevata con A=0, quando la si scarica si porta sempre alla quota Z-MAX 2024-10-17 12:20:58 +02:00
andrea.villa 4ccfb88447 Merge remote-tracking branch 'origin/main' into develop 2024-10-08 12:50:50 +02:00
andrea.villa 801cca3bb7 Merge branch 'develop' 2024-10-08 11:41:06 +02:00
andrea.villa 4b9b1a352e Merge branch 'HOTFIX-ApproachFirstMove' 2024-10-08 10:30:35 +02:00
andrea.villa b2c2f4819b Tolti i 100mm aggiuntivi al calcolo ZMAX 2024-10-08 10:30:20 +02:00
andrea.villa e06f67b22a Modifica gestione primo movimento di approccio al pezzo 2024-10-08 09:35:13 +02:00
andrea.villa e765940154 Merge branch 'HomeNoPresel' into develop 2024-10-03 10:21:12 +02:00
andrea.villa 429c049a44 Piccola correzione gestione movimento in home 2024-10-03 10:20:51 +02:00
andrea.villa a9a7b2c14e In caso di movimento in Home non si fa più preselezione ma si tiene utensile vecchio 2024-10-03 08:42:07 +02:00
andrea.villa a61affc726 Corretto movimento in Home in caso di lama e movimento rulliera di carico. Ticket#2054 2024-09-27 12:56:38 +02:00
andrea.villa b9bc1f0922 Merge branch 'main' into develop 2024-09-13 15:18:14 +02:00
andrea.villa 24cbfe0737 - Aggiunta collisione magazzino motosega ONE
- Piccole migliorie ai movimenti
2024-09-13 15:17:52 +02:00
andrea.villa 0272e7d606 Merge branch 'main' into develop 2024-09-13 11:25:39 +02:00
andrea.villa 6df44b4a74 Merge remote-tracking branch 'origin/develop' 2024-09-13 11:25:32 +02:00
andrea.villa 2d43a594d1 - Migliorato calcolo chiusura paratia rulli con aggiornamento lunghezza della barra in caso di ultimo taglio e grezzo residuo in coda
- Corretto movimento a Y di sicurezza con lama
2024-09-13 11:25:19 +02:00
andrea.villa 5cb0055dc9 Migliorato calcolo chiusura paratia rulli con aggiornamento lunghezza della barra in caso di ultimo taglio e grezzo residuo in coda 2024-09-12 12:41:25 +02:00
andrea.villa e33a6c163e Merge branch 'main' into develop 2024-09-02 10:06:30 +02:00
andrea.villa 171ff119b0 Merge remote-tracking branch 'origin/develop' 2024-09-02 10:06:17 +02:00
andrea.villa 8733ed4007 Commit per versione 2024-09-02 10:05:35 +02:00
andrea.villa c650b259ff In preselezione. Se lavorazione motosega, non mando a parcheggio altra testa con utensile precedente, perchè subito dopo viene chiamata preselezione 2024-08-09 16:34:51 +02:00
andrea.villa c74ff69f55 Quando si aprono i rulli, se la trave non può seguire i rulli perchè la pinza andrebbe in extra-corsa, si sposta comunque la pinza fino al massimo della sua corsa. 2024-08-07 14:24:08 +02:00
andrea.villa 64bbe6947f Merge branch 'main' into develop 2024-08-07 10:06:18 +02:00
andrea.villa a3ad415f3e Merge remote-tracking branch 'origin/develop' 2024-08-07 10:05:47 +02:00
andrea.villa 382736ae14 Commit per versione 2024-08-07 10:05:38 +02:00
andrea.villa b7be5c1b2a Allineata simulazione a generazione in primo movimento rapido approccio al pezzo 2024-08-01 14:57:05 +02:00
andrea.villa 67c6573974 Merge branch 'main' into develop 2024-08-01 12:54:44 +02:00
andrea.villa 85fbb5830d Merge remote-tracking branch 'origin/develop' 2024-08-01 12:54:39 +02:00
andrea.villa 5b3d0e897f Commit per versione 2024-08-01 12:54:25 +02:00
andrea.villa 8a4bbff20b Corretto segno posizione X di sicurezza per rotazione assi rotanti 2024-08-01 09:22:17 +02:00
andrea.villa 6e799468ae Merge remote-tracking branch 'origin/main' into develop 2024-07-31 17:17:30 +02:00
andrea.villa 524bbb1edc Tolto stato finale paratia carico 2024-07-31 17:16:47 +02:00
andrea.villa 7fa71a1002 Merge remote-tracking branch 'origin/main' into develop 2024-07-31 15:22:58 +02:00
andrea.villa 03218233f7 Piccola correzione segni quote parcheggio 2024-07-31 15:22:19 +02:00
andrea.villa 8a3d1e05f6 Merge remote-tracking branch 'origin/main' into develop 2024-07-31 10:56:27 +02:00
andrea.villa 009216d59c Merge branch 'develop' 2024-07-31 10:56:01 +02:00
andrea.villa 20b54428f8 Commit per versione 2024-07-31 10:55:49 +02:00
andrea.villa 492af68caf Merge branch 'SpecialMoveHighPieces' into develop 2024-07-31 10:53:50 +02:00
andrea.villa e6e37c6c51 Merge branch 'AdjustClampAfterRotation' into develop 2024-07-31 10:53:28 +02:00
andrea.villa 91d5656a3d Merge remote-tracking branch 'origin/develop' into SpecialMoveHighPieces 2024-07-30 14:43:00 +02:00
andrea.villa c05b8a4117 Modifica limite inferirore intervallo di pinzaggio per garantire, se possibile, il passaggio pezzo a pinza 2 2024-07-30 14:41:54 +02:00
andrea.villa 824cf6eda2 Tolto offset aggiuntivo fatto per pezzi a caduta, ma creava tanti riposizionamenti extra. 2024-07-29 14:59:14 +02:00
andrea.villa f1262e191f Merge branch 'GenPlaneOnFirstArc' into develop 2024-07-29 14:57:20 +02:00
andrea.villa 343298e87f Viene ripristinato il tipo di arco corretto 2024-07-29 09:53:59 +02:00
andrea.villa be109120f1 Gestione creazione piano generico in caso il primo movimento della lavorazione sia un arco. 2024-07-29 09:31:14 +02:00
andrea.villa f677ef6213 Gestione movimenti speciali per pezzi molto alti. Se HomeZ < primo punto lavorazione, allora vado al punto Z lavorazione prima di approcciare il pezzo in X. 2024-07-25 11:43:21 +02:00
5 changed files with 1247 additions and 248 deletions
+497 -138
View File
File diff suppressed because it is too large Load Diff
+478 -76
View File
@@ -24,7 +24,7 @@ end
---------------------------------------------------------------------
-- *** SIMULATION ***
---------------------------------------------------------------------
local COLL_SAFE_DIST = 4
local COLL_SAFE_DIST = 3
---------------------------------------------------------------------
function OnSimulInit()
@@ -79,6 +79,14 @@ function OnSimulStart()
if vTools and vTools[1] and #(vTools[1]) > 0 then
EgtLoadTool( vTcPos[i], 1, vTools[1])
ShowToolInTcPos( vTcPos[i], true)
-- Aggiunto controllo lunghezza lama minima * 0.9 per ricavare la tolleranza del VMILL
if EgtTdbSetCurrTool(vTools[1]) 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
end
@@ -119,9 +127,17 @@ function OnSimulStart()
{ Grp = 'Base', Sub = 'COLLISION', Name = 'TRAV'},
{ Grp = 'Base', Sub = 'COLLISION', Name = 'COL1'},
{ Grp = 'Base', Sub = 'COLLISION', Name = 'COL2'},
{ Grp = 'Base', Sub = 'BELT', Name = 'COLLISION'}}
{ Grp = 'Base', Sub = 'COLLISION', Name = 'TC1'},
{ Grp = 'Base', Sub = 'COLLISION', Name = 'TC2'},
{ Grp = 'Base', Sub = 'BELT', Name = 'COLLISION'},
{ Grp = 'X1', Sub = 'COLLISION', Name = 'STM'}}
if EgtGetHeadId( 'H21') then
table.insert( McdData, { Grp = 'X2', Sub = 'COLLISION', Name = 'STM'})
end
-- gruppo CHSAW si attiva solo se progress, one con BIT mortiser o PF
if Progress or Mortiser or EgtGetHeadId( 'H21') then
if Progress or Mortiser or EgtGetHeadId( 'H21') or SecondToolChanger then
table.insert( McdData, { Grp = 'Base', Sub = 'COLLISION', Name = 'CHSAW'})
end
-- gruppo MORTISER si attiva solo se PF con BIT mortiser attivo
@@ -132,6 +148,10 @@ function OnSimulStart()
if Progress and EgtGetHeadId( 'H21') then
table.insert( McdData, { Grp = 'Base', Sub = 'COLLISION', Name = 'SAW1'})
end
-- se non è Progress ed è una ONE, aggiungo collisioni magazzino speciale
if not Progress and not EgtGetHeadId( 'H21') then
table.insert( McdData, { Grp = 'Base', Sub = 'COLLISION', Name = 'MTC'})
end
if Clamp5 then
table.insert( McdData, { Grp = 'W', Sub = 'COLLISION', Name = 'STM1'})
@@ -225,19 +245,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.51
if dArea < CoeffVM * 0.5e6 then
dTol = 1.01
elseif dArea < CoeffVM * 1.2e6 then
dTol = 1.51
elseif dArea < CoeffVM * 2.5e6 then
dTol = 1.97
elseif dArea < CoeffVM * 5.0e6 then
dTol = 2.81
elseif dArea < CoeffVM * 10.0e6 then
dTol = 3.77
local dTol = 4.71
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
@@ -345,6 +372,8 @@ function OnSimulDispositionStart()
else
EgtOutText( 'Barra non ruotata')
end
-- forzo apertura rulli in caso fossero chiusi. Altrimenti all'apertura nell OnSimulMoveStart sposterebbe anche la trave
ExecParkRoller( nil, nil, nil, nil, nil, nil)
end
-- eseguo aggancio
local nRawId = EgtGetFirstRawPart()
@@ -452,6 +481,7 @@ function OnSimulDispositionEnd()
EMT.UNLOADING = false
EMT.FALL = false
EMT.TO_FALL = false
EMT.Y2DELTA = nil
end
-- se disposizione intermedia
if IsMidPhase( EMT.PHASE) or IsEnd2Phase( EMT.PHASE) then
@@ -493,10 +523,8 @@ function OnSimulToolSelect( dPosA)
end
-- se sega a catena, imposto subito angolo scelto per asse virtuale A
if HeadIsChainSaw( EMT.HEAD) then
-- se non Progress, apro le paratie
if not Progress then
ExecParkRoller( nil, nil, nil, nil, false, IsStartPhase( EMT.PHASE))
end
-- apro le paratie
ExecParkRoller( nil, nil, nil, nil, false, IsStartPhase( EMT.PHASE))
-- valore dell'asse virtuale
dPosA = dPosA or GetNextChainSawingVirtualAxis( EMT.MCHID)
-- imposto il valore di A
@@ -628,7 +656,7 @@ function OnSimulToolDeselect( dPrevA)
SimulMoveAxes( 'B1', ParkB1, MCH_SIM_STEP.RAPROT, 'C1', ParkC1, MCH_SIM_STEP.RAPROT)
SimulMoveAxis( 'X1', ParkX1, MCH_SIM_STEP.RAPID)
-- deposito utensile lama
elseif EMT.PREVHEAD_H1 == 'H12' then
elseif EMT.PREVHEAD_H1 == 'H12' or EMT.PREVHEAD_H1 == 'H17' then
-- simulo movimento
SimulMoveAxes( 'B1', ParkB1, MCH_SIM_STEP.RAPROT, 'C1', ParkC1, MCH_SIM_STEP.RAPROT)
SimulMoveAxis( 'X1', ParkX1, MCH_SIM_STEP.RAPID)
@@ -696,12 +724,12 @@ function OnSimulToolDeselect( dPrevA)
-- nascondo l'utensile sulla testa
EgtSetMode( EgtGetHeadId( EMT.PREVHEAD_H1 or '') or GDB_ID.NULL, GDB_MD.HIDDEN)
-- prendo utensile fresa o lama
if EMT.NEXTHEAD == 'H11' or EMT.NEXTHEAD == 'H12' then
if EMT.NEXTHEAD == 'H11' or EMT.NEXTHEAD == 'H12' or EMT.NEXTHEAD == 'H17' then
local MyParkX1 = EgtIf( GetHeadTCSet( EMT.NEXTHEAD, EMT.NEXTTCPOS) == 'Head1_TC1', ParkX1, ParkFrnX1)
local MyParkB1 = ParkB1
local MyParkC1 = ParkC1
-- se ho due teste oppure è progress, significa che ho CU verticale
if EgtGetHeadId('H21') or bProgress then
if EgtGetHeadId('H21') or Progress or SecondToolChanger then
MyParkB1 = EgtIf( GetHeadTCSet( EMT.NEXTHEAD, EMT.NEXTTCPOS) == 'Head1_TC1', ParkB1, ParkFrnB1)
MyParkC1 = EgtIf( GetHeadTCSet( EMT.NEXTHEAD, EMT.NEXTTCPOS) == 'Head1_TC1', ParkC1, ParkFrnC1)
-- altrimenti su one CU speciale motosega-utensile lungo
@@ -752,6 +780,7 @@ function OnSimulMachiningStart()
EMT.VMRS = ( EMT.MCHTYPE ~= MCH_MY.DRILLING and not EMT.MCHUSERNOTES:find( 'VMRS=0;', 1, true))
EMT.MCHSPLIT = ( EMT.MCHUSERNOTES:find( 'Split;', 1, true) ~= nil)
EMT.MCHPRECUT = ( EMT.MCHUSERNOTES:find( 'Precut;', 1, true) ~= nil)
EMT.MCHCUT = ( EMT.MCHUSERNOTES:find( 'Cut;', 1, true) ~= nil)
-- recupero TASKID della feature lavorata
local vId = EgtGetMachiningGeometry()
if vId and #vId > 0 and #vId[1] > 0 then
@@ -945,7 +974,12 @@ function OnSimulMoveStart()
-- pinza 5
if EMT.W2DELTA then
EMT.A5n = 'W'
EMT.A5m = 'T'
local dPosQW = EgtGetAxisPos( 'QW') or 0
if dPosQW < 1 then
EMT.A5m = nil
else
EMT.A5m = 'T'
end
EMT.A5 = EMT.L1 + EMT.W2DELTA - EMT.A4
VerifyWStroke( EMT.A5)
end
@@ -954,6 +988,7 @@ function OnSimulMoveStart()
VerifyY2Stroke( EMT.A2)
VerifyV1Stroke( EMT.A3)
VerifyV2Stroke( EMT.A4)
-- se devo subito parcheggiare i rulli
local nRes = 0
if bParkV then
@@ -965,6 +1000,12 @@ function OnSimulMoveStart()
end
-- se movimento in rapido ad inizio lavorazione
if EMT.MOVE == 0 and EMT.MOVEIND <= 3 then
-- gestione speciale per pezzi molto alti. Se il movimento successivo è più alto del precedente, allora prendo il successivo
if EMT.L3s then
if EMT.L3s > EMT.L3 then
EMT.L3 = EMT.L3s
end
end
-- Dati
local B1Pos = EgtGetAxisPos( 'B1')
local B1Home = EgtGetAxisHomePos( 'B1')
@@ -979,20 +1020,52 @@ function OnSimulMoveStart()
-- se movimento iniziale da Zmax con lama o fresa
if EMT.ZMAX or EMT.FLAG == 1 or ( EMT.FLAG == 2 and EMT.FLAG2 == 1) then
--EgtOutBox( 'Flag 2,1', 'Info Rapid')
local bMoveZbeforeX = false
local dZref = EMT.L3
if EMT.HEAD == 'H12' and ( EgtIf( BD.RIGHT_LOAD, -EMT.L2 < -LimX1RotSaw, -EMT.L2 > -LimX1RotSaw) or EMT.R2 < -91) then
dZref = Z1Home + GetZExtra( EMT.HEAD, EMT.R2) - 100
end
-- se la quota di lavoro è più in alta della posizione a ZHOME della testa, prima si va alla Z di lavoro e poi si approccia il pezzo
if EMT.L3 > dZref then
bMoveZbeforeX = true
end
-- se vado in posizione speciale rotazione assi, poi devo ritornare alla X vera di lavoro
local dMoveXtoFinalPosition = false
local dXref = EMT.L2
if EMT.HEAD == 'H12' and -EMT.L2 < -LimX1PlRotSaw then
dXref = LimX1PlRotSaw
SimulMoveAxis( 'X1', dXref, MCH_SIM_STEP.RAPID)
dZref = max( EMT.L3, Z1Home + GetZExtra( EMT.HEAD, EMT.R2))
dMoveXtoFinalPosition = true
elseif not bMoveZbeforeX then
SimulMoveAxis( 'X1', dXref, MCH_SIM_STEP.RAPID)
else
SimulMoveAxis( 'X1', LimX1PlRotSaw, MCH_SIM_STEP.RAPID)
dZref = max( EMT.L3, Z1Home + GetZExtra( EMT.HEAD, EMT.R2))
dMoveXtoFinalPosition = true
end
SimulMoveAxis( 'X1', dXref, MCH_SIM_STEP.RAPID)
local dZref = EMT.L3
if EMT.HEAD == 'H12' and ( EgtIf( not EgtGetHeadId( 'H21') or BD.RIGHT_LOAD, -EMT.L2 < -LimX1RotSaw, -EMT.L2 > -LimX1RotSaw) or EMT.R2 < -91) then
dZref = Z1Home + GetZExtra( EMT.HEAD, EMT.R2) - 100
end
-- caso speciale per trave alta con rotazione lama pericolosa (tolto "and EMT.SB > 379")
if EMT.HEAD == 'H12' and abs( C1Pos - EMT.R1) > 1 and ( abs( C1Home - EMT.R1) > 30.1 or abs(B1Home - EMT.R2) > 30.1) then
SimulMoveAxis( 'B1', 0, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'C1', EMT.R1, MCH_SIM_STEP.COLLROT)
SimulMoveAxes( 'Z1', dZref, MCH_SIM_STEP.RAPID, 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
-- se movimento di B > di 90°, spezza il movimento in 2 arrivando alla quota Z con B+-90 e poi muove l'ultimo segmento
-- evita collisione con carro X
if EMT.R2 > 91 or EMT.R2 < -91 then
local dBref = EgtClamp( EMT.R2, -91, 91)
SimulMoveAxes( 'Z1', dZref, MCH_SIM_STEP.RAPID, 'B1', dBref, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
else
SimulMoveAxes( 'Z1', dZref, MCH_SIM_STEP.RAPID, 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
end
if bMoveZbeforeX then
SimulMoveAxis( 'Z1', EMT.L3, MCH_SIM_STEP.RAPID)
end
if dMoveXtoFinalPosition then
SimulMoveAxis( 'X1', EMT.L2, MCH_SIM_STEP.RAPID)
end
-- caso standard
else
SimulMoveAxis( 'Z1', dZref, MCH_SIM_STEP.RAPID)
@@ -1002,9 +1075,9 @@ function OnSimulMoveStart()
end
-- altrimenti sega a catena
else
local dPosA = GetCurrChainSawingVirtualAxis()
-- se anche precedente con sega a catena ma depositata, devo riprenderla
if EMT.CHSAW_OUT then
local dPosA = GetCurrChainSawingVirtualAxis()
EgtSetMode( EgtGetHeadId( EMT.HEAD), GDB_MD.HIDDEN)
OnSimulToolDeselect()
EgtLoadTool( EMT.HEAD, 1, EMT.TOOL)
@@ -1033,31 +1106,52 @@ function OnSimulMoveStart()
else
if GetHeadTCSet( EMT.HEAD, EMT.TCPOS) == 'Head1_TC2' then
-- se movimento iniziale da Zmax con lama o fresa
if EMT.HEAD == 'H11' or EMT.HEAD == 'H12' then
if EMT.HEAD == 'H11' or EMT.HEAD == 'H12' or EMT.HEAD == 'H17' then
if EMT.ZMAX or EMT.FLAG == 1 or ( EMT.FLAG == 2 and EMT.FLAG2 == 1) then
--EgtOutBox( 'Flag 2,1', 'Info Rapid')
SimulMoveAxis( 'X1', EMT.L2, MCH_SIM_STEP.RAPID)
local bMoveZbeforeX = false
local dZref = EMT.L3
if EMT.HEAD == 'H12' and ( -EMT.L2 < -LimX1RotSaw or EMT.R2 > 91) then
if EMT.HEAD == 'H12' and ( EgtIf( BD.RIGHT_LOAD, -EMT.L2 < -LimX1RotSaw, -EMT.L2 > -LimX1RotSaw) or EMT.R2 > 91) then
dZref = Z1Home + GetZExtra( EMT.HEAD, EMT.R2) - 100
end
-- se la quota di lavoro è più in alta della posizione a ZHOME della testa, prima si va alla Z di lavoro e poi si approccia il pezzo
if EMT.L3 > dZref then
bMoveZbeforeX = true
end
if not bMoveZbeforeX then
SimulMoveAxis( 'X1', EMT.L2, MCH_SIM_STEP.RAPID)
else
SimulMoveAxis( 'X1', LimX1RotSawTC2, MCH_SIM_STEP.RAPID)
end
-- caso speciale per trave alta con rotazione lama pericolosa (tolto "and EMT.SB > 400")
if EMT.HEAD == 'H12' and abs( C1Pos - EMT.R1) > 1 and ( abs( C1Home - EMT.R1) > 30.1 or abs(B1Home - EMT.R2) > 30.1) then
SimulMoveAxis( 'B1', 0, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'C1', EMT.R1, MCH_SIM_STEP.COLLROT)
SimulMoveAxes( 'Z1', dZref, MCH_SIM_STEP.RAPID, 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
-- se movimento di B > di 90°, spezza il movimento in 2 arrivando alla quota Z con B+-90 e poi muove l'ultimo segmento
-- evita collisione con carro X
if EMT.R2 > 91 or EMT.R2 < -91 then
local dBref = EgtClamp( EMT.R2, -91, 91)
SimulMoveAxes( 'Z1', dZref, MCH_SIM_STEP.RAPID, 'B1', dBref, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
else
SimulMoveAxes( 'Z1', dZref, MCH_SIM_STEP.RAPID, 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
end
if bMoveZbeforeX then
SimulMoveAxis( 'Z1', EMT.L3, MCH_SIM_STEP.RAPID)
end
-- caso standard
else
SimulMoveAxis( 'Z1', dZref, MCH_SIM_STEP.RAPID)
SimulMoveAxis( 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'C1', EMT.R1, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'B1', EMT.R2, MCH_SIM_STEP.COLLROT)
end
end
-- altrimenti sega a catena (H13 o H15)
else
local dPosA = GetCurrChainSawingVirtualAxis()
-- se anche precedente con sega a catena ma depositata, devo riprenderla
if EMT.CHSAW_OUT then
local dPosA = GetCurrChainSawingVirtualAxis()
EgtSetMode( EgtGetHeadId( EMT.HEAD), GDB_MD.HIDDEN)
OnSimulToolDeselect()
EgtLoadTool( EMT.HEAD, 1, EMT.TOOL)
@@ -1095,28 +1189,53 @@ function OnSimulMoveStart()
-- se movimento iniziale da Zmax con lama o fresa
if EMT.ZMAX or EMT.FLAG == 1 or ( EMT.FLAG == 2 and EMT.FLAG2 == 1) then
--EgtOutBox( 'Flag 2,1', 'Info Rapid')
SimulMoveAxis( 'X2', EMT.L2, MCH_SIM_STEP.RAPID)
local bMoveZbeforeX = false
local dZref = EMT.L3
if EMT.HEAD == 'H22' and ( EgtIf( BD.RIGHT_LOAD, EMT.L2 < -LimX2RotSaw, EMT.L2 > -LimX2RotSaw) or EMT.R2 > 91) then
if EMT.HEAD == 'H22' and ( EgtIf( BD.RIGHT_LOAD, -EMT.L2 < -LimX1RotSaw, -EMT.L2 > -LimX1RotSaw) or EMT.R2 > 91) then
dZref = Z2Home + GetZExtra( EMT.HEAD, EMT.R2) - 100
end
-- caso speciale per trave alta con rotazione lama pericolosa (tolto "and EMT.SB > 379")
if EMT.HEAD == 'H22' and abs( C2Pos - EMT.R1) > 1 and ( abs( C2Home - EMT.R1) > 30.1 or abs(B2Home - EMT.R2) > 30.1) then
SimulMoveAxis( 'B2', 0, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'C2', EMT.R1, MCH_SIM_STEP.COLLROT)
SimulMoveAxes( 'Z2', dZref, MCH_SIM_STEP.RAPID, 'B2', EMT.R2, MCH_SIM_STEP.COLLROT)
-- caso standard
-- se la quota di lavoro è più in alta della posizione a ZHOME della testa, prima si va alla Z di lavoro e poi si approccia il pezzo
if EMT.L3 > dZref then
bMoveZbeforeX = true
end
if not bMoveZbeforeX then
SimulMoveAxis( 'X2', EMT.L2, MCH_SIM_STEP.RAPID)
else
SimulMoveAxis( 'Z2', dZref, MCH_SIM_STEP.RAPID)
SimulMoveAxis( 'B2', EMT.R2, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'C2', EMT.R1, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'X2', LimX2RotSaw, MCH_SIM_STEP.RAPID)
end
-- caso speciale per trave alta con rotazione lama pericolosa (tolto "and EMT.SB > 379")
if abs( C2Pos - EMT.R1) > 1 and ( abs( C2Home - EMT.R1) > 30.1 or abs( B2Home - EMT.R2) > 30.1) then
if EMT.HEAD == 'H22' then
SimulMoveAxis( 'B2', 0, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'C2', EMT.R1, MCH_SIM_STEP.COLLROT)
-- se movimento di B > di 90°, spezza il movimento in 2 arrivando alla quota Z con B+-90 e poi muove l'ultimo segmento
-- evita collisione con carro X
if EMT.R2 > 91 or EMT.R2 < -91 then
local dBref = EgtClamp( EMT.R2, -91, 91)
SimulMoveAxes( 'Z2', dZref, MCH_SIM_STEP.RAPID, 'B2', dBref, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'B2', EMT.R2, MCH_SIM_STEP.COLLROT)
else
SimulMoveAxes( 'Z2', dZref, MCH_SIM_STEP.RAPID, 'B2', EMT.R2, MCH_SIM_STEP.COLLROT)
end
if bMoveZbeforeX then
SimulMoveAxis( 'Z2', EMT.L3, MCH_SIM_STEP.RAPID)
end
-- caso standard
else
SimulMoveAxis( 'Z2', dZref, MCH_SIM_STEP.RAPID)
SimulMoveAxis( 'B2', EMT.R2, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'C2', EMT.R1, MCH_SIM_STEP.COLLROT)
if bMoveZbeforeX then
SimulMoveAxis( 'Z2', EMT.L3, MCH_SIM_STEP.RAPID)
end
end
end
end
-- altrimenti sega a catena
else
local dPosA = GetCurrChainSawingVirtualAxis()
-- se anche precedente con sega a catena ma depositata, devo riprenderla
if EMT.CHSAW_OUT then
local dPosA = GetCurrChainSawingVirtualAxis()
EgtSetMode( EgtGetHeadId( EMT.HEAD), GDB_MD.HIDDEN)
OnSimulToolDeselect()
EgtLoadTool( EMT.HEAD, 1, EMT.TOOL)
@@ -1209,6 +1328,7 @@ function OnSimulMoveStart()
EMT.A4 = EgtIf( GetV2ToClose(), EMT.V2NEXTPOS, ParkV2)
end
EMT.ZMAX = nil
EMT.XHOME = nil
end
---------------------------------------------------------------------
@@ -1261,7 +1381,7 @@ function OnSimulMoveEnd()
-- eventuale rimozione sfridi
ExecRemoveScraps()
-- se Split o Presplit lascio agganciata solo la pinza Y2 alla fine dei movimenti
local sNextTool = GetNextTool( EMT.MCHID)
local sNextTool = GetNextTool( EMT.MCHID, true)
-- vado in home se è ultimo movimento ed è ultima lavorazione, se sono con motosega e devo cambiare utensile, oppure se ho la lama
local bToXhome = ( IsLastPath( EMT.PATHID) and not sNextTool) or ( EMT.HEAD == 'H23' and EMT.TOOL ~= sNextTool) or ( EMT.HEAD == 'H13' and EMT.TOOL ~= sNextTool) or
( EMT.HEAD == 'H12' and EMT.TOOL ~= sNextTool ) or ( EMT.HEAD == 'H22' and EMT.TOOL ~= sNextTool) or EMT.MCHSPLIT
@@ -1317,6 +1437,10 @@ function ExecAuxCmd( sCmd, bPathStart)
ExecOpenRoller( 1)
ExecOpenRoller( 2)
local sV1, MoveV1, sV2, MoveV2 = CalcMoveV1V2ForAuxCmd( Cmd)
-- se stringo i rulli e ho lama, verifico che sia in home
if MoveV1 and MoveV1 < 400 and ( EMT.HEAD == 'H12' or EMT.HEAD == 'H22') and EMT.ZMAX and not EMT.XHOME then
ExecMoveZmax( false, true)
end
local bOk, bOk1, bOk2, bOk3 = SimulMoveAxes( Cmd[2], tonumber( Cmd[3]), MCH_SIM_STEP.RAPID,
sV1, MoveV1, MCH_SIM_STEP.RAPID,
sV2, MoveV2, MCH_SIM_STEP.RAPID)
@@ -1339,6 +1463,10 @@ function ExecAuxCmd( sCmd, bPathStart)
ExecOpenRoller( 1)
ExecOpenRoller( 2)
local sV1, MoveV1, sV2, MoveV2 = CalcMoveV1V2ForAuxCmd( Cmd)
-- se stringo i rulli e ho lama, verifico che sia in home
if MoveV1 and MoveV1 < 400 and ( EMT.HEAD == 'H12' or EMT.HEAD == 'H22') and EMT.ZMAX and not EMT.XHOME then
ExecMoveZmax( false, true)
end
local bOk, bOk1, bOk2, bOk3, bOk4 = SimulMoveAxes( Cmd[2], tonumber( Cmd[3]), MCH_SIM_STEP.RAPID,
Cmd[4], tonumber( Cmd[5]), MCH_SIM_STEP.RAPID,
sV1, MoveV1, MCH_SIM_STEP.RAPID,
@@ -1362,6 +1490,10 @@ function ExecAuxCmd( sCmd, bPathStart)
ExecOpenRoller( 1)
ExecOpenRoller( 2)
local sV1, MoveV1, sV2, MoveV2 = CalcMoveV1V2ForAuxCmd( Cmd)
-- se stringo i rulli e ho lama, verifico che sia in home
if MoveV1 and MoveV1 < 400 and ( EMT.HEAD == 'H12' or EMT.HEAD == 'H22') and EMT.ZMAX and not EMT.XHOME then
ExecMoveZmax( false, true)
end
local bOk, bOk1, bOk2, bOk3, bOk4, bOk5 = SimulMoveAxes( Cmd[2], tonumber( Cmd[3]), MCH_SIM_STEP.RAPID,
Cmd[4], tonumber( Cmd[5]), MCH_SIM_STEP.RAPID,
Cmd[6], tonumber( Cmd[7]), MCH_SIM_STEP.RAPID,
@@ -1383,7 +1515,7 @@ function ExecAuxCmd( sCmd, bPathStart)
ExecMoveHome( Cmd[2] == '1', EgtIf( bPathStart, false, EMT.MCHSPLIT))
elseif Cmd[1] == '11' then
local bClose = Cmd[2] ~= '0'
if bPathStart and EMT.MCHSPLIT and not EMT.FALL and GetPY2Light() then bClose = false end
if bPathStart and EMT.MCHSPLIT and not ( EMT.FALL or EMT.TO_FALL) and GetPY2Light() then bClose = false end
ExecMovePY1( bClose)
elseif Cmd[1] == '12' then
ExecMovePY2( Cmd[2] ~= '0')
@@ -1501,7 +1633,15 @@ function ExecMoveHome( bNearV, bMchSplit)
EMT.CHSAW_OUT = true
end
-- porto le teste in home
SimulMoveAxes( 'X1', ParkX1, MCH_SIM_STEP.RAPID, 'X2', ParkX2, MCH_SIM_STEP.RAPID)
if EgtGetHeadId( 'H21') then
SimulMoveAxes( 'X1', ParkX1, MCH_SIM_STEP.RAPID, 'X2', ParkX2, MCH_SIM_STEP.RAPID)
else
if GetHeadTCSet( EMT.HEAD, EMT.TCPOS) == 'Head1_TC1' then
SimulMoveAxes( 'X1', ParkX1, MCH_SIM_STEP.RAPID)
else
SimulMoveAxes( 'X1', ParkFrnX1, MCH_SIM_STEP.RAPID)
end
end
-- sistemo i rulli
ExecOpenRoller( 1)
ExecOpenRoller( 2)
@@ -1542,8 +1682,8 @@ function ExecMoveZmax( bMchSplit, btoXHome)
if GetHeadTCSet( EMT.HEAD, EMT.TCPOS) == 'Head1_TC1' then
if not HeadIsChainSaw( EMT.HEAD) then
if abs( HomeC - CurrC) > 0.1 or abs( HomeB - CurrB) > 0.1 then
local dZref = HomeZ + GetZExtra( EMT.HEAD, CurrB)
if EgtIf( not EgtGetHeadId( 'H21') or BD.RIGHT_LOAD, -CurrX < -LimX1RotSaw, -CurrX > -LimX1RotSaw) then
local dZref = HomeZ + GetZExtra( EMT.HEAD, EgtClamp( CurrB, -90, 90))
if EgtIf( BD.RIGHT_LOAD, -CurrX < -LimX1RotSaw, -CurrX > -LimX1RotSaw) then
dZref = dZref - EgtIf( not Mortiser, 100, 370)
end
SimulMoveAxes( 'Z1', EgtIf( dZref > CurrZ, dZref, CurrZ), MCH_SIM_STEP.RAPID, 'B1', EgtClamp( CurrB, -90, 90), MCH_SIM_STEP.COLLROT)
@@ -1555,6 +1695,7 @@ function ExecMoveZmax( bMchSplit, btoXHome)
end
SimulMoveAxis( 'Z1', MaxZ1, MCH_SIM_STEP.RAPID)
if btoXHome then
EMT.XHOME = true
SimulMoveAxis( 'X1', ParkX1, MCH_SIM_STEP.RAPID)
end
-- se lavorazione in doppio
@@ -1566,6 +1707,7 @@ function ExecMoveZmax( bMchSplit, btoXHome)
SimulMoveAxes( 'B2', ParkB2, MCH_SIM_STEP.COLLROT, 'C2', ParkC2, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'Z2', MaxZ2, MCH_SIM_STEP.RAPID)
if bToXHome then
EMT.XHOME = true
SimulMoveAxis( 'X2', ParkX2, MCH_SIM_STEP.RAPID)
end
EMT.DOU_TO_ZMAX = nil
@@ -1573,40 +1715,60 @@ function ExecMoveZmax( bMchSplit, btoXHome)
-- altrimenti sega a catena
else
SimulMoveAxes( 'Z1', HomeZ, MCH_SIM_STEP.RAPID, 'B1', HomeB, MCH_SIM_STEP.COLLROT)
if EMT.SB > 650 and abs( EMT.R3) < 0.1 then
if EMT.R3 and abs( EMT.R3) < 0.1 then
SimulMoveAxis( 'Z1', ParkCSawZ1, MCH_SIM_STEP.RAPID)
end
SimulMoveAxes( 'X1', HomeX, MCH_SIM_STEP.RAPID, 'C1', HomeC, MCH_SIM_STEP.COLLROT)
end
else
-- se sega a catena
-- se fresa o lama
if not HeadIsChainSaw( EMT.HEAD) then
if abs( HomeC - CurrC) > 0.1 or abs( HomeB - CurrB) > 0.1 then
local dZref = HomeZ + GetZExtra( EMT.HEAD, CurrB)
SimulMoveAxes( 'Z1', EgtIf( dZref > CurrZ, dZref, CurrZ), MCH_SIM_STEP.RAPID, 'B1', EgtClamp( CurrB, -90, 90), MCH_SIM_STEP.COLLROT)
if EMT.HEAD == 'H12' and ( abs( HomeC - CurrC) > 30.1 or abs( HomeB - CurrB) > 30.1) then
SimulMoveAxes( 'Z1', MaxZ1, MCH_SIM_STEP.RAPID, 'B1', 0, MCH_SIM_STEP.COLLROT)
end
SimulMoveAxes( 'Z1', MaxZ1, MCH_SIM_STEP.RAPID, 'B1', 0, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'C1', HomeC, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'B1', HomeB, MCH_SIM_STEP.COLLROT)
end
SimulMoveAxis( 'Z1', MaxZ1, MCH_SIM_STEP.RAPID)
if btoXHome then
SimulMoveAxis( 'X1', ParkX1, MCH_SIM_STEP.RAPID)
EMT.XHOME = true
SimulMoveAxis( 'X1', HomeX, MCH_SIM_STEP.RAPID)
end
-- altrimenti sega a catena
else
-- controlla che l'ingombro della sega a catena non possa collidere durante il suo riposizionamento
local dChSawEncumbrance = sqrt( pow( EgtTdbGetCurrToolParam( MCH_TP.TOTLEN), 2) + pow( ChSawLen + MillOffs, 2))
if EMT.ADIR and EMT.TDIR then
-- direzione versore sega a catena X- (copre anche eventuali inclinazioni in Y)
if EMT.TDIR[1] <= 0 then
-- ingombro massimo di quota Z (senza pivot) + ingombro massimo sega + altezza pezzo + altezza sicurezza
local dEncumbranceTot = EMT.L3p + MillOffs - dChSawEncumbrance - EMT.SB - 30
-- nuova quota Z intermedia
local dZUp = EMT.L3p + ( DeltaTabZ - dEncumbranceTot)
-- se la nuova quota è minore della quota di parcheggio
if dZUp <= ParkCSawZ1 then
-- se B è oltre il punto di massimo ingombro (con l'inclinazione attuale non ha il massimo ingombro)
if asin( EMT.TDIR[3] / 1) > asin( EgtTdbGetCurrToolParam( MCH_TP.TOTLEN) / dChSawEncumbrance) and ( dEncumbranceTot < DeltaTabZ) then
SimulMoveAxis( 'Z1', dZUp, MCH_SIM_STEP.RAPID)
end
end
end
end
SimulMoveAxes( 'Z1', HomeZ, MCH_SIM_STEP.RAPID, 'B1', HomeB, MCH_SIM_STEP.COLLROT)
if EMT.SB > 650 and abs( EMT.R3) < 0.1 then
if EMT.R3 and abs( EMT.R3) < 0.1 then
SimulMoveAxis( 'Z1', ParkCSawZ1, MCH_SIM_STEP.RAPID)
end
if btoXHome then
EgtUnloadTool( EMT.HEAD, 1)
ShowToolInTcPos( EMT.TCPOS, true)
-- nascondo l'utensile sulla testa
EgtSetMode( EgtGetHeadId( EMT.HEAD or '') or GDB_ID.NULL, GDB_MD.HIDDEN)
EMT.PREVTOOL_H1 = nil
EMT.PREVHEAD_H1 = nil
EMT.PREVTCPOS_H1 = nil
EMT.CHSAW_OUT = true
EMT.XHOME = true
end
SimulMoveAxes( 'X1', HomeX, MCH_SIM_STEP.RAPID, 'C1', HomeC, MCH_SIM_STEP.COLLROT)
end
@@ -1627,15 +1789,34 @@ function ExecMoveZmax( bMchSplit, btoXHome)
end
SimulMoveAxis( 'Z2', MaxZ2, MCH_SIM_STEP.RAPID)
if btoXHome then
EMT.XHOME = true
SimulMoveAxis( 'X2', ParkX2, MCH_SIM_STEP.RAPID)
end
-- altrimenti sega a catena
-- altrimenti sega a catena
else
-- controlla che l'ingombro della sega a catena non possa collidere durante il suo riposizionamento
local dChSawEncumbrance = sqrt( pow( EgtTdbGetCurrToolParam( MCH_TP.TOTLEN), 2) + pow( ChSawLen + Mill2Offs, 2))
if EMT.ADIR and EMT.TDIR then
-- direzione versore sega a catena X- (copre anche eventuali inclinazioni in Y)
if EMT.TDIR[1] <= 0 then
-- ingombro massimo di quota Z (senza pivot) + ingombro massimo sega + altezza pezzo + altezza sicurezza
local dEncumbranceTot = EMT.L3p + Mill2Offs - dChSawEncumbrance - EMT.SB - 30
-- nuova quota Z intermedia
local dZUp = EMT.L3p + ( DeltaTabZ - dEncumbranceTot)
-- se la nuova quota è minore della quota di parcheggio
if dZUp <= ParkCSawZ2 then
-- se B è oltre il punto di massimo ingombro (con l'inclinazione attuale non ha il massimo ingombro)
if asin( EMT.TDIR[3] / 1) > asin( EgtTdbGetCurrToolParam( MCH_TP.TOTLEN) / dChSawEncumbrance) and ( dEncumbranceTot < DeltaTabZ) then
SimulMoveAxis( 'Z2', dZUp, MCH_SIM_STEP.RAPID)
end
end
end
end
SimulMoveAxes( 'Z2', HomeZ, MCH_SIM_STEP.RAPID, 'B2', HomeB, MCH_SIM_STEP.COLLROT)
if EMT.SB > 650 and abs( EMT.R3) < 0.1 then
if EMT.R3 and abs( EMT.R3) < 0.1 then
SimulMoveAxis( 'Z2', ParkCSawZ2, MCH_SIM_STEP.RAPID)
end
SimulMoveAxes( 'X2', HomeX, MCH_SIM_STEP.RAPID, 'C2', HomeC, MCH_SIM_STEP.COLLROT)
SimulMoveAxes( 'X2', ParkCSawX2, MCH_SIM_STEP.RAPID, 'C2', HomeC, MCH_SIM_STEP.COLLROT)
end
end
EMT.ZMAX = true
@@ -1710,16 +1891,163 @@ function ExecUnloading()
end
end
---------------------------------------------------------------------
function CheckClamping( sClampName)
nIndexClamp = EgtGetAxisId( sClampName)
local idClampPath = EgtGetFirstInGroup( EgtGetFirstNameInGroup( nIndexClamp, 'CLAMP_CHECK') or GDB_ID.NULL)
local b3ClampingArea = EgtGetBBoxGlob( idClampPath or GDB_ID.NULL, GDB_BB.STANDARD)
-- se non trovo percorso area di clamping, esco subito
if not idClampPath or not EMT.VMILL or not ClampingCoeffMin then
return
end
local function GetCurveListFromIntersection( sPosIntersPlane, sIntersPlane, dDepth)
local idCurveList = {}
local vtIntersPlane
-- piano di interpolazione
if sIntersPlane == 'X' then
vtIntersPlane = X_AX()
elseif sIntersPlane == 'Y' then
vtIntersPlane = Y_AX()
elseif sIntersPlane == 'Z' then
vtIntersPlane = Z_AX()
end
for i = 1, #EMT.VMILL do
local b3VMill = EgtGetBBoxGlob( EMT.VMILL[i], GDB_BB.EXACT)
local ptPosIntersPlane
if sPosIntersPlane == 'MIN' then
ptPosIntersPlane = b3VMill:getMin() + dDepth * vtIntersPlane
elseif sPosIntersPlane == 'MAX' then
ptPosIntersPlane = b3VMill:getMax() - dDepth * vtIntersPlane
end
local idLoop, nLoopCnt = EgtPlaneVolZmapInters( ptPosIntersPlane, vtIntersPlane, EMT.VMILL[i], CLAMP_CHECK_INTERS, GDB_RT.GLOB)
-- se c'è almeno una curva
if idLoop then
for j = 1, nLoopCnt do
local idLoopTemp = idLoop + j - 1
table.insert( idCurveList, idLoopTemp)
end
end
end
return idCurveList
end
local function CalculateIntersectionArea( sPosIntersPlane, sIntersPlane, dDepth)
-- test piano frontale
local idCurveList = GetCurveListFromIntersection( sPosIntersPlane, sIntersPlane, dDepth)
-- si copia curva intersezione e curva pinza in gruppo di confronto
local idFlatSurf, nFlatSurfCnt = EgtSurfFlatRegion( CLAMP_CHECK_GROUP, idCurveList)
local idClampSurf = EgtSurfFlatRegion( CLAMP_CHECK_GROUP, idClampPath)
if idFlatSurf then
local dTotalArea = 0
local dTotalXLenght = 0
for k = 1, nFlatSurfCnt do
local idTempSurf = idFlatSurf + k - 1
EgtSurfFrIntersect( idTempSurf, idClampSurf)
if idTempSurf then
dTotalArea = dTotalArea + ceil( EgtSurfArea( idTempSurf) or 0)
local b3BoxIntersectionBox = EgtGetBBoxGlob( idTempSurf, GDB_BB.STANDARD)
if b3BoxIntersectionBox then
dTotalXLenght = dTotalXLenght + ceil( b3BoxIntersectionBox:getDimX()) -- somma lunghezze (x) delle aree pinzate
end
end
end
return dTotalArea, dTotalXLenght
end
return 0
end
-- minima area considerata per un corretto pinzaggio
DistZClampToTable = DistZClampToTable or 0
local MinJoin = BD.GetMinJoin( EMT.HB, EMT.SB, EgtIf( EMT.SPLIT, EMT.LT, EMT.LB))
local MinZClamping = min( b3ClampingArea:getDimZ() + DistZClampToTable, EMT.SB) - DistZClampToTable
-- si moltiplica per un coefficiente minimo sotto al quale si da l'errore di pinzaggio
ClampingCoeffMin = EgtClamp( ClampingCoeffMin, 0.01, 1)
local dMinClampingAreaWarn = ( MinJoin * MinZClamping) * ClampingCoeffMin
local dMinClampingAreaErr = ( MinJoin * MinZClamping) * ( ClampingCoeffMin / 3)
local bError = true
local sWrn, sErr
local bWriteWarnMessage = false
local bWriteErrMessage = false
-- controllo faccia frontale
local dArea, dXClampedLenght = CalculateIntersectionArea( 'MIN', 'Y', 3)
-- ERRORE: pinza troppo poco (meno di 1/3 del minimo richiesto)
if dArea and dArea < dMinClampingAreaErr then
-- solo se pinza almeno 1cm2, e la somma della lunghezza pinzata è maggiore della lunghezza minima pinzabile da Warning e non errore
if dXClampedLenght >= MinJoin * ClampingCoeffMin and dArea > 1000 then
bError = false
end
-- pinzaggio non fattibile, errore
if bError then
sErr = 'ERROR CLAMPING ' .. sClampName .. ' : '..tostring( ceil( ( dArea / dMinClampingAreaWarn) * 100))..'% ( '.. tostring( dArea/1000)..'cm2)'
bWriteErrMessage = true
end
end
-- WARNING: pinza meno del minimo richiesto
if dArea and dArea < dMinClampingAreaWarn and not bWriteErrMessage then
sWrn = 'WARNING CLAMPING ' .. sClampName .. ' : '..tostring( ceil( ( dArea / dMinClampingAreaWarn) * 100))..'% ( '.. tostring( dArea/1000)..'cm2)'
bWriteWarnMessage = true
end
EgtEmptyGroup( CLAMP_CHECK_GROUP)
EgtEmptyGroup( CLAMP_CHECK_INTERS)
-- controllo altro lato solo se non sono già in errore
if not bWriteErrMessage then
-- controllo faccia posteriore
dArea = CalculateIntersectionArea( 'MAX', 'Y', 3)
-- ERRORE: pinza troppo poco (meno di 1/3 del minimo richiesto)
if dArea and dArea < dMinClampingAreaErr then
-- solo se pinza almeno 1cm2, e la somma della lunghezza pinzata è maggiore della lunghezza minima pinzabile da Warning e non errore
if dXClampedLenght >= MinJoin * ClampingCoeffMin and dArea > 1000 then
bError = false
end
-- pinzaggio non fattibile, errore
if bError then
sErr = 'ERROR CLAMPING ' .. sClampName .. ' : '..tostring( ceil( ( dArea / dMinClampingAreaWarn) * 100))..'% ( '.. tostring( dArea/1000)..'cm2)'
bWriteErrMessage = true
end
end
-- WARNING: pinza meno del minimo richiesto
if dArea and dArea < dMinClampingAreaWarn and not bWriteWarnMessage and not bWriteErrMessage then
sWrn = 'WARNING CLAMPING ' .. sClampName .. ' : '..tostring( ceil( ( dArea / dMinClampingAreaWarn) * 100))..'% ( '.. tostring( dArea/1000)..'cm2)'
bWriteWarnMessage = true
end
EgtEmptyGroup( CLAMP_CHECK_GROUP)
EgtEmptyGroup( CLAMP_CHECK_INTERS)
end
if bWriteErrMessage then
EmtSetLastError( 1213, sErr, EgtGetEnableUI())
EgtOutBox( sErr, 'CLAMPING', 'ERROR', 'OK')
EmtSetSimulPause()
elseif bWriteWarnMessage then
EgtOutLog( sWrn)
EgtOutBox( sWrn, 'CLAMPING', 'WARNING', 'OK')
EmtSetSimulPause()
end
end
---------------------------------------------------------------------
function ExecMovePY1( bClose)
SimulMoveAxis( 'PY1', EgtIf( not bClose, MaxHoOpen, EMT.HB), MCH_SIM_STEP.RAPID)
SetPY1Light( bClose)
if bClose then
CheckClamping( 'PY1')
end
end
---------------------------------------------------------------------
function ExecMovePY2( bClose)
SimulMoveAxis( 'PY2', EgtIf( not bClose, MaxHoOpen, EMT.HB), MCH_SIM_STEP.RAPID)
SetPY2Light( bClose)
if bClose then
CheckClamping( 'PY2')
end
end
---------------------------------------------------------------------
@@ -1762,8 +2090,20 @@ function ExecParkRoller( PosY1, PosY2, PosV1, PosV2, bSpliCut, bAgg)
local DiffY2 = MyParkY2 - PosY2
-- se appena eseguito taglio di separazione
if bSpliCut then
local dAddMove
-- se entrambe le morse si spostano vado in posizione calcolata
if DiffY1 > 0.1 and DiffY2 < -0.1 then
dAddMove = 0
-- se almeno una è rimasta ferma in posizione, allontano comunque di 30mm ulteriori
else
dAddMove = 30
end
local MoveY1 = max( DiffY1, 0.0)
local MoveY2 = min( DiffY2, 0.0)
MoveY1 = MoveY1 + dAddMove
MoveY2 = MoveY2 - dAddMove
-- aggancio i pezzi rimanenti all'asse Y1
LinkRemainingPartsToY1()
-- eseguo i movimenti
@@ -1811,7 +2151,7 @@ function ExecParkRoller( PosY1, PosY2, PosV1, PosV2, bSpliCut, bAgg)
local MoveV1 = ParkV1 - PosV1
local DiffY1 = MyParkY1 - PosY1
local MoveY1 = EgtIf( DiffY1 > 0.1, MoveV1, 0)
local TryMoveY1 = ParkV1 - PosT - EgtIf( bSpliCut or EMT.FALL, EMT.LT, 0) - EMT.HOVM
local TryMoveY1 = min( ParkV1 - PosT - EgtIf( bSpliCut or EMT.FALL, EMT.LT, 0) - EMT.HOVM, MaxY1 - PosY1 - 10)
if ( PosT > ParkV2 - ExtraParkV and PosT < ParkV1 and PosY1 + TryMoveY1 < MaxY1 and not EMT.W2DELTA) then MoveY1 = max( MoveY1, TryMoveY1) end
-- se appena eseguito taglio di separazione
if bSpliCut then
@@ -1841,7 +2181,7 @@ function ExecParkRoller( PosY1, PosY2, PosV1, PosV2, bSpliCut, bAgg)
local MoveV2 = ParkV2 - PosV2
local DiffY2 = MyParkY2 - PosY2
local MoveY2 = EgtIf( DiffY2 < -0.1, MoveV2, 0)
local TryMoveY2 = ParkV2 - PosT - EMT.LT - EMT.DELTA_LT - EMT.HOVM
local TryMoveY2 = max( ParkV2 - PosT - EMT.LT - EMT.DELTA_LT - EMT.HOVM, MinY2 - PosY2 + 10)
if ( PosT + EMT.LT + EMT.DELTA_LT + EMT.HOVM < ParkV1 + ExtraParkV and PosT + EMT.LT + EMT.DELTA_LT + EMT.HOVM > ParkV2 and PosY2 + TryMoveY2 > MinY2) then MoveY2 = min( MoveY2, TryMoveY2) end
if not SimulMoveAxes( 'T', PosT + MoveY2, MCH_SIM_STEP.RAPID,
'V1', ParkV1, MCH_SIM_STEP.RAPID,
@@ -2095,6 +2435,9 @@ end
---------------------------------------------------------------------
function GetV1ToClose()
if EMT.MCHPRECUT or EMT.MCHCUT then
return false
end
--EgtOutLog( string.format( 'L1m=%.3f L1M=%.3f V2NP=%.3f LB=%.3f', EMT.MAXMIN[1], EMT.MAXMAX[1], EMT.V2NEXTPOS, EMT.LB))
--EgtOutLog( string.format( 'LB=%.3f LT=%.3f', EMT.LB, EMT.LT or 0))
return ( EMT.MAXMAX[1] <= EMT.V1NEXTPOS + RollCageMin and EMT.MAXMIN[1] + EMT.LB >= EMT.V1NEXTPOS + RollCageMax)
@@ -2109,11 +2452,17 @@ end
---------------------------------------------------------------------
function ShowToolInTcPos( sTcPos, bShow)
-- recupero identificativo della posizione sul TC
local TcPosId = EgtGetTcPosId( sTcPos or '')
if not TcPosId then return end
-- recupero il gruppo dell'utensile
local TcExitId = EgtGetFirstNameInGroup( EgtGetTcPosId( sTcPos or '') or GDB_ID.NULL, 'T1')
local TcExitId = EgtGetFirstNameInGroup( TcPosId or GDB_ID.NULL, 'T1')
if not TcExitId then return end
-- imposto lo stato di visualizzazione
EgtSetStatus( TcExitId, EgtIf( bShow, GDB_ST.ON, GDB_ST.OFF))
-- recupero eventuale gruppo ausiliario da visualizzare/nascondere
local TcHSId = EgtGetFirstNameInGroup( TcPosId, sTcPos .. '_HS')
if TcHSId then EgtSetStatus( TcHSId, EgtIf( bShow, GDB_ST.ON, GDB_ST.OFF)) end
end
---------------------------------------------------------------------
@@ -2134,7 +2483,7 @@ function LoadNextTool( nHSet, sTcPosDef, bFirst)
if vTools and vTools[1] and #(vTools[1]) > 0 then
sTool = vTools[1]
sTcPos = sTcPosDef
if Progress then
if Progress or SecondToolChanger then
sHead = EgtIf( sTcPos == 'T11', 'H12', 'H11')
elseif nHSet == 1 then
sHead = EgtIf( sTcPos == 'T1', 'H12', 'H11')
@@ -2191,6 +2540,9 @@ local FALL_T = 2 * ESTIMATION_RAPID_COEFF -- s
---------------------------------------------------------------------
function OnEstimStart()
EMT.INCHES = not EgtUiUnitsAreMM() -- unità di misura mm/inches
EMT.FMAXPINZE = EgtClamp( MaxFeedPinze or 102000, 20000, 102000) -- feed massima pinze
EMT.MAXACC = MaxAcc or ( EMT.FMAXPINZE / ( 60 * 0.3)) -- accelerazione massima pinze
EMT.MINACC = MinAcc or ( EMT.FMAXPINZE / ( 60 * 4)) -- accelerazione minima pinze
end
---------------------------------------------------------------------
@@ -2276,6 +2628,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
@@ -2332,6 +2693,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
---------------------------------------------------------------------
@@ -2457,11 +2824,11 @@ 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), RAPID_X_FEED, EMT.SPLIT)
if dT1 > dTime then dTime = dT1 end
local dT2 = abs( dL2) / RAPID_Y_FEED * 60
local dT2 = CalcMoveTime( abs( dL2), EMT.FMAXPINZE, EMT.SPLIT)
if dT2 > dTime then dTime = dT2 end
local dT3 = abs( dL3) / RAPID_Z_FEED * 60
local dT3 = CalcMoveTime( abs( dL3), RAPID_Z_FEED, EMT.SPLIT)
if dT3 > dTime then dTime = dT3 end
local dT4 = abs( dR1) / RAPID_C_FEED * 60
if dT4 > dTime then dTime = dT4 end
@@ -2483,7 +2850,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 = 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
@@ -2704,7 +3071,7 @@ function GetNextChainSawingVirtualAxis( MchId)
end
---------------------------------------------------------------------
function GetNextTool( nMchId)
function GetNextTool( nMchId, bResetOnStart)
-- inizializzo prossimo utensile
local sNextTool
-- recupero lavorazione successiva
@@ -2712,7 +3079,7 @@ function GetNextTool( nMchId)
while nNextMchId do
-- se la prossima lavorazione è lo start di un altro pezzo, faccio finta che cambia utensile in modo che vada in parcheggio con utensili speciali
if EgtGetOperationType( nNextMchId) == MCH_OY.DISP then
if IsStartOrRestPhase( EMT.PHASE+1) then
if IsStartOrRestPhase( EMT.PHASE+1) and bResetOnStart then
return nil
end
else
@@ -2737,10 +3104,10 @@ end
---------------------------------------------------------------------
function RollerParkingNeeded( sHead, dAng1p, dAng2p, dAng1, dAng2)
if sHead == 'H11' or sHead == 'H12' or HeadIsChainSaw( sHead) then
return ( abs( dAng1 - dAng1p) > 1 or ( abs( dAng2 - dAng2p) > 1 and abs( dAng1 % 180.0) > 1))
if sHead == 'H11' or sHead == 'H12' or sHead == 'H17' or HeadIsChainSaw( sHead) then
return ( abs( dAng1 - dAng1p) > 1 or ( abs( dAng2 - dAng2p) > 1 and abs( dAng1) % 180.0 > 1))
elseif sHead == 'H21' or sHead == 'H22' or HeadIsChainSaw( sHead) then
return ( abs( dAng1 - dAng1p) > 1 or ( abs( dAng2 - dAng2p) > 1 and abs( dAng1 % 180.0) > 1))
return ( abs( dAng1 - dAng1p) > 1 or ( abs( dAng2 - dAng2p) > 1 and abs( dAng1) % 180.0 > 1))
end
end
@@ -2755,5 +3122,40 @@ function GetCmdAxMove( Cmd, sAx)
end
end
---------------------------------------------------------------------
function CalcDinamicaPinze( 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
end
---------------------------------------------------------------------
function CalcMoveTime( dPathLen, dFeed, bIsSplitted)
local dTime
local dFeedInSec = dFeed / 60
local dAcc, _, _ = CalcDinamicaPinze( EMT.HB, EMT.SB, 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
return dTime
end
---------------------------------------------------------------------
-- *** END GENERAL ***
+125 -31
View File
@@ -7,6 +7,65 @@ EgtEnableDebug( false)
-- Carico libreria
local BD = require( 'BeamData')
---------------------------------------------------------------------
-- *** Generic Machinings ***
---------------------------------------------------------------------
require( 'EmtGenMachining')
---------------------------------------------------------------------
-- *** Special GetPrevMachiningOffset ***
---------------------------------------------------------------------
-----------------------------------------------------------------------------------------
function OnSpecialGetPrevMachiningOffset()
-- Aggiorno posizione della testa della trave a seguito di movimenti delle pinze non previsti tra le fasi
local function TPosUpdate()
local nClId = EgtGetFirstNameInGroup( EMC.CURRMCHID, 'CL') -- recupero Id del gruppo CL della lavorazione corrente
local nPathId = EgtGetFirstInGroup( nClId or GDB_ID.NULL) -- Id del primo gruppo nella lavorazione (P1)
if not nPathId then
EMC.ERR = 12
EMC.MSG = ' Error : CL group path not found'
return
end
local dAuxMoveCount = EgtGetInfo( nPathId, 'AS#', 'd') or 0 -- numero di movimenti ausiliari
local dTRepos = nil
-- controlla ogni gruppo di movimenti ausiliari
for i = 1, dAuxMoveCount do
local aAuxMove = EgtGetInfo( nPathId, 'AS' .. tostring( i), 'vs') or {} -- array contenete i parametri di ogni gruppo
-- controlla solo i movimenti della testa trave e salva l'ultimo
if aAuxMove[1] == '2' or aAuxMove[1] == '3' then
for j = 2, #aAuxMove do
if aAuxMove[j] == 'T' then
dTRepos = aAuxMove[j+1]
break
end
end
end
end
return dTRepos
end
-- default
EMC.ERR = 0
EMC.PREVOFFSX = 0
-- se c'è cambio di fase tra le lavorazioni (quindi la precedente è l'ultima della sua fase e la corrente la prima)
if EMC.PREVPHASE ~= EMC.CURRPHASE then
-- se la fase corrente è di inizio lavorazione di nuova trave
if IsStartOrRestPhase( EMC.CURRPHASE) then
-- recupero la posizione finale della lavorazione precedente
local vPrevAx = EmtGetFinalAxesPos( EMC.PREVMCHID)
-- ricava se e quanto la trave viene spostata tra le due fasi dai movimenti ausiliari e corregge l'offset di fine fase
local dNewTPos = TPosUpdate()
-- se ci sono dei movimenti della testa trave tra le due fasi ricava il delta tra la vecchia e la nuova posizione
if dNewTPos then
EMC.PREVOFFSX = dNewTPos - vPrevAx[1]
-- oppure la X (L1) di questa corrisponde alla posizione iniziale della nuova trave, se ne deduce l'offset
else
EMC.PREVOFFSX = ParkV1 - vPrevAx[1]
end
end
end
end
---------------------- OnSpecialGetMaxZ -----------------------------
---------------------------------------------------------------------
local function CalcExtraZ( vtTp, vtT, vMZ)
@@ -72,8 +131,8 @@ function OnSpecialGetMaxZ()
local vMZ = {{ Tz=0.85, Ez=390}, { Tz=0.5, Ez=280}, { Tz=-0.01, Ez=160}, { Tz=-0.5, Ez=1}, { Tz=-0.61, Ez=1}}
EMC.MAXZ = ParkZ1 + CalcExtraZ( vtTpZm, vtT, vMZ)
end
elseif EMC.HEAD == 'H12' and sHead_TC == 'Head1_TC1' then
if vtTp:getX() > 0.3 and vtT:getX() > 0.3 then
elseif ( EMC.HEAD == 'H12' or EMC.HEAD == 'H17') and sHead_TC == 'Head1_TC1' then
if vtTp:getX() > 0.4 and vtT:getX() > 0.4 then
if bBSameSign and abs( EMC.R1 - EMC.R1p) < 165 then
EMC.MAXZ = MaxZ1 - EgtIf( abs( EMC.R2) < 90.1 and abs( EMC.R2p) < 90.1, 0, 130)
elseif vtTp:getZ() > 0.707 or vtT:getZ() > 0.707 then
@@ -95,7 +154,7 @@ function OnSpecialGetMaxZ()
EMC.MAXZ = ParkZ1 + CalcExtraZ( vtTpZm, vtT, vMZ)
end
elseif EMC.HEAD == 'H12' and sHead_TC == 'Head1_TC2' then
if vtTp:getX() > 0.3 and vtT:getX() > 0.3 then
if vtTp:getX() > 0.4 and vtT:getX() > 0.4 then
if bBSameSign and abs( EMC.R1 - EMC.R1p) < 165 then
EMC.MAXZ = MaxZ1 - EgtIf( abs( EMC.R2) < 90.1 and abs( EMC.R2p) < 90.1, 0, 130)
elseif vtTp:getZ() > 0.707 or vtT:getZ() > 0.707 then
@@ -124,7 +183,7 @@ function OnSpecialGetMaxZ()
EMC.MAXZ = ParkZ2 + CalcExtraZ( vtTpZm, vtT, vMZ)
end
elseif EMC.HEAD == 'H22' then
if vtTp:getX() > 0.3 and vtT:getX() > 0.3 then
if vtTp:getX() > 0.4 and vtT:getX() > 0.4 then
if bBSameSign and abs( EMC.R1 - EMC.R1p) < 165 then
EMC.MAXZ = MaxZ2 - EgtIf( abs( EMC.R2) < 90.1 and abs( EMC.R2p) < 90.1, 0, 130)
elseif vtTp:getZ() > 0.707 or vtT:getZ() > 0.707 then
@@ -173,7 +232,7 @@ function OnSpecialMoveZup()
if EMC.HEAD == 'H11' or EMC.HEAD == 'H21' then
;
-- se lama posizionata su CU prossimo a testa 1
elseif EMC.HEAD == 'H12' and sHead_TC == 'Head1_TC1' then
elseif ( EMC.HEAD == 'H12' or EMC.HEAD == 'H17') and sHead_TC == 'Head1_TC1' then
-- se inclinata oltre 90 gradi e interferisce con la trave
if ( EMC.R2 > 87.9 and ( EMC.R1 < 15.0 or EMC.R1 > 180.0)) or ( EMC.R2 < -87.9 and ( EMC.R1 > -15.0 and EMC.R1 < 180.0)) then
local dZref = dZmax + min( 330 * vtT:getZ(), 0) + 260 * ( 1 - sqrt( 1- vtT:getZ() * vtT:getZ()))
@@ -223,7 +282,7 @@ local MIN_BACK_ENG_V = 115 -- ingombro asse Z a sinistra
local AGG_V = MinDeltaYV -- ingombro rulli pressori + sicurezza
local MIN_CLAMP_5 = 150 -- minima presa con la pinza speciale (pinza 5)
local SIC_CLAMP_5 = 50 -- sicurezza testa da pinza speciale
local MAX_BACK_CLAMP_5 = 320 -- massima sporgenza posteriore del pezzo da pinza speciale
local MAX_BACK_CLAMP_5 = EgtClamp( MaxBackClamp5 or 320, 200, 380) -- massima sporgenza posteriore del pezzo da pinza speciale
----------------------- Variabili -----------------------------------
local Test = false
@@ -654,6 +713,24 @@ end
---------------------------------------------------------------------
function OnPostApplyMachining()
-- Inizializzo codice di errore
EMC.ERR = 0
-- Verifico se ultima lavorazione della fase
local nNextOpeId = EgtGetNextActiveOperation( EMC.MCHID)
local bMchLast = ( not nNextOpeId or EgtGetOperationPhase( nNextOpeId) ~= EMC.PHASE) -- Agisco sui diversi percorsi della lavorazione
local nPathId = EgtGetFirstInGroup( EgtGetFirstNameInGroup( EMC.MCHID, 'CL') or GDB_ID.NULL)
while nPathId do
-- recupero id del successivo
nPathId = EgtGetNext( nPathId)
-- verifico se ultimo percorso di ultima lavorazione della fase
local bLast = ( bMchLast and ( not nPathId))
-- se ultimo, elimino ritorno in home
if bLast then EgtRemoveOperationHome( EMC.MCHID) end
end
end
---------------------------------------------------------------------
function OnSpecialApplyMachining()
EgtOutLog( ' Lavorazione : ' .. EgtGetName( EMC.MCHID), 1)
@@ -761,7 +838,7 @@ function OnPostApplyMachining()
-- verifico se ultimo percorso di ultima lavorazione della fase
local bLast = ( bMchLast and ( not nPathId))
-- se ultimo, elimino ritorno in home
if bLast then EgtRemoveOperationHome( EMC.MCHID) end
-- if bLast then EgtRemoveOperationHome( EMC.MCHID) end
-- salvo lo stato dei carrelli
local OriTPos = EMC.TPOS
local OriY1Delta = EMC.Y1DELTA
@@ -824,6 +901,13 @@ end
---------------------------------------------------------------------
function SpecApplyPath( bPreSplit, bSplitting, bPreCut, bCutting, bUnload, bPreRotMch)
-- mi salvo info lavorazione su una lista
local AuxInfoMach = {}
AuxInfoMach.bPreSplit = bPreSplit
AuxInfoMach.bSplitting = bSplitting
AuxInfoMach.bPreCut = bPreCut
AuxInfoMach.bCutting = bCutting
AuxInfoMach.bUnload = bUnload
-- Assegno flag di pezzo separato dal resto del grezzo
SPLIT = IsEndPhase( EMC.PHASE) or IsMid2Phase( EMC.PHASE) or IsEnd2Phase( EMC.PHASE)
@@ -921,7 +1005,7 @@ function SpecApplyPath( bPreSplit, bSplitting, bPreCut, bCutting, bUnload, bPreR
local dPosT = LoadT
if IsFirstMachiningAfterRotation( EMC.MCHID) then dPosT = dPosT + TurnerOffs end
local vCmd = SpecCalcLoad( dPosT, dDistFront, max( dDistBack, MinJoin + EgtIf( SPLIT, EMC.TCING, 0), EMC.LB - ( MaxY1 - MinY1) + 6))
local vCmd2 = SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1DeltaMaxSP, dY2DeltaMinUL, nChar)
local vCmd2 = SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1DeltaMaxSP, dY2DeltaMinUL, nChar, AuxInfoMach)
if bSplitting and EMC.ERR == 18 then
table.insert( vCmd, { 22, dRollBack, -dRollFront})
end
@@ -934,7 +1018,7 @@ function SpecApplyPath( bPreSplit, bSplitting, bPreCut, bCutting, bUnload, bPreR
-- Se altrimenti carri entrambi diponibili, eseguo calcoli per carrelli
elseif not IsEndPhase( EMC.PHASE) then
local vCmd = SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1DeltaMaxSP, dY2DeltaMinUL, nChar)
local vCmd = SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1DeltaMaxSP, dY2DeltaMinUL, nChar, AuxInfoMach)
-- Se non ci sono spostamenti, confermo i parametri di aggancio e di posizione roller
if SpecTestOnlyRemarkInCmds( vCmd) then
table.insert( vCmd, { 21, EgtIf( EMC.Y1DELTA, EMC.Y1DELTA, 0), EgtIf( EMC.Y2DELTA, EMC.Y2DELTA, 0)})
@@ -1262,7 +1346,7 @@ function SpecCalcLoad( dPosT, dDistFront, dDistBack)
end -- SpecAdjustLoad [L]
---------------------------------------------------------------------
function SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1DeltaMaxSP, dY2DeltaMinUL, nChar)
function SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1DeltaMaxSP, dY2DeltaMinUL, nChar, AuxInfoMach)
local MinFrontJoin = MinJoin + EMC.HCING + EMC.HOVM
local MyMinOther = MinOther + EgtIf( EMC.CNT == 1, AggLoad, 0)
@@ -1301,13 +1385,11 @@ function SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1Del
WorkTab.dV2PosF = -dRollFront
WorkTab.bV2CloseF = false
-- aggiuntivo per non avere problemi con pezzi a caduta
if WorkTab.dY1DeltaMaxF - WorkTab.dY1DeltaMinF > 5 * BD.CHAR_EXTRA_DIST then
WorkTab.dY1DeltaMinF = WorkTab.dY1DeltaMinF + 4 * BD.CHAR_EXTRA_DIST
elseif WorkTab.dY1DeltaMaxF - WorkTab.dY1DeltaMinF > 2.5 * BD.CHAR_EXTRA_DIST then
WorkTab.dY1DeltaMinF = WorkTab.dY1DeltaMinF + 2 * BD.CHAR_EXTRA_DIST
elseif WorkTab.dY1DeltaMaxF - WorkTab.dY1DeltaMinF > 1.5 * BD.CHAR_EXTRA_DIST then
WorkTab.dY1DeltaMinF = WorkTab.dY1DeltaMinF + BD.CHAR_EXTRA_DIST
-- dopo che si è calcolato il minimo e massimo dell'intervallo, verifico che in testa rimanga almeno il minimo per poter fare passaggio pinze e scaricare
if AuxInfoMach and ( AuxInfoMach.bSplitting or AuxInfoMach.bCutting) then
if WorkTab.dY1DeltaMaxF - WorkTab.dY1DeltaMinF > 1.5 * BD.CHAR_EXTRA_DIST and WorkTab.dY1DeltaMaxF > EMC.LT + BD.MINRAW_S + BD.CHAR_EXTRA_DIST then
WorkTab.dY1DeltaMinF = max( min( EMC.LT + BD.MINRAW_S, WorkTab.dY1DeltaMaxF - 1), WorkTab.dY1DeltaMinF)
end
end
-- verifico validità intervallo ammesso per Y1
@@ -1346,13 +1428,11 @@ function SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1Del
WorkTab.dV2PosF = -dRollFront
WorkTab.bV2CloseF = false
-- aggiuntivo per minimizzare scambi carrelli
if WorkTab.dY1DeltaMaxF - WorkTab.dY1DeltaMinF > 5 * BD.CHAR_EXTRA_DIST then
WorkTab.dY1DeltaMinF = WorkTab.dY1DeltaMinF + 4 * BD.CHAR_EXTRA_DIST
elseif WorkTab.dY1DeltaMaxF - WorkTab.dY1DeltaMinF > 2.5 * BD.CHAR_EXTRA_DIST then
WorkTab.dY1DeltaMinF = WorkTab.dY1DeltaMinF + 2 * BD.CHAR_EXTRA_DIST
elseif WorkTab.dY1DeltaMaxF - WorkTab.dY1DeltaMinF > 1.5 * BD.CHAR_EXTRA_DIST then
WorkTab.dY1DeltaMinF = WorkTab.dY1DeltaMinF + BD.CHAR_EXTRA_DIST
-- dopo che si è calcolato il minimo e massimo dell'intervallo, verifico che in testa rimanga almeno il minimo per poter fare passaggio pinze e scaricare
if AuxInfoMach and ( AuxInfoMach.bSplitting or AuxInfoMach.bCutting) then
if WorkTab.dY1DeltaMaxF - WorkTab.dY1DeltaMinF > 1.5 * BD.CHAR_EXTRA_DIST and WorkTab.dY1DeltaMaxF > EMC.LT + BD.MINRAW_S + BD.CHAR_EXTRA_DIST then
WorkTab.dY1DeltaMinF = max( min( EMC.LT + BD.MINRAW_S, WorkTab.dY1DeltaMaxF - 1), WorkTab.dY1DeltaMinF)
end
end
-- verifico validità intervallo ammesso per Y1
@@ -1420,7 +1500,14 @@ function SpecCalcSplit( dLenRaw, dMaxLenLeft)
local vCmd = {}
EgtOutLog( ' *[S]', 1)
local bSplit = ( EMC.Y2DELTA ~= nil or EMC.W2DELTA ~= nil)
local ParkT = EgtIf( bSplit and dMaxLenLeft > ParkV1 - 50, LoadT, ParkV1)
local ParkT = ParkV1
if bSplit then
if dMaxLenLeft + 100 > LoadT then
ParkT = dMaxLenLeft + 300
elseif dMaxLenLeft + 100 > ParkV1 then
ParkT = LoadT
end
end
local sType = EgtIf( EMC.Y2DELTA, 'Split', EgtIf( EMC.W2DELTA, 'SpecSplit', 'Fall'))
table.insert( vCmd, { 0, sType})
if not bSplit then EnsureZmax( false, vCmd) end
@@ -1543,8 +1630,11 @@ function SpecCalcUnload()
EgtOutLog( ' *[U1]', 1)
end
local vCmd = {}
-- Tipo di scarico
local bStdUl = ( not MaxUnloadLen or MaxUnloadLen < 1 or EMC.LB - EMC.HOVM < MaxUnloadLen + 1)
-- Commento
table.insert( vCmd, { 0, 'Unloading'})
table.insert( vCmd, { 0, 'Unloading', EgtIf( bStdUl, 'Unloading', 'Manual Unloading')})
-- posizionamento sicuro teste e rulli (non serve ?)
--table.insert( vCmd, { 4, 0})
-- Se pinza Y chiusa, la apro
@@ -1552,11 +1642,15 @@ function SpecCalcUnload()
table.insert( vCmd, { 11, 0})
EMC.CNT = nil
end
-- Sposto il pezzo in posizione di scarico
local dFinT = UnloadT - EMC.LB
local dFinY2 = dFinT + EMC.Y2DELTA
table.insert( vCmd, { 2, 'T', dFinT, 'Y2', dFinY2})
EgtOutLog( ' Y2PosF=' .. EgtNumToString( dFinY2), 1)
-- Se non supero la lunghezza massima di scarico, sposto il pezzo in posizione di scarico
if bStdUl then
local dFinT = UnloadT - EMC.LB
local dFinY2 = dFinT + EMC.Y2DELTA
table.insert( vCmd, { 2, 'T', dFinT, 'Y2', dFinY2})
EgtOutLog( ' Y2PosF=' .. EgtNumToString( dFinY2), 1)
else
table.insert( vCmd, { 1, 'Y2', MaxY2})
end
-- apro la morsa
table.insert( vCmd, { 12, 0})
-- riporto il carrello in home
+145 -1
View File
@@ -1,7 +1,151 @@
==== Common_ONE-PF Update Log ====
Versione 2.6-- (--/--/2024)
Versione 3.1c2 (17/03/2026)
- (SIM-GEN) Aggiunta OnSpecialApplyMachining per calcolare i carrelli da subito
- Aggiungendo OnSpecialApplyMachining, ora la OnSpecialGetPrevMachiningOffset lavora correttamente. ATT: MIN_MACH -> 3.1b2
Versione 3.1c1 (04/03/2026)
- (GEN) Corretta chiamata di una variabile insesistente in caso di ONE
- (SIM) Allineata simulazione a generazione
Versione 3.1b1 (20/02/2026)
- (GEN) Aggiunta funzione ToolPreSelection() per la preselezione utensile. Ticket#2789
- (GEN) Funzione rinominata in ToolPreSelectionSingleHead(), ora utilizza funzione in MLDE per capire se è motosega
Versione 3.1a1 (16/01/2026)
- (SIM-GEN) Aggiunto controllo che evita collisioni durante lo svincolo in Z della sega a catena nelle funzioni ExecMoveZMax() e EmitZMax(). Ticket#2767
- (SIM-GEN) Piccola correzione modifiche fatte in precedenza
Versione 2.7l1 (18/12/2025)
- (SIM-GEN) Aggiunto controllo post movimenti ausiliari dell' EMC.PREVOFFSX nella funzione OnSpecialGetPrevMachiningOffset(). Ticket#2727
- (SIM-GEN) Divisione movimento B in approccio se > 90°. Ticket#2754
- (SIM) Aggiunta funzione CheckClamping
Versione 2.7k3 (28/11/2025)
- (GEN) Prima di andare allo scarico, si aggiunge movimento intermedio dove si aspetta che rulli scarico siano arrivati in posizione. Ticket#2716
Versione 2.7k2 (20/11/2025)
- (SIM) Aggiornata risoluzione VMillTol in funzione dello spessore lama
Versione 2.7k1 (05/11/2025)
- (SIM-GEN) Corretto calcolo per decidere se serve aprire i rulli
- (GEN) Aggiunta tolleranza in creazione piano di lavoro inclinato
- (SIM) Allo scarico si resetta Y2DELTA. Ticket#2687
Versione 2.7j3 (23/10/2025)
- (SIM) Corretta posizione parcheggio in caso di testa 1 su magazzino 2. Ticket#2660
Versione 2.7j2 (21/10/2025)
- (GEN) Se SPLIT con pinza 5, corretto salvataggio posizione pinza 2. Ticket#2654
Versione 2.7j1 (08/10/2025)
- (GEN) Salvataggio posizione Z su lavorazione precedente, sbagliava in caso di separazione. Ticket#2637
Versione 2.7i1 (10/09/2025)
- (SIM-GEN) Piccole correzioni per gestire secondo TC su ONE. Ticket#2563
- (SIM-GEN) Gestione aggregato BH completato. Ticket#2482
- (EST) Stima tempi considerando accelerazioni
- (SIM-GEN) Se fase start o restart, si aggiorna la posizione in X dell'asse per calcolare il link corretto
- (GEN) Piccola correzione risalita ZMAX dopo RELOAD del pezzo. Generazione allineata a simulazione.
Versione 2.7h2 (28/08/2025)
- (GEN) Migliorata gestione spegnimento utensile e disattivazione piano
- (SIM-GEN) Corretto nome variabile e altre piccole modifiche per Progress
Versione 2.7h1 (20/08/2025)
- (SIM-GEN) Non si chiudono i rulli se tagli o pretagli di testa e coda
- (SIM) Corretto movimento pinza 5 in caso di riposizionamento pinza 1
- (GEN) Corretta quota assoluta posizione testa trave in caso di pinza 5 e testa rimasta bassa
- (GEN) Se ultima lavorazione pezzo precedente ha stesso utensile della prima lavorazione pezzo successivo, la speed resta accesa
Versione 2.7g4 (23/07/2025)
- (SIM-GEN) Aggiunto parametro configurabile da TS3 per massima sporgenza trave in coda per pinza 5. Ticket#2538
Versione 2.7g3 (22/07/2025)
- (SIM) Corretto lettura angolo di presa della motosega
Versione 2.7g2 (08/07/2025)
- (SIM) Corretto movimento a parcheggio sega a catena. Ticket#2517
Versione 2.7g1 (01/07/2025)
- (GEN) Rimossa gestione PROBE inserita per sbaglio
- (GEN) Corretto gestione accelerazioni
- (SIM-GEN) Aggiunta gestione massima lunghezza scarico
Versione 2.7f1 (04/06/2025)
- (SIM) Aggiunta gestione qualità VMILL da impostazioni macchina. Tolto parametro 'CoeffVM'.
- (GEN) Aggiunti parametri FMAXPINZE, MAXACC, MINACC configurabili da TS3. Ticket#2052
Versione 2.7e1 (28/05/2025)
- (SIM-GEN) Alla separazione si spostano i carrelli di 30mm aprendo il taglio. Ticket#2259,Ticket#2328
Versione 2.7d1 (16/04/2025)
- (SIM) Distanza di collisione portata a 3mm, qualità VMILL ridotta a 4mm. Ticket#2395
Versione 2.7c3 (25/03/2025)
- (GEN) Corretto movimento approccio alla lavorazione se utensile lama montata su magazzino 2. Ticket#2361
Versione 2.7c2 (12/03/2025)
- (SIM-GEN) Migliorato calcolo posizione barra dopo split. Tiene in considerazione ingombro lavorazioni pezzo. Ticket#2321
- (GEN) Aggiunta commenti HEADER e FOOTER per comunicazione con linea o altre macchine, da parte di Essetre.
- (SIm-GEN) Migliorato movimento approccio al pezzo con lama. Allineamento simulazione-generazione che facevano due movimenti leggermente diversi. Ticket#2335
Versione 2.7c1 (05/03/2025)
- (GEN) Corretto movimento in home utensile precedente. Ticket#2324
Versione 2.7b1 (07/02/2025)
- (SIM-GEN) In caso di Progress, alla deselezione utensile testa 1 su TC2 si fa movimento Z raddrizzando asse B. Ticket#2247
- (SIM-GEN) Estensione soluzione Ticket#2206. Ora si aprono di 5mm extra anche se solo una morsa resta in posizione. Ticket#2259
- (SIM) Migliorato controllo collisioni con traversa. Ora si considera asse X. Serve modifica NGE! Ticket#2257
Versione 2.7a2 (15/01/2024)
- (SIM-GEN) In caso di testa 1 su TC2 (ONE), si ruota prima la C e poi la B. Ticket#2247
Versione 2.7a1 (07/01/2024)
- (GEN) In separazione, quando si porta indietro il restante, si aprono le paratie rulli subito. Ticket#2214
- (SIM-GEN) Se entrambe le morse sono restate in posizione, le sposto comunque di 5mm per distanziare i pezzi separati. Ticket#2206
Versione 2.6l2 (09/12/2024)
- (SIM-GEN) Corretto problema introdotto in 2.6l1 per risolvere #2198. Ticket#2203
- (SIM-GEN) In MLSE modificato controllo direzione utensile per determinare Z massima. Ticket#2204
Versione 2.6l1 (02/12/2024)
- (SIM) Dopo scarico pezzo per ribaltamento, si aprono sempre i rulli. Ticket#2192
- (SIM-GEN) Nei movimenti si ricalcola la Z solo se la quota di lavoro è più in alta della posizione a ZHOME della testa. Ticket#2198
- (GEN) Se bisogna andare in home, ma la testa lo è già, non si scrive nulla
Versione 2.6j3 (21/10/2024)
- (GEN) Se richiesto movimento in home, si scrive sempre parcheggio in home dell'utensile precedente. Prima si scriveva solo per lama.
Versione 2.6j2 (17/10/2024)
- (SIM-GEN) Se motosega prelevata con A=0, alla fine la si porta sempre alla quota ZMAX, indipendentemente dall'altezza trave che era fissata a 650mm. Ora lo fa sempre.
Versione 2.6j1 (08/10/2024)
- (SIM-GEN) Corretto primo movimento di approccio al pezzo. Ticket#2093
- (SIM-GEN) Corretto movimento in Home in caso di lama e movimento rulliera di carico. Ticket#2054
- (GEN) In caso di movimento in Home non si fa più preselezione ma si tiene utensile vecchio. Ticket#1926
Versione 2.6i2 (13/09/2024)
- (GEN) Migliorato calcolo chiusura paratia rulli con aggiornamento lunghezza della barra in caso di ultimo taglio e grezzo residuo in coda. Ticket#2017
- (NGE-MLDE-GEN-SIM) Aggiunto solidi collisione TC. Corretto movimento a Y di sicurezza con lama. Ticket#2042
- (NGE-SIM) Aggiunta collisione magazzino motosega ONE
Versione 2.6i1 (02/09/2024)
- (SIM-GEN) Quando si aprono i rulli, se la trave non può seguire i rulli perchè la pinza andrebbe in extra-corsa, si sposta comunque la pinza fino al massimo della sua corsa. Ticket#1949
- (GEN) In preselezione. Se lavorazione motosega, non mando a parcheggio altra testa con utensile precedente, perchè subito dopo viene chiamata preselezione. Ticket#1961
Versione 2.6h2 (07/08/2024)
- (SIM) Allineata simulazione a generazione in primo movimento rapido approccio al pezzo.
Versione 2.6h1 (01/08/2024)
- (GEN) Corretto segno posizione X di sicurezza per rotazione assi rotanti.
Versione 2.6g5 (31/07/2024)
- (SIM-GEN) Se motosega allineata ad asse B per tagli di fianco, corretto movimento che manda testa a parcheggio. Pezzi più alti di 650 va solo in Zmax. Ticket#1943
- (SIM-GEN) Gestione movimenti speciali per pezzi molto alti. Se HomeZ < primo punto lavorazione, allora vado al punto Z lavorazione prima di approcciare il pezzo in X. Ticket#1943
- (GEN) Gestione creazione piano generico in caso il primo movimento della lavorazione sia un arco. Ticket#1891
- (SIM-GEN) Modifica limite inferirore intervallo di pinzaggio per garantire, se possibile, il passaggio pezzo a pinza 2. Da Common-PF1250.
- (GEN) Corretta scrittura ISO per parcheggiare morsa 3 dopo ribaltamento. Ticket#1922,#1733
Versione 2.6g4 (19/07/2024)
+2 -2
View File
@@ -3,8 +3,8 @@
local InfoCommon_STD_PP = {
NAME = 'Common_ONE-PF', -- nome script PP standard
VERSION = '2.6--DEV', -- versione script
MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel
VERSION = '3.1c2', -- versione script
MIN_MACH_VER_PP_COMMON = '3.1b2' -- versione minima kernel
}
return InfoCommon_STD_PP