From ed55861cbe56b0c1914f48a349dc6882d82662b9 Mon Sep 17 00:00:00 2001
From: Gijs Schoonderbeek <schoonderbeek@astron.nl>
Date: Tue, 6 Dec 2022 18:54:03 +0100
Subject: [PATCH] Small changes after double check

---
 APSPU_I2C.py        |  2 +-
 apspu_lib.py        | 11 +++++++----
 production_apspu.py | 10 +++++-----
 3 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/APSPU_I2C.py b/APSPU_I2C.py
index 491dc58..55b0c95 100644
--- a/APSPU_I2C.py
+++ b/APSPU_I2C.py
@@ -20,7 +20,7 @@ VOUT_POLS = {"CTR_LBA" :  8.0,
 
 IOUT_POLS = {"CTR_LBA" :  0.45,
             "CTR_RCU2_A" : 0.7,
-            "CTR_RCU2_D" : 0.36}
+            "CTR_RCU2_D" : 0.3}
 
 LP_VIN             = 0x88 #
 LP_VOUT_MODE       = 0x20
diff --git a/apspu_lib.py b/apspu_lib.py
index b0f7311..809a31b 100644
--- a/apspu_lib.py
+++ b/apspu_lib.py
@@ -355,6 +355,7 @@ class PolClass:
         else:
             check_ok = False
             print(f"POL {self.name:10} Vout not OK, expected {expected_vout} V, measured {self.vout} V")
+            return check_ok
         vin_low = 45
         vin_high = 50
         if vin_low < self.vin < vin_high:
@@ -362,16 +363,18 @@ class PolClass:
         else:
             check_ok = False
             print(f"POL {self.name:10} Vin not OK, expected {vin_low} V - {vin_high} V, measured {self.vout} V ")
+            return check_ok
         temp_low = 20
         temp_high = 50
-        if (temp_low < self.temp < temp_high) & check_ok:
+        if temp_low < self.temp < temp_high:
             check_ok = True
         else:
             check_ok = False
             print(f"POL {self.name:10} TEMP not OK, expected {temp_low} C - {temp_high} C, measured {self.temp} C ")
-        i_low = 0.8*IOUT_POLS[self.name]
-        i_high = 1.2*IOUT_POLS[self.name]
-        if (i_low < self.iout < i_high) & check_ok:
+            return check_ok
+        i_low = 0.75*IOUT_POLS[self.name]
+        i_high = 1.25*IOUT_POLS[self.name]
+        if i_low < self.iout < i_high:
             check_ok = True
         else:
             check_ok = False
diff --git a/production_apspu.py b/production_apspu.py
index 5f312f4..99d8ad8 100644
--- a/production_apspu.py
+++ b/production_apspu.py
@@ -31,11 +31,11 @@ if len(sys.argv)<2:
     exit()
 
 apspu = ApspuClass()
-#apspu.apspu_on_off(False)
-#sleep(5)
-#apspu.set_pols()
-#apspu.apspu_on_off(True)
-#sleep(10)
+apspu.apspu_on_off(False)
+sleep(5)
+apspu.set_pols()
+apspu.apspu_on_off(True)
+sleep(10)
 apspu.read_all()
 apspu.print_status()
 if apspu.check_apspu():
-- 
GitLab