PID Feedback Control

Use settings defined in hardware to perform feedback on a monitored quantity.
  1. This plug-in relies on simple-pid (v2+) library, install it (don’t forget conda activate scopefoundry if necessary.)

    pip install simple-pid
    
  2. Add PIDFeedbackControl to your app.

        # fancy_app.py
        from ScopeFoundry import BaseMicroscopeApp
    
    
        class FancyApp(BaseMicroscopeApp):
    
            name = "fancy_app"
    
            def setup(self):
    
                from ScopeFoundry.controlling import PIDFeedbackControl
                self.add_measurement(PIDFeedbackControl)
    
  3. Refer to the following figure to define the control.
    pid_feedback_control

    a) The system used in this example: a laser beam from the OPO is controlled by a motorized ND filter wheel (“Plant”). The power of the laser beam is monitored at a pickoff location using a power meter (“Sensor”). (Ignore the rest of figure a).)

    b) Control loop diagram. Note it is a standard feedback with a PID controller - however, the inputs that the plant receives are constraint with min/max for safety.

    c) The GUI of PIDFeedbackControl: Defining

    • The setpoint.
    • plant_input (position of the motor of the ND filter wheel, side_beam_power_wheel).
    • sensor is the power readout of a power meter (thorlabs_powermeter as a sensor) by moving an ND density filter wheel (as the plant).
    • The PID controller with the usual 3 parameters.
    • Note that the input to the plant can be constrained by (min_plant_input, max_plant_input).
    • Lastly, you can define when the measurement terminates.