As part of our control system we have a mix of control hardware (e.g. shutters, custom AOM drivers) and this leads to some inconsistency in whether TTL high or low corresponds to light reaching the experiment.
As a simple fix to this we have modified the artiq source so TTLOut
and TTLInOut
now assign a new property invert_output=False
in the __init__
and updated the output function to
def set_o(self, o):
if self.invert_output:
rtio_output(self.target_o, 0 if o else 1)
else:
rtio_output(self.target_o, 1 if o else 0)
TTL channels can then be initialised and set to invert using self.ttl0.invert_output=True
and this allows us to operate such that e.g. self.ttl0.on()
and self.ttl0.off()
give the same behaviour for all shutters / AOM RF switches on the experiment. It would likely be easy to allow this to be hardcoded into the device_db if preferred.
Is this a feature other people would find useful, and if so should we submit a PR? Alternatively, have we over engineered this and a simple solution already exists within artiq without changing the source?