VEXCODE autonomous programming help

So on our first robot this year had a fairly reliable 3pt autonomous that always worked just fine running off the auton button on the v5 controller. When plugged into a the competition switch at the first tourney however, it only worked about half the time. The other half, it would just drive straight forward, quickly, further than it should have in any of our autonomous code, and somehow continue running the rest of the autonomous, but something like the motor speed and distance was off. It didn’t work and almost crossed center line. Our next robot has been built… and the exact same thing happens. My coach thinks it may have something to do with a depricated wait command, what is the wait command I should be using? Any other possibilities? Here is my auton code:

    Brain.Screen.clearScreen();
    Brain.Screen.newLine();
    Brain.Screen.print("Blue Auton Started");
    frontLeftMotor.setVelocity(40, velocityUnits::pct); // set velocities
    backLeftMotor.setVelocity(40, velocityUnits::pct);
    frontRightMotor.setVelocity(40, velocityUnits::pct);
    backRightMotor.setVelocity(40, velocityUnits::pct);
    trayMotor.setVelocity(100, velocityUnits::pct);
    leftIntakeMotor.setVelocity(100, velocityUnits::pct);
    rightIntakeMotor.setVelocity(100, velocityUnits::pct);

    leftIntakeMotor.spin(reverse); // start intake to take in cubes
    rightIntakeMotor.spin(reverse);
    
    vex::task::sleep(1500);

    frontLeftMotor.rotateFor(3, rotationUnits::rev,
                             false); // drive forward into cubes
    frontRightMotor.rotateFor(3, rotationUnits::rev, false);
    backLeftMotor.rotateFor(3, rotationUnits::rev, false);
    backRightMotor.rotateFor(3, rotationUnits::rev);

    vex::task::sleep(500);

        frontLeftMotor.setVelocity(30, velocityUnits::pct); // set velocities
    backLeftMotor.setVelocity(30, velocityUnits::pct);
    frontRightMotor.setVelocity(30, velocityUnits::pct);
    backRightMotor.setVelocity(30, velocityUnits::pct);

    frontLeftMotor.rotateFor(0.8, rotationUnits::rev, false); // strafe right
    frontRightMotor.rotateFor(-0.8, rotationUnits::rev, false);
    backLeftMotor.rotateFor(-0.8, rotationUnits::rev, false);
    backRightMotor.rotateFor(0.8, rotationUnits::rev);

    vex::task::sleep(500);

    frontLeftMotor.rotateFor(.7, rotationUnits::rev,
                             false); // drive forward into cube
    frontRightMotor.rotateFor(.7, rotationUnits::rev, false);
    backLeftMotor.rotateFor(.7, rotationUnits::rev, false);
    backRightMotor.rotateFor(.7, rotationUnits::rev);

    vex::task::sleep(200);

    leftIntakeMotor.stop(brake); // stop the intake after collecting cubes
    rightIntakeMotor.stop(brake);

    frontLeftMotor.rotateFor(-0.7, rotationUnits::rev, false);
    frontRightMotor.rotateFor(-0.7, rotationUnits::rev, false);
    backLeftMotor.rotateFor(-0.7, rotationUnits::rev, false);
    backRightMotor.rotateFor(-0.7, rotationUnits::rev);

    frontLeftMotor.rotateFor(
        -2, rotationUnits::rev,
        false); // backup almost (or all the way to) the wall
    frontRightMotor.rotateFor(-1.5, rotationUnits::rev, false);
    backLeftMotor.rotateFor(-1.5, rotationUnits::rev, false);
    backRightMotor.rotateFor(-1.5, rotationUnits::rev);

    vex::task::sleep(100);

    frontLeftMotor.rotateFor(-1.7, rotationUnits::rev,
                             false); // turn left to drive to goal
    frontRightMotor.rotateFor(1.7, rotationUnits::rev, false);
    backLeftMotor.rotateFor(-1.7, rotationUnits::rev, false);
    backRightMotor.rotateFor(1.7, rotationUnits::rev);

    vex::task::sleep(500);

    frontLeftMotor.spin(forward); // push (long distance)
    frontRightMotor.spin(forward);
    backLeftMotor.spin(forward);
    backRightMotor.spin(forward);

    vex::task::sleep(2500);

    frontLeftMotor.stop(brake); // stop push
    frontRightMotor.stop(brake);
    backLeftMotor.stop(brake);
    backRightMotor.stop(brake);

    trayMotor.rotateFor(-5, rotationUnits::rev); // push tray out quickly

    leftIntakeMotor.setVelocity(17, velocityUnits::pct); // velocities
    rightIntakeMotor.setVelocity(17, velocityUnits::pct);
    trayMotor.setVelocity(90, velocityUnits::pct);

    leftIntakeMotor.spin(forward); // eject a cube
    rightIntakeMotor.spin(forward);

    vex::task::sleep(700);

    leftIntakeMotor.stop(brake); // stop the intake after ejecting a cube
    rightIntakeMotor.stop(brake);

    trayMotor.rotateFor(
        -3, rotationUnits::rev); // move tray perpendicular to ground

    trayMotor.rotateFor(8, rotationUnits::rev,
                        false); // lower tray and eject the stack
    leftIntakeMotor.spin(directionType::fwd, 30, velocityUnits::pct);
    rightIntakeMotor.spin(directionType::fwd, 30, velocityUnits::pct);

    vex::task::sleep(3000); // wait while it is ejecting the stack

    leftIntakeMotor.stop(coast); // stop ejection of stack
    rightIntakeMotor.stop(coast);

    frontLeftMotor.setVelocity(100, velocityUnits::pct); // set velocities
    backLeftMotor.setVelocity(100, velocityUnits::pct);
    frontRightMotor.setVelocity(100, velocityUnits::pct);
    backRightMotor.setVelocity(100, velocityUnits::pct);

    frontLeftMotor.rotateFor(-2, rotationUnits::rev, false); // backup from goal
    frontRightMotor.rotateFor(-2, rotationUnits::rev, false);
    backLeftMotor.rotateFor(-2, rotationUnits::rev, false);
    backRightMotor.rotateFor(-2, rotationUnits::rev);

    Brain.Screen.newLine();
    Brain.Screen.print("Blue Auton Complete");

