I'm trying to implement a constant current solenoid driver (it's more of a constant wattage pwm driver, current changes with supply voltage which is fine) using UC3843 PWM driver. I'm using the automotive variant of UC3843, NCV3843 which claims to be operational upto +125'C. Here is my schematic,
Here I use error amplifier as an inverting amplifier with gain of -2.12 to keep Comp(pin 1) voltage at about 1.67V which determines the PWM duty cycle with respect to Current sense (pin 3) feedback voltage. This feedback voltage is filtered by a RC low pass filter (R2 and C7) having cutoff frequency of 159kHz. The PWM frequency is 50kHz which determined by R5 and C1.
The RMS current through solenoid remains constant (0.2A) with steady supply voltage of 12V. However when I change the ambient temperature of the circuit the duty cycle increases and current rises more than 0.45A at temperature of 90'C. Here is a temperature test I did,the behavior looks mostly linear.
Since comp pin (pin 1) voltage determines the cutoff point of pwm signal, I have observed if it changes with temperature. However it did not change by any significant amount (around 10mV) with temperature. Here are two oscilloscope readings of comp voltage (blue) and waveform of current sense pin(pin3, yellow).
Here are the wave forms before low pass filtering(Blue) and after low pass filter (yellow) of current sensing resistor.
What could be the reason for current variation with temperature? Are there any design flaws with my schematic?
Note that I have built this on a well designed PCB, Not on a prototyping breadboard.