What is PID?

There are a few issues I can see at first glance

Your PID function is a “while True” loop, which means once you start the function nothing else will happen. It’ll get stuck. However, your motor speeds also never get set, because you have a “return” statement before the motor power is set. Return breaks out of the function, immediately killing the PID.

You can either make a PID task, or you can have a function that is “polled” during each run of your driver control loop.

There is a lot of help about making tasks, just google “RobotC multitasking”

Your driver control code isn’t in any loop, so it only runs once–make a competition template file and put it within the usercontrol task.

This may not be all your problems but it should give you a good start