idk if this is the problem but is it a competition template?

Yes, the most recent version of the template and vexcode.

It is most likely just different field conditions. The field tiles might have been newer or older, changing the friction you would have on them.

There are no deprecated wait commands.

vex::task::sleep(1500);

is still valid.

3 Likes

Post (or preferably attach) the whole program, perhaps you have another task that is interfering.

1 Like

Not sure if you already do this, but try resetting your motors in preauton

1 Like

No lol, the robot is driving several feet further than it should when it messes up.

Ah, how would I do that?

In the preauton portion of the code use:

Motor.resetRotation();

Replace motor with the actual name of the motor

1 Like

Often when you plug into a competition switch, or at least you have turned on the robot before plugging into the competition switch, the driver control section of you code will run. If you have then sent spin commands to the motors, even spin 0, a following command like this

frontLeftMotor.setVelocity(40, velocityUnits::pct);

will start the motors moving, the reason is that using setVelocity on a motor that is already thought to be moving (having received a spin command) will change the current speed of the motor.

solution is to send stop to all motors at the beginning of auton.
or, better, don’t use setVelocity at all and add requested velocity to the spin commands
instead of doing this.

frontRightMotor.setVelocity(40, velocityUnits::pct);
frontRightMotor.rotateFor(3, rotationUnits::rev, false);

combine them into this

frontRightMotor.rotateFor(3, rotationUnits::rev, 40, velocityUnits::pct,  false);
3 Likes

Thanks, I will try that when school lets out and let you know if it works. On another note, do you know how to use the rotations of a motor as a variable? Like “if motor rotation <10 { }” or something?

Thank you, I will try using this and test it in a few hours.

I will try a couple things after school, the rest of my code looks like this:

/*                                                                            */
/*    Module:       main.cpp                                                  */
/*    Author:       VEX                                                       */
/*    Created:      Thu Sep 26 2019                                           */
/*    Description:  Competition Template                                      */
/*                                                                            */
/*----------------------------------------------------------------------------*/

// ---- START VEXCODE CONFIGURED DEVICES ----
// Robot Configuration:
// [Name]               [Type]        [Port(s)]
// Controller1          controller
// frontRightMotor      motor         15
// backRightMotor       motor         1
// frontLeftMotor       motor         14
// backLeftMotor        motor         13
// leftIntakeMotor      motor         17
// rightIntakeMotor     motor         3
// trayMotor            motor         12
// auxMotor             motor         5
// ---- END VEXCODE CONFIGURED DEVICES ----

