Preamble: I have a LED driven by an opamp-based constant current source (CCS). It works fine, I can set up current required and it is reasonably stable. The problem is, that LED forward voltage drops over first 5-10 minutes due to internal heating, optical output power drops with it. To compensate for this, I would like to use a photodiode (PD) as an optical feedback, which adjusts current through the LED to keep optical output stable (increase drive current as Vfwd drops).
Request: A circuit idea, which would allow to set initial output level as a function of CCS setpoint, which is measured by PD and then used for driving the CCS (in theory setpoint input shouldn't matter after initial setup). The sequence I envision could be:
1. power up 2. set current limit (turn the LED on) 3. photodiode gets connected in feedback (perhaps with a small delay) 4. photodiode feedback controls output power, initial setpoint can be ignored, since no changes in levels are planned
EDIT: Per Andy's request CCS circuit, borrowed from another question:
EDIT2: Essentially I'm looking for a way to override one analog signal with another.