Drivetrain never reaches desired amount of distance traveled

I would like the drivetrain to drive reverse and then activate a piston. However, the drivetrain never finishes its task so the robot is waiting on completion of the drivetrain before doing anything else. I have no way of fixing this, and I’m not sure if this is a mechanical or programming issue. Everything else works just fine, the drivetrain is the only subsystem that doesn’t finish doing what it’s supposed to do.
So far, this is my program:
void highstakes_left () {
Drivetrain6.setDriveVelocity(30.0, percent);
Drivetrain6.driveFor(reverse, 5, inches, true);
DigitalOutD.set(true);
}
Anyone have any possible solutions to this issue?

1 Like

Does the reverse for 5 inches need to be a negative value? If it is constantly driving forward it might be that.

I don’t know if it is just me but I can’t see the code, do you think you could re-send it so that I know what your code looks like
Thanks.

Sure:
void highstakes_left () {
Drivetrain6.setDriveVelocity(30.0, percent);
Drivetrain6.driveFor(reverse, 5, inches, true);
DigitalOutD.set(true);
}

1 Like

It moves in reverse just fine, but the next command never executes

1 Like

I ran into this issue back in my vex iq days; based on what I see you are using the default vex code drivetrain (the one where you put in the motors for each side into vexcode) what is probably happening is that the max torque is set to 50% so the drivetrain only applies 50% power. To fix this just add in the max torque block/line and set it to 100%. That should fix your issue. Good luck this season!

Do you happen to know what the function is? I saw in our old program it was setMaxTorque but this does not work in my new program.

The usual problem is incorrect configuration of the drivetrain, perhaps you swapped left and right motors. the drivetrain must be configured to match the way the robot has been built.

max torque is set for 100%
The default drive velocity is 50 rpm (which happens to be 50%)

2 Likes

Sorry, that is the most I can help you. I am not a coder

hey I’m having the same issue, were you able to fix it?

This was a long time ago so I don’t exactly remember what template I used but I believe this was using VEXCode V5 PRO. Our template was very buggy and had a lot of issues so we never actually solved the problems. Then we switched to EZ Template which solved our drivetrain issues. I think having the correct configuration of drivetrain settings also plays a role in solving this problem.

1 Like