#include "vex.h"

using namespace vex;

// A global instance of competition
competition Competition;

// define your global instances of motors and other devices here

/*---------------------------------------------------------------------------*/
/*                          Pre-Autonomous Functions                         */
/*                                                                           */
/*  You may want to perform some actions before the competition starts.      */
/*  Do them in the following function.  You must return from this function   */
/*  or the autonomous and usercontrol tasks will not be started.  This       */
/*  function is only called once after the V5 has been powered on and        */
/*  not every time that the robot is disabled.                               */
/*---------------------------------------------------------------------------*/

void pre_auton(void) {
  // Initializing Robot Configuration. DO NOT REMOVE!
  vexcodeInit();
  // All activities that occur before the competition starts
  // Example: clearing encoders, setting servo positions, ...
}

/*---------------------------------------------------------------------------*/
/*                                                                           */
/*                              Autonomous Task                              */
/*                                                                           */
/*  This task is used to control your robot during the autonomous phase of   */
/*  a VEX Competition.                                                       */
/*                                                                           */
/*  You must modify the code to add your own robot specific commands here.   */
/*---------------------------------------------------------------------------*/

void autonomous(void) {
  if (1) { // blue left match auton slot 1 (WIP)
    Brain.Screen.clearScreen();
    Brain.Screen.newLine();
    Brain.Screen.print("Blue Auton Started");
    frontLeftMotor.setVelocity(40, velocityUnits::pct); // set velocities
    backLeftMotor.setVelocity(40, velocityUnits::pct);
    frontRightMotor.setVelocity(40, velocityUnits::pct);
    backRightMotor.setVelocity(40, velocityUnits::pct);
    trayMotor.setVelocity(100, velocityUnits::pct);
    leftIntakeMotor.setVelocity(100, velocityUnits::pct);
    rightIntakeMotor.setVelocity(100, velocityUnits::pct);

    leftIntakeMotor.spin(reverse); // start intake to take in cubes
    rightIntakeMotor.spin(reverse);

    wait(1.5, seconds);

    frontLeftMotor.rotateFor(3, rotationUnits::rev,
                             false); // drive forward into cubes
    frontRightMotor.rotateFor(3, rotationUnits::rev, false);
    backLeftMotor.rotateFor(3, rotationUnits::rev, false);
    backRightMotor.rotateFor(3, rotationUnits::rev);

    wait(0.5, seconds);

    frontLeftMotor.setVelocity(30, velocityUnits::pct); // set velocities
    backLeftMotor.setVelocity(30, velocityUnits::pct);
    frontRightMotor.setVelocity(30, velocityUnits::pct);
    backRightMotor.setVelocity(30, velocityUnits::pct);

    frontLeftMotor.rotateFor(0.8, rotationUnits::rev, false); // strafe right
    frontRightMotor.rotateFor(-0.8, rotationUnits::rev, false);
    backLeftMotor.rotateFor(-0.8, rotationUnits::rev, false);
    backRightMotor.rotateFor(0.8, rotationUnits::rev);

    wait(0.5, seconds);

    frontLeftMotor.rotateFor(.7, rotationUnits::rev,
                             false); // drive forward into cube
    frontRightMotor.rotateFor(.7, rotationUnits::rev, false);
    backLeftMotor.rotateFor(.7, rotationUnits::rev, false);
    backRightMotor.rotateFor(.7, rotationUnits::rev);

    wait(0.2, seconds);

    leftIntakeMotor.stop(brake); // stop the intake after collecting cubes
    rightIntakeMotor.stop(brake);

    frontLeftMotor.rotateFor(-0.7, rotationUnits::rev, false);
    frontRightMotor.rotateFor(-0.7, rotationUnits::rev, false);
    backLeftMotor.rotateFor(-0.7, rotationUnits::rev, false);
    backRightMotor.rotateFor(-0.7, rotationUnits::rev);

    frontLeftMotor.rotateFor(
        -2, rotationUnits::rev,
        false); // backup almost (or all the way to) the wall
    frontRightMotor.rotateFor(-1.5, rotationUnits::rev, false);
    backLeftMotor.rotateFor(-1.5, rotationUnits::rev, false);
    backRightMotor.rotateFor(-1.5, rotationUnits::rev);

    wait(0.1, seconds);

    frontLeftMotor.rotateFor(-1.7, rotationUnits::rev,
                             false); // turn left to drive to goal
    frontRightMotor.rotateFor(1.7, rotationUnits::rev, false);
    backLeftMotor.rotateFor(-1.7, rotationUnits::rev, false);
    backRightMotor.rotateFor(1.7, rotationUnits::rev);

    wait(0.5, seconds);

    frontLeftMotor.spin(forward); // push (long distance)
    frontRightMotor.spin(forward);
    backLeftMotor.spin(forward);
    backRightMotor.spin(forward);

    wait(2.5, seconds);

    frontLeftMotor.stop(brake); // stop push
    frontRightMotor.stop(brake);
    backLeftMotor.stop(brake);
    backRightMotor.stop(brake);

    trayMotor.rotateFor(-5, rotationUnits::rev); // push tray out quickly

    leftIntakeMotor.setVelocity(17, velocityUnits::pct); // velocities
    rightIntakeMotor.setVelocity(17, velocityUnits::pct);
    trayMotor.setVelocity(90, velocityUnits::pct);

    leftIntakeMotor.spin(forward); // eject a cube
    rightIntakeMotor.spin(forward);

    wait(0.7, seconds);

    leftIntakeMotor.stop(brake); // stop the intake after ejecting a cube
    rightIntakeMotor.stop(brake);

    trayMotor.rotateFor(
        -3, rotationUnits::rev); // move tray perpendicular to ground

    trayMotor.rotateFor(8, rotationUnits::rev,
                        false); // lower tray and eject the stack
    leftIntakeMotor.spin(directionType::fwd, 30, velocityUnits::pct);
    rightIntakeMotor.spin(directionType::fwd, 30, velocityUnits::pct);

    wait(3, seconds); // wait while it is ejecting the stack

    leftIntakeMotor.stop(coast); // stop ejection of stack
    rightIntakeMotor.stop(coast);

    frontLeftMotor.setVelocity(100, velocityUnits::pct); // set velocities
    backLeftMotor.setVelocity(100, velocityUnits::pct);
    frontRightMotor.setVelocity(100, velocityUnits::pct);
    backRightMotor.setVelocity(100, velocityUnits::pct);

    frontLeftMotor.rotateFor(-2, rotationUnits::rev, false); // backup from goal
    frontRightMotor.rotateFor(-2, rotationUnits::rev, false);
    backLeftMotor.rotateFor(-2, rotationUnits::rev, false);
    backRightMotor.rotateFor(-2, rotationUnits::rev);

    Brain.Screen.newLine();
    Brain.Screen.print("Blue Auton Complete");
  }
  //
  //
  //
  //
  //
  //
  //
  //
  if (0) { // red right match auton slot 3 (WIP)
    frontLeftMotor.setVelocity(40, velocityUnits::pct); // set velocities
    backLeftMotor.setVelocity(40, velocityUnits::pct);
    frontRightMotor.setVelocity(40, velocityUnits::pct);
    backRightMotor.setVelocity(40, velocityUnits::pct);
    trayMotor.setVelocity(100, velocityUnits::pct);
    leftIntakeMotor.setVelocity(100, velocityUnits::pct);
    rightIntakeMotor.setVelocity(100, velocityUnits::pct);

    leftIntakeMotor.spin(reverse); // start intake to take in cubes
    rightIntakeMotor.spin(reverse);

    frontLeftMotor.rotateFor(3, rotationUnits::rev,
                             false); // drive forward into cubes
    frontRightMotor.rotateFor(3, rotationUnits::rev, false);
    backLeftMotor.rotateFor(3, rotationUnits::rev, false);
    backRightMotor.rotateFor(3, rotationUnits::rev);

    vex::task::sleep(300);

    frontLeftMotor.rotateFor(1, rotationUnits::rev, false); // strafe right
    frontRightMotor.rotateFor(1, rotationUnits::rev, false);
    backLeftMotor.rotateFor(-1, rotationUnits::rev, false);
    backRightMotor.rotateFor(-1, rotationUnits::rev);

    vex::task::sleep(300);

    frontLeftMotor.rotateFor(.7, rotationUnits::rev,
                             false); // drive forward into cube
    frontRightMotor.rotateFor(.7, rotationUnits::rev, false);
    backLeftMotor.rotateFor(.7, rotationUnits::rev, false);
    backRightMotor.rotateFor(.7, rotationUnits::rev);

    vex::task::sleep(400);

    frontLeftMotor.setVelocity(60, velocityUnits::pct); // set velocities
    backLeftMotor.setVelocity(60, velocityUnits::pct);
    frontRightMotor.setVelocity(60, velocityUnits::pct);
    backRightMotor.setVelocity(60, velocityUnits::pct);

    frontLeftMotor.rotateFor(-1, rotationUnits::rev, false);
    frontRightMotor.rotateFor(-1, rotationUnits::rev, false);
    backLeftMotor.rotateFor(-1, rotationUnits::rev, false);
    backRightMotor.rotateFor(-1, rotationUnits::rev);

    leftIntakeMotor.stop(brake); // stop the intake after collecting cubes
    rightIntakeMotor.stop(brake);

    frontLeftMotor.rotateFor(
        -2, rotationUnits::rev,
        false); // backup almost (or all the way to) the wall
    frontRightMotor.rotateFor(-2, rotationUnits::rev, false);
    backLeftMotor.rotateFor(-2, rotationUnits::rev, false);
    backRightMotor.rotateFor(-2, rotationUnits::rev);

    vex::task::sleep(100);

    frontLeftMotor.rotateFor(2, rotationUnits::rev,
                             false); // turn 90 left to drive to goal
    frontRightMotor.rotateFor(-2, rotationUnits::rev, false);
    backLeftMotor.rotateFor(2, rotationUnits::rev, false);
    backRightMotor.rotateFor(-2, rotationUnits::rev);

    vex::task::sleep(100);

    frontLeftMotor.rotateFor(4.5, rotationUnits::rev,
                             false); // drive to goal and rotate 45 (to the
                                     // left) to it to prepare for push
    frontRightMotor.rotateFor(4, rotationUnits::rev, false);
    backLeftMotor.rotateFor(4.5, rotationUnits::rev, false);
    backRightMotor.rotateFor(4, rotationUnits::rev);

    frontLeftMotor.spin(forward); // push
    frontRightMotor.spin(forward);
    backLeftMotor.spin(forward);
    backRightMotor.spin(forward);

    vex::task::sleep(500);

    frontLeftMotor.stop(brake); // stop push
    frontRightMotor.stop(brake);
    backLeftMotor.stop(brake);
    backRightMotor.stop(brake);

    trayMotor.rotateFor(
        -3, rotationUnits::rev); // push tray out almost half way quickly

    leftIntakeMotor.setVelocity(17, velocityUnits::pct); // velocities
    rightIntakeMotor.setVelocity(17, velocityUnits::pct);
    trayMotor.setVelocity(70, velocityUnits::pct);

    leftIntakeMotor.spin(forward); // eject a cube
    rightIntakeMotor.spin(forward);

    vex::task::sleep(400);

    leftIntakeMotor.stop(brake); // stop the intake after ejecting a cube
    rightIntakeMotor.stop(brake);

    trayMotor.rotateFor(
        -4, rotationUnits::rev); // move tray perpendicular to ground

    trayMotor.spin(reverse); // lower tray and eject the stack
    leftIntakeMotor.spin(directionType::fwd, 17, velocityUnits::pct);
    rightIntakeMotor.spin(directionType::fwd, 17, velocityUnits::pct);

    vex::task::sleep(2000); // wait while it is ejecting the stack

    trayMotor.stop(brake); // stop ejection of stack
    leftIntakeMotor.stop(brake);
    rightIntakeMotor.stop(brake);

    frontLeftMotor.rotateFor(-2, rotationUnits::rev, false); // backup from goal
    frontRightMotor.rotateFor(-2, rotationUnits::rev, false);
    backLeftMotor.rotateFor(-2, rotationUnits::rev, false);
    backRightMotor.rotateFor(-2, rotationUnits::rev);
  }
}

