VEX PID Control
(→Super User Menu Level) |
(→Super User Menu Level) |
||
| Line 126: | Line 126: | ||
|- | |- | ||
| style="text-align:left; border-style: solid; border-width: 0px 1px 1px 0px"|Derivative | | style="text-align:left; border-style: solid; border-width: 0px 1px 1px 0px"|Derivative | ||
| − | | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|Displays the Derivative (D) | + | | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|Displays the Derivative (D) from the in the specified motor's PID algorithm. This is read-only and cannot be changed via the debug window. |
|- | |- | ||
| style="text-align:left; border-style: solid; border-width: 0px 1px 1px 0px"|Integral | | style="text-align:left; border-style: solid; border-width: 0px 1px 1px 0px"|Integral | ||
| − | | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|Displays the Integral(I) | + | | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|Displays the Integral(I) output from the specified motor's PID algorithm. This is read-only and cannot be changed via the debug window. |
| style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"| | | style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"| | ||
|- | |- | ||
| − | | style="text-align:left; border-style: solid; border-width: 0px 1px 1px 0px"| | + | | style="text-align:left; border-style: solid; border-width: 0px 1px 1px 0px"|SynchErr |
| − | | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|Displays the | + | | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|Displays the difference of two synchronized motors' encoder counts. This is read-only and cannot be changed via the debug window. |
| style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"| | | style="text-align:right; border-style: solid; border-width: 0px 0px 1px 0px"| | ||
|- | |- | ||
| style="text-align:left; border-style: solid; border-width: 0px 1px 1px 0px"|'''Overloads''' | | style="text-align:left; border-style: solid; border-width: 0px 1px 1px 0px"|'''Overloads''' | ||
| − | | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|Displays the number of times the PID algorithm has overloaded (returned values outside of the usable range of -127 to +127). | + | | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|Displays the number of times the PID algorithm has overloaded (returned values outside of the usable range of -127 to +127). This is read-only and cannot be changed via the debug window. |
|- | |- | ||
| − | | style="text-align:left; border-style: solid; border-width: 0px 1px 1px 0px"| | + | | style="text-align:left; border-style: solid; border-width: 0px 1px 1px 0px"|Cycles |
| − | | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|Displays the number of times the PID algorithm has | + | | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|Displays the number of times the PID algorithm has ran (cycles) since the start of the program. The rate that this value increases scales linearly with the Period parameter. This is read-only and cannot be changed via the debug window. |
|- | |- | ||
| style="text-align:left; border-style: solid; border-width: 0px 1px 1px 0px"|Period | | style="text-align:left; border-style: solid; border-width: 0px 1px 1px 0px"|Period | ||
| Line 147: | Line 147: | ||
|- | |- | ||
| style="text-align:left; border-style: solid; border-width: 0px 1px 1px 0px"|kP (Speed) | | style="text-align:left; border-style: solid; border-width: 0px 1px 1px 0px"|kP (Speed) | ||
| − | | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"| | + | | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|Displays the Proportional (P) parameter used by the specified motor's PID algorithm for normal PID control. |
|- | |- | ||
| style="text-align:left; border-style: solid; border-width: 0px 1px 1px 0px"|kI (Speed) | | style="text-align:left; border-style: solid; border-width: 0px 1px 1px 0px"|kI (Speed) | ||
| − | | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|Displays the | + | | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|Displays the Integral(I) parameter used by the specified motor's PID algorithm for normal PID control. |
|- | |- | ||
| style="text-align:left; border-style: solid; border-width: 0px 1px 1px 0px"|kD (Speed) | | style="text-align:left; border-style: solid; border-width: 0px 1px 1px 0px"|kD (Speed) | ||
| − | | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|Displays | + | | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|Displays the Derivative (D) parameter used by the specified motor's PID algorithm for normal PID control. |
|- | |- | ||
| style="text-align:left; border-style: solid; border-width: 0px 1px 1px 0px"|kP (Pos) | | style="text-align:left; border-style: solid; border-width: 0px 1px 1px 0px"|kP (Pos) | ||
| − | | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|Displays the | + | | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|Displays the Derivative (D) parameter used by the specified motor's PID algorithm for normal PID control. |
|- | |- | ||
| style="text-align:left; border-style: solid; border-width: 0px 1px 1px 0px"|kI (Pos) | | style="text-align:left; border-style: solid; border-width: 0px 1px 1px 0px"|kI (Pos) | ||
| − | | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|Displays the | + | | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|Displays the Derivative (D) parameter used by the specified motor's PID algorithm for normal PID control. |
|- | |- | ||
| style="text-align:left; border-style: solid; border-width: 0px 1px 1px 0px"|kD (Pos) | | style="text-align:left; border-style: solid; border-width: 0px 1px 1px 0px"|kD (Pos) | ||
| − | | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|Displays the | + | | style="text-align:left; border-style: solid; border-width: 0px 0px 1px 0px"|Displays the Derivative (D) parameter used by the specified motor's PID algorithm for normal PID control. |
|- | |- | ||
|} | |} | ||
|} | |} | ||
Revision as of 15:00, 7 December 2012
| For ROBOTC VEX PID Control Functions, see: VEX PID Control Functions. |
|
| |||||||
Getting StartedBefore you can start using PID control for the VEX Cortex in ROBOTC, you must make sure you have all of the required components. There are two main components required to get started: a VEX 269 or 369 motor with an Integrated Motor Encoder (IME) installed, and a copy of ROBOTC for Cortex/PIC version 3.6.1 or higher. If you wish to control more than one motor using PID (on a robot, for example), you will need to make sure each motor that is PID controlled has an IME installed and is connected to the Cortex correctly. If you are unsure of how to configure the IME's inside of ROBOTC, please see our IME programming guide before continuing. |
Enabling PID (Simple)
Enabling basic PID control in ROBOTC is simple; navigate to the 'Robot -> Motors and Sensors Setup' window, find the motor you wish to enable PID control on, and check the 'PID Control'

