pid.c: converted PID controller to ticks