gl_fan is hard coded to check the temp and set the fan speed only every 20 seconds. For a PID control loop to be effective it needs to read it’s input and adjust it’s output much more frequently. An RC drone for example will sample 1000x a second to be able to stay in flight.
If you want to understand the I and D values read this