This will enable basic PID control for the specified motors using ROBOTC's default parameters.
Enabling PID (Advanced)
Motors and Sensors Setup
Caution: Changing the default PID parameters may cause motor behavior which can potentially damage your robot with unexpected movements. As such, we advise that all PID testing be done in a safe area to help mitigate any possible damage.
1. The first thing you need to do before you can use the advanced features of PID control is change the menu level type to 'Super User'. This is done by navigating to the 'Window -> Menu Level' option in ROBOTC and changing the selected level to 'Super User'.
2. Once the Menu Level has been changed to 'Super User', open the Motors and Sensors setup window (under the Robot menu). You will notice that there is now an additional tab for 'PID Settings'; click on it to open the PID Settings window.
3. All of the motors configured with VEX IME's that have PID enabled will appear in the "PID Settings for Motors in This Single Program" box. Double-clicking on one of the listed motors will bring up a separate 'Edit PID Settings' window that can be used to manually tweak the PID settings for that particular motor.
4. There is also the option to change how ROBOTC handles PID for any particular motor setup, even if it is outside of that particular program. To view this menu option, click the 'More' button.
5. Let's assume you would like to change the PID settings for any VEX 269 motor (without a Motor Controller 29) programmed in ROBOTC. Double click on the appropriate motor and change the settings as needed in the 'Edit PID Settings' box that appears. Remember, any changes to these setting will overwrite ROBOTC's defaults and will be applied to any program using PID control!
6. To finalize the changes to PID control, click the 'Apply' button on the Motors and Sensors Setup window. To revert the individual or global PID settings, simply click the 'Reset to Standard Values' or 'Reset to Application Defaults' buttons, respectively.
Motors Debug Window
When a program is running with the menu level set to 'Expert' or 'Super User', the Motors Debug window will display the parameters in the 'Expert and Super User Menu Levels' table. When the menu level is set to 'Super User', the parameters in the 'Super User Menu Level' table also become available:
Expert and Super User Menu Levels
|
Super User Menu Level
|