*** Wartungsfenster jeden ersten Mittwoch vormittag im Monat ***

Skip to content
Snippets Groups Projects

PID improvements for ADwin

Merged Schabbauer, Johannes requested to merge PID_improvement into main
3 files
+ 135
50
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -29,7 +29,7 @@ class ADwinProIIWorker(Worker):
def init(self):
self.timing = None
self.h5file = None
self.smart_cache = {"AOUT":None, "PIDs":None, "AIN":None}
self.smart_cache = {"AOUT":None, "PIDs":None, "PID_CONFIG":None, "AIN":None}
self.smart_cache.update({DIO:None for DIO in self.DIO_ADwin_DataNo})
self.process_number_buffered = int(self.process_buffered[-1])
self.process_number_manual = int(self.process_manual[-1])
@@ -164,11 +164,19 @@ class ADwinProIIWorker(Worker):
self.adw.SetData_Long(PIDs["n_cycles"], 4, 1, PIDs.shape[0])
self.adw.SetData_Long(PIDs["AOUT_channel"], 5, 1, PIDs.shape[0])
self.adw.SetData_Long(PIDs["PID_channel"], 6, 1, PIDs.shape[0])
self.adw.SetData_Float(PIDs["PID_P"], 25, 1, PIDs.shape[0])
self.adw.SetData_Float(PIDs["PID_I"], 26, 1, PIDs.shape[0])
self.adw.SetData_Float(PIDs["PID_D"], 27, 1, PIDs.shape[0])
self.adw.SetData_Long(PIDs["PID_min"], 28, 1, PIDs.shape[0])
self.adw.SetData_Long(PIDs["PID_max"], 29, 1, PIDs.shape[0])
self.adw.SetData_Long(PIDs["PID_start"], 30, 1, PIDs.shape[0])
PID_config = group["ANALOG_OUT/PID_CONFIG"]
if fresh or not np.array_equal(PID_config[:],self.smart_cache["PID_CONFIG"]):
print("PID_CONFIG programmed.")
self.smart_cache["PID_CONFIG"] = PID_config[:]
n_PID = PID_config.shape[0]
self.adw.Set_Par(22,n_PID)
self.adw.SetData_Long(PID_config["PID_channel"], 24, 1, n_PID)
self.adw.SetData_Float(PID_config["PID_P"], 25, 1, n_PID)
self.adw.SetData_Float(PID_config["PID_I"], 26, 1, n_PID)
self.adw.SetData_Float(PID_config["PID_D"], 27, 1, n_PID)
self.adw.SetData_Long(PID_config["PID_min"], 28, 1, n_PID)
self.adw.SetData_Long(PID_config["PID_max"], 29, 1, n_PID)
AIN = group["ANALOG_IN/TIMES"]
if fresh or not np.array_equal(AIN[:],self.smart_cache["AIN"]):
print("AIN programmed.")
Loading