/*---------------------------------------------------------------------------*/
/*                                                                           */
/*                              User Control Task                            */
/*                                                                           */
/*  This task is used to control your robot during the user control phase of */
/*  a VEX Competition.                                                       */
/*                                                                           */
/*  You must modify the code to add your own robot specific commands here.   */
/*---------------------------------------------------------------------------*/

void driveControl(void) {
  int left = Controller1.Axis3.position(vex::percent);
  int right = Controller1.Axis2.position(vex::percent);
  int sideways = Controller1.Axis1.position(vex::percent);

  frontRightMotor.spin(vex::forward, right - sideways, vex::percent);
  frontLeftMotor.spin(vex::forward, left + sideways, vex::percent);
  backRightMotor.spin(vex::forward, right + sideways, vex::percent);
  backLeftMotor.spin(vex::forward, left - sideways, vex::percent);
}

void trayIntakeControl(void) {}

void auxControl(void) {
  if (Controller1.ButtonUp.pressing()) {
    auxMotor.spin(directionType::rev, 100, velocityUnits::pct);
  } else if (Controller1.ButtonDown.pressing()) {
    auxMotor.spin(directionType::fwd, 100, velocityUnits::pct);
  } else {
    auxMotor.stop(brakeType::hold);
  }
}

void intakeControl(void) {
  if (Controller1.ButtonR1.pressing()) {
    leftIntakeMotor.spin(directionType::rev, 100, velocityUnits::pct);
    rightIntakeMotor.spin(directionType::rev, 100, velocityUnits::pct);
  } else if (Controller1.ButtonR2.pressing()) {
    leftIntakeMotor.spin(directionType::fwd, 70, velocityUnits::pct);
    rightIntakeMotor.spin(directionType::fwd, 70, velocityUnits::pct);
  } else {
    if (Controller1.ButtonX.pressing()) {
      trayMotor.spin(directionType::fwd, 80, velocityUnits::pct);
      leftIntakeMotor.spin(directionType::fwd, 17, velocityUnits::pct);
      rightIntakeMotor.spin(directionType::fwd, 17, velocityUnits::pct);
    } else {
      leftIntakeMotor.stop(brakeType::hold);
      rightIntakeMotor.stop(brakeType::hold);
    }
  }
}

