added a mapping function to map PID control