lneuhaus / pyrpl

pyrpl turns your RedPitaya into a powerful DSP device, especially suitable as a lockbox in quantum optics experiments.
http://lneuhaus.github.io/pyrpl/
MIT License
137 stars 105 forks source link

Using In1 - In2 as the input of a PID #472

Open KaifengC opened 2 years ago

KaifengC commented 2 years ago

Sometime people would like to lock the signal to a given set point (not the one entered from the GUI). For example, to stabilize the intensity of a laser, one could connect "In 1" to a detector for the laser intensity and "In 2" to another detector for the background light. In this case, using In1 - In2 as the input would be very useful.

Is there a way to implement this in the current version of PyRPL that I just missed?

tt-aqt commented 2 years ago

In the max_hold_no_iir branch there is something called differential mode which does what you need. Not sure exactly how it works but i vaguely recall in the code (pid.py?) there was a comment explaining that it takes the difference between the pid0 and pid1 inputs.