Robot Will Not Stop in Autonomous Code

  1. 2 months ago

    Adriana102

    Dec 7 Arizona 2998A

    Hi, we're a new Vex team and we've been having some trouble with our autonomous code. When our robot runs the code, it lifts our arm (the first command), moves forward (the second command), and then lowers the arm (our third command). But all during our third command, our robot is still moving forward. We have tried decreasing the amount of time we run the second command for, but it has not done anything.

    Here is a snippet of our robot's autonomous code:

    motor[chainLift] = 127; // Our first command
    wait1Msec(3400);

    motor[rightDrive] = 127; // Our second command
    motor[leftDrive] = 127;
    wait1Msec(2410);

    motor[chainLift] = -127; // Our third command
    wait1Msec(1150);

    Any help would be appreciated!

  2. briancole

    Dec 7 Utah 4270C

    you have to tell the motors to equal zero after you tell them to equal 127, or no matter how long you wait they'll keep equalling 127.

  3. Adriana102

    Dec 7 Arizona 2998A

    Do you mean like this?

    motor[rightDrive] = 127; // Our second command
    motor[leftDrive] = 127;
    wait1Msec(2410);
    motor[rightDrive] = 0;
    motor[leftDrive] = 0;

  4. @Adriana102

    motor[chainLift] = 127; // Our first command
    wait1Msec(3400);
    motor[chainLift] =0; //stop the motors after the set amount of time
    
    motor[rightDrive] = 127; // Our second command
    motor[leftDrive] = 127;
    wait1Msec(2410);
    motor[leftDrive] =0;  //stop the motors after the set amount of time
    motor[rightDrive] =0;  //stop the motors after the set amount of time
    
    motor[chainLift] = -127; // Our third command
    wait1Msec(1150);
    motor[chainLift] =0; //stop the motors after the set amount of time
    
  5. Adriana102

    Dec 7 Arizona 2998A

    Thank you very much for the help!

  6. briancole

    Dec 7 Utah 4270C

    @Adriana102 Do you mean like this?

    motor[rightDrive] = 127; // Our second command
    motor[leftDrive] = 127;
    wait1Msec(2410);
    motor[rightDrive] = 0;
    motor[leftDrive] = 0;

    Yes, that should do it.

  7. blatwell

    Dec 7 Event Partner Indianapolis 621A

    I would also suggest you not run the motors at 127. The difference in speed between 90 and 127 is very minimal but the difference in how quickly they will burn out is quite a bit. If you talk to some of the top teams in the world, most of them do not exceed 90 or 100 even in driver control.

  8. Also if your going to be holding weight with your autonomous, instead of 0 use 5 for a cone, and 20 for a base

  9. Easton

    Dec 8 Loganville, GA, USA 1958 A

    @blatwell I would also suggest you not run the motors at 127. The difference in speed between 90 and 127 is very minimal but the difference in how quickly they will burn out is quite a bit. If you talk to some of the top teams in the world, most of them do not exceed 90 or 100 even in driver control.

    By motors burning out, do you mean the PTC tripping or how long the motor lasts overall?

 

or Sign Up to reply!