Temperature compensation equation?
So you have a simple linear compensation equation.
The &quot;variation isn't constant&quot; doesn't really mean much, if it's constant it's not a variation. Maybe you mean that the correction does not work for variations that are not specific amounts.
In any case, it seems that dynamic changes are a problem, which indicates that whatever you are using as a temperature sensor is not really sensing the temperature closely enough to the part of the detector that needs correctly.
There is probably not a simple cheap solution to this. You can get a better sensor, which is probably the best solution.. other options..
Perhaps you ovenize the sensor so that the temperature does not vary significantly.
Or you could calibrate the sensor in an environmental chamber with many points and then create a polynomial fit equation that cancels out the errors-- but that won't help with dynamic effects.
We did have a compensation situation where dynamic effects were partially corrected by assuming a certain response curve, but in some cases it made the errors worse.