2019-11-20 12:50 AM
Hello, I am creating a Li-ion battery discharger. Only thing left is temperature control loop right now and I want to use PID for that purpose. I want to keep the temperature inside the device at max 95 Celsius. I am using PWM to set the discharging current. Which is 4500 for 2 Ampere ( maximum rate) and 9999 is the minimum discharging rate which is 0 ampere. So I will be discharging the battery at 2 ampere till temperature ( if it will ) reaches the 95 Celsius then I want to increase PWM values according to PID which will decrease the discharging current. However I cannot figure out how PID will be used for this purpose. I though following a way like this :
if(temperature<90){}
else{
PID Loop
.
.
.}
Will this approach break the PID loop? If yes then what kind of path I should follow. I am worried about integral part. It will keep increasing when the temperature is less than 95. But since the discharge current is constant 2 amp for this case, temperature will not rise and integral part will be increasing and increasing. And in case of any heat rise, piled up integration will break up the PID term in this case. I am looking forward for all the suggestions. Thanks beforehand.
2019-11-20 01:49 AM
> if(temperature<90){}
> else{
> PID Loop ...
> Will this approach break the PID loop?
I suppose, in some way. It would create large jumps in the set value when the control kicks in.
In general, a PID (or linear) controller would regulate for a certain set point.
Which means, you would operate the device at or near that set point most of the time.
> I am worried about integral part. It will keep increasing when the temperature is less than 95. But since the discharge current is constant 2 amp for this case, temperature will not rise and integral part will be increasing and increasing. And in case of any heat rise, piled up integration will break up the PID term in this case.
If 95°C is your maximal limit, it should effect a discharge current of zero, else you would overheat.
I would suggest a lower set point (perhaps 65°C).
There are implementations of PID algorithms with output value limitation available.