The P.I.D needs a short time to taught by itssel.
Leave it a while the fan will run in auto mode.
At very beginning, you may meet big temperature swing.
The temperature will get stable step by step during "learning period".
Fine tuning P.I.D will shorten "learning period" and less temperature swing.
P.I.D. theory is a standard automatic control math, it is used in many application.
There are many papers about tuning P.I.D. in the Internet