PID Tuner
Setter Functions
pid_tuner_enable()
Enables PID Tuner.
- Prototype
- Example
void opcontrol() {
// This is preference to what you like to drive on
chassis.drive_brake_set(MOTOR_BRAKE_COAST);
// Enable PID Tuner
chassis.pid_tuner_enable();
while (true) {
// Trigger the selected autonomous routine
if (master.get_digital_new_press(DIGITAL_B))
autonomous();
chassis.pid_tuner_iterate(); // Allow PID Tuner to iterate
chassis.opcontrol_tank(); // Tank control
pros::delay(ez::util::DELAY_TIME); // This is used for timer calculations! Keep this ez::util::DELAY_TIME
}
}
void pid_tuner_enable();
pid_tuner_disable()
Disables PID Tuner.
- Prototype
- Example
void opcontrol() {
// This is preference to what you like to drive on
chassis.drive_brake_set(MOTOR_BRAKE_COAST);
// Enable PID Tuner
chassis.pid_tuner_enable();
while (true) {
// Trigger the selected autonomous routine
if (master.get_digital_new_press(DIGITAL_B))
autonomous();
// Disable PID Tuner
if (master.get_digital_new_press(DIGITAL_X))
chassis.pid_tuner_disable();
chassis.pid_tuner_iterate(); // Allow PID Tuner to iterate
chassis.opcontrol_tank(); // Tank control
pros::delay(ez::util::DELAY_TIME); // This is used for timer calculations! Keep this ez::util::DELAY_TIME
}
}
void pid_tuner_disable();
pid_tuner_toggle()
Toggles PID Tuner. If it's enabled, it will disable. If it's disabled, it will enable.
- Prototype
- Example
void opcontrol() {
// This is preference to what you like to drive on
chassis.drive_brake_set(MOTOR_BRAKE_COAST);
while (true) {
// PID Tuner
// After you find values that you're happy with, you'll have to set them in auton.cpp
if (!pros::competition::is_connected()) {
// Enable / Disable PID Tuner
if (master.get_digital_new_press(DIGITAL_X))
chassis.pid_tuner_toggle();
// Trigger the selected autonomous routine
if (master.get_digital_new_press(DIGITAL_B))
autonomous();
chassis.pid_tuner_iterate(); // Allow PID Tuner to iterate
}
chassis.opcontrol_tank(); // Tank control
pros::delay(ez::util::DELAY_TIME); // This is used for timer calculations! Keep this ez::util::DELAY_TIME
}
}
void pid_tuner_toggle();
pid_tuner_iterate()
Iterates through PID Tuner to allow gui navigation and constant changing.
- Prototype
- Example
void opcontrol() {
// This is preference to what you like to drive on
chassis.drive_brake_set(MOTOR_BRAKE_COAST);
while (true) {
// PID Tuner
// After you find values that you're happy with, you'll have to set them in auton.cpp
if (!pros::competition::is_connected()) {
// Enable / Disable PID Tuner
if (master.get_digital_new_press(DIGITAL_X))
chassis.pid_tuner_toggle();
// Trigger the selected autonomous routine
if (master.get_digital_new_press(DIGITAL_B))
autonomous();
chassis.pid_tuner_iterate(); // Allow PID Tuner to iterate
}
chassis.opcontrol_tank(); // Tank control
pros::delay(ez::util::DELAY_TIME); // This is used for timer calculations! Keep this ez::util::DELAY_TIME
}
}
void pid_tuner_iterate();
pid_tuner_print_brain_set()
Enables or disables the PID Tuner from printing to the brain screen. To use the PID Tuner, this or pid_tuner_print_terminal_set()
must be set to true.
input
true enables printing to brain, false disables.
- Prototype
- Example
void opcontrol() {
// This is preference to what you like to drive on
chassis.drive_brake_set(MOTOR_BRAKE_COAST);
chassis.pid_tuner_print_brain_set(true);
while (true) {
// PID Tuner
// After you find values that you're happy with, you'll have to set them in auton.cpp
if (!pros::competition::is_connected()) {
// Enable / Disable PID Tuner
if (master.get_digital_new_press(DIGITAL_X))
chassis.pid_tuner_toggle();
// Trigger the selected autonomous routine
if (master.get_digital_new_press(DIGITAL_B))
autonomous();
chassis.pid_tuner_iterate(); // Allow PID Tuner to iterate
}
chassis.opcontrol_tank(); // Tank control
pros::delay(ez::util::DELAY_TIME); // This is used for timer calculations! Keep this ez::util::DELAY_TIME
}
}
void pid_tuner_print_brain_set(bool input);
pid_tuner_print_terminal_set()
Enables or disables the PID Tuner from printing to the terminal. To use the PID Tuner, this or pid_tuner_print_brain_set()
must be set to true.
input
true enables printing to terminal, false disables.
- Prototype
- Example
void opcontrol() {
// This is preference to what you like to drive on
chassis.drive_brake_set(MOTOR_BRAKE_COAST);
chassis.pid_tuner_print_terminal_set(true);
while (true) {
// PID Tuner
// After you find values that you're happy with, you'll have to set them in auton.cpp
if (!pros::competition::is_connected()) {
// Enable / Disable PID Tuner
if (master.get_digital_new_press(DIGITAL_X))
chassis.pid_tuner_toggle();
// Trigger the selected autonomous routine
if (master.get_digital_new_press(DIGITAL_B))
autonomous();
chassis.pid_tuner_iterate(); // Allow PID Tuner to iterate
}
chassis.opcontrol_tank(); // Tank control
pros::delay(ez::util::DELAY_TIME); // This is used for timer calculations! Keep this ez::util::DELAY_TIME
}
}
void pid_tuner_print_terminal_set(bool input);
pid_tuner_increment_p_set()
Sets the amount that P will change when increasing or decreasing it.
p
new value to increment and decrement by.
- Prototype
- Example
void opcontrol() {
// This is preference to what you like to drive on
chassis.drive_brake_set(MOTOR_BRAKE_COAST);
chassis.pid_tuner_increment_p_set(0.25);
while (true) {
// PID Tuner
// After you find values that you're happy with, you'll have to set them in auton.cpp
if (!pros::competition::is_connected()) {
// Enable / Disable PID Tuner
if (master.get_digital_new_press(DIGITAL_X))
chassis.pid_tuner_toggle();
// Trigger the selected autonomous routine
if (master.get_digital_new_press(DIGITAL_B))
autonomous();
chassis.pid_tuner_iterate(); // Allow PID Tuner to iterate
}
chassis.opcontrol_tank(); // Tank control
pros::delay(ez::util::DELAY_TIME); // This is used for timer calculations! Keep this ez::util::DELAY_TIME
}
}
void pid_tuner_increment_p_set(double p);
pid_tuner_increment_i_set()
Sets the amount that I will change when increasing or decreasing it.
i
new value to increment and decrement by.
- Prototype
- Example
void opcontrol() {
// This is preference to what you like to drive on
chassis.drive_brake_set(MOTOR_BRAKE_COAST);
chassis.pid_tuner_increment_i_set(0.25);
while (true) {
// PID Tuner
// After you find values that you're happy with, you'll have to set them in auton.cpp
if (!pros::competition::is_connected()) {
// Enable / Disable PID Tuner
if (master.get_digital_new_press(DIGITAL_X))
chassis.pid_tuner_toggle();
// Trigger the selected autonomous routine
if (master.get_digital_new_press(DIGITAL_B))
autonomous();
chassis.pid_tuner_iterate(); // Allow PID Tuner to iterate
}
chassis.opcontrol_tank(); // Tank control
pros::delay(ez::util::DELAY_TIME); // This is used for timer calculations! Keep this ez::util::DELAY_TIME
}
}
void pid_tuner_increment_i_set(double i);
pid_tuner_increment_d_set()
Sets the amount that D will change when increasing or decreasing it.
d
new value to increment and decrement by.
- Prototype
- Example
void opcontrol() {
// This is preference to what you like to drive on
chassis.drive_brake_set(MOTOR_BRAKE_COAST);
chassis.pid_tuner_increment_d_set(1.0);
while (true) {
// PID Tuner
// After you find values that you're happy with, you'll have to set them in auton.cpp
if (!pros::competition::is_connected()) {
// Enable / Disable PID Tuner
if (master.get_digital_new_press(DIGITAL_X))
chassis.pid_tuner_toggle();
// Trigger the selected autonomous routine
if (master.get_digital_new_press(DIGITAL_B))
autonomous();
chassis.pid_tuner_iterate(); // Allow PID Tuner to iterate
}
chassis.opcontrol_tank(); // Tank control
pros::delay(ez::util::DELAY_TIME); // This is used for timer calculations! Keep this ez::util::DELAY_TIME
}
}
void pid_tuner_increment_d_set(double d);
pid_tuner_increment_start_i_set()
Sets the amount that Start I will change when increasing or decreasing it.
start_i
new value to increment and decrement by.
- Prototype
- Example
void opcontrol() {
// This is preference to what you like to drive on
chassis.drive_brake_set(MOTOR_BRAKE_COAST);
chassis.pid_tuner_increment_start_i_set(5.0);
while (true) {
// PID Tuner
// After you find values that you're happy with, you'll have to set them in auton.cpp
if (!pros::competition::is_connected()) {
// Enable / Disable PID Tuner
if (master.get_digital_new_press(DIGITAL_X))
chassis.pid_tuner_toggle();
// Trigger the selected autonomous routine
if (master.get_digital_new_press(DIGITAL_B))
autonomous();
chassis.pid_tuner_iterate(); // Allow PID Tuner to iterate
}
chassis.opcontrol_tank(); // Tank control
pros::delay(ez::util::DELAY_TIME); // This is used for timer calculations! Keep this ez::util::DELAY_TIME
}
}
void pid_tuner_increment_start_i_set(double start_i);
Getter Functions
pid_tuner_enabled()
Returns the state of the PID Tuner. True is enabled, false is disabled.
- Prototype
- Example
void opcontrol() {
// This is preference to what you like to drive on
chassis.drive_brake_set(MOTOR_BRAKE_COAST);
while (true) {
// PID Tuner
// After you find values that you're happy with, you'll have to set them in auton.cpp
if (!pros::competition::is_connected()) {
// Enable / Disable PID Tuner
if (master.get_digital_new_press(DIGITAL_X)) {
if (chassis.pid_tuner_enabled())
chassis.pid_tuner_disable();
else
chassis.pid_tuner_enable();
}
// Trigger the selected autonomous routine
if (master.get_digital_new_press(DIGITAL_B))
autonomous();
chassis.pid_tuner_iterate(); // Allow PID Tuner to iterate
}
chassis.opcontrol_tank(); // Tank control
pros::delay(ez::util::DELAY_TIME); // This is used for timer calculations! Keep this ez::util::DELAY_TIME
}
}
bool pid_tuner_enabled();
pid_tuner_print_terminal_enabled()
Returns the state of printing the PID Tuner to terminal. True is enabled, false is disabled.
- Prototype
- Example
void opcontrol() {
// This is preference to what you like to drive on
chassis.drive_brake_set(MOTOR_BRAKE_COAST);
chassis.pid_tuner_print_terminal_set(true);
printf("Printing to Terminal? %i\n", chassis.pid_tuner_print_terminal_enabled()); // Prints true
chassis.pid_tuner_print_terminal_set(false);
printf("Printing to Terminal? %i\n", chassis.pid_tuner_print_terminal_enabled()); // Prints false
while (true) {
// PID Tuner
// After you find values that you're happy with, you'll have to set them in auton.cpp
if (!pros::competition::is_connected()) {
// Enable / Disable PID Tuner
if (master.get_digital_new_press(DIGITAL_X)) {
if (chassis.pid_tuner_enabled())
chassis.pid_tuner_toggle();
}
// Trigger the selected autonomous routine
if (master.get_digital_new_press(DIGITAL_B))
autonomous();
chassis.pid_tuner_iterate(); // Allow PID Tuner to iterate
}
chassis.opcontrol_tank(); // Tank control
pros::delay(ez::util::DELAY_TIME); // This is used for timer calculations! Keep this ez::util::DELAY_TIME
}
}
bool pid_tuner_print_terminal_enabled();
pid_tuner_print_brain_enabled()
Returns the state of printing the PID Tuner to the brain. True is enabled, false is disabled.
- Prototype
- Example
void opcontrol() {
// This is preference to what you like to drive on
chassis.drive_brake_set(MOTOR_BRAKE_COAST);
chassis.pid_tuner_print_terminal_set(false);
printf("Printing to Terminal? %i\n", chassis.pid_tuner_print_brain_enabled()); // Prints false
chassis.pid_tuner_print_terminal_set(true);
printf("Printing to Terminal? %i\n", chassis.pid_tuner_print_brain_enabled()); // Prints true
while (true) {
// PID Tuner
// After you find values that you're happy with, you'll have to set them in auton.cpp
if (!pros::competition::is_connected()) {
// Enable / Disable PID Tuner
if (master.get_digital_new_press(DIGITAL_X)) {
if (chassis.pid_tuner_enabled())
chassis.pid_tuner_toggle();
}
// Trigger the selected autonomous routine
if (master.get_digital_new_press(DIGITAL_B))
autonomous();
chassis.pid_tuner_iterate(); // Allow PID Tuner to iterate
}
chassis.opcontrol_tank(); // Tank control
pros::delay(ez::util::DELAY_TIME); // This is used for timer calculations! Keep this ez::util::DELAY_TIME
}
}
bool pid_tuner_print_brain_enabled();
pid_tuner_increment_p_get()
Returns the amount that P will change when increasing or decreasing it.
- Prototype
- Example
void opcontrol() {
// This is preference to what you like to drive on
chassis.drive_brake_set(MOTOR_BRAKE_COAST);
chassis.pid_tuner_increment_p_set(0.25);
printf("%f\n", chassis.pid_tuner_increment_p_get());
while (true) {
// PID Tuner
// After you find values that you're happy with, you'll have to set them in auton.cpp
if (!pros::competition::is_connected()) {
// Enable / Disable PID Tuner
if (master.get_digital_new_press(DIGITAL_X))
chassis.pid_tuner_toggle();
// Trigger the selected autonomous routine
if (master.get_digital_new_press(DIGITAL_B))
autonomous();
chassis.pid_tuner_iterate(); // Allow PID Tuner to iterate
}
chassis.opcontrol_tank(); // Tank control
pros::delay(ez::util::DELAY_TIME); // This is used for timer calculations! Keep this ez::util::DELAY_TIME
}
}
double pid_tuner_increment_p_set();
pid_tuner_increment_i_set()
Gets the amount that I will change when increasing or decreasing it.
- Prototype
- Example
void opcontrol() {
// This is preference to what you like to drive on
chassis.drive_brake_set(MOTOR_BRAKE_COAST);
chassis.pid_tuner_increment_i_set(0.25);
printf("%f\n", chassis.pid_tuner_increment_i_get());
while (true) {
// PID Tuner
// After you find values that you're happy with, you'll have to set them in auton.cpp
if (!pros::competition::is_connected()) {
// Enable / Disable PID Tuner
if (master.get_digital_new_press(DIGITAL_X))
chassis.pid_tuner_toggle();
// Trigger the selected autonomous routine
if (master.get_digital_new_press(DIGITAL_B))
autonomous();
chassis.pid_tuner_iterate(); // Allow PID Tuner to iterate
}
chassis.opcontrol_tank(); // Tank control
pros::delay(ez::util::DELAY_TIME); // This is used for timer calculations! Keep this ez::util::DELAY_TIME
}
}
double pid_tuner_increment_i_set();
pid_tuner_increment_d_set()
Gets the amount that D will change when increasing or decreasing it.
- Prototype
- Example
void opcontrol() {
// This is preference to what you like to drive on
chassis.drive_brake_set(MOTOR_BRAKE_COAST);
chassis.pid_tuner_increment_d_set(1.0);
printf("%f\n", chassis.pid_tuner_increment_d_get());
while (true) {
// PID Tuner
// After you find values that you're happy with, you'll have to set them in auton.cpp
if (!pros::competition::is_connected()) {
// Enable / Disable PID Tuner
if (master.get_digital_new_press(DIGITAL_X))
chassis.pid_tuner_toggle();
// Trigger the selected autonomous routine
if (master.get_digital_new_press(DIGITAL_B))
autonomous();
chassis.pid_tuner_iterate(); // Allow PID Tuner to iterate
}
chassis.opcontrol_tank(); // Tank control
pros::delay(ez::util::DELAY_TIME); // This is used for timer calculations! Keep this ez::util::DELAY_TIME
}
}
double pid_tuner_increment_d_set();
pid_tuner_increment_start_i_set()
Gets the amount that Start I will change when increasing or decreasing it.
- Prototype
- Example
void opcontrol() {
// This is preference to what you like to drive on
chassis.drive_brake_set(MOTOR_BRAKE_COAST);
chassis.pid_tuner_increment_start_i_set(5.0);
printf("%f\n", chassis.pid_tuner_increment_start_i_get());
while (true) {
// PID Tuner
// After you find values that you're happy with, you'll have to set them in auton.cpp
if (!pros::competition::is_connected()) {
// Enable / Disable PID Tuner
if (master.get_digital_new_press(DIGITAL_X))
chassis.pid_tuner_toggle();
// Trigger the selected autonomous routine
if (master.get_digital_new_press(DIGITAL_B))
autonomous();
chassis.pid_tuner_iterate(); // Allow PID Tuner to iterate
}
chassis.opcontrol_tank(); // Tank control
pros::delay(ez::util::DELAY_TIME); // This is used for timer calculations! Keep this ez::util::DELAY_TIME
}
}
double pid_tuner_increment_start_i_set();