From 6346a91c19a8ad27aa2435817feb64d069c6703d Mon Sep 17 00:00:00 2001 From: germano Date: Mon, 24 Jul 2023 22:46:19 +0200 Subject: [PATCH] PID params tbt --- config/machine_settings/defaults.ini | 6 ++++++ src/components/tecna_marposs_provaset_t3.py | 9 +++++++-- src/components/tecna_marposs_provaset_t3l_registers.py | 5 ++--- src/components/tecna_marposs_provaset_t3p_registers.py | 3 ++- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/config/machine_settings/defaults.ini b/config/machine_settings/defaults.ini index 7b9f780..cefd354 100644 --- a/config/machine_settings/defaults.ini +++ b/config/machine_settings/defaults.ini @@ -121,6 +121,12 @@ tolleranza_resistenza_pos: 10 tolleranza_resistenza_neg: 5 prova_tenuta_abilitata: x warning_img: + +#TECNA RECIPE PARAMETERS +pid_mode: 0 # 0=FAST 1=MEDIUM 2=SLOW 4 = FIXED 5 = AUTOMATIC 6 = FLOW 7 = LEAK WITH FLOW +pid_level: 1 +pid_speed: 1 + tempo_pre_riempimento: 0 pressione_pre_riempimento: 1000 tempo_riempimento: 10 diff --git a/src/components/tecna_marposs_provaset_t3.py b/src/components/tecna_marposs_provaset_t3.py index 748c23a..ed0eda5 100644 --- a/src/components/tecna_marposs_provaset_t3.py +++ b/src/components/tecna_marposs_provaset_t3.py @@ -271,6 +271,10 @@ class TecnaMarpossProvasetT3(ModbusComponent): recipe_name += b"\x00" * (16 - len(recipe_name)) recipe_barcode = f"j{recipe.part_number}"[:16].encode("ascii") recipe_barcode += b"\x00" * (24 - len(recipe_barcode)) + test_flags = 0b0110100001010100 if (step.spec.get("autotest", False) in ["ko_check"]) else 0b0110000001010100 + pid_mode = int(step.spec["pid_mode"])<<4 + test_flags = test_flags | pid_mode + pid_ramps=0b0000000000000000 | int(step.spec.get("pid_level",1))<<8 | int(step.spec.get("pid_speed",1))<<12 spec = { "Flag: Instrument settings": 0b0000000000000000, "Test program for read/write operation": table, @@ -280,8 +284,7 @@ class TecnaMarpossProvasetT3(ModbusComponent): # **{769 - 1 + i: (recipe_name[i * 2 + 1] << 8) + recipe_name[i * 2] for i in range(8)}, # print field 2 "Print options": 0b0000000000000000 | self.saver_label_count << 12 | self.saver_print_on_fail << 8 | self.saver_label_template, "Test type": "Leak Test", - # "Test flags": 0b0110000001011100 if step.spec.get("autotest", False) is not True else 0b0110000001010100, - "Test flags": 0b0110100001010100 if (step.spec.get("autotest", False) in ["ko_check"]) else 0b0110000001010100, + "Test flags": test_flags, "T0 - Pre-filling time": step.spec["pre_filling_time"], "P0 - Pre-filling pressure": step.spec["pre_filling_pressure"], "T1 - Filling time": step.spec["filling_time"], @@ -295,6 +298,8 @@ class TecnaMarpossProvasetT3(ModbusComponent): "FST - Discharge time": step.spec["flush_time"], "FSL - Discharge limit": step.spec["flush_pressure"], "PSQ - Next sequence program PSOUT mode": 0, + "RAMPS: T1 configuration": pid_ramps, + "PID: pressure correction": 100 } if self.model == "t3p": diff --git a/src/components/tecna_marposs_provaset_t3l_registers.py b/src/components/tecna_marposs_provaset_t3l_registers.py index 77c0edf..f52b469 100644 --- a/src/components/tecna_marposs_provaset_t3l_registers.py +++ b/src/components/tecna_marposs_provaset_t3l_registers.py @@ -275,9 +275,7 @@ registers = { # T1/Pr: Filling mode 0=TIME 1=PRESSURE (*) # T1/Pr (T3LPQ) = 0 - 250 (seconds) # T3/Q: Fail mode 0=TIME 1=PRESSURE (*) - # PID MODE: 0=FAST 1=MEDIUM 2=SLOW 4 = FIXED 5 = AUTOMATIC 6 = FLOW 7 = LEAK WITH - # ----- - # FLOW + # PID MODE: 0=FAST 1=MEDIUM 2=SLOW 4 = FIXED 5 = AUTOMATIC 6 = FLOW 7 = LEAK WITH FLOW # P0-: 0= P0 pre-filling pressure is positive 1=P0 pre-filling pressure is negative (vacuum) # Pr-: 0= Pr filling pressure is positive 1=Pr filling pressure is negative (vacuum) # B: = beep (not used) @@ -338,4 +336,5 @@ registers = { # | 15 14 13 12 11 10 9 8 | 7 6 5 4 3 2 1 0 | # | Step % T1 | T1 Steps | "PSQ - Next sequence program PSOUT mode": [754 - 1, {"dt": "16bit_uint", }], + "RAMPS: T1 configuration": [755-1, {"dt": "16bit_uint", }] } diff --git a/src/components/tecna_marposs_provaset_t3p_registers.py b/src/components/tecna_marposs_provaset_t3p_registers.py index 750e8bb..f84dd2c 100644 --- a/src/components/tecna_marposs_provaset_t3p_registers.py +++ b/src/components/tecna_marposs_provaset_t3p_registers.py @@ -274,7 +274,7 @@ registers = { "PB - Minimum burst pressure": [743 - 1, {"dt": "16bit_uint", "f": 23, }], "BD - Burst gap / PD - Delta Aperture": [744 - 1, {"dt": "16bit_uint", "f": 23, }], "FSL - Discharge limit": [745 - 1, {"dt": "16bit_uint", "f": 23, }], - "RP% - Pressure ratio": [746 - 1, {"dt": "16bit_uint", "g": 100, }], + "PID: pressure correction": [746 - 1, {"dt": "16bit_uint", "g": 100, }], # Format; x.xx % "PR+ - Max pressure tolerance % (P+)": [747 - 1, {"dt": "16bit_uint", "g": 10, }], # Format: x.x % @@ -298,6 +298,7 @@ registers = { # | PSQ | | PSOUT | # PSOUT MODE: 0 = While test run 1 = After start delay 2 = Always 3 = Only during start delay + # 1001-1060 Table of the last test performed X The order of the parameters is always the same, as indicated for register from 701 to 759. # 10001-10060 Direct access to test program table number 1 X X The order of the parameters is always the same, as indicated for register from 701 to 759. # 10101-10160 Direct access to test program table number 2 X X The order of the parameters is always the same, as indicated for register from 701 to 759.