Following on from yesterday's alog #91730 today I turned off the JAC Heater controller and switched the gain back to -0.1 and the second pole at 1Hz off also.
I then updated the JAC heater guardian so it switches on and off the Beckhoff JAC Heater Controller and also adds in the normalised control signal from the length feedback to the JAC PZT as an error to the Heater control signal.
The code that does this is:
class HEATER_SERVO_OFF(GuardState):
index = 20
request = True
def run(self):
ezca['JAC-HEATER_CONTROL_LOOP_SWITCH'] = 'Off'
ezca['JAC-HEATER_CONTROL_VOLTSOFFSET'] = 0
if beckhoff_check():
return True
else:
notify('Heater off! Check Driver and Beckhoff controller.')
return False
class HEATER_SERVO_ON(GuardState):
index = 1
request = True
def main(self):
self.pzt_fb = ezca['JAC-PZT_DRIVER_VOLTS']
self.pzt_low = ezca['JAC-PZT_DRIVER_PZTHIGH']
self.pzt_high = ezca['JAC-PZT_DRIVER_PZTLOW']
self.servo_setpoint = ezca['JAC-HEATER_CONTROL_SETTEMP']
self.in_loop_sensor = ezca['JAC-HEATER_THERMISTOR_1_TEMPERATURE']
self.sensor = 1
def run(self):
if beckhoff_check():
notify(f'Servo on with set temperature: {self.servo_setpoint} deg.')
ezca['JAC-HEATER_CONTROL_LOOP_SWITCH'] = 'On'
if ISC_library.JAC_locked():
ezca['JAC-HEATER_CONTROL_VOLTSOFFSET'] = (self.pzt_fb/(self.pzt_high - self.pzt_low))
else:
ezca['JAC-HEATER_CONTROL_VOLTSOFFSET'] = 0
return True
else:
notify('Heater off! Check Driver and Beckhoff controller.')
return 'HEATER_SERVO_OFF'
edges = [
('HEATER_SERVO_ON', 'HEATER_SERVO_OFF'),
('HEATER_SERVO_OFF', 'HEATER_SERVO_ON'),
]
It is necessary to normalise the PZT fb signal by the total range of the PZT HV driver before adding the signal into the error point to normalise it.
The code should only include the offset from the PZT error point if the JAC is locked, this is because we don't want it adding random offset while the pzt is scanning.
However we do still want the JAC heater locked to its set temperature when the JAC is unlocked.
From the image you can see that the JAC-HEATER_CONTROL_VOLTSOFFSET is zero until we get past the scanning state (number 20) in the JAC locking sequence.
I will leave this servo on all weekend to test it with the new guardian control.