More generalized PID controller using template