# function of PIDControl #pragma config() directive in robotC

I am trying to sync motors on a VEX Cortex based robot and have had mixed success using the encoders with position control. I noticed that the motor setup directive

#pragma config(Motor, port2, motorA, tmotorVex393, PIDControl, encoder, encoderPort, I2C_1, 1000)


has a parameter "PIDControl" but I cannot find any documentation as to what it actually does.

I see on the encoder documentation page here that the encoder provides velocity output, but it is not apparently built into the API. So my question is two fold:

1) What does the "PIDControl" directive actually do?

2) How can I use the encoder to control the speed of the motors?

• Try plugging your code line into a well known search engine. I think this is some sort of flag. You need to look at the documentation of the compiler/system/robot (robotC?), not the encoder... robotc.net/forums/viewtopic.php?f=52&t=5916 Mar 13 '14 at 6:17
• I have searched extensively... most of what I find is for NXT. As for the documentation, it does not expose lower-level functions of the language. It is pretty high level. Mar 14 '14 at 1:32

2. You do not use encoders to control speed. You use encoders to control distance. Now, having said that, if you want to get higher performance of motor control, such as eliminate overshooting, you will need to use the encoder to tell the maximum distance (equivalent to the encoder value, you need simple gear math work here, of course). Use the setMotorTarget(...).