Compare commits

...

205 Commits

Author SHA1 Message Date
andrea.villa 211b59c79b Cambio versione 2026-04-22 16:26:46 +02:00
andrea.villa f8464fa0de - Corretto pinzaggio in caso di passo del pellegrino con recupero completo di una sola pinza
- Semplificato salvataggio stato in PreparePostRotation
- Cambio versione per rilasci oa cliente
2026-04-22 16:26:15 +02:00
daniele.nicoli 7a6bdaf637 Corretta generazione del PreparePostRotation (in tutti i CN) ora salva lo stato della pinza per lo spostamento successivo 2026-04-22 13:12:29 +02:00
andrea.villa 73881f4042 Merge remote-tracking branch 'origin/main' into develop 2026-04-14 15:13:56 +02:00
andrea.villa 92ab99cde9 Merge branch 'develop' 2026-04-14 15:13:37 +02:00
andrea.villa 4496302ec3 Cambio versione per rilascio a cliente 2026-04-14 15:13:14 +02:00
daniele.nicoli c85df70b61 Aggiorna lo step totale del PilgrimStep e lo step Y con il valore di MyMinY, di modo che tenga conto del AGG_LOAD quando c'è 2026-04-14 09:28:02 +02:00
andrea.villa a8f142e8d7 Per NUM, si lascia aperta la pinza di carico in caso di END2. TPA era già corretto 2026-04-02 09:57:16 +02:00
andrea.villa 9bebdcc4e7 Merge remote-tracking branch 'origin/main' into develop 2026-04-02 09:53:39 +02:00
andrea.villa f8436a983a Merge branch 'develop' 2026-03-30 18:31:22 +02:00
andrea.villa d7e870cf1e Merge branch 'develop' of https://gitlab.steamware.net/egalware-machines/essetre/Common-FAST into develop 2026-03-30 18:29:35 +02:00
andrea.villa 82f0eab4ae - Corretti moviemnti con motosega. Ora si ruota la C con B sempre a zero, anche alla posizione X di sicurezza
- Cambio versione per rilascio a cliente
2026-03-30 18:29:31 +02:00
andrea.villa 04ab01cba8 Merge remote-tracking branch 'origin/main' into develop 2026-03-30 18:25:54 +02:00
daniele.nicoli 536352b802 Merge remote-tracking branch 'origin/main' into develop 2026-03-27 15:39:19 +01:00
andrea.villa 1484fb761b Merge remote-tracking branch 'origin/develop' 2026-03-27 15:22:05 +01:00
andrea.villa 660209bdea - In caso di motosega prelevata, si ruota in home.
- Cambio versione per rilascio a cliente
2026-03-27 15:14:21 +01:00
daniele.nicoli 3867f7b7ed Sistemati anche casi di prima lavorazione con motosega, ora in tutti i casi la motosega che si muove da Home spezza i movimenti B e C dai lineari. 2026-03-27 13:04:52 +01:00
daniele.nicoli bc2388dd43 - In generazione diversificato caso di cambio utensile da H1 a H3 (motosega) e caso di home con utensile H3 sia in lavorazione precedente che corrente.
- Motosega - Separata funzione di calcolo parcheggio asse A/C in mlde e mlpe
2026-03-26 15:25:10 +01:00
daniele.nicoli 86d9b2ec3d Allineata generazione a simulazione. Se con motosega girava asse rotante B rischiava collisione perchè li muoveva contemporaneamente X,B,C. 2026-03-25 17:02:10 +01:00
andrea.villa 2221224e9a Miglioramento del posizionamento pinze con FASTCLAMPING attivo 2026-03-20 10:48:11 +01:00
andrea.villa 0b7fefd0fd Merge remote-tracking branch 'origin/main' into develop 2026-03-20 10:47:01 +01:00
andrea.villa 51e2180b15 Nella G101 il parametro EE era sempre a 4 perchè la variabile veniva settata dopo 2026-01-26 15:54:43 +01:00
andrea.villa ee7087b003 Variabile DeltaTol deve essere spostata in MLDE 2026-01-08 12:14:51 +01:00
andrea.villa be993f47df Merge remote-tracking branch 'origin/develop' 2026-01-08 08:39:13 +01:00
andrea.villa 2522967e95 Commit per rilascio nuova versione macchina 2026-01-08 08:38:59 +01:00
daniele.nicoli 40e049dbb5 - Ottimizzata scrittura funzione ClampCheck post aggiornamento dll.
- Corretto problema della funzione OnSimulDispositionStart in caso di fase finale.
2026-01-07 11:39:56 +01:00
daniele.nicoli 270039d7e3 Merge remote-tracking branch 'origin/HEAD' into develop 2026-01-07 10:50:36 +01:00
andrea.villa 9241a53f97 Merge branch 'develop' 2025-12-22 10:06:21 +01:00
andrea.villa ff984c30b4 Cambio versione per rilascio a cliente 2025-12-22 10:05:59 +01:00
daniele.nicoli 001fd45f0c - Eliminata MinJoin, utilizzata al suo posto funzione già esistente UpdateMinJoin nell'mlde
- Modificata formula calcolo Area minima
2025-12-22 08:23:07 +01:00
daniele.nicoli 24e73d886d Merge remote-tracking branch 'origin/main' into develop 2025-12-22 08:20:26 +01:00
andrea.villa f3e7254b48 Merge remote-tracking branch 'origin/develop' 2025-12-18 12:39:56 +01:00
andrea.villa 3cf27288f3 Cambio versione per rilascio a cliente 2025-12-18 12:38:51 +01:00
daniele.nicoli fce0068d45 - Arrotondati valori area trapezio
- Trasferite operazioni di SimulMoveAxis e SetPVLight, SetPYLight nelle funzioni ExecMovePV e ExecMovePY
2025-12-18 11:22:17 +01:00
daniele.nicoli 07a261bfce Corretta funzione legata a ClampCheck 2025-12-16 13:40:02 +01:00
daniele.nicoli b0a7be8454 Aggiornamento UpdateLog e Version 2025-12-15 15:27:11 +01:00
daniele.nicoli 18cf79bb82 aggiunta funzione ClampCheck, variabili e funzioni ausiliarie 2025-12-12 16:30:18 +01:00
andrea.villa 4986b48e31 Merge remote-tracking branch 'origin/main' into develop 2025-12-10 09:49:56 +01:00
andrea.villa 523c5a99ce Merge branch 'develop' 2025-12-10 09:46:35 +01:00
andrea.villa db68ad1a90 Cambio versione per rilascio a cliente 2025-12-10 09:46:22 +01:00
daniele.nicoli 9259b6e633 Aggiunto controllo C in base a carico Dx o Sx durante il cambio utensile 2025-12-10 09:40:16 +01:00
andrea.villa 0c2387c901 Con controllo NUM/NUM_PLUS nella scrittura della coordinata tolto il simbolo '=' 2025-12-02 15:01:34 +01:00
andrea.villa 24ea5db4f5 Merge remote-tracking branch 'origin/origin/VMill_Tol' into develop 2025-11-27 09:11:10 +01:00
andrea.villa fb3d203f77 Corretto movimento in simulazione che non rispettava movimento macchina generato 2025-11-27 09:09:07 +01:00
daniele.nicoli 9fab4f9330 Aggiornato UpdateLog 2025-11-20 17:09:35 +01:00
daniele.nicoli f1faaa1eda Aggiornata risoluzione VMillTol in funzione dello spessore lama 2025-11-20 17:09:01 +01:00
andrea.villa c9469ee7e2 Modifiche a calcolo stima tempi, da verificare 2025-11-19 16:38:56 +01:00
andrea.villa 108c6d2d8e Merge remote-tracking branch 'origin/main' into develop 2025-11-10 16:13:31 +01:00
andrea.villa 052f6aa18e Merge remote-tracking branch 'origin/develop' 2025-11-10 16:13:11 +01:00
andrea.villa d4376dfa8e Corretto set variabili info utensile prima del movimento in home in caso di pezzi alti per NUM/NUM_PLUS 2025-11-10 16:12:58 +01:00
andrea.villa f25d90518d Merge commit '5ff538314a85a4709e41584bc130c5d7403028f1' into develop 2025-11-10 16:09:25 +01:00
andrea.villa 5ff538314a Quando si scarica motosega, si raddrizza prima l'asse B e poi si muove il C. Ora sempre e non solo se pezzo alto 2025-10-08 16:10:13 +02:00
andrea.villa db91129c66 Aggiornato UpdateLog 2025-10-06 15:55:53 +02:00
andrea.villa 8f124af521 Merge remote-tracking branch 'origin/main' into develop 2025-10-06 15:55:35 +02:00
andrea.villa fbd5f170de Quando si scarica motosega, si raddrizza prima l'asse B e poi si muove il C 2025-10-06 15:53:55 +02:00
andrea.villa 00fffeb388 Controllo collisione tra utensile e TOP testa C. Rilasciare dopo che è stata pubblicata nuova versioen CAM5 27j1 2025-09-25 12:45:11 +02:00
andrea.villa 0f6e9b9899 Merge remote-tracking branch 'origin/main' into develop 2025-09-25 12:43:12 +02:00
andrea.villa b06d6d4afe Merge remote-tracking branch 'origin/develop' 2025-09-23 11:25:49 +02:00
andrea.villa 36efe11298 Spostate costanti dimensioni utensili in MLDE 2025-09-23 11:25:32 +02:00
andrea.villa 5447eca3c3 Merge branch 'main' into develop 2025-09-17 09:21:20 +02:00
andrea.villa f5dc0ec3f2 Merge remote-tracking branch 'origin/develop' 2025-09-17 09:21:06 +02:00
andrea.villa a8a708697d Prelievo e deposito motosega con gli angoli comunicati da Essetre 2025-09-17 08:56:07 +02:00
andrea.villa 7806f539b5 Stima tempi considerando accelerazioni 2025-09-10 13:09:55 +02:00
andrea.villa 2f0ee75abf Merge remote-tracking branch 'origin/main' into develop 2025-09-08 08:41:29 +02:00
andrea.villa f515dd0312 Merge remote-tracking branch 'origin/develop' 2025-09-08 08:41:13 +02:00
andrea.villa 6a530927c9 Per NEWCLAMPING, corretto un caso di riposizionemento allo scarico 2025-09-08 08:41:00 +02:00
andrea.villa 1f358ce1e1 Migliorata gestione movimenti speciali in caso di motosega 2025-07-21 13:09:49 +02:00
andrea.villa e5442d976a Se lavorazione precedente e successiva con motosega e si cambiano assi rotanti, vado in parcheggio per ruotare 2025-07-21 11:57:37 +02:00
andrea.villa bb190b1643 Merge remote-tracking branch 'origin/main' into develop 2025-07-01 08:43:58 +02:00
andrea.villa 8adfbaf24b Corretta accelerazione di default 2025-07-01 08:43:39 +02:00
andrea.villa 55f5710f7c Merge remote-tracking branch 'origin/main' into develop 2025-07-01 08:11:03 +02:00
andrea.villa 1ee84c6cf8 Merge remote-tracking branch 'origin/develop' 2025-07-01 08:10:39 +02:00
andrea.villa 44ea5b2a2c Cambio versione per rilascio 2025-07-01 08:10:24 +02:00
andrea.villa 3c82040b21 Aggiunti parametri FMAXPINZE, MAXACC, MINACC configurabili da TS3. 2025-06-30 12:22:10 +02:00
andrea.villa 42ab289444 Merge remote-tracking branch 'origin/main' into develop 2025-06-26 08:48:50 +02:00
andrea.villa e6ab77e59a Merge remote-tracking branch 'origin/develop' 2025-06-26 08:48:34 +02:00
andrea.villa 958b5bbc3a Commit per versione 2025-06-26 08:48:10 +02:00
andrea.villa f223006bc7 Aggiunti 10mm di sicurezza in caso di primo pinzaggio. La tolleranza per riqualifica laser è a 50mm, mettere 50mm di distanza è troppo poco in caso il pezzo venisse caricato lontano dalla battuta di carico. Il calcolo è comunque da rivedere. 2025-06-26 08:45:56 +02:00
andrea.villa 659aa80001 Merge remote-tracking branch 'origin/main' into develop 2025-06-19 16:50:17 +02:00
andrea.villa 6db40176a2 Merge remote-tracking branch 'origin/develop' 2025-06-19 16:49:55 +02:00
andrea.villa 0fa80629f6 Se in separazione il pezzo è andato più lontano della posizione standard, viene riletta 2025-06-19 16:49:39 +02:00
andrea.villa 9eb362d312 Merge remote-tracking branch 'origin/main' into develop 2025-06-18 17:56:50 +02:00
andrea.villa 912bf4f072 Corretto movimento speciale solo se utensile lungo su testa 1 2025-06-18 17:56:16 +02:00
andrea.villa 717a03a549 Merge branch 'main' into develop 2025-06-18 17:33:46 +02:00
andrea.villa 1a68f3e543 Merge remote-tracking branch 'origin/develop' 2025-06-18 17:33:31 +02:00
andrea.villa d5165571da Se utensile più lungo di 350mm, si va in posizione sicurezza come per la motosega 2025-06-18 17:31:34 +02:00
andrea.villa e2a5b11cfa Merge remote-tracking branch 'origin/main' into develop 2025-05-26 09:49:56 +02:00
andrea.villa bd80cd5500 Merge branch 'develop' 2025-05-26 09:49:12 +02:00
andrea.villa 9bb3b85930 - In simulazione, corretto selezione utensile per punte lunghe
- Cambio versione
2025-05-26 09:48:44 +02:00
andrea.villa 4c7380986c Aumentata dimensione massima per la quale si rimuove uno scarto dal VMILL 2025-04-28 16:30:50 +02:00
andrea.villa 837a607ceb Merge remote-tracking branch 'origin/main' into develop 2025-04-14 08:29:33 +02:00
andrea.villa d6f6b91bbb Merge remote-tracking branch 'origin/develop' 2025-04-14 08:29:15 +02:00
andrea.villa 8a35315165 Corretto movimento iniziale in caso di motosega, si controlla solo se non è il carico 2025-04-14 08:29:04 +02:00
andrea.villa 98156b21eb Merge remote-tracking branch 'origin/main' into develop 2025-03-26 12:15:31 +01:00
andrea.villa 2bfb1b4b27 Merge remote-tracking branch 'origin/develop' 2025-03-26 12:15:15 +01:00
andrea.villa bf0c9460c6 Commit per versione 2025-03-26 12:15:03 +01:00
andrea.villa a721fda298 In MyAdjustLinearAxes si utilizza TDIR per calcolarsi gli offset per compatibilità con lavorazioni a 5 assi. 2025-03-26 09:18:38 +01:00
andrea.villa 47516ad370 - All'inizio del codice ISO si scrive nel commento anche il controllo numerico utilizzato per la generazione.
- Aggiunta commenti HEADER e FOOTER per comunicazione con linea o altre macchine, da parte di Essetre.
2025-03-10 08:25:20 +01:00
andrea.villa 09f5c56ac9 Merge remote-tracking branch 'origin/main' into develop 2025-02-20 16:44:42 +01:00
andrea.villa 7765c9c767 Aggiunta gestione per ToolHolder flottante 2025-02-20 16:44:21 +01:00
andrea.villa 9da3bb88e1 Merge remote-tracking branch 'origin/main' into develop 2025-02-20 16:37:02 +01:00
andrea.villa aa0d80735b Merge branch 'develop' 2025-02-20 16:36:43 +01:00
andrea.villa 5426a1a07a Per controllo TPA, modifica al numero di decimali. 2025-02-20 16:36:23 +01:00
andrea.villa db906c0817 Caricamento libreria EmtGenMachining. Si fa una require con PCALL perchè la libreria è opzionale e non è detto che ci sia. In installazione CAM5 dalla 2.7a1 2025-01-16 12:42:27 +01:00
andrea.villa 14d5f35f8f - Aggiunta possibilità di settare HCING/TCING nelle note di ogni singola lavorazione per gestire parte non pinzabile del pezzo. Funziona solo con nuova strategia pinzaggio
- Piccola correzione calcolo posizione carrelli con nuova strategia di pinzaggio
2025-01-14 08:37:23 +01:00
andrea.villa e039384b87 Merge branch 'main' into develop 2025-01-08 16:01:39 +01:00
andrea.villa d2b4a55db4 Dopo separazione, in NUM_PLUS, si srive EH1 solo se macro G101, perchè altrimenti non è prevista 2025-01-08 16:01:29 +01:00
andrea.villa 833c2d95e7 Merge remote-tracking branch 'origin/main' into develop 2025-01-08 12:01:21 +01:00
andrea.villa 2577240699 Aggiunta gestione qualità VMILL da impostazioni macchina 2025-01-08 12:00:56 +01:00
andrea.villa 3a20baca05 Merge remote-tracking branch 'origin/main' into develop 2025-01-08 11:50:27 +01:00
andrea.villa 590f332cea Aggiunta gestione FACOLTATIVA 'EstimationRapidMultiplier' in MLDE per regolare il tempo stimato 2025-01-08 11:50:14 +01:00
andrea.villa c4c818eb6a Merge remote-tracking branch 'origin/main' into develop 2025-01-07 14:37:36 +01:00
andrea.villa 49316c92fc Merge branch 'develop' 2025-01-07 14:37:19 +01:00
andrea.villa a479cfac69 Commit per versione 2025-01-07 14:36:41 +01:00
andrea.villa 692601f07e Aumentati limiti massimi di pinzaggio minimo 2024-12-18 12:03:30 +01:00
andrea.villa 487bbf1ce6 Per controllo NUM si blocca generazione se lavorazione con aggregato (mai gestito) 2024-12-12 14:56:58 +01:00
andrea.villa c7ebf339ec Nuovo aggregato 90° (H7) per fresa tipo BlockHaus. 2024-12-05 16:23:42 +01:00
andrea.villa 685e63dd83 Merge remote-tracking branch 'origin/main' into develop 2024-12-02 08:25:40 +01:00
andrea.villa a19947f6c2 Merge branch 'develop' 2024-12-02 08:25:22 +01:00
andrea.villa 07770ea12e Commit per versione 2024-12-02 08:25:12 +01:00
andrea.villa ce1ae72beb Per decidere posizione parcheggio barra dopo separazione, si considera lunghezza coda del pezzo in lavoro per evitare collisioni 2024-11-18 12:15:30 +01:00
andrea.villa 341e049753 Corretto movimento VMILL durante scarico pezzo piccolo a caduta 2024-11-14 10:42:10 +01:00
andrea.villa e8be6e9ca8 Merge remote-tracking branch 'origin/main' into develop 2024-11-11 09:25:01 +01:00
andrea.villa e4659394a5 Merge remote-tracking branch 'origin/develop' 2024-11-11 09:24:45 +01:00
andrea.villa 1e8dfdd2f0 - Aggiustato parametro in calcolo ingombro lavorazione
- Cambio versione
2024-11-11 09:24:31 +01:00
andrea.villa 1ff99e2f0f - Aggiunta gestione aggregato a T per NUM
- Tolta gestione testa dummy H4
2024-11-08 09:23:59 +01:00
andrea.villa e8958065ef Merge branch 'main' into develop 2024-10-25 14:35:55 +02:00
andrea.villa eff8fc90c6 Merge branch 'develop' 2024-10-25 14:35:50 +02:00
andrea.villa 4448156fec Miglioria 2.6j9. Si ribadisce pinza in presa sempre, all'inizio, in base a quella attiva 2024-10-25 14:35:36 +02:00
andrea.villa f346df9d27 Merge remote-tracking branch 'origin/main' into develop 2024-10-22 11:18:16 +02:00
andrea.villa 810f85c62a Merge branch 'hotfix/NewReposClampAfterTurn' 2024-10-22 11:17:35 +02:00
andrea.villa 6ec26b5ad1 Miglioria 2.6j6. Oltre al passo pellegrino si ribadisce anche quando è scambio diretto 2024-10-22 11:16:47 +02:00
andrea.villa 304701cb77 Merge branch 'main' into develop 2024-10-21 08:44:10 +02:00
andrea.villa 306945f09b Merge branch 'hotfix/BugFixRepositioningTolerance' 2024-10-21 08:44:03 +02:00
andrea.villa 09eb355037 Corretto problema tolleranza aggiunto con versione 2.6j7 2024-10-21 08:43:49 +02:00
andrea.villa 30ed6aa984 Merge remote-tracking branch 'origin/main' into develop 2024-10-18 10:21:52 +02:00
andrea.villa ff7338e2f4 Merge branch 'hotfix/NewRepositioningTolerance' 2024-10-18 10:21:07 +02:00
andrea.villa 4903a6065e In nuova disposizione carrelli, aggiunta tolleranza di 100 EPS quando si calcola minimo posizionamento 2024-10-18 10:20:51 +02:00
andrea.villa 36df78ed67 Merge remote-tracking branch 'origin/main' into develop 2024-10-17 16:10:15 +02:00
andrea.villa 3132d213c1 Commit per versione 2024-10-17 16:10:03 +02:00
andrea.villa cbf5df9895 Merge branch 'hotfix/NewRepositioning' 2024-10-17 16:08:39 +02:00
andrea.villa ec8fa72ca2 Si ribadisce che la pinza era in presa, prima di cominciare con lo scambio del passo del pellegrino 2024-10-17 16:08:22 +02:00
andrea.villa 8c5e759bec Merge remote-tracking branch 'origin/main' into develop 2024-10-17 09:28:19 +02:00
andrea.villa 6ace9c266d Merge remote-tracking branch 'origin/develop' 2024-10-17 09:28:03 +02:00
andrea.villa 2a7b732444 Piccola correzione nuovo riposizionamento. Nel taglio dello scarto finale riposizionava nel vuoto 2024-10-17 09:27:45 +02:00
andrea.villa 6206ba44db Merge remote-tracking branch 'origin/main' into develop 2024-10-15 09:10:14 +02:00
andrea.villa ad882352d0 Merge remote-tracking branch 'origin/develop' 2024-10-15 09:09:56 +02:00
andrea.villa 8ef399a55c - Piccola correzione nuovo riposizionamento. Non considerava i 50mm di tolleranza su primo pinzaggio dopo ribaltamento
- Gestione attivazione pressore verticale in nuovo riposizionamento
2024-10-15 09:09:45 +02:00
andrea.villa e397ac2627 Merge branch 'main' into develop 2024-10-11 14:50:07 +02:00
andrea.villa cfc1fbc6b6 Merge remote-tracking branch 'origin/develop' 2024-10-11 14:49:49 +02:00
andrea.villa 3b91c0c603 Corretta scrittura macro start/attesa movimenti per NUM. Veniva scritto codice per TPA. 2024-10-11 14:49:30 +02:00
andrea.villa a2d0ff4d77 Merge remote-tracking branch 'origin/main' into develop 2024-10-03 10:25:40 +02:00
andrea.villa 977f006bdc Merge remote-tracking branch 'origin/develop' 2024-10-03 10:25:20 +02:00
andrea.villa aad0a2dee1 Piccola correwzione calcolo posizione carrello durante riposizionamento, nuova gestione 2024-10-03 10:24:52 +02:00
andrea.villa 5589385f4d Merge branch 'main' into develop 2024-10-01 08:12:46 +02:00
andrea.villa 5fa764cb96 Merge remote-tracking branch 'origin/develop' 2024-10-01 08:12:39 +02:00
andrea.villa f78a042dbe Commit per versione 2024-10-01 08:12:29 +02:00
andrea.villa 1c80767eee Sistemato calcolo in nuova disposzione carrelli 2024-09-26 18:12:26 +02:00
andrea.villa 369d1a7456 Merge remote-tracking branch 'origin/main' into develop 2024-09-26 18:12:03 +02:00
andrea.villa d23a9c6fa9 Migliorata gestione movimenti per portare testa vicino a cambio utensile se trave alta. 2024-09-25 13:22:18 +02:00
andrea.villa fbfe8187b9 Merge remote-tracking branch 'origin/develop' 2024-09-24 17:41:08 +02:00
andrea.villa 3ef4c18fe6 Corretto emissione movimento ZMAX con EMT.FLAG =5 2024-09-24 17:40:56 +02:00
andrea.villa b50c4ef806 - Tolto controllo su lunghezza maggiore di 200mm introdotto con 2.6i2
- Gestione in OnRapid() di EMT.FLAG=5
2024-09-24 16:03:40 +02:00
andrea.villa 7a7981fddb Merge remote-tracking branch 'origin/main' into develop 2024-09-24 10:13:27 +02:00
andrea.villa 74a0bc4a43 Aggiunto ripinzaggio extra in caso servisse un grande spostamento e si sta pinzando poco 2024-09-24 10:13:10 +02:00
andrea.villa 4cc2e5a2d7 Merge remote-tracking branch 'origin/main' into develop 2024-09-23 12:55:32 +02:00
andrea.villa 24857bc252 Merge branch 'develop' 2024-09-23 12:55:14 +02:00
andrea.villa 5e90232086 - Aggiunta nuova strategia riposizionamento morse
- Aggiunta lettura flag NEWCLAMPING in BeamData, per abilitare nuova strategia riposizionamento
- Aggiunta lettura flag FASTCLAMPING. Se false, al carico prende al massimo 1000mm
2024-09-23 12:54:44 +02:00
andrea.villa 6e1faf69bc Merge branch 'NewClampRepos' into develop 2024-09-23 12:49:53 +02:00
andrea.villa 8fdda065d4 Ripristinato vecchio metodo riposizionamento morse 2024-09-23 11:28:35 +02:00
andrea.villa 5ae185cd0e Prima versione funzionante con tutti i test 101 e altri test ulteriori 2024-09-23 09:51:06 +02:00
andrea.villa 446b56d975 Piccole correzioni a calcoli e gestione offset iniziale 2024-09-20 17:05:55 +02:00
andrea.villa 48626b7f90 - Compensazione errore laser al carico per primo riposizionamento
- Rimosse variabili non più utilizzate
2024-09-20 16:00:24 +02:00
andrea.villa 21104984ad Aggiunto controllo tolleranza su posizione pinze per evitare riposizionamenti 2024-09-20 12:13:25 +02:00
andrea.villa c33c3196f2 Rimosse variabili non più utilizzate 2024-09-20 10:01:56 +02:00
andrea.villa 9b6c24017d Piccole correzioni ai calcoli del posizionamento 2024-09-20 08:19:22 +02:00
andrea.villa 5b7bab2873 Rivisitazione condizioni per scambio diretto 2024-09-19 12:07:30 +02:00
andrea.villa 1886d6620e Se posso fare scambio diretto non suddivido il movimento 2024-09-18 10:29:42 +02:00
andrea.villa 235a8dacb7 Offset minimo impostato prima del controllo se spostare morse 2024-09-18 08:28:26 +02:00
andrea.villa aad2a95dff - Risalita a ZMAX
- Migliorie se scambio diretto
2024-09-17 15:56:47 +02:00
andrea.villa 26126ac892 Aggiunto gestione riposizionamento per trave che si muove dallo scarico al carico 2024-09-17 12:52:32 +02:00
andrea.villa 5491e5cd81 Cancellate vecchie funzioni 2024-09-17 12:32:25 +02:00
andrea.villa 16e04c8502 Prima bozza nuova gestione riposizionamento carrelli 2024-09-17 12:24:29 +02:00
andrea.villa 3b1133f88c Merge branch 'main' into develop 2024-09-16 10:29:16 +02:00
andrea.villa 5d72e04f7e Merge remote-tracking branch 'origin/develop' 2024-09-16 10:28:55 +02:00
andrea.villa 72d61b4561 - Se utensili più lunghi di 200mm, si ruota in home e poi si approccia il pezzo.
- Aumentata distanza ingombro da 650mm a 660mm.
2024-09-16 10:28:41 +02:00
andrea.villa 7a16f26a63 Merge remote-tracking branch 'origin/main' into develop 2024-09-02 08:56:48 +02:00
andrea.villa c425cf1be3 Merge branch 'develop' 2024-09-02 08:56:27 +02:00
andrea.villa 79ecca7e02 Commit per versione 2024-09-02 08:56:17 +02:00
andrea.villa b9cc8a3aa9 Rinominato file da "Common-" a "Common_" 2024-08-02 09:32:17 +02:00
andrea.villa 0c8769dd81 Merge branch 'main' into develop 2024-07-03 10:07:33 +02:00
andrea.villa 7c9ec51f55 corretto nome versione in Version.lua 2024-07-03 10:07:09 +02:00
andrea.villa d0817659e5 Merge branch 'main' into develop 2024-07-03 10:05:57 +02:00
andrea.villa f283fe8fa9 Merge branch 'develop' 2024-07-03 10:05:36 +02:00
andrea.villa 87a7a89dbd commit per versione 2024-07-03 10:05:26 +02:00
andrea.villa 1a1f775c88 Per controllo NUM, se arco maggiore di 99999mm, si approssima con una retta 2024-06-26 16:32:03 +02:00
andrea.villa fd7cc25a4f Corretto chiamata macro precarico in caso di taglio finale, ma con ribaltaemnto successivo. 2024-06-26 15:20:15 +02:00
andrea.villa bdbec7cf37 Merge branch 'main' into develop 2024-05-06 16:37:51 +02:00
andrea.villa 6f115a81a0 Gestione facoltativa parametri MIN_JOIN_xx settabili in Ts3 2024-05-06 16:37:35 +02:00
andrea.villa 8e6daeeac7 Merge branch 'main' into develop 2024-05-06 14:52:48 +02:00
andrea.villa f029673970 Modificata tolleranza calcolo ingombri lavorazioni per posizionamento pinze 2024-05-06 14:52:33 +02:00
andrea.villa 01e5018c3d Merge branch 'main' into develop 2024-04-30 16:53:49 +02:00
andrea.villa c91ded71cd Merge branch 'develop' 2024-04-30 16:53:31 +02:00
andrea.villa 1e00fa27a0 - Gestione facoltativa parametro WOOD_DENSITY con variabile 'WoodDensity' 2024-04-30 16:53:23 +02:00
andrea.villa d57b86b046 Merge branch 'main' into develop 2024-04-18 10:49:14 +02:00
7 changed files with 2217 additions and 560 deletions
+144 -37
View File
@@ -3,9 +3,10 @@
-- carico librerie -- carico librerie
local INFO_STD_PP = require( 'Version') local INFO_STD_PP = require( 'Version')
local BD = require( 'BeamData')
-- Variabili di modulo -- Variabili di modulo
local CSP_INFO = INFO_STD_PP.NAME..' ver.'..INFO_STD_PP.VERSION..' by EgalWare s.r.l.' local CSP_INFO = INFO_STD_PP.NAME..'_'..NumericalControl..' ver.'..INFO_STD_PP.VERSION..' by EgalWare s.r.l.'
local MACHINE_INFO = MACH_NAME..' ver.'..PP_VER local MACHINE_INFO = MACH_NAME..' ver.'..PP_VER
local TEST_USE = false local TEST_USE = false
@@ -26,7 +27,9 @@ function OnStart()
--EMT.LINEINC = 1 -- incremento numerazione linee --EMT.LINEINC = 1 -- incremento numerazione linee
--EMT.Ft = 'F' -- token per feed --EMT.Ft = 'F' -- token per feed
--EMT.St = 'S' -- token per speed --EMT.St = 'S' -- token per speed
EMT.FMAXPINZE = 154000 -- feed massima pinze EMT.FMAXPINZE = EgtClamp( MaxFeedPinze or 154000, 20000, 160000) -- feed massima pinze
EMT.MAXACC = MaxAcc or ( EMT.FMAXPINZE / ( 60 * 0.3)) -- accelerazione massima pinze
EMT.MINACC = MinAcc or ( EMT.FMAXPINZE / ( 60 * 4)) -- accelerazione minima pinze
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
@@ -52,6 +55,7 @@ function OnProgramStart()
end end
EmtOutput( sPrefixCommentLine..'('.. CSP_INFO..')') EmtOutput( sPrefixCommentLine..'('.. CSP_INFO..')')
EmtOutput( sPrefixCommentLine..'('.. MACHINE_INFO..')\n') EmtOutput( sPrefixCommentLine..'('.. MACHINE_INFO..')\n')
EmtOutput( '(HEADER)')
-- Se modalità test, aggiungo linee per muovere tappeto e alzare la testa (in automatico viene fatto dal main residente) -- Se modalità test, aggiungo linee per muovere tappeto e alzare la testa (in automatico viene fatto dal main residente)
if TEST_USE then if TEST_USE then
EmtOutput( 'M28') EmtOutput( 'M28')
@@ -103,6 +107,7 @@ function OnProgramEnd()
EMT.FALL = nil EMT.FALL = nil
EMT.RELOAD = nil EMT.RELOAD = nil
EMT.RELOAD2 = nil EMT.RELOAD2 = nil
EmtOutput( '(FOOTER)')
-- Se modalità test, termino il programma -- Se modalità test, termino il programma
if TEST_USE then if TEST_USE then
EmtOutput( 'M02') EmtOutput( 'M02')
@@ -180,16 +185,12 @@ function OnDispositionEnd()
local STrave = EMT.ST local STrave = EMT.ST
local HOverM = EMT.HOVM local HOverM = EMT.HOVM
-- calcolo dati pinze -- calcolo dati pinze
local MinAccPinze = 0.3 local KgMtCubo= WoodDensity or 550 -- densità legno in Kg / metro cubo
local MaxAccPinze = 4
local KgMtCubo= 550 -- densità legno in Kg / metro cubo
local Massa = ( HTrave * STrave * LBarra * KgMtCubo ) / 1000000000 local Massa = ( HTrave * STrave * LBarra * KgMtCubo ) / 1000000000
local FMaxPinze = EMT.FMAXPINZE local FMaxPinze = EMT.FMAXPINZE
local ForzaAtrito = 700 / 2 -- Serve per regolare P32 (700 valore reale pistone) local ForzaAtrito = 700 / 2 -- Serve per regolare P32 (700 valore reale pistone)
local TempoAcc = ( ( Massa * FMaxPinze) / ( 60 * ForzaAtrito) / 1000) local TempoAcc = ( ( Massa * FMaxPinze) / ( 60 * ForzaAtrito) / 1000)
if ( TempoAcc < MinAccPinze) then TempoAcc = MinAccPinze end local AccPinze = EgtClamp( FMaxPinze / ( 60 * TempoAcc), EMT.MINACC, EMT.MAXACC)
if ( TempoAcc > MaxAccPinze) then TempoAcc = MaxAccPinze end
local AccPinze = FMaxPinze / ( 60 * TempoAcc)
local RidFeed = 100 / Massa * 100 local RidFeed = 100 / Massa * 100
if ( RidFeed > 100) then RidFeed = 100 end if ( RidFeed > 100) then RidFeed = 100 end
if IdTrave >= 0 then if IdTrave >= 0 then
@@ -249,9 +250,9 @@ function OnDispositionEnd()
EmtOutput( sOut) EmtOutput( sOut)
-- altrimenti recupero rimanenza -- altrimenti recupero rimanenza
else else
EmtOutput( 'G112 EC1'..' Y'..EmtLenToString( LoadT, 3).. ' EY'..EmtLenToString( EMT.YPOS, 3)..' EV'..EmtLenToString( ParkV, 3) ..' EF'..GetFmaxClamp()) EmtOutput( 'G112 EC1'..' Y'..EmtLenToString( EMT.TPOS, 3).. ' EY'..EmtLenToString( EMT.YPOS, 3)..' EV'..EmtLenToString( ParkV, 3) ..' EF'..GetFmaxClamp())
-- aggiorno dati aggancio carrelli alla trave -- aggiorno dati aggancio carrelli alla trave
EMT.YDELTA = EMT.YPOS - LoadT EMT.YDELTA = EMT.YPOS - EMT.TPOS
EMT.VDELTA = nil EMT.VDELTA = nil
end end
-- eventuale preparazione per rotazione immediata -- eventuale preparazione per rotazione immediata
@@ -495,6 +496,7 @@ function OnMachiningEnd()
EMT.U_STD = nil EMT.U_STD = nil
EMT.PREVTOOL = EMT.TOOL EMT.PREVTOOL = EMT.TOOL
EMT.PREVHEAD = EMT.HEAD EMT.PREVHEAD = EMT.HEAD
EMT.PREVET = GetET( EMT.HEAD, EMT.TCPOS, EMT.R3)
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
@@ -508,6 +510,7 @@ function OnPathStart()
-- salvo precedenti rotanti -- salvo precedenti rotanti
EMT.R1pp = EMT.R1p EMT.R1pp = EMT.R1p
EMT.R2pp = EMT.R2p EMT.R2pp = EMT.R2p
EMT.R3pp = EMT.R3p
-- reset valori precedenti (per forzare emissione di tutti gli assi del 1° movimento) -- reset valori precedenti (per forzare emissione di tutti gli assi del 1° movimento)
EmtResetPrev() EmtResetPrev()
@@ -602,9 +605,14 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function OnRapid() function OnRapid()
-- recupero prossimo utensile
EMT.NEXTTOOL, EMT.NEXTHEAD, EMT.NEXTTCPOS = FindNextTool()
MyBackupAxes() MyBackupAxes()
-- se primo movimento della lavorazione, gestione speciale -- se primo movimento della lavorazione, gestione speciale
if EMT.MCHFIRST and not EMT.OPEISDISP then if EMT.MCHFIRST and not EMT.OPEISDISP then
-- primo posizionamento
local MyZHome = EgtGetAxisHomePos( 'Z')
local bZmax = ( #EMT.AUXSTR > 0 or EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1)
-- decido se muovere prima testa o carrelli (standard prima testa) -- decido se muovere prima testa o carrelli (standard prima testa)
local bHeadFirst = true local bHeadFirst = true
local sLateG101 local sLateG101
@@ -623,15 +631,31 @@ function OnRapid()
end end
end end
-- primo posizionamento local sET = GetET( EMT.HEAD, EMT.TCPOS, EMT.R3)
local MyZHome = EgtGetAxisHomePos( 'Z')
local bZmax = ( #EMT.AUXSTR > 0 or EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1) local bGoToHome = false
-- se gli assi rotanti cambiano parecchio, con motosega si va in parcheggio
if EMT.PREVHEAD == 'H3' and EMT.HEAD == 'H3' and ( sET ~= EMT.PREVET or abs( EMT.R2pp - EMT.R2) > 25 or abs( EMT.R1pp - EMT.R1) > 25) then
bGoToHome = true
end
-- ricavo i dati per la lavorazione
local sEE = ' EE' .. EgtIf( bZmax, '3', '4')
local sEL = ' EL' .. EmtLenToString( EgtIf( EMT.HEAD ~= 'H3', EMT.TLEN, ( EMT.TDIST or ChSawLen)), 3)
local sER = ' ER' .. EmtLenToString( EgtIf( EMT.HEAD ~= 'H3', EMT.TDIAM / 2, EMT.TLEN), 3)
local sES = ' ES'..EgtNumToString( EMT.S, 0)
-- se avevo motosega, torno in zona sicura senza ruotare assi rotanti -- se avevo motosega, torno in zona sicura senza ruotare assi rotanti
if EMT.PREVHEAD == 'H3' and EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then if not EMT.LOAD and EMT.PREVHEAD == 'H3' and EMT.FLAG2 == 1 then
-- se ho ancora motosega, si setta già asse C, altrimenti asse C per andare in home
local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) .. local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
' B' .. EmtLenToString( EMT.R2pp, 3) .. ' C' .. EmtLenToString( EMT.R1pp, 3) .. ' B' .. EmtLenToString( EMT.R2pp, 3) .. ' C' .. EmtLenToString( EMT.R1pp, 3) ..
' EE' .. EgtIf( bZmax, '3', '4') .. EMT.PREVsEL .. EMT.PREVsER .. EMT.PREVsET .. EMT.PREVsES ' EE' .. EgtIf( bZmax, '3', '4') .. EMT.PREVsEL .. EMT.PREVsER .. EMT.PREVsET .. EMT.PREVsES
EmtOutput( sOutPreMove) EmtOutput( sOutPreMove)
sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
' B' .. EmtLenToString( 0, 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 ET1001')
EmtOutput( 'G101 ET2001') EmtOutput( 'G101 ET2001')
end end
@@ -641,18 +665,27 @@ function OnRapid()
EmtOutput( '( *** ' .. sOut .. ' *** )') EmtOutput( '( *** ' .. sOut .. ' *** )')
end end
-- ricavo i dati per la lavorazione
local sEE = ' EE' .. EgtIf( bZmax, '3', '4')
local sEL = ' EL' .. EmtLenToString( EgtIf( EMT.HEAD ~= 'H3', EMT.TLEN, ( EMT.TDIST or ChSawLen)), 3)
local sER = ' ER' .. EmtLenToString( EgtIf( EMT.HEAD ~= 'H3', EMT.TDIAM / 2, EMT.TLEN), 3)
local sET = GetET( EMT.HEAD, EMT.TCPOS, EMT.R3)
local sES = ' ES'..EgtNumToString( EMT.S, 0)
-- se carico motosega, ruoto in zona sicura prima di approcciare la lavorazione -- se carico motosega, ruoto in zona sicura prima di approcciare la lavorazione
if EMT.HEAD == 'H3' and EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then if EMT.HEAD == 'H3' and EMT.PREVHEAD ~= 'H3' then
local sEEPreMove = ' EE' .. EgtIf( bZmax, '3', '4')
local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) .. local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
EmtGetAxis( 'R2') .. EmtGetAxis( 'R1') .. sEE .. sEL .. sER .. sET .. sES ' B' .. EgtNumToString( 0, 3) .. ' C' .. EgtNumToString( EMT.R1, 3) .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOutPreMove)
sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
' B' .. EgtNumToString( EMT.R2, 3) .. ' C' .. EgtNumToString( EMT.R1, 3) .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOutPreMove)
EmtOutput( 'G101 ET1001')
EmtOutput( 'G101 ET2001')
-- se carico motosega, ruoto in zona sicura prima di approcciare la lavorazione
elseif not EMT.LOAD and ( EMT.HEAD == 'H3' or ( bZmax and EMT.TTOTLEN > 200)) and
( EMT.ST > BeamHeightForFixRot or ( EMT.HEAD == 'H1' and EMT.TTOTLEN > 350) or bGoToHome) and EMT.FLAG2 == 1 then
local sOutPreMove
if EMT.HEAD == 'H3' and bGoToHome then
sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
' B' .. EgtNumToString( 0, 3) .. ' C' .. EgtNumToString( EMT.R1, 3) .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOutPreMove)
end
sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
' B' .. EgtNumToString( EMT.R2, 3) .. ' C' .. EgtNumToString( EMT.R1, 3) .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOutPreMove) EmtOutput( sOutPreMove)
EmtOutput( 'G101 ET1001') EmtOutput( 'G101 ET1001')
EmtOutput( 'G101 ET2001') EmtOutput( 'G101 ET2001')
@@ -833,12 +866,47 @@ function OnRapid()
EmtAdjustRotaryAxes() EmtAdjustRotaryAxes()
EmitZmax() EmitZmax()
EMT.ZMAX = true EMT.ZMAX = true
-- se pezzi alti e devo cambiare utensile su testa con CU, porto la testa vicino al cambio utensile
if EMT.ST > BeamHeightForFixRot and EMT.HEAD == 'H1' and EMT.TOOL ~= EMT.NEXTTOOL and EMT.NEXTHEAD ~= 'H2' then
local dBAxis = 90
local dCAxis = EgtIf( BD.RIGHT_LOAD, 90, -90)
local sEE = ' EE3'
local sEL = ' EL' .. EmtLenToString( EgtIf( EMT.HEAD ~= 'H3', EMT.TLEN, ( EMT.TDIST or ChSawLen)), 3)
local sER = ' ER' .. EmtLenToString( EgtIf( EMT.HEAD ~= 'H3', EMT.TDIAM / 2, EMT.TLEN), 3)
local sET = GetET( EMT.HEAD, EMT.TCPOS, EMT.R3)
local sES = ' ES'..EgtNumToString( EMT.S, 0)
local sOut = 'G101' .. EmtGetAxis( 'L2') .. EmtGetAxis( 'L3') ..' B' .. EgtNumToString( dBAxis, 3) ..
' C' .. EgtNumToString( dCAxis, 3) .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOut)
EmtOutput( 'G101 ET1001')
EmtOutput( 'G101 ET2001')
sOut = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. EmtGetAxis( 'L3') ..' B' .. EgtNumToString( dBAxis, 3) ..
' C' .. EgtNumToString( dCAxis, 3) .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOut)
EmtOutput( 'G101 ET1001')
EmtOutput( 'G101 ET2001')
end
-- se altrimenti movimento in Home -- se altrimenti movimento in Home
elseif EMT.FLAG == 4 then elseif EMT.FLAG == 4 then
-- non previsto -- non previsto
-- se altrimenti rotazione a Z max -- se altrimenti rotazione a Z max per lavorazione successiva
elseif EMT.FLAG == 5 then elseif EMT.FLAG == 5 then
-- viene gestito all'inizio della lavorazione successiva EMT.REFLOC = nil
EMT.IPLGL = false
MyAdjustLinearAxes()
EmtAdjustRotaryAxes()
EmtResetPrev()
-- ricavo i dati per la lavorazione
local sEE = ' EE3'
local sEL = ' EL' .. EmtLenToString( EgtIf( EMT.HEAD ~= 'H3', EMT.TLEN, ( EMT.TDIST or ChSawLen)), 3)
local sER = ' ER' .. EmtLenToString( EgtIf( EMT.HEAD ~= 'H3', EMT.TDIAM / 2, EMT.TLEN), 3)
local sET = GetET( EMT.HEAD, EMT.TCPOS, EMT.R3)
local sES = ' ES'..EgtNumToString( EMT.S, 0)
local sOut = 'G101' .. EmtGetAxis( 'L2') .. EmtGetAxis( 'L3') ..
EmtGetAxis( 'R2') .. EmtGetAxis( 'R1') .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOut)
EmtOutput( 'G101 ET1001')
EmtOutput( 'G101 ET2001')
-- altrimenti errore -- altrimenti errore
else else
EmtSetLastError( 1212, "Unknown Rapid flag") EmtSetLastError( 1212, "Unknown Rapid flag")
@@ -930,13 +998,46 @@ function OnArc()
local sFeed = EmtGetFeed() local sFeed = EmtGetFeed()
-- tipo arco -- tipo arco
local sArc = 'G' .. EgtNumToString(EMT.MOVE,0) local sArc = 'G' .. EgtNumToString(EMT.MOVE,0)
-- emetto arco -- se arco molto grande, approssimo con una retta
EmtOutput( sArc..sAxes..sRad..sFeed) if EMT.RR > 99999 then
EmtOutput( "G1"..sAxes..sFeed)
else
EmtOutput( sArc..sAxes..sRad..sFeed)
end
-- aggiorno valori come precedenti -- aggiorno valori come precedenti
EmtUpdatePrev() EmtUpdatePrev()
end end
---------------------------------------------------------------------
function FindNextTool()
-- salvo stato iniziale
local CurrMachId = EgtGetCurrMachining()
local CurrTool = EgtTdbGetCurrToolParam( MCH_TP.NAME)
-- cerco lavorazione con utensile su gruppo testa indicato
local sTool, sHead, sTcPos
local OpId = EgtGetNextActiveOperation( CurrMachId or EMT.MCHID)
while OpId do
local nType = EgtGetOperationType( OpId)
if nType ~= MCH_OY.NONE and nType ~= MCH_OY.DISP then
if EgtSetCurrMachining( OpId) then
sTool = EgtGetMachiningParam( MCH_MP.TOOL)
if EgtTdbSetCurrTool( sTool) then
sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
sTcPos = EgtTdbGetCurrToolParam( MCH_TP.TCPOS)
break
end
end
end
OpId = EgtGetNextActiveOperation( OpId)
end
-- ripristino stato iniziale
EgtSetCurrMachining( CurrMachId or GDB_ID.NULL)
EgtTdbSetCurrTool( CurrTool or '')
-- restituisco risultato
return sTool, sHead, sTcPos
end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function CalcCharStatus( sCmd, bSkipPress) function CalcCharStatus( sCmd, bSkipPress)
-- aperto -- aperto
@@ -1247,7 +1348,7 @@ function PrepareUnload( sCmd)
table.insert( EMT.AUXCMD, sMsg) table.insert( EMT.AUXCMD, sMsg)
if Cmd[2] == 'V' then if Cmd[2] == 'V' then
-- se non è ultima fase c'è una barra sulla pinza Y (1) -- se non è ultima fase c'è una barra sulla pinza Y (1)
local sEE = EgtIf( EMT.PHASE == EgtGetPhaseCount(), '0', '1') local sEE = EgtIf( EMT.PHASE == EgtGetPhaseCount() or IsEnd2Phase( EMT.PHASE), '0', '1')
local sOut = 'G111 '..Cmd[2]..Cmd[3]..' EC141 ED83 EE'..sEE..' EF'..GetFmaxClamp() local sOut = 'G111 '..Cmd[2]..Cmd[3]..' EC141 ED83 EE'..sEE..' EF'..GetFmaxClamp()
table.insert( EMT.AUXSTR, sOut) table.insert( EMT.AUXSTR, sOut)
end end
@@ -1256,7 +1357,7 @@ function PrepareUnload( sCmd)
table.insert( EMT.AUXCMD, sMsg) table.insert( EMT.AUXCMD, sMsg)
if Cmd[4] == 'V' then if Cmd[4] == 'V' then
-- se non è ultima fase c'è una barra sulla pinza Y (1) -- se non è ultima fase c'è una barra sulla pinza Y (1)
local sEAB = EgtIf( EMT.PHASE == EgtGetPhaseCount(), '111', '112') local sEAB = EgtIf( EMT.PHASE == EgtGetPhaseCount() or IsEnd2Phase( EMT.PHASE), '111', '112')
local sOut = 'G111 '..Cmd[4]..Cmd[5]..' EA'..sEAB..' EB'..sEAB..' EC142 ED141 EE2 EF'..GetFmaxClamp() local sOut = 'G111 '..Cmd[4]..Cmd[5]..' EA'..sEAB..' EB'..sEAB..' EC142 ED141 EE2 EF'..GetFmaxClamp()
table.insert( EMT.AUXSTR, sOut) table.insert( EMT.AUXSTR, sOut)
EMT.U_STD = true EMT.U_STD = true
@@ -1416,10 +1517,13 @@ function PreparePostRotation( sCmd)
elseif nVDelta > 0 then elseif nVDelta > 0 then
EMT.YDELTA = nil EMT.YDELTA = nil
EMT.VDELTA = nVDelta EMT.VDELTA = nVDelta
end end
local sYLoad = ' Y'..EmtLenToString( LoadT) local sYLoad = ' Y'..EmtLenToString( LoadT)
local sOut = 'G111'..sYLoad..' EA76'..EMT.SB..' EE0 EF'..EmtLenToString( EMT.FMAXPINZE,0)..' ET1' local sOut = 'G111'..sYLoad..' EA76'..EMT.SB..' EE0 EF'..EmtLenToString( EMT.FMAXPINZE,0)..' ET1'
table.insert( EMT.AUXSTR, sOut) table.insert( EMT.AUXSTR, sOut)
-- setto parametri di pinzaggio reali
EMT.SA = ' EA110'
EMT.SE = ' EE1'
end end
end end
@@ -1461,10 +1565,13 @@ function MyAdjustLinearAxes()
if EMT.REFLOC then if EMT.REFLOC then
local vtE local vtE
if EMT.HEAD ~= 'H3' then -- su NUM aggregati non gestiti
if EMT.HEAD == 'H5' or EMT.HEAD == 'H6' or EMT.HEAD == 'H7' then
EmtSetLastError( 1211, "Aggregates not managed")
elseif EMT.HEAD ~= 'H3' then
local Len = EMT.TLEN + EgtIf( EMT.HEAD == 'H1', MillOffs, abs( SawOffs)) local Len = EMT.TLEN + EgtIf( EMT.HEAD == 'H1', MillOffs, abs( SawOffs))
local LenRef = MillOffs local LenRef = MillOffs
vtE = Vector3d( EMT.EXTR) * Len - Z_AX() * LenRef vtE = Vector3d( EMT.TDIR) * Len - Z_AX() * LenRef
else else
local LenAux = ( EMT.TDIST or ChSawLen) + MillOffs local LenAux = ( EMT.TDIST or ChSawLen) + MillOffs
local LenRef = MillOffs local LenRef = MillOffs
@@ -1576,7 +1683,7 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function GetET( sHead, sTcPos, dAxR3) function GetET( sHead, sTcPos, dAxR3)
if sHead == 'H1' then if sHead == 'H1' or sHead == 'H5' or sHead == 'H6' or sHead == 'H7' then
return ' E'..sTcPos return ' E'..sTcPos
elseif sHead == 'H2' then elseif sHead == 'H2' then
return ' ET42' return ' ET42'
@@ -3,9 +3,10 @@
-- carico librerie -- carico librerie
local INFO_STD_PP = require( 'Version') local INFO_STD_PP = require( 'Version')
local BD = require( 'BeamData')
-- Variabili di modulo -- Variabili di modulo
local CSP_INFO = INFO_STD_PP.NAME..' ver.'..INFO_STD_PP.VERSION..' by EgalWare s.r.l.' local CSP_INFO = INFO_STD_PP.NAME..'_'..NumericalControl..' ver.'..INFO_STD_PP.VERSION..' by EgalWare s.r.l.'
local MACHINE_INFO = MACH_NAME..' ver.'..PP_VER local MACHINE_INFO = MACH_NAME..' ver.'..PP_VER
local TEST_USE = false local TEST_USE = false
@@ -26,7 +27,9 @@ function OnStart()
--EMT.LINEINC = 1 -- incremento numerazione linee --EMT.LINEINC = 1 -- incremento numerazione linee
--EMT.Ft = 'F' -- token per feed --EMT.Ft = 'F' -- token per feed
--EMT.St = 'S' -- token per speed --EMT.St = 'S' -- token per speed
EMT.FMAXPINZE = 154000 -- feed massima pinze EMT.FMAXPINZE = EgtClamp( MaxFeedPinze or 154000, 20000, 160000) -- feed massima pinze
EMT.MAXACC = MaxAcc or ( EMT.FMAXPINZE / ( 60 * 0.3)) -- accelerazione massima pinze
EMT.MINACC = MinAcc or ( EMT.FMAXPINZE / ( 60 * 4)) -- accelerazione minima pinze
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
@@ -52,6 +55,7 @@ function OnProgramStart()
end end
EmtOutput( sPrefixCommentLine..'('.. CSP_INFO..')') EmtOutput( sPrefixCommentLine..'('.. CSP_INFO..')')
EmtOutput( sPrefixCommentLine..'('.. MACHINE_INFO..')\n') EmtOutput( sPrefixCommentLine..'('.. MACHINE_INFO..')\n')
EmtOutput( '(HEADER)')
-- Se modalità test, aggiungo linee per muovere tappeto e alzare la testa (in automatico viene fatto dal main residente) -- Se modalità test, aggiungo linee per muovere tappeto e alzare la testa (in automatico viene fatto dal main residente)
if TEST_USE then if TEST_USE then
EmtOutput( 'M28') EmtOutput( 'M28')
@@ -107,6 +111,7 @@ function OnProgramEnd()
EMT.FALL = nil EMT.FALL = nil
EMT.RELOAD = nil EMT.RELOAD = nil
EMT.RELOAD2 = nil EMT.RELOAD2 = nil
EmtOutput( '(FOOTER)')
-- Se modalità test, termino il programma -- Se modalità test, termino il programma
if TEST_USE then if TEST_USE then
EmtOutput( 'M02') EmtOutput( 'M02')
@@ -144,7 +149,11 @@ function OnToolData()
local sPos = 'N2' .. tostring(nPos) local sPos = 'N2' .. tostring(nPos)
local sOut = 'L11=' .. EmtLenToString( EMT.SMAX, 3) .. ' L12=' .. EmtLenToString( AngTr1Offs, 1)..' G76H9998.1'..sPos..sPos local sOut = 'L11=' .. EmtLenToString( EMT.SMAX, 3) .. ' L12=' .. EmtLenToString( AngTr1Offs, 1)..' G76H9998.1'..sPos..sPos
EmtOutput( sOut) EmtOutput( sOut)
-- altro non previsto -- emissione dati sega a catena
elseif EMT.HEAD == 'H7' then
local sOut = 'L11='..EgtNumToString( EMT.SMAX, 0)..' L12='..EmtLenToString( ( 154.5), 1)..' G76H9998.1N121N121'
EmtOutput( sOut)
-- altro non previsto
end end
end end
@@ -198,9 +207,9 @@ function OnDispositionEnd()
local BtlInfoId = EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo') or EgtGetCurrMachGroup() or GDB_ID.NULL local BtlInfoId = EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo') or EgtGetCurrMachGroup() or GDB_ID.NULL
local nLoad90 = EgtGetInfo( BtlInfoId, 'LOAD90', 'i') or 0 local nLoad90 = EgtGetInfo( BtlInfoId, 'LOAD90', 'i') or 0
-- calcolo dati pinze -- calcolo dati pinze
local AccPinze, AccMaxPinze, RidFeed, TempoAcc = CalcDinamicaPinze( HTrave, STrave, LBarra) local AccPinze, AccMaxPinze, RidFeed, TempoAcc = CalcDinamicaPinze_NUM( HTrave, STrave, LBarra)
local AccPinz1, AccMaxPinz1, RidFeed1, TempoAcc1 = CalcDinamicaPinze( HTrave, STrave, LBarra - LTrave) local AccPinz1, AccMaxPinz1, RidFeed1, TempoAcc1 = CalcDinamicaPinze_NUM( HTrave, STrave, LBarra - LTrave)
local AccPinz2, AccMaxPinz2, RidFeed2, TempoAcc2 = CalcDinamicaPinze( HTrave, STrave, LTrave) local AccPinz2, AccMaxPinz2, RidFeed2, TempoAcc2 = CalcDinamicaPinze_NUM( HTrave, STrave, LTrave)
if IdTrave >= 0 then if IdTrave >= 0 then
local sOut = '( SN='..IdTrave..' LBarra='..EmtLenToString( LBarra, 3)..' L='..EmtLenToString( LTrave, 3).. local sOut = '( SN='..IdTrave..' LBarra='..EmtLenToString( LBarra, 3)..' L='..EmtLenToString( LTrave, 3)..
' H='..EmtLenToString( HTrave, 3)..' S='..EmtLenToString( STrave, 3)..' Acc='..EgtNumToString( TempoAcc, 1).. ' H='..EmtLenToString( HTrave, 3)..' S='..EmtLenToString( STrave, 3)..' Acc='..EgtNumToString( TempoAcc, 1)..
@@ -264,9 +273,9 @@ function OnDispositionEnd()
EmtOutput( sOut) EmtOutput( sOut)
-- altrimenti recupero rimanenza -- altrimenti recupero rimanenza
else else
EmtOutput( 'G112 EC1'..' Y'..EmtLenToString( LoadT, 3).. ' EY'..EmtLenToString( EMT.YPOS, 3)..' EV'..EmtLenToString( ParkV, 3) ..' EF'..GetFmaxClamp()) EmtOutput( 'G112 EC1'..' Y'..EmtLenToString( EMT.TPOS, 3).. ' EY'..EmtLenToString( EMT.YPOS, 3)..' EV'..EmtLenToString( ParkV, 3) ..' EF'..GetFmaxClamp())
-- aggiorno dati aggancio carrelli alla trave -- aggiorno dati aggancio carrelli alla trave
EMT.YDELTA = EMT.YPOS - LoadT EMT.YDELTA = EMT.YPOS - EMT.TPOS
EMT.VDELTA = nil EMT.VDELTA = nil
end end
-- eventuale preparazione per rotazione immediata -- eventuale preparazione per rotazione immediata
@@ -488,7 +497,7 @@ function OnMachiningEnd()
end end
for i = 1, #EMT.AUXSTR do for i = 1, #EMT.AUXSTR do
local sOut = EMT.AUXSTR[i] local sOut = EMT.AUXSTR[i]
if EMT.AUXTYPE == 'S' then if EMT.AUXTYPE == 'S' and sOut:find( 'G101 ') then
sOut = sOut .. ' EH1' sOut = sOut .. ' EH1'
elseif EMT.AUXTYPE == 'U' and not EMT.CHY_ON and not sOut:find( 'ET') then elseif EMT.AUXTYPE == 'U' and not EMT.CHY_ON and not sOut:find( 'ET') then
sOut = sOut .. ' ET2' sOut = sOut .. ' ET2'
@@ -535,6 +544,7 @@ function OnMachiningEnd()
EMT.PREVTOOL = EMT.TOOL EMT.PREVTOOL = EMT.TOOL
EMT.PREVHEAD = EMT.HEAD EMT.PREVHEAD = EMT.HEAD
EMT.PREVR3 = EMT.R3 EMT.PREVR3 = EMT.R3
EMT.PREVET = GetET( EMT.HEAD, EMT.TCPOS, EMT.R3)
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
@@ -548,6 +558,7 @@ function OnPathStart()
-- salvo precedenti rotanti -- salvo precedenti rotanti
EMT.R1pp = EMT.R1p EMT.R1pp = EMT.R1p
EMT.R2pp = EMT.R2p EMT.R2pp = EMT.R2p
EMT.R3pp = EMT.R3p
-- reset valori precedenti (per forzare emissione di tutti gli assi del 1° movimento) -- reset valori precedenti (per forzare emissione di tutti gli assi del 1° movimento)
EmtResetPrev() EmtResetPrev()
@@ -642,9 +653,14 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function OnRapid() function OnRapid()
-- recupero prossimo utensile
EMT.NEXTTOOL, EMT.NEXTHEAD, EMT.NEXTTCPOS = FindNextTool()
MyBackupAxes() MyBackupAxes()
-- se primo movimento della lavorazione, gestione speciale -- se primo movimento della lavorazione, gestione speciale
if EMT.MCHFIRST and not EMT.OPEISDISP then if EMT.MCHFIRST and not EMT.OPEISDISP then
-- primo posizionamento
local MyZHome = EgtGetAxisHomePos( 'Z')
local bZmax = ( #EMT.AUXSTR > 0 or EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1)
-- decido se muovere prima testa o carrelli (standard prima testa) -- decido se muovere prima testa o carrelli (standard prima testa)
local bHeadFirst = true local bHeadFirst = true
local sLateG101 local sLateG101
@@ -664,22 +680,12 @@ function OnRapid()
end end
end end
-- primo posizionamento local sET = GetET( EMT.HEAD, EMT.TCPOS, EMT.R3)
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 bGoToHome = false
local sOut = string.gsub( string.gsub( EMT.MCHNAME..'/'..EMT.TOOL, '%(', '-'), '%)', '-') -- se gli assi rotanti cambiano parecchio, con motosega si va in parcheggio
EmtOutput( '( *** ' .. sOut .. ' *** )') if EMT.PREVHEAD == 'H3' and EMT.HEAD == 'H3' and ( sET ~= EMT.PREVET or abs( EMT.R2pp - EMT.R2) > 25 or abs( EMT.R1pp - EMT.R1) > 25) then
bGoToHome = true
end end
-- ricavo i dati per la lavorazione -- ricavo i dati per la lavorazione
@@ -690,7 +696,7 @@ function OnRapid()
if EMT.HEAD == 'H3' then if EMT.HEAD == 'H3' then
sEL = sEL..EmtLenToString( ( EMT.TDIST or ChSawLen), 3) sEL = sEL..EmtLenToString( ( EMT.TDIST or ChSawLen), 3)
-- se aggregato -- se aggregato
elseif EMT.HEAD == 'H5' or EMT.HEAD == 'H6' then elseif EMT.HEAD == 'H5' or EMT.HEAD == 'H6' or EMT.HEAD == 'H7' then
sEL = sEL..EmtLenToString( AngTr1Offs, 3) sEL = sEL..EmtLenToString( AngTr1Offs, 3)
-- se testa normale ( H1 or H2) -- se testa normale ( H1 or H2)
else else
@@ -702,21 +708,56 @@ function OnRapid()
if EMT.HEAD == 'H3' then if EMT.HEAD == 'H3' then
sER = sER..EmtLenToString( EMT.TLEN, 3) sER = sER..EmtLenToString( EMT.TLEN, 3)
-- se aggregato -- se aggregato
elseif EMT.HEAD == 'H5' or EMT.HEAD == 'H6' then elseif EMT.HEAD == 'H5' or EMT.HEAD == 'H6' or EMT.HEAD == 'H7' then
sER = sER..EmtLenToString( EMT.TLEN + AngTr1Len, 3) sER = sER..EmtLenToString( EMT.TLEN + AngTr1Len, 3)
-- se testa normale ( H1 or H2) -- se testa normale ( H1 or H2)
else else
sER = sER..EmtLenToString( EMT.TDIAM / 2, 3) sER = sER..EmtLenToString( EMT.TDIAM / 2, 3)
end end
local sET = GetET( EMT.HEAD, EMT.TCPOS, EMT.R3)
local sES = ' ES'..EgtNumToString( EMT.S, 0) local sES = ' ES'..EgtNumToString( EMT.S, 0)
-- se carico motosega, ruoto in zona sicura prima di approcciare la lavorazione -- se avevo motosega, torno in zona sicura senza ruotare assi rotanti
if EMT.HEAD == 'H3' and EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then if not EMT.LOAD and EMT.PREVHEAD == 'H3' and EMT.FLAG2 == 1 then
local sEEPreMove = ' EE' .. EgtIf( bZmax, '3', '4') -- se ho ancora motosega, si setta già asse C, altrimenti asse C per andare in home
local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) .. local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
EmtGetAxis( 'R2') .. EmtGetAxis( 'R1') .. sEE .. sEL .. sER .. sET .. sES ' B' .. EmtLenToString( EMT.R2pp, 3) .. ' C' .. EmtLenToString( EMT.R1pp, 3) ..
' EE' .. EgtIf( bZmax, '3', '4') .. EMT.PREVsEL .. EMT.PREVsER .. EMT.PREVsET .. EMT.PREVsES
EmtOutput( sOutPreMove)
sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
' B' .. EmtLenToString( 0, 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
-- se carico motosega, ruoto in zona sicura prima di approcciare la lavorazione
if EMT.HEAD == 'H3' and EMT.PREVHEAD ~= 'H3' then
local sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
' B' .. EgtNumToString( 0, 3) .. ' C' .. EgtNumToString( EMT.R1, 3) .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOutPreMove)
sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
' B' .. EgtNumToString( EMT.R2, 3) .. ' C' .. EgtNumToString( EMT.R1, 3) .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOutPreMove)
EmtOutput( 'G101 ET1001')
EmtOutput( 'G101 ET2001')
-- ruoto in zona sicura prima di approcciare la lavorazione
elseif not EMT.LOAD and ( EMT.HEAD == 'H3' or ( bZmax and EMT.TTOTLEN > 200)) and
( EMT.ST > BeamHeightForFixRot or ( EMT.HEAD == 'H1' and EMT.TTOTLEN > 350) or bGoToHome) and EMT.FLAG2 == 1 then
local sOutPreMove
if EMT.HEAD == 'H3' and bGoToHome then
sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
' B' .. EgtNumToString( 0, 3) .. ' C' .. EgtNumToString( EMT.R1, 3) .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOutPreMove)
end
sOutPreMove = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. ' Z' .. EmtLenToString( MyZHome, 3) ..
' B' .. EgtNumToString( EMT.R2, 3) .. ' C' .. EgtNumToString( EMT.R1, 3) .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOutPreMove) EmtOutput( sOutPreMove)
EmtOutput( 'G101 ET1001') EmtOutput( 'G101 ET1001')
EmtOutput( 'G101 ET2001') EmtOutput( 'G101 ET2001')
@@ -843,7 +884,7 @@ function OnRapid()
sOut = 'G112 EA'..sA..' EB'..sB..EmtGetAxis('L1')..' EY'..sY..' EV'..sV..' EF'..GetFmaxClamp() sOut = 'G112 EA'..sA..' EB'..sB..EmtGetAxis('L1')..' EY'..sY..' EV'..sV..' EF'..GetFmaxClamp()
EmtOutput( sOut) EmtOutput( sOut)
-- se taglio di coda senza residuo da scaricare, emetto M175 per accelerare il carico della barra successiva -- se taglio di coda senza residuo da scaricare, emetto M175 per accelerare il carico della barra successiva
if EMT.MCHUSERNOTES and EMT.MCHUSERNOTES:find( 'Cut') then if EMT.MCHUSERNOTES and EMT.MCHUSERNOTES:find( 'Cut') and ( IsEndPhase( EMT.PHASE+1) or IsEnd2Phase( EMT.PHASE+1)) then
EmtOutput( '(M175)') EmtOutput( '(M175)')
end end
if not bHeadFirst then if not bHeadFirst then
@@ -907,12 +948,47 @@ function OnRapid()
EmtAdjustRotaryAxes() EmtAdjustRotaryAxes()
EmitZmax( false) EmitZmax( false)
EMT.ZMAX = true EMT.ZMAX = true
-- se pezzi alti e devo cambiare utensile su testa con CU, porto la testa vicino al cambio utensile
if EMT.ST > BeamHeightForFixRot and EMT.HEAD == 'H1' and EMT.TOOL ~= EMT.NEXTTOOL and EMT.NEXTHEAD ~= 'H2' then
local dBAxis = 90
local dCAxis = EgtIf( BD.RIGHT_LOAD, 90, -90)
local sEE = ' EE3'
local sEL = ' EL' .. EmtLenToString( EgtIf( EMT.HEAD ~= 'H3', EMT.TLEN, ( EMT.TDIST or ChSawLen)), 3)
local sER = ' ER' .. EmtLenToString( EgtIf( EMT.HEAD ~= 'H3', EMT.TDIAM / 2, EMT.TLEN), 3)
local sET = GetET( EMT.HEAD, EMT.TCPOS, EMT.R3)
local sES = ' ES'..EgtNumToString( EMT.S, 0)
local sOut = 'G101' .. EmtGetAxis( 'L2') .. EmtGetAxis( 'L3') ..' B' .. EgtNumToString( dBAxis, 3) ..
' C' .. EgtNumToString( dCAxis, 3) .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOut)
EmtOutput( 'G101 ET1001')
EmtOutput( 'G101 ET2001')
sOut = 'G101' .. ' X' .. EmtLenToString( -SafeXRotAxes, 3) .. EmtGetAxis( 'L3') ..' B' .. EgtNumToString( dBAxis, 3) ..
' C' .. EgtNumToString( dCAxis, 3) .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOut)
EmtOutput( 'G101 ET1001')
EmtOutput( 'G101 ET2001')
end
-- se altrimenti movimento in Home -- se altrimenti movimento in Home
elseif EMT.FLAG == 4 then elseif EMT.FLAG == 4 then
-- non previsto -- non previsto
-- se altrimenti rotazione a Z max -- se altrimenti rotazione a Z max per lavorazione successiva
elseif EMT.FLAG == 5 then elseif EMT.FLAG == 5 then
-- viene gestito all'inizio della lavorazione successiva EMT.REFLOC = nil
EMT.IPLGL = false
MyAdjustLinearAxes()
EmtAdjustRotaryAxes()
EmtResetPrev()
-- ricavo i dati per la lavorazione
local sEE = ' EE3'
local sEL = ' EL' .. EmtLenToString( EgtIf( EMT.HEAD ~= 'H3', EMT.TLEN, ( EMT.TDIST or ChSawLen)), 3)
local sER = ' ER' .. EmtLenToString( EgtIf( EMT.HEAD ~= 'H3', EMT.TDIAM / 2, EMT.TLEN), 3)
local sET = GetET( EMT.HEAD, EMT.TCPOS, EMT.R3)
local sES = ' ES'..EgtNumToString( EMT.S, 0)
local sOut = 'G101' .. EmtGetAxis( 'L2') .. EmtGetAxis( 'L3') ..
EmtGetAxis( 'R2') .. EmtGetAxis( 'R1') .. sEE .. sEL .. sER .. sET .. sES
EmtOutput( sOut)
EmtOutput( 'G101 ET1001')
EmtOutput( 'G101 ET2001')
-- altrimenti errore -- altrimenti errore
else else
EmtSetLastError( 1212, "Unknown Rapid flag") EmtSetLastError( 1212, "Unknown Rapid flag")
@@ -979,7 +1055,7 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function OnArc() function OnArc()
-- con aggregato non si possono fare archi. Deve essere tutto spezzato -- con aggregato non si possono fare archi. Deve essere tutto spezzato
if EMT.HEAD == 'H5' or EMT.HEAD == 'H6' then if EMT.HEAD == 'H5' or EMT.HEAD == 'H6' or EMT.HEAD == 'H7' then
EmtSetLastError( 1211, "With aggregate, the arcs must be splitted") EmtSetLastError( 1211, "With aggregate, the arcs must be splitted")
end end
@@ -1009,33 +1085,44 @@ function OnArc()
local sFeed = EmtGetFeed() local sFeed = EmtGetFeed()
-- tipo arco -- tipo arco
local sArc = 'G' .. EgtNumToString(EMT.MOVE,0) local sArc = 'G' .. EgtNumToString(EMT.MOVE,0)
-- emetto arco -- se arco molto grande, approssimo con una retta
EmtOutput( sArc..sAxes..sRad..sFeed) if EMT.RR > 99999 then
EmtOutput( "G1"..sAxes..sFeed)
else
EmtOutput( sArc..sAxes..sRad..sFeed)
end
-- aggiorno valori come precedenti -- aggiorno valori come precedenti
EmtUpdatePrev() EmtUpdatePrev()
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function CalcDinamicaPinze( dH, dS, dL) function FindNextTool()
local MinTempoAcc = 0.3 -- [s] -- salvo stato iniziale
local MaxTempoAcc = 4.0 -- [s] local CurrMachId = EgtGetCurrMachining()
local KgMtCubo= 550 -- densità legno [Kg / metro cubo] local CurrTool = EgtTdbGetCurrToolParam( MCH_TP.NAME)
local Massa = ( dH * dS * dL * KgMtCubo ) / 1e9 -- massa [Kg] -- cerco lavorazione con utensile su gruppo testa indicato
local FMaxPinze = EMT.FMAXPINZE -- Feed massima pinze [mm/min] local sTool, sHead, sTcPos
local ForzaAttrito = 350 * 9.8 * 0.2 -- Forza chiusura pinze [Kgf] * g * Coeff_Attrito -> [N] local OpId = EgtGetNextActiveOperation( CurrMachId or EMT.MCHID)
local TempoAcc = ( ( Massa * FMaxPinze) / ( 60 * ForzaAttrito) / 1000) while OpId do
if ( TempoAcc < MinTempoAcc) then TempoAcc = MinTempoAcc end local nType = EgtGetOperationType( OpId)
if ( TempoAcc > MaxTempoAcc) then TempoAcc = MaxTempoAcc end if nType ~= MCH_OY.NONE and nType ~= MCH_OY.DISP then
local AccMaxPinze = FMaxPinze / ( 60 * MinTempoAcc) if EgtSetCurrMachining( OpId) then
local AccPinze = FMaxPinze / ( 60 * TempoAcc) sTool = EgtGetMachiningParam( MCH_MP.TOOL)
local RidFeed = 100 / Massa * 100 if EgtTdbSetCurrTool( sTool) then
if RidFeed > 100 then sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
RidFeed = 100 sTcPos = EgtTdbGetCurrToolParam( MCH_TP.TCPOS)
elseif RidFeed < 10 then break
RidFeed = 10 end
end
end
OpId = EgtGetNextActiveOperation( OpId)
end end
return AccPinze, AccMaxPinze, RidFeed, TempoAcc -- ripristino stato iniziale
EgtSetCurrMachining( CurrMachId or GDB_ID.NULL)
EgtTdbSetCurrTool( CurrTool or '')
-- restituisco risultato
return sTool, sHead, sTcPos
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
@@ -1348,7 +1435,7 @@ function PrepareUnload( sCmd)
table.insert( EMT.AUXCMD, sMsg) table.insert( EMT.AUXCMD, sMsg)
if Cmd[2] == 'V' then if Cmd[2] == 'V' then
-- se non è ultima fase c'è una barra sulla pinza Y (1) -- se non è ultima fase c'è una barra sulla pinza Y (1)
local sEE = EgtIf( EMT.PHASE == EgtGetPhaseCount(), '0', '1') local sEE = EgtIf( EMT.PHASE == EgtGetPhaseCount() or IsEnd2Phase( EMT.PHASE), '0', '1')
local sOut = 'G111 '..Cmd[2]..Cmd[3]..' EC141 ED83 EE'..sEE..' EF'..GetFmaxClamp() local sOut = 'G111 '..Cmd[2]..Cmd[3]..' EC141 ED83 EE'..sEE..' EF'..GetFmaxClamp()
table.insert( EMT.AUXSTR, sOut) table.insert( EMT.AUXSTR, sOut)
end end
@@ -1357,7 +1444,7 @@ function PrepareUnload( sCmd)
table.insert( EMT.AUXCMD, sMsg) table.insert( EMT.AUXCMD, sMsg)
if Cmd[4] == 'V' then if Cmd[4] == 'V' then
-- se non è ultima fase c'è una barra sulla pinza Y (1) -- se non è ultima fase c'è una barra sulla pinza Y (1)
local sEAB = EgtIf( EMT.PHASE == EgtGetPhaseCount(), '111', '112') local sEAB = EgtIf( EMT.PHASE == EgtGetPhaseCount() or IsEnd2Phase( EMT.PHASE), '111', '112')
local sOut = 'G111 '..Cmd[4]..Cmd[5]..' EA'..sEAB..' EB'..sEAB..' EC142 ED141 EE2 EF'..GetFmaxClamp() local sOut = 'G111 '..Cmd[4]..Cmd[5]..' EA'..sEAB..' EB'..sEAB..' EC142 ED141 EE2 EF'..GetFmaxClamp()
table.insert( EMT.AUXSTR, sOut) table.insert( EMT.AUXSTR, sOut)
EMT.U_STD = true EMT.U_STD = true
@@ -1517,10 +1604,13 @@ function PreparePostRotation( sCmd)
elseif nVDelta > 0 then elseif nVDelta > 0 then
EMT.YDELTA = nil EMT.YDELTA = nil
EMT.VDELTA = nVDelta EMT.VDELTA = nVDelta
end end
local sYLoad = ' Y'..EmtLenToString( LoadT) local sYLoad = ' Y'..EmtLenToString( LoadT)
local sOut = 'G111'..sYLoad..' EA76'..EMT.SB..' EE0 EF'..EmtLenToString( EMT.FMAXPINZE,0)..' ET1' local sOut = 'G111'..sYLoad..' EA76'..EMT.SB..' EE0 EF'..EmtLenToString( EMT.FMAXPINZE,0)..' ET1'
table.insert( EMT.AUXSTR, sOut) table.insert( EMT.AUXSTR, sOut)
-- setto parametri di pinzaggio reali
EMT.SA = ' EA110'
EMT.SE = ' EE1'
end end
end end
@@ -1565,17 +1655,22 @@ function MyAdjustLinearAxes()
if EMT.HEAD == 'H1' or EMT.HEAD == 'H2' then if EMT.HEAD == 'H1' or EMT.HEAD == 'H2' then
local Len = EMT.TLEN + EgtIf( EMT.HEAD == 'H1', MillOffs, abs( SawOffs)) local Len = EMT.TLEN + EgtIf( EMT.HEAD == 'H1', MillOffs, abs( SawOffs))
local LenRef = MillOffs local LenRef = MillOffs
vtE = Vector3d( EMT.EXTR) * Len - Z_AX() * LenRef vtE = Vector3d( EMT.TDIR) * Len - Z_AX() * LenRef
elseif EMT.HEAD == 'H3' then elseif EMT.HEAD == 'H3' then
local LenAux = ( EMT.TDIST or ChSawLen) + MillOffs local LenAux = ( EMT.TDIST or ChSawLen) + MillOffs
local LenRef = MillOffs local LenRef = MillOffs
local vtAux = EgtGetCalcAuxDirFromAngles( EMT.R1, EMT.R2, EMT.R3) local vtAux = EgtGetCalcAuxDirFromAngles( EMT.R1, EMT.R2, EMT.R3)
vtE = vtAux * LenAux - Z_AX() * LenRef vtE = vtAux * LenAux - Z_AX() * LenRef
elseif EMT.HEAD == 'H5' then elseif EMT.HEAD == 'H5' or EMT.HEAD == 'H6' then
local LenAux = AngTr1Offs + MillOffs local LenAux = AngTr1Offs + MillOffs
local LenRef = MillOffs local LenRef = MillOffs
local vtAux = EgtGetCalcAuxDirFromAngles( EMT.R1, EMT.R2, EMT.R3) local vtAux = EgtGetCalcAuxDirFromAngles( EMT.R1, EMT.R2, EMT.R3)
vtE = vtAux * LenAux - Z_AX() * LenRef vtE = vtAux * LenAux - Z_AX() * LenRef
elseif EMT.HEAD == 'H7' then
local LenAux = AngTrBHOffs + MillOffs
local LenRef = MillOffs
local vtAux = EgtGetCalcAuxDirFromAngles( EMT.R1, EMT.R2, EMT.R3)
vtE = vtAux * LenAux - Z_AX() * LenRef
else else
EmtSetLastError( 1211, 'Head not allowed ' .. EMT.HEAD) EmtSetLastError( 1211, 'Head not allowed ' .. EMT.HEAD)
end end
@@ -1670,7 +1765,7 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function GetET( sHead, sTcPos, dAxR3) function GetET( sHead, sTcPos, dAxR3)
if sHead == 'H1' or sHead == 'H5' or sHead == 'H6' then if sHead == 'H1' or sHead == 'H5' or sHead == 'H6' or sHead == 'H7' then
return ' E'..sTcPos return ' E'..sTcPos
elseif sHead == 'H2' then elseif sHead == 'H2' then
return ' ET42' return ' ET42'
+180 -69
View File
@@ -3,9 +3,10 @@
-- carico librerie -- carico librerie
local INFO_STD_PP = require( 'Version') local INFO_STD_PP = require( 'Version')
local BD = require( 'BeamData')
-- Variabili di modulo -- Variabili di modulo
local CSP_INFO = INFO_STD_PP.NAME..' ver.'..INFO_STD_PP.VERSION..' by EgalWare s.r.l.' local CSP_INFO = INFO_STD_PP.NAME..'_'..NumericalControl..' ver.'..INFO_STD_PP.VERSION..' by EgalWare s.r.l.'
local MACHINE_INFO = MACH_NAME..' ver.'..PP_VER local MACHINE_INFO = MACH_NAME..' ver.'..PP_VER
local TEST_USE = false local TEST_USE = false
@@ -20,14 +21,19 @@ function OnStart()
EMT.USETO1 = false -- abilitazione uso origine tavola EMT.USETO1 = false -- abilitazione uso origine tavola
EMT.MODAL = true -- abilitazione emissione modale EMT.MODAL = true -- abilitazione emissione modale
EMT.INCHES = false -- unità di misura mm/inches EMT.INCHES = false -- unità di misura mm/inches
EMT.DECNUM = 5 -- numero di decimali dopo la virgola EMT.DECNUM = 4 -- numero di decimali dopo la virgola
EMT.DECVERS = 6 -- numero di decimali dopo la virgola per versori
EMT.DECRAD = 4 -- numero di decimali dopo la virgola per raggio
EMT.DECMACRO = 3 -- numero di decimali dopo la virgola per macro
EMT.NUM = false -- abilitazione numerazione linee EMT.NUM = false -- abilitazione numerazione linee
--EMT.Nt = 'N' -- token per la numerazione di linea --EMT.Nt = 'N' -- token per la numerazione di linea
--EMT.LINENBR = 0 -- numero di linea --EMT.LINENBR = 0 -- numero di linea
--EMT.LINEINC = 1 -- incremento numerazione linee --EMT.LINEINC = 1 -- incremento numerazione linee
--EMT.Ft = 'F' -- token per feed --EMT.Ft = 'F' -- token per feed
--EMT.St = 'S' -- token per speed --EMT.St = 'S' -- token per speed
EMT.FMAXPINZE = 154000 -- feed massima pinze EMT.FMAXPINZE = EgtClamp( MaxFeedPinze or 154000, 20000, 160000) -- feed massima pinze
EMT.MAXACC = MaxAcc or 4000 -- accelerazione massima pinze. In realtà è il tempo in millisecondi, quindi MAXACC corrisponde al tempo massimo per raggiungere la velocità desiderata
EMT.MINACC = MinAcc or 300 -- accelerazione minima pinze. In realtà è il tempo in millisecondi, quindi MINACC corrisponde al tempo massimo per raggiungere la velocità desiderata
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
@@ -50,6 +56,7 @@ function OnProgramStart()
end end
ParkLine( sPrefixCommentLine..'('.. CSP_INFO..')') ParkLine( sPrefixCommentLine..'('.. CSP_INFO..')')
ParkLine( sPrefixCommentLine..'('.. MACHINE_INFO..')') ParkLine( sPrefixCommentLine..'('.. MACHINE_INFO..')')
ParkLine( '(HEADER)')
-- Se modalità test, aggiungo linee per muovere tappeto e alzare la testa (in automatico viene fatto dal main residente) -- Se modalità test, aggiungo linee per muovere tappeto e alzare la testa (in automatico viene fatto dal main residente)
if TEST_USE then if TEST_USE then
@@ -107,6 +114,7 @@ function OnProgramEnd()
EMT.FALL = nil EMT.FALL = nil
EMT.RELOAD = nil EMT.RELOAD = nil
EMT.RELOAD2 = nil EMT.RELOAD2 = nil
EmtOutput( '(FOOTER)')
-- Termino il programma -- Termino il programma
EmtOutput( 'M02') EmtOutput( 'M02')
end end
@@ -115,8 +123,8 @@ end
function OnToolData() function OnToolData()
-- emissione dati utensili -- emissione dati utensili
if EMT.HEAD == 'H1' then if EMT.HEAD == 'H1' then
local sOut = 'M992 P1=' .. EMT.TCPOS:gsub( 'T', '') .. ' P2=' .. EmtLenToString( EMT.TLEN, 3) .. ' P3=' .. EmtLenToString( EMT.TDIAM, 3) .. local sOut = 'M992 P1=' .. EMT.TCPOS:gsub( 'T', '') .. ' P2=' .. EmtLenToString( EMT.TLEN, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( EMT.TDIAM, EMT.DECMACRO) ..
' P4=' .. EmtLenToString( EMT.SMAX, 3) .. ' P5=' .. EmtLenToString( EMT.TTOTLEN, 3) ' P4=' .. EmtLenToString( EMT.SMAX, EMT.DECMACRO) .. ' P5=' .. EmtLenToString( EMT.TTOTLEN, EMT.DECMACRO)
ParkLine( sOut) ParkLine( sOut)
-- cerco posizione di attrezzaggio del primo utensile di lavorazione -- cerco posizione di attrezzaggio del primo utensile di lavorazione
if EMT.TOOL == EMT.TOOL_1 and EMT.TLEN_1 < LONG_TOOL_MINLEN then if EMT.TOOL == EMT.TOOL_1 and EMT.TLEN_1 < LONG_TOOL_MINLEN then
@@ -124,14 +132,14 @@ function OnToolData()
end end
-- emissione dati lama -- emissione dati lama
elseif EMT.HEAD == 'H2' then elseif EMT.HEAD == 'H2' then
local sOut = 'M992 P1=' .. EMT.TCPOS:gsub( 'T', '') .. ' P2=' .. EmtLenToString( EMT.TLEN, 3) .. ' P3=' .. EmtLenToString( EMT.TDIAM, 3) .. local sOut = 'M992 P1=' .. EMT.TCPOS:gsub( 'T', '') .. ' P2=' .. EmtLenToString( EMT.TLEN, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( EMT.TDIAM, EMT.DECMACRO) ..
' P4=' .. EmtLenToString( EMT.SMAX, 3) .. ' P5=' .. EmtLenToString( EMT.TTOTLEN, 3) ' P4=' .. EmtLenToString( EMT.SMAX, EMT.DECMACRO) .. ' P5=' .. EmtLenToString( EMT.TTOTLEN, EMT.DECMACRO)
ParkLine( sOut) ParkLine( sOut)
-- emissione dati sega a catena -- emissione dati sega a catena
elseif EMT.HEAD == 'H3' then elseif EMT.HEAD == 'H3' then
if EMT.TDIST and abs( EMT.TDIST) < 0.1 then EMT.TDIST = nil end if EMT.TDIST and abs( EMT.TDIST) < 0.1 then EMT.TDIST = nil end
local sData = ' P2=' .. EmtLenToString( ( EMT.TDIST or ChSawLen), 3) .. ' P3=' .. EmtLenToString( EMT.TLEN, 3) .. local sData = ' P2=' .. EmtLenToString( ( EMT.TDIST or ChSawLen), EMT.DECMACRO) .. ' P3=' .. EmtLenToString( EMT.TLEN, EMT.DECMACRO) ..
' P4=' .. EmtLenToString( EMT.SMAX, 3) .. ' P5=' .. EmtLenToString( ( EMT.TDIST or ChSawLen), 3) ' P4=' .. EmtLenToString( EMT.SMAX, EMT.DECMACRO) .. ' P5=' .. EmtLenToString( ( EMT.TDIST or ChSawLen), EMT.DECMACRO)
if EMT.TCPOS == 'T101' then if EMT.TCPOS == 'T101' then
ParkLine( 'M992 P1=101' .. sData) ParkLine( 'M992 P1=101' .. sData)
ParkLine( 'M992 P1=102' .. sData) ParkLine( 'M992 P1=102' .. sData)
@@ -147,10 +155,15 @@ function OnToolData()
elseif EMT.HEAD == 'H5' or EMT.HEAD == 'H6' then elseif EMT.HEAD == 'H5' or EMT.HEAD == 'H6' then
local nPos = EgtIf( EMT.HEAD == 'H5', 91, 93) local nPos = EgtIf( EMT.HEAD == 'H5', 91, 93)
if EMT.EXIT == 2 then nPos = nPos + 1 end if EMT.EXIT == 2 then nPos = nPos + 1 end
local sOut = 'M992 P1=' .. EgtNumToString( nPos, 0) .. ' P2=' .. EmtLenToString( EMT.TLEN, 3) .. ' P3=' .. EmtLenToString( EMT.TDIAM, 3) .. local sOut = 'M992 P1=' .. EgtNumToString( nPos, 0) .. ' P2=' .. EmtLenToString( EMT.TLEN, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( EMT.TDIAM, EMT.DECMACRO) ..
' P4=' .. EmtLenToString( EMT.SMAX, 3) .. ' P5=' .. EmtLenToString( EMT.TTOTLEN, 3) ' P4=' .. EmtLenToString( EMT.SMAX, EMT.DECMACRO) .. ' P5=' .. EmtLenToString( EMT.TTOTLEN, EMT.DECMACRO)
ParkLine( sOut) ParkLine( sOut)
-- altro non previsto -- emissione dati sega a catena
elseif EMT.HEAD == 'H7' then
local sOut = 'M992 P1=' .. EMT.TCPOS:gsub( 'T', '') .. ' P2=' .. EmtLenToString( EMT.TLEN, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( EMT.TDIAM, EMT.DECMACRO) ..
' P4=' .. EmtLenToString( EMT.SMAX, EMT.DECMACRO) .. ' P5=' .. EmtLenToString( EMT.TTOTLEN, EMT.DECMACRO)
ParkLine( sOut)
-- altro non previsto
else else
EmtSetLastError( 1211, 'Head not allowed ' .. EMT.HEAD) EmtSetLastError( 1211, 'Head not allowed ' .. EMT.HEAD)
end end
@@ -212,14 +225,14 @@ function OnDispositionEnd()
local HOverM = EMT.HOVM local HOverM = EMT.HOVM
-- calcolo dati pinze -- calcolo dati pinze
local TempAccPinze, TempMinAccPinze, RidFeed = CalcDinamicaPinze( HTrave, STrave, LBarra) local TempAccPinze, TempMinAccPinze, RidFeed = CalcDinamicaPinze_TPA( HTrave, STrave, LBarra)
local TempAccPinz1, TempMinAccPinz1, RidFeed1 = CalcDinamicaPinze( HTrave, STrave, LBarra - LTrave) local TempAccPinz1, TempMinAccPinz1, RidFeed1 = CalcDinamicaPinze_TPA( HTrave, STrave, LBarra - LTrave)
local TempAccPinz2, TempMinAccPinz2, RidFeed2 = CalcDinamicaPinze( HTrave, STrave, LTrave) local TempAccPinz2, TempMinAccPinz2, RidFeed2 = CalcDinamicaPinze_TPA( HTrave, STrave, LTrave)
if IdTrave >= 0 then if IdTrave >= 0 then
local sPrt = '( *** Part '.. EgtNumToString( IdTrave, 0) ..' ***)' local sPrt = '( *** Part '.. EgtNumToString( IdTrave, 0) ..' ***)'
local sOut = '( SN=' .. IdTrave .. ' LBarra=' .. EmtLenToString( LBarra, 3) .. ' L='..EmtLenToString( LTrave, 3) .. local sOut = '( SN=' .. IdTrave .. ' LBarra=' .. EmtLenToString( LBarra, EMT.DECMACRO) .. ' L='..EmtLenToString( LTrave, EMT.DECMACRO) ..
' H=' .. EmtLenToString( HTrave, 3) .. ' S=' .. EmtLenToString( STrave, 3) .. ' )' ' H=' .. EmtLenToString( HTrave, EMT.DECMACRO) .. ' S=' .. EmtLenToString( STrave, EMT.DECMACRO) .. ' )'
EMT.PRODID = EgtGetInfo( BtlInfoId, 'PRODID', 'i') or 0 EMT.PRODID = EgtGetInfo( BtlInfoId, 'PRODID', 'i') or 0
EMT.PATTID = EgtGetInfo( BtlInfoId, 'PATTID', 'i') or 0 EMT.PATTID = EgtGetInfo( BtlInfoId, 'PATTID', 'i') or 0
EMT.CUTID = EgtGetInfo( EMT.IDT, 'CUTID', 'i') or 0 EMT.CUTID = EgtGetInfo( EMT.IDT, 'CUTID', 'i') or 0
@@ -262,9 +275,9 @@ function OnDispositionEnd()
' P4=' .. EmtLenToString( HOverM, 2) .. ' P5=' .. tostring( nLoad90) .. ' P6=' .. EmtLenToString( EgtIf( IdTrave >= 0, LTrave, LBarra), 2) .. ' 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) ' P7=' .. EgtNumToString( TempAccPinze, 2) .. ' P8=' .. EgtNumToString( TempAccPinz2, 2) .. ' P9=' .. EgtNumToString( TempAccPinz1, 2)
EmtOutput( sOut) EmtOutput( sOut)
EmtOutput( 'M112'..' P1='..EmtLenToString( LoadT, 3).. ' P5=1 P6='..EmtLenToString( EMT.YPOS, 3)..' P7='..EmtLenToString( ParkV, 3) ..' P9='..GetFmaxClamp()) EmtOutput( 'M112'..' P1='..EmtLenToString( EMT.TPOS, 3).. ' P5=1 P6='..EmtLenToString( EMT.YPOS, 3)..' P7='..EmtLenToString( ParkV, 3) ..' P9='..GetFmaxClamp())
-- aggiorno dati aggancio carrelli alla trave -- aggiorno dati aggancio carrelli alla trave
EMT.YDELTA = EMT.YPOS - LoadT EMT.YDELTA = EMT.YPOS - EMT.TPOS
EMT.VDELTA = nil EMT.VDELTA = nil
end end
-- eventuale preparazione per rotazione immediata -- eventuale preparazione per rotazione immediata
@@ -512,6 +525,9 @@ function OnMachiningEnd()
EMT.PREVTOOL = EMT.TOOL EMT.PREVTOOL = EMT.TOOL
EMT.PREVHEAD = EMT.HEAD EMT.PREVHEAD = EMT.HEAD
EMT.PREVS = EMT.S EMT.PREVS = EMT.S
-- salvo posizione
EMT.PREVTCPOS = AdjustTcPos( false)
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
@@ -526,6 +542,7 @@ function OnPathStart()
-- salvo precedenti rotanti -- salvo precedenti rotanti
EMT.R1pp = EMT.R1p EMT.R1pp = EMT.R1p
EMT.R2pp = EMT.R2p EMT.R2pp = EMT.R2p
EMT.R3pp = EMT.R3p
-- reset valori precedenti (per forzare emissione di tutti gli assi del 1° movimento) -- reset valori precedenti (per forzare emissione di tutti gli assi del 1° movimento)
EmtResetPrev() EmtResetPrev()
@@ -625,6 +642,8 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function OnRapid() function OnRapid()
-- recupero prossimo utensile
EMT.NEXTTOOL, EMT.NEXTHEAD, EMT.NEXTTCPOS = FindNextTool()
MyBackupAxes() MyBackupAxes()
-- se primo movimento della lavorazione, gestione speciale -- se primo movimento della lavorazione, gestione speciale
if EMT.MCHFIRST and not EMT.OPEISDISP then if EMT.MCHFIRST and not EMT.OPEISDISP then
@@ -643,16 +662,30 @@ function OnRapid()
bHeadFirst = false bHeadFirst = false
end end
end end
local sTcPosReal = AdjustTcPos( false)
local bGoToHome = false
-- se gli assi rotanti cambiano parecchio, con motosega si va in parcheggio
if EMT.PREVHEAD == 'H3' and EMT.HEAD == 'H3' and ( sTcPosReal ~= EMT.PREVTCPOS or abs( EMT.R2pp - EMT.R2) > 25 or abs( EMT.R1pp - EMT.R1) > 25) then
bGoToHome = true
end
-- primo posizionamento -- primo posizionamento
local MyZHome = EgtGetAxisHomePos( 'Z') local MyZHome = EgtGetAxisHomePos( 'Z')
local bZmax = ( #EMT.AUXSTR > 0 or EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1) 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 -- se avevo motosega, torno in zona sicura senza ruotare assi rotanti
if EMT.PREVHEAD == 'H3' and EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then if not EMT.LOAD and EMT.PREVHEAD == 'H3' and EMT.FLAG2 == 1 then
local sOutPreMove = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, 3) .. ' P3=' .. EmtLenToString( MyZHome, 3) .. local sOutPreMove = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( MyZHome, EMT.DECMACRO) ..
' P4=' .. EgtNumToString( EMT.R2pp, 3) .. ' P5=' .. EgtNumToString( EMT.R1pp, 3) .. ' P4=' .. EgtNumToString( EMT.R2pp, EMT.DECMACRO) .. ' P5=' .. EgtNumToString( EMT.R1pp, EMT.DECMACRO) ..
' P6=' .. EgtNumToString( EMT.PREVTCPOS, 3) .. ' P7=' .. EgtNumToString( EMT.PREVS, 0) .. ' P6=' .. EgtNumToString( EMT.PREVTCPOS, EMT.DECMACRO) .. ' P7=' .. EgtNumToString( EMT.PREVS, 0) ..
' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4') ' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4')
EmtOutput( sOutPreMove) EmtOutput( sOutPreMove)
sOutPreMove = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( MyZHome, EMT.DECMACRO) ..
' P4=' .. EgtNumToString( 0, EMT.DECMACRO) .. ' P5=' .. EgtNumToString( EMT.R1pp, EMT.DECMACRO) ..
' P6=' .. EgtNumToString( EMT.PREVTCPOS, EMT.DECMACRO) .. ' P7=' .. EgtNumToString( EMT.PREVS, 0) ..
' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4')
EmtOutput( sOutPreMove)
EmtOutput( 'M101 P1=2') EmtOutput( 'M101 P1=2')
EmtOutput( 'M101 P1=3') EmtOutput( 'M101 P1=3')
end end
@@ -663,9 +696,41 @@ function OnRapid()
end end
-- se carico motosega, ruoto in zona sicura prima di approcciare la lavorazione -- se carico motosega, ruoto in zona sicura prima di approcciare la lavorazione
if EMT.HEAD == 'H3' and EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then if EMT.HEAD == 'H3' and EMT.PREVHEAD ~= 'H3' then
local sOutPreMove = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, 3) .. ' P3=' .. EmtLenToString( MyZHome, 3) .. local sOutPreMove = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( MyZHome, EMT.DECMACRO) ..
' P4=' .. EgtNumToString( EMT.R2, 3) .. ' P5=' .. EgtNumToString( EMT.R1, 3) .. ' P4=' .. EgtNumToString( 0, EMT.DECMACRO) .. ' P5=' .. EgtNumToString( EMT.R1, EMT.DECMACRO) ..
' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) ..
' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4')
if EMT.LOAD then
ParkLine( sOutPreMove)
else
EmtOutput( sOutPreMove)
end
sOutPreMove = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( MyZHome, EMT.DECMACRO) ..
' P4=' .. EgtNumToString( EMT.R2, EMT.DECMACRO) .. ' P5=' .. EgtNumToString( EMT.R1, EMT.DECMACRO) ..
' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) ..
' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4')
if EMT.LOAD then
ParkLine( sOutPreMove)
ParkLine( 'M101 P1=2')
ParkLine( 'M101 P1=3')
else
EmtOutput( sOutPreMove)
EmtOutput( 'M101 P1=2')
EmtOutput( 'M101 P1=3')
end
elseif not EMT.LOAD and ( EMT.HEAD == 'H3' or ( bZmax and EMT.TTOTLEN > 200)) and
( EMT.ST > BeamHeightForFixRot or ( EMT.HEAD == 'H1' and EMT.TTOTLEN > 350) or bGoToHome) and EMT.FLAG2 == 1 then
local sOutPreMove
if EMT.HEAD == 'H3' and bGoToHome then
sOutPreMove = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( MyZHome, EMT.DECMACRO) ..
' P4=' .. EgtNumToString( 0, EMT.DECMACRO) .. ' P5=' .. EgtNumToString( EMT.R1, EMT.DECMACRO) ..
' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) ..
' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4')
EmtOutput( sOutPreMove)
end
sOutPreMove = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( MyZHome, EMT.DECMACRO) ..
' P4=' .. EgtNumToString( EMT.R2, EMT.DECMACRO) .. ' P5=' .. EgtNumToString( EMT.R1, EMT.DECMACRO) ..
' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) .. ' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) ..
' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4') ' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4')
EmtOutput( sOutPreMove) EmtOutput( sOutPreMove)
@@ -679,8 +744,8 @@ function OnRapid()
if EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then if EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
MyZPos = MyZHome MyZPos = MyZHome
end end
local sOut = 'M101 P1=1' .. ' P2=' .. EmtLenToString( EMT.L2, 3) .. ' P3=' .. EmtLenToString( MyZPos, 3) .. local sOut = 'M101 P1=1' .. ' P2=' .. EmtLenToString( EMT.L2, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( MyZPos, EMT.DECMACRO) ..
' P4=' .. EgtNumToString( EMT.R2, 3) .. ' P5=' .. EgtNumToString( EMT.R1, 3) .. ' P4=' .. EgtNumToString( EMT.R2, EMT.DECMACRO) .. ' P5=' .. EgtNumToString( EMT.R1, EMT.DECMACRO) ..
' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) .. ' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) ..
' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4') ' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4')
if EMT.LOAD then if EMT.LOAD then
@@ -730,7 +795,7 @@ function OnRapid()
sV = EmtLenToString( ParkV) sV = EmtLenToString( ParkV)
sB = '2' sB = '2'
end end
sOut = 'M112 P1='..EmtLenToString( EMT.L1, 3)..' P3='..sA..' P4='..sB..' P5=0 P6='..sY..' P7='..sV..' P9='..GetFmaxClamp() sOut = 'M112 P1='..EmtLenToString( EMT.L1, EMT.DECMACRO)..' P3='..sA..' P4='..sB..' P5=0 P6='..sY..' P7='..sV..' P9='..GetFmaxClamp()
ParkLine( sOut) ParkLine( sOut)
EMT.LOAD = false EMT.LOAD = false
-- emissione prime linee speciali e linee parcheggiate -- emissione prime linee speciali e linee parcheggiate
@@ -774,14 +839,14 @@ function OnRapid()
sB = '2' sB = '2'
end end
-- se taglio di coda senza residuo da scaricare, emetto M175 per accelerare il carico della barra successiva -- se taglio di coda senza residuo da scaricare, emetto M175 per accelerare il carico della barra successiva
if EMT.MCHUSERNOTES and EMT.MCHUSERNOTES:find( 'Cut') then if EMT.MCHUSERNOTES and EMT.MCHUSERNOTES:find( 'Cut') and ( IsEndPhase( EMT.PHASE+1) or IsEnd2Phase( EMT.PHASE+1)) then
EmtOutput( 'M175') EmtOutput( 'M175')
end end
if bHeadFirst then if bHeadFirst then
sOut = 'M101 P1=3' sOut = 'M101 P1=3'
EmtOutput( sOut) EmtOutput( sOut)
end end
sOut = 'M112 P1=' .. EmtLenToString( EMT.L1, 3) ..' P3='..sA..' P4='..sB..' P6='..sY..' P7='..sV..' P9=' .. GetFmaxClamp() sOut = 'M112 P1=' .. EmtLenToString( EMT.L1, EMT.DECMACRO) ..' P3='..sA..' P4='..sB..' P6='..sY..' P7='..sV..' P9=' .. GetFmaxClamp()
EmtOutput( sOut) EmtOutput( sOut)
if not bHeadFirst then if not bHeadFirst then
sOut = 'M101 P1=2' sOut = 'M101 P1=2'
@@ -849,12 +914,42 @@ function OnRapid()
EmtAdjustRotaryAxes() EmtAdjustRotaryAxes()
EmitZmax( true) EmitZmax( true)
EMT.ZMAX = true EMT.ZMAX = true
-- se pezzi alti e devo cambiare utensile su testa con CU, porto la testa vicino al cambio utensile
if EMT.ST > BeamHeightForFixRot and EMT.HEAD == 'H1' and EMT.TOOL ~= EMT.NEXTTOOL and EMT.NEXTHEAD ~= 'H2' then
local dBAxis = 90
local dCAxis = EgtIf( BD.RIGHT_LOAD, 90, -90)
local sOut = 'M101 P1=1' .. ' P2=' .. EmtLenToString( EMT.L2, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( EMT.L3, EMT.DECMACRO) ..
' P4=' .. EgtNumToString( dBAxis, EMT.DECMACRO) .. ' P5=' .. EgtNumToString( dCAxis, EMT.DECMACRO) ..
' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) ..
' P8=0' .. ' P9=0' .. ' P10=3'
EmtOutput( sOut)
EmtOutput( 'M101 P1=2')
EmtOutput( 'M101 P1=3')
sOut = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( EMT.L3, EMT.DECMACRO) ..
' P4=' .. EgtNumToString( dBAxis, EMT.DECMACRO) .. ' P5=' .. EgtNumToString( dCAxis, EMT.DECMACRO) ..
' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) ..
' P8=0' .. ' P9=0' .. ' P10=3'
EmtOutput( sOut)
EmtOutput( 'M101 P1=2')
EmtOutput( 'M101 P1=3')
end
-- se altrimenti movimento in Home -- se altrimenti movimento in Home
elseif EMT.FLAG == 4 then elseif EMT.FLAG == 4 then
-- non previsto -- non previsto
-- se altrimenti rotazione a Z max -- se altrimenti rotazione a Z max per lavorazione successiva
elseif EMT.FLAG == 5 then elseif EMT.FLAG == 5 then
-- viene gestito all'inizio della lavorazione successiva EMT.REFLOC = nil
EMT.IPLGL = false
MyAdjustLinearAxes()
EmtAdjustRotaryAxes()
EmtResetPrev()
local sOut = 'M101 P1=1' .. ' P2=' .. EmtLenToString( EMT.L2, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( EMT.L3, EMT.DECMACRO) ..
' P4=' .. EgtNumToString( EMT.R2, EMT.DECMACRO) .. ' P5=' .. EgtNumToString( EMT.R1, EMT.DECMACRO) ..
' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) ..
' P8=0' .. ' P9=0' .. ' P10=3'
EmtOutput( sOut)
EmtOutput( 'M101 P1=2')
EmtOutput( 'M101 P1=3')
-- altrimenti errore -- altrimenti errore
else else
error( "Unknown Rapid flag") error( "Unknown Rapid flag")
@@ -969,7 +1064,7 @@ function OnArc()
--local sCen = ' ' .. EMT.C1t .. EmtLenToString(EMT.C1,3) .. --local sCen = ' ' .. EMT.C1t .. EmtLenToString(EMT.C1,3) ..
-- ' ' .. EMT.C2t .. EmtLenToString(EMT.C2,3) -- ' ' .. EMT.C2t .. EmtLenToString(EMT.C2,3)
-- raggio -- raggio
local sRad = ' ' .. EMT.RRt .. EmtLenToString( EMT.RR, EMT.DECNUM) local sRad = ' ' .. EMT.RRt .. EmtLenToString( EMT.RR, EMT.DECRAD)
-- aggiungo feed -- aggiungo feed
local sFeed = EmtGetFeed() local sFeed = EmtGetFeed()
-- tipo arco -- tipo arco
@@ -982,25 +1077,32 @@ function OnArc()
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function CalcDinamicaPinze( dH, dS, dL) function FindNextTool()
local MinTempoAcc = 0.3 -- [s] -- salvo stato iniziale
local MaxTempoAcc = 4.0 -- [s] local CurrMachId = EgtGetCurrMachining()
local KgMtCubo= 550 -- densità legno [Kg / metro cubo] local CurrTool = EgtTdbGetCurrToolParam( MCH_TP.NAME)
local Massa = ( dH * dS * dL * KgMtCubo ) / 1e9 -- massa [Kg] -- cerco lavorazione con utensile su gruppo testa indicato
local FMaxPinze = EMT.FMAXPINZE -- Feed massima pinze [mm/min] local sTool, sHead, sTcPos
local ForzaAttrito = 350 * 9.8 * 0.2 -- Forza chiusura pinze [Kgf] * g * Coeff_Attrito -> [N] local OpId = EgtGetNextActiveOperation( CurrMachId or EMT.MCHID)
local TempoAcc = ( ( Massa * FMaxPinze) / ( 60 * ForzaAttrito) / 1000) while OpId do
if ( TempoAcc < MinTempoAcc) then TempoAcc = MinTempoAcc end local nType = EgtGetOperationType( OpId)
if ( TempoAcc > MaxTempoAcc) then TempoAcc = MaxTempoAcc end if nType ~= MCH_OY.NONE and nType ~= MCH_OY.DISP then
local AccMaxPinze = FMaxPinze / ( 60 * MinTempoAcc) if EgtSetCurrMachining( OpId) then
local AccPinze = FMaxPinze / ( 60 * TempoAcc) sTool = EgtGetMachiningParam( MCH_MP.TOOL)
local RidFeed = 100 / Massa * 100 if EgtTdbSetCurrTool( sTool) then
if RidFeed > 100 then sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
RidFeed = 100 sTcPos = EgtTdbGetCurrToolParam( MCH_TP.TCPOS)
elseif RidFeed < 10 then break
RidFeed = 10 end
end
end
OpId = EgtGetNextActiveOperation( OpId)
end end
return TempoAcc * 1000, MinTempoAcc * 1000, RidFeed -- ripristino stato iniziale
EgtSetCurrMachining( CurrMachId or GDB_ID.NULL)
EgtTdbSetCurrTool( CurrTool or '')
-- restituisco risultato
return sTool, sHead, sTcPos
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
@@ -1524,10 +1626,13 @@ function PreparePostRotation( sCmd)
elseif nVDelta > 0 then elseif nVDelta > 0 then
EMT.YDELTA = nil EMT.YDELTA = nil
EMT.VDELTA = nVDelta EMT.VDELTA = nVDelta
end end
local sYLoad = ' P2='..EmtLenToString( LoadT) local sYLoad = ' P2='..EmtLenToString( LoadT)
local sOut = 'M111 P1=11'..sYLoad..' P4=76'..EMT.SB..' P8=0 P9='..GetFmaxClamp() local sOut = 'M111 P1=11'..sYLoad..' P4=76'..EMT.SB..' P8=0 P9='..GetFmaxClamp()
table.insert( EMT.AUXSTR, sOut) table.insert( EMT.AUXSTR, sOut)
-- setto parametri di pinzaggio reali
EMT.SA = ' P4=110'
EMT.SE = ' P8=1'
end end
end end
@@ -1572,18 +1677,24 @@ function MyAdjustLinearAxes()
if EMT.HEAD == 'H1' or EMT.HEAD == 'H2' then if EMT.HEAD == 'H1' or EMT.HEAD == 'H2' then
local Len = EMT.TLEN + EgtIf( EMT.HEAD == 'H1', MillOffs, abs( SawOffs)) local Len = EMT.TLEN + EgtIf( EMT.HEAD == 'H1', MillOffs, abs( SawOffs))
local LenRef = MillOffs local LenRef = MillOffs
vtE = Vector3d( EMT.EXTR) * Len - Z_AX() * LenRef vtE = Vector3d( EMT.TDIR) * Len - Z_AX() * LenRef
elseif EMT.HEAD == 'H3' then elseif EMT.HEAD == 'H3' then
local LenAux = ( EMT.TDIST or ChSawLen) + MillOffs local LenAux = ( EMT.TDIST or ChSawLen) + MillOffs
local LenRef = MillOffs local LenRef = MillOffs
local vtAux = EgtGetCalcAuxDirFromAngles( EMT.R1, EMT.R2, EMT.R3) local vtAux = EgtGetCalcAuxDirFromAngles( EMT.R1, EMT.R2, EMT.R3)
vtE = vtAux * LenAux - Z_AX() * LenRef vtE = vtAux * LenAux - Z_AX() * LenRef
elseif EMT.HEAD == 'H5' then elseif EMT.HEAD == 'H5' or EMT.HEAD == 'H6' then
local Len = EMT.TLEN + AngTr1Len local Len = EMT.TLEN + AngTr1Len
local LenAux = MillOffs + AngTr1Offs local LenAux = MillOffs + AngTr1Offs
local LenRef = MillOffs local LenRef = MillOffs
local vtAux = EgtGetCalcAuxDirFromAngles( EMT.R1, EMT.R2) local vtAux = EgtGetCalcAuxDirFromAngles( EMT.R1, EMT.R2)
vtE = Vector3d( EMT.EXTR) * Len + vtAux * LenAux - Z_AX() * LenRef vtE = Vector3d( EMT.TDIR) * Len + vtAux * LenAux - Z_AX() * LenRef
elseif EMT.HEAD == 'H7' then
local Len = EMT.TLEN + AngTrBHLen
local LenAux = MillOffs + AngTrBHOffs
local LenRef = MillOffs
local vtAux = EgtGetCalcAuxDirFromAngles( EMT.R1, EMT.R2)
vtE = Vector3d( EMT.TDIR) * Len + vtAux * LenAux - Z_AX() * LenRef
else else
EmtSetLastError( 1211, 'Head not allowed ' .. EMT.HEAD) EmtSetLastError( 1211, 'Head not allowed ' .. EMT.HEAD)
end end
@@ -1620,6 +1731,8 @@ function AdjustToolKinematic()
return EgtIf( EMT.EXIT == 1, '11', '12') return EgtIf( EMT.EXIT == 1, '11', '12')
elseif EMT.HEAD == 'H6' then elseif EMT.HEAD == 'H6' then
return EgtIf( EMT.EXIT == 1, '21', '22') return EgtIf( EMT.EXIT == 1, '21', '22')
elseif EMT.HEAD == 'H7' then
return '31'
else else
EmtSetLastError( 1211, 'Head not allowed ' .. EMT.HEAD) EmtSetLastError( 1211, 'Head not allowed ' .. EMT.HEAD)
end end
@@ -1668,8 +1781,6 @@ function AdjustTcPos( bLen3)
sPos = '0' .. sPos sPos = '0' .. sPos
end end
end end
-- salvo posizione
EMT.PREVTCPOS = sPos
return sPos return sPos
end end
@@ -1692,9 +1803,9 @@ function CalcInterpPlane()
local vtY = EMT.IPLGLFR:getVersY() local vtY = EMT.IPLGLFR:getVersY()
local vtZ = EMT.IPLGLFR:getVersZ() local vtZ = EMT.IPLGLFR:getVersZ()
EMT.IPLGLSTR = ' X0 Y' .. EmtLenToString( xS, EMT.DECNUM) .. ' Z0' .. EMT.IPLGLSTR = ' X0 Y' .. EmtLenToString( xS, EMT.DECNUM) .. ' Z0' ..
' A' .. EgtNumToString( - vtX:getY(), 6) .. ' B' .. EgtNumToString( vtX:getX(), 6) .. ' C' .. EgtNumToString( vtX:getZ(), 6) .. ' A' .. EgtNumToString( - vtX:getY(), EMT.DECVERS) .. ' B' .. EgtNumToString( vtX:getX(), EMT.DECVERS) .. ' C' .. EgtNumToString( vtX:getZ(), EMT.DECVERS) ..
' I' .. EgtNumToString( - vtY:getY(), 6) .. ' J' .. EgtNumToString( vtY:getX(), 6) .. ' K' .. EgtNumToString( vtY:getZ(), 6) .. ' I' .. EgtNumToString( - vtY:getY(), EMT.DECVERS) .. ' J' .. EgtNumToString( vtY:getX(), EMT.DECVERS) .. ' K' .. EgtNumToString( vtY:getZ(), EMT.DECVERS) ..
' P' .. EgtNumToString( - vtZ:getY(), 6) .. ' Q' .. EgtNumToString( vtZ:getX(), 6) .. ' R' .. EgtNumToString( vtZ:getZ(), 6) ' P' .. EgtNumToString( - vtZ:getY(), EMT.DECVERS) .. ' Q' .. EgtNumToString( vtZ:getX(), EMT.DECVERS) .. ' R' .. EgtNumToString( vtZ:getZ(), EMT.DECVERS)
EMT.IPLGL = true EMT.IPLGL = true
end end
+521 -103
View File
@@ -7,19 +7,16 @@ EgtEnableDebug( false)
-- carico librerie -- carico librerie
local BD = require( 'BeamData') local BD = require( 'BeamData')
LONG_TOOL_MINLEN = 221
BIG_TOOL_DIAM = 300
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- *** GENERATION *** -- *** GENERATION ***
--------------------------------------------------------------------- ---------------------------------------------------------------------
local sBaseDir = EgtGetCurrMachineDir() local sBaseDir = EgtGetCurrMachineDir()
if NumericalControl == 'NUM' then if NumericalControl == 'NUM' then
dofile( sBaseDir .. '\\Common-FAST.NUM.mlpe') dofile( sBaseDir .. '\\Common_FAST.NUM.mlpe')
elseif NumericalControl == 'TPA' then elseif NumericalControl == 'TPA' then
dofile( sBaseDir .. '\\Common-FAST.TPA.mlpe') dofile( sBaseDir .. '\\Common_FAST.TPA.mlpe')
elseif NumericalControl == 'NUM_PLUS' then elseif NumericalControl == 'NUM_PLUS' then
dofile( sBaseDir .. '\\Common-FAST.NUM_PLUS.mlpe') dofile( sBaseDir .. '\\Common_FAST.NUM_PLUS.mlpe')
else else
EmtSetLastError( 1201, 'Numerical Control error : unkwnown type') EmtSetLastError( 1201, 'Numerical Control error : unkwnown type')
end end
@@ -82,6 +79,14 @@ function OnSimulStart()
for j = 1, #( vTools or {}) do for j = 1, #( vTools or {}) do
if vTools[j] ~= '' then if vTools[j] ~= '' then
EgtLoadTool( vTcPos[i], j, vTools[j]) EgtLoadTool( vTcPos[i], j, vTools[j])
-- Aggiunto controllo lunghezza lama minima * 0.9 per ricavare la tolleranza del VMILL
if EgtTdbSetCurrTool(vTools[j]) then -- set utensile corrente
if EgtTdbGetCurrToolParam( MCH_TP.TYPE) == MCH_TY.SAW_STD or EgtTdbGetCurrToolParam( MCH_TP.TYPE) == MCH_TY.SAW_FLAT then -- controllo tipo utensile sega
local dCurrSawLen = EgtTdbGetCurrToolParam( MCH_TP.LEN) * 0.9
-- se non definito o minore del valore precedente aggiorna la tolleranza
EMT.VMILLTOL = EgtIf( not EMT.VMILLTOL or dCurrSawLen < EMT.VMILLTOL, dCurrSawLen, EMT.VMILLTOL)
end
end
end end
end end
ShowToolInTcPos( vTcPos[i], true) ShowToolInTcPos( vTcPos[i], true)
@@ -105,6 +110,7 @@ function OnSimulStart()
AddToCollisionCheck( 'B', 'COLLISION', EMT.COLLOBJ) AddToCollisionCheck( 'B', 'COLLISION', EMT.COLLOBJ)
AddToCollisionCheck( 'C', 'COLLISION', EMT.COLLOBJ) AddToCollisionCheck( 'C', 'COLLISION', EMT.COLLOBJ)
AddToCollisionCheck( 'H5', 'COLLISION', EMT.COLLOBJ) AddToCollisionCheck( 'H5', 'COLLISION', EMT.COLLOBJ)
AddToCollisionCheck( 'H6', 'COLLISION', EMT.COLLOBJ)
AddToolToCollisionCheck( 'H2', 1, EMT.COLLOBJ) AddToolToCollisionCheck( 'H2', 1, EMT.COLLOBJ)
AddToolHolderToCollisionCheck( 'H2', 1, EMT.COLLOBJ) AddToolHolderToCollisionCheck( 'H2', 1, EMT.COLLOBJ)
DumpCollisionCheck( EMT.COLLOBJ, 'Collision Objects :', 4) DumpCollisionCheck( EMT.COLLOBJ, 'Collision Objects :', 4)
@@ -117,7 +123,8 @@ function OnSimulStart()
{ Grp = 'V', Sub = 'COLLISION', Name = 'VOL2'}, { Grp = 'V', Sub = 'COLLISION', Name = 'VOL2'},
{ Grp = 'PV', Sub = 'COLLISION', Name = 'VOL'}, { Grp = 'PV', Sub = 'COLLISION', Name = 'VOL'},
{ Grp = 'Base', Sub = 'COLLISION', Name = 'SIDE1'}, { Grp = 'Base', Sub = 'COLLISION', Name = 'SIDE1'},
{ Grp = 'Base', Sub = 'COLLISION', Name = 'SIDE2'}} { Grp = 'Base', Sub = 'COLLISION', Name = 'SIDE2'},
{ Grp = 'C', Sub = 'COLLISION2', Name = 'C_TOP'}}
EgtOutLog( 'MCODET Objects :', 4) EgtOutLog( 'MCODET Objects :', 4)
local nMcdNullCnt = 0 local nMcdNullCnt = 0
for i = 1, #McdData do for i = 1, #McdData do
@@ -141,6 +148,30 @@ function OnSimulStart()
end end
-- Preparo lista collisioni vuota -- Preparo lista collisioni vuota
EMT.COLLIDE = {} EMT.COLLIDE = {}
-- si crea gruppo temporaneo appoggio controllo clamping
CLAMP_CHECK_GROUP = EgtGetFirstNameInGroup( GDB_ID.ROOT, 'CLAMP_CHECK')
CLAMP_CHECK_INTERS = EgtGetFirstNameInGroup( GDB_ID.ROOT, 'CLAMP_INTERS')
if CLAMP_CHECK_GROUP then
EgtEmptyGroup( CLAMP_CHECK_GROUP)
else
local frClampCheckGroup = Frame3d( ORIG(), GDB_FR.FRONT)
CLAMP_CHECK_GROUP = EgtGroup( GDB_ID.ROOT, frClampCheckGroup)
EgtSetName( CLAMP_CHECK_GROUP, 'CLAMP_CHECK')
EgtSetLevel( CLAMP_CHECK_GROUP, GDB_LV.TEMP)
EgtSetStatus( CLAMP_CHECK_GROUP, GDB_ST.OFF)
end
if CLAMP_CHECK_INTERS then
EgtEmptyGroup( CLAMP_CHECK_INTERS)
else
CLAMP_CHECK_INTERS = EgtGroup( GDB_ID.ROOT)
EgtSetName( CLAMP_CHECK_INTERS, 'CLAMP_INTERS')
EgtSetLevel( CLAMP_CHECK_INTERS, GDB_LV.TEMP)
EgtSetStatus( CLAMP_CHECK_INTERS, GDB_ST.OFF)
end
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
@@ -152,7 +183,8 @@ function OnSimulDispositionStarting()
EmtUnlinkAllRawPartsFromGroups() EmtUnlinkAllRawPartsFromGroups()
if EMT.PHASE > 1 then if EMT.PHASE > 1 then
if IsStartOrRestPhase( EMT.PHASE) then if IsStartOrRestPhase( EMT.PHASE) then
EgtSetAxisPos( 'T', LoadT) local ParkT = GetParkT()
EgtSetAxisPos( 'T', ParkT)
end end
end end
end end
@@ -166,20 +198,20 @@ function OnSimulDispositionStart()
-- Determino dimensioni del grezzo -- Determino dimensioni del grezzo
local nSolId = EgtGetFirstNameInGroup( EgtGetFirstRawPart() or GDB_ID.NULL, 'RawSolid') or GDB_ID.NULL local nSolId = EgtGetFirstNameInGroup( EgtGetFirstRawPart() or GDB_ID.NULL, 'RawSolid') or GDB_ID.NULL
local b3Sol = EgtGetBBoxGlob( nSolId, GDB_BB.STANDARD) local b3Sol = EgtGetBBoxGlob( nSolId, GDB_BB.STANDARD)
EMT.LB = 0 EMT.LT = 0
EMT.SB = 0 EMT.ST = 0
EMT.HB = 0 EMT.HT = 0
if b3Sol then if b3Sol then
EMT.LB = b3Sol:getDimX() EMT.LT = b3Sol:getDimX()
EMT.SB = b3Sol:getDimY() EMT.ST = b3Sol:getDimY()
EMT.HB = b3Sol:getDimZ() EMT.HT = b3Sol:getDimZ()
end end
-- Carico primo utensile sulla testa 1 -- Carico primo utensile sulla testa 1
local sTool, nTlen = FindFirstToolOnHead( 'H1') local sTool, nTlen = FindFirstToolOnHead( 'H1')
if sTool and nTlen < LONG_TOOL_MINLEN then if sTool and nTlen < LONG_TOOL_MINLEN then
EMT.TOOL_1 = sTool EMT.TOOL_1 = sTool
else else
EMT.TOOL_1 = GetDefaultToolName() EMT.TOOL_1 = GetDefaultToolName()
end end
EgtLoadTool( 'H1', 1, EMT.TOOL_1) EgtLoadTool( 'H1', 1, EMT.TOOL_1)
EMT.TCPOS_1 = GetToolTcPos( EMT.TOOL_1) EMT.TCPOS_1 = GetToolTcPos( EMT.TOOL_1)
@@ -189,7 +221,7 @@ function OnSimulDispositionStart()
EMT.VMILL = {} EMT.VMILL = {}
if not EMT.SIM1ST and EgtGetInfo( EgtGetCurrMachGroup(), 'Vm', 'b') then if not EMT.SIM1ST and EgtGetInfo( EgtGetCurrMachGroup(), 'Vm', 'b') then
local nLastOrd = GetPhaseOrd( EgtGetPhaseCount()) local nLastOrd = GetPhaseOrd( EgtGetPhaseCount())
local nPartRawId = EgtGetFirstRawPart() local nPartRawId = EgtGetFirstRawPart()
while nPartRawId do while nPartRawId do
-- se è lo scarto finale tagliato a pezzi, esco -- se è lo scarto finale tagliato a pezzi, esco
local nRawOrd = EgtGetInfo( nPartRawId, 'ORD', 'i') local nRawOrd = EgtGetInfo( nPartRawId, 'ORD', 'i')
@@ -211,21 +243,26 @@ function OnSimulDispositionStart()
end end
end end
-- determino la risoluzione dello Zmap -- determino la risoluzione dello Zmap
local dArea = b3Raw:getDimX() * b3Raw:getDimY() + b3Raw:getDimX() * b3Raw:getDimZ() + b3Raw:getDimY() * b3Raw:getDimZ()
local dTol = 4.71 local dTol = 4.71
if dArea < CoeffVM * 0.15e6 then if EmtGetVMillStep then
dTol = 0.71 dTol = EmtGetVMillStep( b3Raw:getDimX(), b3Raw:getDimY(), b3Raw:getDimZ(), dTol)
elseif dArea < CoeffVM * 0.3e6 then else
dTol = 1.01 local dArea = b3Raw:getDimX() * b3Raw:getDimY() + b3Raw:getDimX() * b3Raw:getDimZ() + b3Raw:getDimY() * b3Raw:getDimZ()
elseif dArea < CoeffVM * 0.6e6 then if dArea < 0.075e6 then
dTol = 1.51 dTol = 0.71
elseif dArea < CoeffVM * 1.2e6 then elseif dArea < 0.15e6 then
dTol = 1.97 dTol = 1.01
elseif dArea < CoeffVM * 2.4e6 then elseif dArea < 0.3e6 then
dTol = 2.81 dTol = 1.51
elseif dArea < CoeffVM * 4.8e6 then elseif dArea < 0.6e6 then
dTol = 3.77 dTol = 1.97
elseif dArea < 1.2e6 then
dTol = 2.81
elseif dArea < 2.4e6 then
dTol = 3.77
end
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 -- creo lo Zmap
local VMillId = EgtVolZmapBox( nPartRawId, b3Raw:getMin(), b3Raw:getDimX(), b3Raw:getDimY(), b3Raw:getDimZ(), dTol, true, GDB_RT.GLOB) local VMillId = EgtVolZmapBox( nPartRawId, b3Raw:getMin(), b3Raw:getDimX(), b3Raw:getDimY(), b3Raw:getDimZ(), dTol, true, GDB_RT.GLOB)
if VMillId then if VMillId then
@@ -283,18 +320,24 @@ function OnSimulDispositionStart()
local nOrd = GetPhaseOrd( EMT.PHASE) local nOrd = GetPhaseOrd( EMT.PHASE)
local nScrapOrd = GetPhaseOrd( EgtGetPhaseCount()) + 1 local nScrapOrd = GetPhaseOrd( EgtGetPhaseCount()) + 1
local b3Raw = BBox3d() local b3Raw = BBox3d()
local b3Bar = BBox3d()
local b3Part = BBox3d()
local nPartRawId, nScrapRawId local nPartRawId, nScrapRawId
local nRawId = EgtGetFirstRawPart() local nRawId = EgtGetFirstRawPart()
while nRawId do while nRawId do
local nNextRawId = EgtGetNextRawPart( nRawId) local nNextRawId = EgtGetNextRawPart( nRawId)
if EgtVerifyRawPartPhase( nRawId, EMT.PHASE) then if EgtVerifyRawPartPhase( nRawId, EMT.PHASE) then
EmtLinkRawPartToGroup( nRawId, 'Tab') EmtLinkRawPartToGroup( nRawId, 'Tab')
local b3Tmp = EgtGetRawPartBBox( nRawId)
b3Bar:Add( b3Tmp)
local nRawOrd = EgtGetInfo( nRawId, 'ORD', 'i') local nRawOrd = EgtGetInfo( nRawId, 'ORD', 'i')
if nRawOrd == nOrd then if nRawOrd == nOrd then
b3Raw = EgtGetRawPartBBox( nRawId) --b3Raw = EgtGetRawPartBBox( nRawId)
b3Raw:Add( b3Tmp)
b3Part:Add( b3Tmp)
nPartRawId = nRawId nPartRawId = nRawId
elseif nRawOrd == nOrd + 1 and nRawOrd == nScrapOrd then elseif nRawOrd == nOrd + 1 and nRawOrd == nScrapOrd then
local b3Tmp = EgtGetRawPartBBox( nRawId) or BBox3d() --local b3Tmp = EgtGetRawPartBBox( nRawId) or BBox3d()
b3Raw:Add( b3Tmp) b3Raw:Add( b3Tmp)
nScrapRawId = nRawId nScrapRawId = nRawId
end end
@@ -308,6 +351,9 @@ function OnSimulDispositionStart()
else else
EMT.SCRAP = nil EMT.SCRAP = nil
end end
EMT.LB = b3Bar:getDimX()
EMT.LR = b3Raw:getDimX()
EMT.LT = b3Part:getDimX()
-- recupero CutId del pezzo in lavorazione -- recupero CutId del pezzo in lavorazione
EMT.CUTID = EgtGetInfo( EgtGetFirstPartInRawPart( nPartRawId or GDB_ID.NULL) or GDB_ID.NULL, 'CUTID', 'i') or 0 EMT.CUTID = EgtGetInfo( EgtGetFirstPartInRawPart( nPartRawId or GDB_ID.NULL) or GDB_ID.NULL, 'CUTID', 'i') or 0
EMT.YSPEC = nil EMT.YSPEC = nil
@@ -358,6 +404,8 @@ function OnSimulDispositionStart()
EgtOutText( 'Barra non ruotata') EgtOutText( 'Barra non ruotata')
end end
end end
-- verifico posizione di carico
local ParkT = GetParkT()
-- indice primo grezzo della fase -- indice primo grezzo della fase
local nOrd = GetPhaseOrd( EMT.PHASE) local nOrd = GetPhaseOrd( EMT.PHASE)
-- ricerco vettore movimento per i successivi -- ricerco vettore movimento per i successivi
@@ -365,7 +413,7 @@ function OnSimulDispositionStart()
local nRawId = EgtGetFirstRawPart() local nRawId = EgtGetFirstRawPart()
while nRawId do while nRawId do
if EgtGetInfo( nRawId, 'ORD', 'i') == nOrd + 1 then if EgtGetInfo( nRawId, 'ORD', 'i') == nOrd + 1 then
vtMove = Vector3d( - LoadT - EgtGetRawPartBBox( nRawId):getMax():getX(), 0, 0) vtMove = Vector3d( - ParkT - EgtGetRawPartBBox( nRawId):getMax():getX(), 0, 0)
break break
end end
nRawId = EgtGetNextRawPart( nRawId) nRawId = EgtGetNextRawPart( nRawId)
@@ -377,6 +425,7 @@ function OnSimulDispositionStart()
if EgtVerifyRawPartPhase( nRawId, EMT.PHASE) then if EgtVerifyRawPartPhase( nRawId, EMT.PHASE) then
if EgtGetInfo( nRawId, 'ORD', 'i') == nOrd then if EgtGetInfo( nRawId, 'ORD', 'i') == nOrd then
EmtLinkRawPartToGroup( nRawId, 'Tab') EmtLinkRawPartToGroup( nRawId, 'Tab')
b3Bar = EgtGetRawPartBBox( nRawId)
else else
EgtMove( nRawId, vtMove, GDB_RT.GLOB) EgtMove( nRawId, vtMove, GDB_RT.GLOB)
EgtSetStatus( nRawId, GDB_ST.OFF) EgtSetStatus( nRawId, GDB_ST.OFF)
@@ -384,8 +433,12 @@ function OnSimulDispositionStart()
end end
nRawId = nNextRawId nRawId = nNextRawId
end end
EMT.LB = b3Bar:getDimX()
-- altrimenti fase finale, aggancio primo grezzo alla tavola e gli altri in posizione carico al carro Y -- altrimenti fase finale, aggancio primo grezzo alla tavola e gli altri in posizione carico al carro Y
else else
-- verifico posizione di carico
local ParkT = GetParkT()
-- indice primo grezzo della fase -- indice primo grezzo della fase
local nOrd = GetPhaseOrd( EMT.PHASE) local nOrd = GetPhaseOrd( EMT.PHASE)
-- ricerco vettore movimento per i successivi -- ricerco vettore movimento per i successivi
@@ -393,18 +446,20 @@ function OnSimulDispositionStart()
local nRawId = EgtGetFirstRawPart() local nRawId = EgtGetFirstRawPart()
while nRawId do while nRawId do
if EgtGetInfo( nRawId, 'ORD', 'i') == nOrd + 1 then if EgtGetInfo( nRawId, 'ORD', 'i') == nOrd + 1 then
vtMove = Vector3d( - LoadT - EgtGetRawPartBBox( nRawId):getMax():getX(), 0, 0) vtMove = Vector3d( - ParkT - EgtGetRawPartBBox( nRawId):getMax():getX(), 0, 0)
break break
end end
nRawId = EgtGetNextRawPart( nRawId) nRawId = EgtGetNextRawPart( nRawId)
end end
-- eseguo -- eseguo
local b3Bar = BBox3d()
nRawId = EgtGetFirstRawPart() nRawId = EgtGetFirstRawPart()
while nRawId do while nRawId do
local nNextRawId = EgtGetNextRawPart( nRawId) local nNextRawId = EgtGetNextRawPart( nRawId)
if EgtVerifyRawPartPhase( nRawId, EMT.PHASE) then if EgtVerifyRawPartPhase( nRawId, EMT.PHASE) then
if EgtGetInfo( nRawId, 'ORD', 'i') == nOrd then if EgtGetInfo( nRawId, 'ORD', 'i') == nOrd then
EmtLinkRawPartToGroup( nRawId, 'Tab') EmtLinkRawPartToGroup( nRawId, 'Tab')
b3Bar = EgtGetRawPartBBox( nRawId)
else else
EgtMove( nRawId, vtMove, GDB_RT.GLOB) EgtMove( nRawId, vtMove, GDB_RT.GLOB)
EmtLinkRawPartToGroup( nRawId, 'Y') EmtLinkRawPartToGroup( nRawId, 'Y')
@@ -412,6 +467,7 @@ function OnSimulDispositionStart()
end end
nRawId = nNextRawId nRawId = nNextRawId
end end
EMT.LB = b3Bar:getDimX()
end end
-- Indicazione angolo rotazione pezzo -- Indicazione angolo rotazione pezzo
EMT.ROT = EgtGetInfo( EMT.DISPID, 'ROT', 'i') or 0 EMT.ROT = EgtGetInfo( EMT.DISPID, 'ROT', 'i') or 0
@@ -443,6 +499,7 @@ function OnSimulDispositionEnd()
EMT.POSTROT = true EMT.POSTROT = true
end end
end end
EMT.SPLIT = false
EMT.OPEISDISP = false EMT.OPEISDISP = false
end end
@@ -456,8 +513,10 @@ function OnSimulToolSelect( dPosA)
EMT.TOTDIAM = EgtTdbGetCurrToolParam( MCH_TP.TOTDIAM) EMT.TOTDIAM = EgtTdbGetCurrToolParam( MCH_TP.TOTDIAM)
-- se non è chiamato da altro script (non c'è parametro) -- se non è chiamato da altro script (non c'è parametro)
if not dPosA then if not dPosA then
-- se attivo Vmill -- se utensile non flottante, abilito per Vmill
SetToolForVmill( EMT.TOOL, EMT.HEAD, EMT.EXIT, EMT.VMILL) if not EMT.TFLOAT then
EmtSetToolForVmill( EMT.TOOL, EMT.HEAD, EMT.EXIT, EMT.VMILL)
end
-- se attivo Collision Check -- se attivo Collision Check
EMT.SAFEDIST = COLL_SAFE_DIST EMT.SAFEDIST = COLL_SAFE_DIST
if EMT.COLLOBJ then if EMT.COLLOBJ then
@@ -477,8 +536,8 @@ function OnSimulToolSelect( dPosA)
EMT.A1n = 'Y' EMT.A1n = 'Y'
EMT.A2n = 'V' EMT.A2n = 'V'
end end
-- carico utensile se non lama su sua testa o dummy -- carico utensile se non lama
if EMT.HEAD ~= 'H2' and EMT.HEAD ~= 'H4' then if EMT.HEAD ~= 'H2' then
-- se sega a catena, imposto subito angolo scelto per asse virtuale A -- se sega a catena, imposto subito angolo scelto per asse virtuale A
if EMT.HEAD == 'H3' then if EMT.HEAD == 'H3' then
if not dPosA then if not dPosA then
@@ -494,18 +553,27 @@ function OnSimulToolSelect( dPosA)
end end
EgtSetCurrMachining( NextMchId) EgtSetCurrMachining( NextMchId)
-- recupero il valore dell'asse virtuale bloccato A -- recupero il valore dell'asse virtuale bloccato A
local sVal = EgtGetMachiningParam( MCH_MP.BLOCKEDAXIS) dPosA = GetCurrChainSawingVirtualAxis()
dPosA = tonumber( sVal:sub( 3))
else else
-- imposto visualizzazione -- imposto visualizzazione
EgtSetMode( EgtGetHeadId( EMT.HEAD) or GDB_ID.NULL, GDB_MD.STD) EgtSetMode( EgtGetHeadId( EMT.HEAD) or GDB_ID.NULL, GDB_MD.STD)
end end
-- imposto il valore di A -- imposto il valore di A
EgtSetAxisPos( 'A', dPosA) EgtSetAxisPos( 'A', dPosA)
if abs( dPosA) < 0.1 then local dHomeC = GetChainSawCHomeFromVirtualAxis( dPosA)
EgtSetAxisPos( 'C', EgtIf( BD.RIGHT_LOAD, 180, 0)) EgtSetAxisPos( 'C', dHomeC)
end
EgtSetAxisPos( 'B', 0) EgtSetAxisPos( 'B', 0)
-- se aggregato per fresa tipo blockhaus
elseif EMT.HEAD == 'H7' then
EgtSetAxisPos( 'C', EgtIf( BD.RIGHT_LOAD, 180, 0))
end
-- se TC 1
if GetTCSet( EMT.TCPOS) == 1 then
EgtSetAxisPos( 'B', 90)
else
if EMT.HEAD ~= 'H3' then
EgtSetAxisPos( 'B', -90)
end
end end
-- se punta lunga -- se punta lunga
if EMT.TOTLEN > LONG_TOOL_MINLEN then if EMT.TOTLEN > LONG_TOOL_MINLEN then
@@ -513,8 +581,7 @@ function OnSimulToolSelect( dPosA)
if EMT.TCPOS == 'T111' then if EMT.TCPOS == 'T111' then
EgtSetAxisPos( 'B', 0) EgtSetAxisPos( 'B', 0)
end end
end end -- breve pausa
-- breve pausa
EgtPause( 100) EgtPause( 100)
EgtOutText( '') EgtOutText( '')
EMT.TOOL_1 = EMT.TOOL EMT.TOOL_1 = EMT.TOOL
@@ -529,27 +596,26 @@ function OnSimulToolDeselect()
-- se prossimo utensile non definito, è disposizione ed esco -- se prossimo utensile non definito, è disposizione ed esco
if EMT.NEXTTOOL == '' then return end if EMT.NEXTTOOL == '' then return end
-- se cambia uscita su rinvio non devo fare alcunché -- se cambia uscita su rinvio non devo fare alcunché
if EMT.HEAD == 'H5' and EMT.NEXTHEAD == 'H5' then return end if ( EMT.HEAD == 'H5' and EMT.NEXTHEAD == 'H5') or ( EMT.HEAD == 'H6' and EMT.NEXTHEAD == 'H6') then return end
-- se sega a catena o rinvio o punta lunga o utensile di grosso diametro, devo cambiare -- se sega a catena o rinvio o punta lunga o utensile di grosso diametro, devo cambiare
if EMT.HEAD == 'H3' or EMT.HEAD == 'H5' or ( EMT.HEAD == 'H1' and ( EMT.TOTLEN > LONG_TOOL_MINLEN or EMT.TOTDIAM > BIG_TOOL_DIAM)) then if EMT.HEAD == 'H3' or EMT.HEAD == 'H5' or EMT.HEAD == 'H6' or EMT.HEAD == 'H7' or ( EMT.HEAD == 'H1' and ( EMT.TOTLEN > LONG_TOOL_MINLEN or EMT.TOTDIAM > BIG_TOOL_DIAM)) then
EgtOutText( 'Tool change in progress...') EgtOutText( 'Tool change in progress...')
-- movimento scarico sega a catena -- movimento scarico sega a catena
if EMT.HEAD == 'H3' then if EMT.HEAD == 'H3' then
-- se avevo motosega, torno in zona sicura senza ruotare assi rotanti -- se avevo motosega, torno in zona sicura senza ruotare assi rotanti
if EMT.HB > BeamHeightForFixRot then SimulMoveAxis( 'X', SafeXRotAxes, MCH_SIM_STEP.RAPID)
SimulMoveAxis( 'X', SafeXRotAxes, MCH_SIM_STEP.RAPID) -- raddrizzo asse B prima di ruotare il C
end SimulMoveAxis( 'B', 0, MCH_SIM_STEP.COLLROT)
local dPosA = EgtGetAxisPos( 'A') SimulMoveAxis( 'C', 0, MCH_SIM_STEP.COLLROT)
if abs( dPosA) < 0.1 then
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.COLLROT, 'C', EgtIf( BD.RIGHT_LOAD, 180, 0), MCH_SIM_STEP.COLLROT)
else
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.COLLROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.COLLROT)
end
SimulMoveAxis( 'X', 0, MCH_SIM_STEP.RAPID) SimulMoveAxis( 'X', 0, MCH_SIM_STEP.RAPID)
-- movimento scarico rinvio -- movimento scarico rinvio
elseif EMT.HEAD == 'H5' then elseif EMT.HEAD == 'H5' or EMT.HEAD == 'H6' then
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.COLLROT, 'C', -90, MCH_SIM_STEP.COLLROT) SimulMoveAxes( 'B', 0, MCH_SIM_STEP.COLLROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'X', 0, MCH_SIM_STEP.RAPID) SimulMoveAxis( 'X', 0, MCH_SIM_STEP.RAPID)
-- movimento scarico aggregato BlockHaus
elseif EMT.HEAD == 'H7' then
SimulMoveAxis( 'X', 0, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'B', 90, MCH_SIM_STEP.COLLROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.COLLROT)
-- movimento scarico punta lunga su T111 -- movimento scarico punta lunga su T111
elseif EMT.TOTLEN > LONG_TOOL_MINLEN then elseif EMT.TOTLEN > LONG_TOOL_MINLEN then
-- se su cambio utensile T111 -- se su cambio utensile T111
@@ -559,7 +625,11 @@ function OnSimulToolDeselect()
-- altrimenti posizioni standard rastrelliera -- altrimenti posizioni standard rastrelliera
else else
SimulMoveAxis( 'X', 0, MCH_SIM_STEP.RAPID) SimulMoveAxis( 'X', 0, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'B', 90, MCH_SIM_STEP.COLLROT, 'C', -90, MCH_SIM_STEP.COLLROT) if GetTCSet( EMT.TCPOS) == 1 then
SimulMoveAxes( 'B', 90, MCH_SIM_STEP.COLLROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.COLLROT)
else
SimulMoveAxes( 'B', -90, MCH_SIM_STEP.COLLROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.COLLROT)
end
end end
-- movimento scarico utensile di grosso diametro (su T111) -- movimento scarico utensile di grosso diametro (su T111)
else else
@@ -573,24 +643,35 @@ function OnSimulToolDeselect()
-- nascondo utensile su testa e lo visualizzo su TcPos -- nascondo utensile su testa e lo visualizzo su TcPos
EgtSetMode( EgtGetHeadId( EMT.HEAD), GDB_MD.HIDDEN) EgtSetMode( EgtGetHeadId( EMT.HEAD), GDB_MD.HIDDEN)
ShowToolInTcPos( EMT.TCPOS_1, true) ShowToolInTcPos( EMT.TCPOS_1, true)
-- movimento per carico utensile -- movimento per carico utensile
if EMT.NEXTHEAD ~= 'H3' and EMT.NEXTHEAD ~= 'H5' then if EMT.NEXTHEAD ~= 'H3' and EMT.NEXTHEAD ~= 'H5' and EMT.NEXTHEAD ~= 'H6' then
SimulMoveAxes( 'B', 90, MCH_SIM_STEP.RAPROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.RAPROT) SimulMoveAxes( 'B', EgtIf( GetTCSet( EMT.TCPOS) == 1, 90, -90), MCH_SIM_STEP.RAPROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.RAPROT)
else else
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.RAPROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.RAPROT) if EMT.NEXTHEAD == 'H3' then
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.RAPROT, 'C', 0, MCH_SIM_STEP.RAPROT)
else
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.RAPROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.RAPROT)
end
end end
-- se segue lama, carico utensile di default -- se segue lama, carico utensile di default
if EMT.NEXTHEAD == 'H2' then if EMT.NEXTHEAD == 'H2' then
local sDefTool = GetDefaultToolName() local sDefTool = GetDefaultToolName()
EgtLoadTool( 'H1', 1, sDefTool)
EMT.TOOL_1 = sDefTool EMT.TOOL_1 = sDefTool
EMT.TCPOS_1 = GetToolTcPos( EMT.TOOL_1) EMT.TCPOS_1 = GetToolTcPos( EMT.TOOL_1)
-- se TC 1
if GetTCSet( EMT.TCPOS_1) == 1 then
EgtSetAxisPos( 'B', 90)
else
EgtSetAxisPos( 'B', -90)
end
EgtLoadTool( 'H1', 1, sDefTool)
-- lo nascondo sul portautensili -- lo nascondo sul portautensili
ShowToolInTcPos( EMT.TCPOS_1, false) ShowToolInTcPos( EMT.TCPOS_1, false)
end end
EgtOutText( '') EgtOutText( '')
-- deposito utensile se prossimo non lama su sua testa o dummy -- deposito utensile se prossimo non lama su sua testa
elseif EMT.NEXTHEAD ~= 'H2' and EMT.NEXTHEAD ~= 'H4' then elseif EMT.NEXTHEAD ~= 'H2' then
if EMT.NEXTTOOL ~= EMT.TOOL_1 then if EMT.NEXTTOOL ~= EMT.TOOL_1 then
EgtOutText( 'Tool change in progress...') EgtOutText( 'Tool change in progress...')
-- simulo movimento -- simulo movimento
@@ -600,7 +681,7 @@ function OnSimulToolDeselect()
EgtPause( 100) EgtPause( 100)
ShowToolInTcPos( EMT.TCPOS_1, true) ShowToolInTcPos( EMT.TCPOS_1, true)
-- se segue sega a catena -- se segue sega a catena
if EMT.NEXTHEAD == 'H3' or EMT.NEXTHEAD == 'H5' then if EMT.NEXTHEAD == 'H3' or EMT.NEXTHEAD == 'H5' or EMT.NEXTHEAD == 'H6' then
-- se non lama, nascondo l'utensile corrente -- se non lama, nascondo l'utensile corrente
if EMT.HEAD ~= 'H2' then if EMT.HEAD ~= 'H2' then
EgtSetStatus( EgtGetHeadId( EMT.HEAD), GDB_ST.OFF) EgtSetStatus( EgtGetHeadId( EMT.HEAD), GDB_ST.OFF)
@@ -628,8 +709,7 @@ function OnSimulMachiningStart()
-- se lavorazione attuale e precedente con sega a catena con angolo A diverso, devo scaricare e ricaricare -- se lavorazione attuale e precedente con sega a catena con angolo A diverso, devo scaricare e ricaricare
if EMT.HEAD == 'H3' and EMT.HEAD == EMT.PREVHEAD then if EMT.HEAD == 'H3' and EMT.HEAD == EMT.PREVHEAD then
local dPrevA = EgtGetAxisPos( 'A') local dPrevA = EgtGetAxisPos( 'A')
local sVal = EgtGetMachiningParam( MCH_MP.BLOCKEDAXIS) local dPosA = GetCurrChainSawingVirtualAxis()
local dPosA = tonumber( sVal:sub( 3))
if abs( dPosA - dPrevA) > 1 then if abs( dPosA - dPrevA) > 1 then
OnSimulToolDeselect() OnSimulToolDeselect()
EgtSetStatus( EgtGetHeadId( EMT.HEAD), GDB_ST.ON) EgtSetStatus( EgtGetHeadId( EMT.HEAD), GDB_ST.ON)
@@ -661,7 +741,9 @@ function OnSimulMachiningEnd()
EMT.UNLOADING = false EMT.UNLOADING = false
EMT.FALL = false EMT.FALL = false
end end
EMT.SPLIT = nil
EMT.PREVHEAD = EMT.HEAD EMT.PREVHEAD = EMT.HEAD
EMT.PREVTOOL = EMT.TOOL
EMT.PREVEXIT = EMT.EXIT EMT.PREVEXIT = EMT.EXIT
end end
@@ -747,31 +829,89 @@ function OnSimulMoveStart()
VerifyVStroke( EMT.A2) VerifyVStroke( EMT.A2)
-- se inizio lavorazione -- se inizio lavorazione
if EMT.MCHFIRST then if EMT.MCHFIRST then
local bGoToHome = false
-- se gli assi rotanti cambiano parecchio, con motosega si va in parcheggio
if EMT.PREVHEAD == 'H3' and EMT.HEAD == 'H3' and EMT.TOOL == EMT.PREVTOOL and abs( EMT.R3p - EMT.R3) < 100 * GEO.EPS_SMALL and ( abs( EMT.R2p - EMT.R2) > 25 or abs( EMT.R1p - EMT.R1) > 25) then
bGoToHome = true
end
EgtOutText( '') EgtOutText( '')
EMT.MCHFIRST = false EMT.MCHFIRST = false
local bZmax = ( EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1)
-- con pezzi alti aggiorno gli assi rotanti prima di muovermi sopra il pezzo -- con pezzi alti aggiorno gli assi rotanti prima di muovermi sopra il pezzo
if not EMT.LOAD and EMT.MOVE == 0 and EMT.HB > BeamHeightForFixRot and EMT.FLAG2 == 1 then if EMT.HEAD == 'H3' and EMT.PREVHEAD ~= 'H3' then
-- se motosega mi muovo a X di sicurezza per ruotare SimulMoveAxis( 'X', SafeXRotAxes, MCH_SIM_STEP.RAPID)
if EMT.HEAD == 'H3'then SimulMoveAxis( 'B', 0, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'C', EMT.R1, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'B', EMT.R2, MCH_SIM_STEP.COLLROT)
elseif not EMT.LOAD and EMT.MOVE == 0 and ( EMT.HEAD == 'H3' or ( bZmax and EMT.TOTLEN > 200)) and
( EMT.HT > BeamHeightForFixRot or ( EMT.HEAD == 'H1' and EMT.TOTLEN > 350) or bGoToHome) and EMT.FLAG2 == 1 then
-- se motosega mi muovo a X di sicurezza per ruotare, prima si raddrizza B e poi C in posizione
if EMT.HEAD == 'H3' and bGoToHome then
SimulMoveAxis( 'X', SafeXRotAxes, MCH_SIM_STEP.RAPID)
SimulMoveAxis( 'B', 0, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'C', EMT.R1, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'B', EMT.R2, MCH_SIM_STEP.COLLROT)
elseif ( bZmax and EMT.TOTLEN > 200) then
SimulMoveAxes( 'X', SafeXRotAxes, MCH_SIM_STEP.RAPID, 'C', EMT.R1, MCH_SIM_STEP.COLLROT, 'B', EMT.R2, MCH_SIM_STEP.COLLROT) SimulMoveAxes( 'X', SafeXRotAxes, MCH_SIM_STEP.RAPID, 'C', EMT.R1, MCH_SIM_STEP.COLLROT, 'B', EMT.R2, MCH_SIM_STEP.COLLROT)
end end
end end
EMT.POSTROT = nil EMT.POSTROT = nil
end end
-- se aggregato flottante su inizio attacco va compresso
if EMT.TFLOAT and not EMT.TFLOAT_CMP and EMT.MOVE == 1 and EgtGetName( EMT.MOVEID) == 'LI' then
-- recupero lunghezza
local dOffsL = - EgtGetMachiningParam( MCH_MP.OFFSL)
-- imposto compressione della parte flottante
SetFloatPos( EMT.HEAD, dOffsL)
-- imposto dati utensile in posizione compressa
EmtSetToolForVmill( EMT.TOOL, EMT.HEAD, EMT.EXIT, EMT.VMILL, 2, -dOffsL)
-- dichiaro che è compresso (assegnando Id entità di movimento)
EMT.TFLOAT_CMP = EMT.MOVEID
end
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function OnSimulMoveEnd() function OnSimulMoveEnd()
-- se termine di passata con lama
if EMT.FLAG == 301 then if EMT.FLAG == 301 then
-- rimozione eventuali sfridi -- rimozione eventuali sfridi
ExecRemoveScraps() ExecRemoveScraps()
end end
-- se utensile flottante e movimento di compressione
if EMT.TFLOAT and EMT.MOVEID == EMT.TFLOAT_CMP then
-- verifico ci sia stata collisione tra ghiera flottante (portautensile e pezzo)
if not EMT.TFLOAT_TH_COMPR_COLL then
local sErr = 'CUTID='..tostring( EMT.CUTID)..'; TASKID='..tostring( EMT.TASKID)..'; Mach='..EMT.MCHNAME..'; Floating Ring not compressed on approach'
EmtSetLastError( 1222, sErr)
EgtOutLog( 'Error : ' .. sErr, 1)
else
EgtOutLog( 'Floating Ring compressed on approach (MOVEID='..EgtNumToString( EMT.MOVEID)..')', 1)
end
EMT.TFLOAT_TH_COMPR_COLL = nil
end
-- se aggregato flottante su fine uscita va rilasciato
if EMT.TFLOAT and EMT.TFLOAT_CMP and EMT.MOVE == 1 and EgtGetName( EMT.MOVEID) == 'LO' and EgtGetName( EgtGetNext( EMT.MOVEID) or GDB_ID.NULL) ~= 'LO' then
-- reset compressione della parte flottante
SetFloatPos( EMT.HEAD, 0)
-- dichiaro che è rilasciato
EMT.TFLOAT_CMP = nil
end
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function OnSimulCollision() function OnSimulCollision()
-- se prima collisione della lavorazione, la segnalo -- se prima collisione della lavorazione, la segnalo
if EMT.MCHNAME ~= EMT.LAST_MCHNAME_COLLIDE then if EMT.MCHNAME ~= EMT.LAST_MCHNAME_COLLIDE then
-- speciale per utensile flottante (suo holder contro il grezzo)
if EMT.TFLOAT and EMT.TFLOAT_CMP and EMT.SIMCOBIND == 1002 and EMT.SIMVMID == EMT.VMILL[1] then
if EMT.MOVEID == EMT.TFLOAT_CMP then
EMT.TFLOAT_TH_COMPR_COLL = true
end
return
end
-- standard
local Class = '' local Class = ''
if EMT.SIMCOBIND == 1001 then if EMT.SIMCOBIND == 1001 then
Class = 'T_H1' Class = 'T_H1'
@@ -795,6 +935,8 @@ function ExecAuxCmd( sCmd)
if Cmd[1] == '0' then if Cmd[1] == '0' then
if Cmd[2] == 'Unloading' then if Cmd[2] == 'Unloading' then
EMT.UNLOADING = true EMT.UNLOADING = true
elseif Cmd[2] == 'Split' then
EMT.SPLIT = true
elseif Cmd[2] == 'Fall' then elseif Cmd[2] == 'Fall' then
EMT.FALL = true EMT.FALL = true
end end
@@ -836,19 +978,9 @@ function ExecAuxCmd( sCmd)
end end
end end
elseif Cmd[1] == '11' then elseif Cmd[1] == '11' then
local dPY = MaxOpen ExecMovePY( Cmd[2] ~= '0')
if Cmd[2] ~= '0' then
dPY = EgtIf( EMT.ROT == -1, EMT.HB, EMT.SB)
end
SimulMoveAxis( 'PY', dPY, MCH_SIM_STEP.RAPID)
SetPYLight( Cmd[2] ~= '0')
elseif Cmd[1] == '12' then elseif Cmd[1] == '12' then
local dPV = MaxOpen ExecMovePV( Cmd[2] ~= '0')
if Cmd[2] ~= '0' then
dPV = EgtIf( EMT.ROT == -1, EMT.HB, EMT.SB)
end
SimulMoveAxis( 'PV', dPV, MCH_SIM_STEP.RAPID)
SetPVLight( Cmd[2] ~= '0')
elseif Cmd[1] == '21' then elseif Cmd[1] == '21' then
local nYDelta = tonumber( Cmd[2]) local nYDelta = tonumber( Cmd[2])
local nVDelta = tonumber( Cmd[3]) local nVDelta = tonumber( Cmd[3])
@@ -892,7 +1024,7 @@ function ExecRemoveScraps()
for i = nPart, 1, -1 do for i = nPart, 1, -1 do
if i ~= nPartMax then if i ~= nPartMax then
local b3Vmill = EgtVolZmapGetPartBBoxGlob( vMillId, i - 1, GDB_BB.STANDARD) local b3Vmill = EgtVolZmapGetPartBBoxGlob( vMillId, i - 1, GDB_BB.STANDARD)
if b3Vmill:getDimX() < 1200 then if b3Vmill:getDimX() < 1250 then
EgtRemoveVolZmapPart( vMillId, i - 1) EgtRemoveVolZmapPart( vMillId, i - 1)
end end
end end
@@ -912,14 +1044,14 @@ function ExecUnloading()
-- li sposto per lasciare spazio al nuovo pezzo -- li sposto per lasciare spazio al nuovo pezzo
local nId = EgtGetFirstInGroup( nVmGrpId) local nId = EgtGetFirstInGroup( nVmGrpId)
while nId do while nId do
EgtMove( nId, Vector3d( 0, EgtIf( BD.RIGHT_LOAD, ( EMT.SB + 50.0), -( EMT.SB + 50.0)), 0), GDB_RT.GLOB) EgtMove( nId, Vector3d( 0, EgtIf( BD.RIGHT_LOAD, ( EMT.ST + 50.0), -( EMT.ST + 50.0)), 0), GDB_RT.GLOB)
nId = EgtGetNext( nId) nId = EgtGetNext( nId)
end end
-- creo un nuovo layer e vi inserisco il nuovo pezzo -- creo un nuovo layer e vi inserisco il nuovo pezzo
local nLayId = EgtGroup( nVmGrpId, EgtGetGlobFrame( vMillId)) local nLayId = EgtGroup( nVmGrpId, EgtGetGlobFrame( vMillId))
EgtRelocate( vMillId, nLayId) EgtRelocate( vMillId, nLayId)
local vtMove = Vector3d( 0, EgtIf( BD.RIGHT_LOAD, 450, -450), 0) local vtMove = Vector3d( 0, EgtIf( BD.RIGHT_LOAD, 450, -450), 0)
if EMT.FALL then vtMove = Vector3d( -500, 0, EgtIf( BD.RIGHT_LOAD, 750, -750)) end if EMT.FALL then vtMove = Vector3d( 0, EgtIf( BD.RIGHT_LOAD, 500, -500), -750) end
EgtMove( nLayId, vtMove, GDB_RT.GLOB) EgtMove( nLayId, vtMove, GDB_RT.GLOB)
EgtSetLevel( vMillId, GDB_LV.USER) EgtSetLevel( vMillId, GDB_LV.USER)
-- aggiungo gli spigoli -- aggiungo gli spigoli
@@ -957,6 +1089,176 @@ function ExecUnloading()
end end
end end
---------------------------------------------------------------------
function CheckClamping( sClampName)
local nClampId = EgtGetAxisId( sClampName) or GDB_ID.NULL
local nClampPathId = EgtGetFirstInGroup( EgtGetFirstNameInGroup( nClampId, 'CLAMP_CHECK') or GDB_ID.NULL)
local b3ClampingArea = EgtGetBBoxGlob( nClampPathId or GDB_ID.NULL, GDB_BB.STANDARD)
-- se non trovo percorso area di clamping, esco subito
if not nClampPathId or not EMT.VMILL or not ClampingCoeffMin then
return
end
local function GetCurveListFromIntersection( sPosIntersPlane, sIntersPlane, dDepth)
local vCurveListId = {}
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 nLoopId, nLoopCnt = EgtPlaneVolZmapInters( ptPosIntersPlane, vtIntersPlane, EMT.VMILL[i], CLAMP_CHECK_INTERS, GDB_RT.GLOB)
vCurveListId = EgtTableAdd( vCurveListId, nLoopId, nLoopCnt)
end
return vCurveListId
end
local function CalculateIntersectionArea( sPosIntersPlane, sIntersPlane, dDepth)
-- test piano frontale
local vCurveListId = GetCurveListFromIntersection( sPosIntersPlane, sIntersPlane, dDepth)
-- si copia curva intersezione e curva pinza in gruppo di confronto
local nFlatSurfId, nFlatSurfCnt = EgtSurfFlatRegion( CLAMP_CHECK_GROUP, vCurveListId)
local vFlatSurfId = EgtTableFill( nFlatSurfId, nFlatSurfCnt) or {}
local nClampSurfId = EgtSurfFlatRegion( CLAMP_CHECK_GROUP, nClampPathId)
local dTotalArea = 0
local dTotalXLenght = 0
for i = 1, #vFlatSurfId do
local nTempSurfId = vFlatSurfId[i]
EgtSurfFrIntersect( nTempSurfId, nClampSurfId)
if nTempSurfId then
dTotalArea = dTotalArea + ceil( EgtSurfArea( nTempSurfId) or 0)
local b3BoxIntersectionBox = EgtGetBBoxGlob( nTempSurfId, GDB_BB.STANDARD)
if b3BoxIntersectionBox then
dTotalXLenght = dTotalXLenght + ceil( b3BoxIntersectionBox:getDimX()) -- somma lunghezze (x) delle aree pinzate
end
end
end
return dTotalArea, dTotalXLenght
end
-- minima area considerata per un corretto pinzaggio
DistZClampToTable = DistZClampToTable or 0
--local MinJoin = BD.GetMinJoin( EMT.ST, EMT.HT, EgtIf( EMT.SPLIT, EMT.LT, EMT.LB))
UpdateMinJoinDeltaTol( EMT.ST, EMT.HT, EgtIf( EMT.SPLIT, EMT.LT, EMT.LB))
local MinZClamping = min( b3ClampingArea:getDimZ() + DistZClampToTable, EMT.HT) - DistZClampToTable
local dMinClamping = ( MinJoin * MinZClamping)
-- si moltiplica per un coefficiente minimo sotto al quale si da l'errore di pinzaggio
ClampingCoeffMin = EgtClamp( ClampingCoeffMin, 0.01, 1)
if MinZClamping > 116 then
dMinClamping = MinJoin * 116 + ( pow( MinJoin, 2) / 2)
if MinJoin > 280 then
dMinClamping = MinJoin * 116 + ( pow( 280, 2) / 2) + ( pow( MinJoin - 280, 2))
end
end
local dMinClampingAreaWarn = dMinClamping * ClampingCoeffMin
local dMinClampingAreaErr = dMinClamping * ( 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, dXClampedLenght = 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 ExecMovePY( bClose)
--SimulMoveAxes( 'PY', EgtIf( not bClose, MaxHoOpen, EMT.HB), MCH_SIM_STEP.RAPID)
local dPY = MaxOpen
if bClose then
dPY = EgtIf( EMT.ROT == -1, EMT.HT, EMT.ST)
end
SimulMoveAxis( 'PY', dPY, MCH_SIM_STEP.RAPID)
SetPYLight( bClose)
if bClose then
CheckClamping( 'PY')
end
end
---------------------------------------------------------------------
function ExecMovePV( bClose)
--EgtIf( not bClose, MaxHoOpen, EMT.HB), MCH_SIM_STEP.RAPID)
local dPV = MaxOpen
if bClose then
dPV = EgtIf( EMT.ROT == -1, EMT.HT, EMT.ST)
end
SimulMoveAxis( 'PV', dPV, MCH_SIM_STEP.RAPID)
SetPVLight( bClose)
if bClose then
CheckClamping( 'PV')
end
end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function VerifyYSlide( sName1, dVal1, sName2, dVal2) function VerifyYSlide( sName1, dVal1, sName2, dVal2)
-- Se movimento trave agganciata con carrello Y -- Se movimento trave agganciata con carrello Y
@@ -1113,22 +1415,35 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- *** ESTIMATION T&L *** -- *** ESTIMATION T&L ***
--------------------------------------------------------------------- ---------------------------------------------------------------------
local RAPID_X_FEED = 75000 -- mm/min local ESTIMATION_RAPID_COEFF = EstimationRapidMultiplier or 1
local RAPID_Y_FEED = 100000 -- mm/min local RAPID_X_FEED = 100000 / ESTIMATION_RAPID_COEFF -- mm/min
local RAPID_Z_FEED = 50000 -- mm/min local RAPID_Y_FEED = 100000 / ESTIMATION_RAPID_COEFF -- mm/min
local RAPID_C_FEED = 15000 -- deg/min local RAPID_Z_FEED = 100000 / ESTIMATION_RAPID_COEFF -- mm/min
local RAPID_B_FEED = 15000 -- deg/min local RAPID_C_FEED = 12000 / ESTIMATION_RAPID_COEFF -- deg/min
local RAPID_MIN_T = 0.1 -- s local RAPID_B_FEED = 12000 / ESTIMATION_RAPID_COEFF -- deg/min
local LOAD_T = 2 -- s local RAPID_MIN_T = 0.1 * ESTIMATION_RAPID_COEFF -- s
local CHAR_ONE_MOVE_T = 1 -- s local LOAD_T = 2 * ESTIMATION_RAPID_COEFF -- s
local ROTATION_T = 40 -- s local CHAR_ONE_MOVE_T = 1 * ESTIMATION_RAPID_COEFF -- s
local SPLIT_T = 6 -- s local ROTATION_T = 40 * ESTIMATION_RAPID_COEFF -- s
local UNLOAD_T = 4 -- s local SPLIT_T = 6 * ESTIMATION_RAPID_COEFF -- s
local FALL_T = 2 -- s local UNLOAD_T = 4 * ESTIMATION_RAPID_COEFF -- s
local FALL_T = 2 * ESTIMATION_RAPID_COEFF -- s
--------------------------------------------------------------------- ---------------------------------------------------------------------
function OnEstimStart() function OnEstimStart()
EMT.INCHES = not EgtUiUnitsAreMM() -- unità di misura mm/inches EMT.INCHES = not EgtUiUnitsAreMM() -- unità di misura mm/inches
-- TPA
if NumericalControl == 'TPA' then
EMT.FMAXPINZE = EgtClamp( MaxFeedPinze or 154000, 20000, 160000) -- feed massima pinze
EMT.MAXACC = MaxAcc or 4000 -- accelerazione massima pinze. In realtà è il tempo in millisecondi, quindi MAXACC corrisponde al tempo massimo per raggiungere la velocità desiderata
EMT.MINACC = MinAcc or 300 -- accelerazione minima pinze. In realtà è il tempo in millisecondi, quindi MINACC corrisponde al tempo massimo per raggiungere la velocità desiderata
-- NUM_PLUS e NUM
else
EMT.FMAXPINZE = EgtClamp( MaxFeedPinze or 154000, 20000, 160000) -- feed massima pinze
EMT.MAXACC = MaxAcc or ( EMT.FMAXPINZE / ( 60 * 0.3)) -- accelerazione massima pinze
EMT.MINACC = MinAcc or ( EMT.FMAXPINZE / ( 60 * 4)) -- accelerazione minima pinze
end
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
@@ -1214,6 +1529,15 @@ function OnEstimDispositionEnd()
EMT.OPEISDISP = false EMT.OPEISDISP = false
end end
---------------------------------------------------------------------
function OnEstimRawMoveData()
-- se start del pezzo
if IsStartOrRestPhase( EMT.PHASE) then
EMT.SPLIT = false
end
OnRawMoveData()
end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function OnEstimToolSelect() function OnEstimToolSelect()
-- reset indice utensile in tabella lunghezze -- reset indice utensile in tabella lunghezze
@@ -1270,6 +1594,12 @@ function OnEstimMachiningEnd()
EMT.TLE_NAME = nil EMT.TLE_NAME = nil
EMT.TLE_TIME = nil EMT.TLE_TIME = nil
end 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 end
--------------------------------------------------------------------- ---------------------------------------------------------------------
@@ -1400,15 +1730,15 @@ function OnEstimRapid()
EMT.MCHEXTLEN = EMT.MCHEXTLEN + dLen EMT.MCHEXTLEN = EMT.MCHEXTLEN + dLen
-- calcolo tempo -- calcolo tempo
local dTime = RAPID_MIN_T local dTime = RAPID_MIN_T
local dT1 = abs( dL1) / RAPID_X_FEED * 60 local dT1 = CalcMoveTime( abs( dL1), EMT.FMAXPINZE, EMT.SPLIT)
if dT1 > dTime then dTime = dT1 end if dT1 > dTime then dTime = dT1 end
local dT2 = abs( dL2) / RAPID_Y_FEED * 60 local dT2 = abs( dL2) / ( RAPID_X_FEED / 60) -- CalcMoveTime( abs( dL2), RAPID_X_FEED, EMT.SPLIT)
if dT2 > dTime then dTime = dT2 end if dT2 > dTime then dTime = dT2 end
local dT3 = abs( dL3) / RAPID_Z_FEED * 60 local dT3 = abs( dL3) / ( RAPID_Z_FEED * 60) -- CalcMoveTime( abs( dL3), RAPID_Z_FEED, EMT.SPLIT)
if dT3 > dTime then dTime = dT3 end if dT3 > dTime then dTime = dT3 end
local dT4 = abs( dR1) / RAPID_C_FEED * 60 local dT4 = abs( dR1) / ( RAPID_C_FEED / 60)
if dT4 > dTime then dTime = dT4 end if dT4 > dTime then dTime = dT4 end
local dT5 = abs( dR2) / RAPID_B_FEED * 60 local dT5 = abs( dR2) / ( RAPID_B_FEED / 60)
if dT5 > dTime then dTime = dT5 end if dT5 > dTime then dTime = dT5 end
EMT.MCHEXTTIME = EMT.MCHEXTTIME + dTime EMT.MCHEXTTIME = EMT.MCHEXTTIME + dTime
EgtOutLog( string.format( ' G0 Len=%.0f Rot=%.0f° Time=%.2f', dLen, abs( dR1) + abs( dR2), dTime), 5) EgtOutLog( string.format( ' G0 Len=%.0f Rot=%.0f° Time=%.2f', dLen, abs( dR1) + abs( dR2), dTime), 5)
@@ -1426,7 +1756,7 @@ function OnEstimLinear()
local dLen = sqrt( dL1 * dL1 + dL2 * dL2 + dL3 * dL3) local dLen = sqrt( dL1 * dL1 + dL2 * dL2 + dL3 * dL3)
EMT.MCHCUTLEN = EMT.MCHCUTLEN + dLen EMT.MCHCUTLEN = EMT.MCHCUTLEN + dLen
-- calcolo tempo -- calcolo tempo
local dTime = dLen / EMT.F * 60 local dTime = dLen / ( EMT.F / 60) -- CalcMoveTime( dLen, EMT.F, EMT.SPLIT)
EMT.MCHCUTTIME = EMT.MCHCUTTIME + dTime EMT.MCHCUTTIME = EMT.MCHCUTTIME + dTime
EgtOutLog( string.format( ' G1 Len=%.0f Time=%.2f', dLen, dTime), 5) EgtOutLog( string.format( ' G1 Len=%.0f Time=%.2f', dLen, dTime), 5)
-- aggiorno valori come precedenti -- aggiorno valori come precedenti
@@ -1524,6 +1854,12 @@ function IsStartOrRestPhase( nPhase)
return ( sVal == 'START' or sVal == 'REST') return ( sVal == 'START' or sVal == 'REST')
end end
---------------------------------------------------------------------
function IsEndPhase( nPhase)
local sVal = GetPhaseType( nPhase)
return ( sVal == 'END')
end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function IsMidPhase( nPhase) function IsMidPhase( nPhase)
local sVal = GetPhaseType( nPhase) local sVal = GetPhaseType( nPhase)
@@ -1557,6 +1893,88 @@ function GetPhaseRot( nPhase)
return ( EgtGetInfo( EgtGetPhaseDisposition( nPhase) or GDB_ID.NULL, 'ROT', 'i') or 0) return ( EgtGetInfo( EgtGetPhaseDisposition( nPhase) or GDB_ID.NULL, 'ROT', 'i') or 0)
end end
---------------------------------------------------------------------
function GetParkT()
local dTmp = EgtGetInfo( EMT.DISPID, 'TPOS', 'd') or EgtGetInfo( EMT.DISPID, 'TPARK', 'd')
if dTmp then
return dTmp
else
return LoadT
end
end
---------------------------------------------------------------------
function GetCurrChainSawingVirtualAxis()
-- recupero il valore dell'asse virtuale bloccato A
local sVal = EgtGetMachiningParam( MCH_MP.BLOCKEDAXIS) or 'A=0'
local dPosA = tonumber( sVal:sub( 3)) or 0
return dPosA
end
---------------------------------------------------------------------
function CalcDinamicaPinze_TPA( dH, dS, dL)
local MinTempoAcc = EMT.MINACC -- [ms] ~300
local MaxTempoAcc = EMT.MAXACC -- [ms] ~4000
local KgMtCubo= WoodDensity or 550 -- densità legno [Kg / metro cubo]
local Massa = ( dH * dS * dL * KgMtCubo ) / 1e9 -- massa [Kg]
local FMaxPinze = EMT.FMAXPINZE -- Feed massima pinze [mm/min]
local ForzaAttrito = 350 * 9.8 * 0.2 -- Forza chiusura pinze [Kgf] * g * Coeff_Attrito -> [N]
local TempoAcc = EgtClamp( ( Massa * FMaxPinze) / ( 60 * ForzaAttrito), MinTempoAcc, MaxTempoAcc)
local RidFeed = 100 / Massa * 100
if RidFeed > 100 then
RidFeed = 100
elseif RidFeed < 10 then
RidFeed = 10
end
return TempoAcc, MinTempoAcc, RidFeed
end
---------------------------------------------------------------------
function CalcDinamicaPinze_NUM( dH, dS, dL)
local KgMtCubo= WoodDensity or 550 -- densità legno [Kg / metro cubo]
local Massa = ( dH * dS * dL * KgMtCubo ) / 1e9 -- massa [Kg]
local FMaxPinze = EMT.FMAXPINZE -- Feed massima pinze [mm/min]
local ForzaAttrito = 350 * 9.8 * 0.2 -- Forza chiusura pinze [Kgf] * g * Coeff_Attrito -> [N]
local TempoAcc = ( ( Massa * FMaxPinze) / ( 60 * ForzaAttrito) / 1000)
local AccMaxPinze = EMT.MAXACC
local AccPinze = EgtClamp( FMaxPinze / ( 60 * TempoAcc), EMT.MINACC, EMT.MAXACC)
local RidFeed = 100 / Massa * 100
if RidFeed > 100 then
RidFeed = 100
elseif RidFeed < 10 then
RidFeed = 10
end
return AccPinze, AccMaxPinze, RidFeed, TempoAcc
end
---------------------------------------------------------------------
function CalcMoveTime( dPathLen, dFeed, bIsSplitted)
local dTime
local dFeedInSec = dFeed / 60
if NumericalControl == 'TPA' then
local dTempoAcc, _, _ = CalcDinamicaPinze_TPA( EMT.HT, EMT.ST, EgtIf( bIsSplitted, EMT.LT, EMT.LB))
dTempoAcc = dTempoAcc / 1000
-- se si raggiunge la velocità massima
if dPathLen >= dFeedInSec * dTempoAcc then
dTime = dTempoAcc * 2 + ( ( dPathLen - dFeedInSec * dTempoAcc) / dFeedInSec)
else
dTime = 2 * sqrt( (dPathLen * dTempoAcc) / dFeedInSec)
end
else
local dAcc, _, _, _ = CalcDinamicaPinze_NUM( EMT.HT, EMT.ST, EgtIf( bIsSplitted, EMT.LT, EMT.LB))
-- Caso 1: dFeed raggiunta
if dPathLen >= ( dFeedInSec ^ 2) / dAcc then
dTime = ( dFeedInSec / dAcc) + ( dPathLen / dFeedInSec)
-- Caso 2: dFeed non raggiunta
else
dTime = 2 * sqrt( dPathLen / dAcc)
end
end
return dTime
end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- *** END GENERAL *** -- *** END GENERAL ***
--------------------------------------------------------------------- ---------------------------------------------------------------------
File diff suppressed because it is too large Load Diff
+177
View File
@@ -1,5 +1,182 @@
==== Common_FAST Update Log ==== ==== Common_FAST Update Log ====
Versione 3.1d2 (22/04/2026)
- (GEN) Corretta generazione del PreparePostRotation (in tutti i CN) ora salva lo stato della pinza per lo spostamento successivo. Ticket#2933
- (SIM-GEN) Corretto pinzaggio in caso di passo del pellegrino con recupero completo di una sola pinza
Versione 3.1d1 (14/04/2026)
- (SIM-GEN) Aggiorna lo step totale del PilgrimStep e lo step Y con il valore di MyMinY, di modo che tenga conto del AGG_LOAD quando c'è. Ticket#2919
- (GEN) Per NUM, si lascia aperta la pinza di carico in caso di END2. TPA era già corretto. Ticket#2869
Versione 3.1c2 (30/03/2026)
- (SIM-GEN) Corretti moviemnti con motosega. Ora si ruota la C con B sempre a zero, anche alla posizione X di sicurezza. Ticket#2866
Versione 3.1c1 (27/03/2026)
- (SIM-GEN) FASTCLAMPING = true : si suddivide il movimento metà tirando e metà spingendo con altra pinza. Così si aumenta la velocità.
- FASTCLAMPING = false : una pinza resta ferma e si fa il movimento tutto con una pinza. Così si limita lo scivolamento del pezzo.
- (GEN) In caso di motosega prelevata, si ruota in home. Ticket#2866
Versione 3.1a2 (26/01/2026)
- (GEN) Nella G101 il parametro EE era sempre a 4 perchè la variabile veniva settata dopo. Ticket#2796
Versione 3.1a1 (08/01/2026)
- (SIM) Ottimizzata scrittura funzione ClampCheck post aggiornamento dll
- (SIM) Corretto problema della funzione OnSimulDispositionStart in caso di fase finale.
- (MLDE-SIM-GEN) Variabile DeltaTol deve essere spostata in MLDE
Versione 2.7l3 (22/12/2025)
- (SIM) Eliminata MinJoin, utilizzata al suo posto funzione già esistente UpdateMinJoin nell'mlde
- (SIM) Modificata formula calcolo Area minima
Versione 2.7l2 (18/12/2025)
- (SIM) Aggiunta funzione CheckClamping
Versione 2.7l1 (10/12/2025)
- (SIM) Aggiornata risoluzione VMillTol in funzione dello spessore lama
- (EST) Modifiche a calcolo stima tempi, da verificare.
- (SIM) Corretto movimento in simulazione che non rispettava movimento generato.
- (GEN) Con controllo NUM/NUM_PLUS nella scrittura della coordinata tolto il simbolo '='
- (SIM) Aggiunto controllo C in base a carico Dx o Sx durante il cambio utensile
Versione 2.7k1 (10/11/2025)
- (GEN) Corretto set variabili info utensile prima del movimento in home in caso di pezzi alti per NUM/NUM_PLUS.
Versione 2.7j2 (08/10/2025)
- (SIM-GEN) Quando si scarica motosega, si raddrizza prima l'asse B e poi si muove il C. Ora sempre e non solo se pezzo alto.
Versione 2.7j1 (06/10/2025)
- (SIM-GEN) Quando si scarica motosega, si raddrizza prima l'asse B e poi si muove il C.
- (MLDE-SIM) Controllo collisione tra utensile e TOP testa C. Serve CAM5 2.7j1
Versione 2.7i3 (23/09/2025)
- (MLDE-ALL) Spostate costanti dimensioni utensili in MLDE.
Versione 2.7i2 (17/09/2025)
- (EST) Stima tempi considerando accelerazioni
- (SIM) Prelievo e deposito motosega con gli angoli comunicati da Essetre
Versione 2.7i1 (08/09/2025)
- (SIM-GEN) Se lavorazione precedente e successiva con motosega e si cambiano assi rotanti, vado in parcheggio per ruotare. Ticket#1844
- (SIM-GEN) Per NEWCLAMPING, corretto un caso di riposizionemento allo scarico dove la pinza V poteva andare in posizione direttamente, ma cercava di fare passo pellegrino. Ticket#2572
Versione 2.7g1 (01/07/2025)
- (GEN) Aggiunti parametri FMAXPINZE, MAXACC, MINACC configurabili da TS3. Ticket#2052
Versione 2.7f3 (26/06/2025)
- (SIM-GEN) Aggiunti 10mm di sicurezza in caso di primo pinzaggio per stare oltre tolleranza riqualifica laser di 50mm. Ticket#2504
Versione 2.7f2 (19/06/2025)
- (GEN) Se in separazione il pezzo è andato più lontano della posizione standard, viene riletta. Ticket#2498
Versione 2.7f1 (18/06/2025)
- (SIM-GEN) Se utensile più lungo di 350mm, si va in posizione sicurezza come per la motosega. Ticket#2438
Versione 2.7e1 (26/05/2025)
- (SIM) Aumentata dimensione massima per la quale si rimuove uno scarto dal VMILL. Ticket#1438
- (SIM) In simulazione, corretto selezione utensile per punte lunghe. Ticket#2438
Versione 2.7d1 (14/04/2025)
- (GEN) Corretto movimento iniziale in caso di motosega, si controlla solo se non è il carico. Ticket#2385
Versione 2.7c1 (26/03/2025)
- (GEN) All'inizio del codice ISO si scrive nel commento anche il controllo numerico utilizzato per la generazione.
- (GEN) Aggiunta commenti HEADER e FOOTER per comunicazione con linea o altre macchine, da parte di Essetre.
- (GEN) In MyAdjustLinearAxes si utilizza TDIR per calcolarsi gli offset per compatibilità con lavorazioni a 5 assi.
Versione 2.7b1 (20/02/2025)
- (SIM-GEN) Aggiunta possibilità di settare HCING/TCING nelle note di ogni singola lavorazione per gestire parte non pinzabile del pezzo. Funziona solo con nuovo pinzaggio.
- (SIM-GEN) Piccola correzione calcolo posizione carrelli con nuova strategia di pinzaggio.
- (SIM-GEN) Caricamento libreria EmtGenMachining. Si fa una require con PCALL perchè la libreria è opzionale e non è detto che ci sia. In installazione CAM5 dalla 2.7a1
- (GEN) Per controllo TPA, modifica al numero di decimali.
- (SIM) Aggiunta gestione per ToolHolder flottante
Versione 2.7a3 (08/01/2025)
- (GEN) Dopo separazione, in NUM_PLUS, si srive EH1 solo se macro G101, perchè altrimenti non è prevista. Ticket#2239
Versione 2.7a2 (08/01/2025)
- (MLDE-SIM) Aggiunta gestione FACOLTATIVA 'EstimationRapidMultiplier' in MLDE per regolare il tempo stimato. Se non presente in MLDE, default 1.
- (SIM) Aggiunta gestione qualità VMILL da impostazioni macchina
Versione 2.7a1 (07/01/2025)
- (MLDE-SIM-GEN) Nuovo aggregato 90° (H7) per fresa tipo BlockHaus. Ticket#2142
- (SIM-GEN) Aumentati limiti massimi di pinzaggio minimo
Versione 2.6l1 (02/12/2024)
- (SIM) Corretto movimento VMILL durante scarico pezzo piccolo a caduta
- (SIM-GEN) Per decidere posizione parcheggio barra dopo separazione, si considera lunghezza coda del pezzo in lavoro per evitare collisioni. Ticket#2168
Versione 2.6k1 (11/11/2024)
- (GEN) Aggiunta gestione aggregato a T per NUM
- (SIM) Tolta gestione testa dummy H4
- (SIM-GEN) Aggiustato parametro in calcolo ingombro lavorazione. Ticket#2163
Versione 2.6j10 (25/10/2024)
- (SIM-GEN) Miglioria 2.6j9. Si ribadisce pinza in presa sempre, all'inizio, in base a quella attiva
Versione 2.6j9 (22/10/2024)
- (SIM-GEN) Miglioria 2.6j6. Oltre al passo pellegrino si ribadisce anche quando è scambio diretto
Versione 2.6j8 (21/10/2024)
- (SIM-GEN) Corretto problema tolleranza aggiunto con versione 2.6j7
Versione 2.6j7 (18/10/2024)
- (SIM-GEN) In nuova disposizione carrelli, aggiunta tolleranza di 100 EPS quando si calcola minimo posizionamento
Versione 2.6j6 (17/10/2024)
- (GEN) Si ribadisce che la pinza era in presa, prima di cominciare con lo scambio del passo del pellegrino. Ticket#2121
Versione 2.6j5 (17/10/2024)
- (SIM-GEN) Piccola correzione nuovo riposizionamento. Nel taglio dello scarto finale riposizionava nel vuoto. Ticket#2115
Versione 2.6j4 (15/10/2024)
- (SIM-GEN) Piccola correzione nuovo riposizionamento. Non considerava i 50mm di tolleranza su primo pinzaggio dopo ribaltamento
- (SIM-GEN) Gestione attivazione pressore verticale in nuovo riposizionamento
Versione 2.6j3 (11/10/2024)
- (GEN) Corretta scrittura macro start/attesa movimenti per NUM. Veniva scritto codice per TPA.
Versione 2.6j2 (03/10/2024)
- (SIM-GEN) Piccola correzione calcolo posizione carrello durante riposizionamento, nuova gestione
Versione 2.6j1 (01/10/2024)
- (SIM-GEN) Sistemato calcolo in nuova disposzione carrelli
Versione 2.6i6 (25/09/2024)
- (GEN) Migliorata gestione movimenti per portare testa vicino a cambio utensile se trave alta. Ticket#2066
Versione 2.6i5 (24/09/2024)
- (SIM-GEN) Tolto controllo su lunghezza maggiore di 200mm introdotto con 2.6i2 perchè non completamente funzionante
- (GEN) Gestione in OnRapid() di EMT.FLAG=5 (rotazione a Z max per lavorazione successiva). Ora allineata alla simulazione
Versione 2.6i4 (24/09/2024)
- (SIM-GEN) Aggiunto ripinzaggio extra in caso servisse un grande spostamento e si sta pinzando poco.
L'aggiunta del ripinzaggio dipende da FASTCLAMPING (che deve essere disattiva). Viene aggiunta GAIN_RECLAMPING per decidere il guadagno in mm del ripinzaggio.
Versione 2.6i3 (23/09/2024)
- (SIM-GEN) Aggiunta nuova strategia riposizionamento morse
- (SIM-GEN) Aggiunta lettura flag NEWCLAMPING in BeamData, per abilitare nuova strategia riposizionamento. Se false o nil, funziona con metodo vecchio.
- (SIM-GEN) Aggiunta lettura flag FASTCLAMPING. Se false, al carico prende al massimo 1000mm, per evitare collisioni durante ciclo di lettura laser e prima lavorazione.
Versione 2.6i2 (16/09/2024)
- (SIM-GEN) Se utensili più lunghi di 200mm, si ruota in home e poi si approccia il pezzo. Ticket#2038
- (SIM-GEN) Aumentata distanza ingombro da 650mm a 660mm. In casi di utensile abbastanza lungo poteva andare in colisione. Ticket#2041
Versione 2.6i1 (02/09/2024)
- (MLDE-SIM-GEN) Rinominato file da "Common-" a "Common_" per uniformità con i file common delle altre macchine. Serve modifica a MLDE macchina.
Versione 2.6g1 (03/07/2024)
- (GEN) Corretto chiamata macro precarico in caso di taglio finale, ma con ribaltamento successivo. Ora si chiama solo se la fase successiva è una "END". Ticket#1881
- (GEN) Per controllo NUM, se arco maggiore di 99999mm, si approssima con una retta. Ticket#1888
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) 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-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 - (SIM) Nel file di log dove c'è stampa gruppi di collisione, viene scritto anche ID del gruppo
+2 -2
View File
@@ -2,8 +2,8 @@
-- Gestione della versione dei file comuni post-processori macchine FAST e FASTrl di Essetre -- Gestione della versione dei file comuni post-processori macchine FAST e FASTrl di Essetre
local InfoCommon_STD_PP = { local InfoCommon_STD_PP = {
NAME = 'Common-FAST', -- nome script PP standard NAME = 'Common_FAST', -- nome script PP standard
VERSION = '2.6d2', -- versione script VERSION = '3.1d2', -- versione script
MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel
} }