void trayControl(void) {
  if (Controller1.ButtonX.pressing()) {
  } else {
    if (Controller1.ButtonL1.pressing()) {
      trayMotor.spin(directionType::rev, 100, velocityUnits::pct);
    } else if (Controller1.ButtonL2.pressing()) {
      trayMotor.spin(directionType::fwd, 100, velocityUnits::pct);
    } else {
      trayMotor.stop(brakeType::hold);
    }
  }
}

void trayControl2(void) {
  // int trayencoder = trayMotor[rotations];
}

void usercontrol(void) {
  Brain.Screen.clearScreen();
  Brain.Screen.print("Driver Control Started");
  Brain.Screen.newLine();
  Brain.Screen.print("STEM, STEM, STEM, STEM, STEM, STEM, STEM, STEM, STEM, "
                     "STEM, STEM, STEM, STEM, STEM, STEM, STEM,");
  // User control code here, inside the loop
  while (1) {

    driveControl();

    intakeControl();

    auxControl();

    trayControl();

    trayIntakeControl();

    // This is the main execution loop for the user control program.
    // Each time through the loop your program should update motor + servo
    // values based on feedback from the joysticks.

    // ........................................................................
    // Insert user code here. This is where you use the joystick values to
    // update your motors, etc.
    // ........................................................................

    wait(10, msec); // Sleep the task for a short amount of time to
                    // prevent wasted resources.
  }
}

//
// Main will set up the competition functions and callbacks.
//
int main() {
  // Set up callbacks for autonomous and driver control periods.
  Competition.autonomous(autonomous);
  Competition.drivercontrol(usercontrol);

  // Run the pre-autonomous function.
  pre_auton();

  // Prevent main from exiting with an infinite loop.
  while (true) {
    wait(100, msec);
  }
}

edit by mods: use code tags not quote tags.
ah, ty mods I wasn’t quite sure how to do that. I guess it’s 3 tildes.

Yes you definitely need to reset the motors because they aren’t in preauton.

To get the motor rotations an example to use:

if(Motor.rotation(deg)<10){
    //Do something
}
1 Like

Ok, thanks. When is preauton actually run? Can I just put the reset commands at the beginning of auton?

Yeah you could also put it at the beginning of auton. Preauton is run when the competition switch is disabled and right before auton

Ok, I wasn’t sure if preauton was run only once when the robot was turned on or what. Thanks.