How do you program a 6 motor drivetrain

I thought I might be able to do that but would that not have issues with variable speed? I haven’t actually tried it so I don’t know, but I saw one other person that did six motor drive through blocks, I think in the way you said to. The issue he ended up running into was the motors would either be 100% on or off so he ended up flipping a lot just due to the jolt of all six motors starting at 100% power.

He might have coded it completely incorrectly, I don’t know because I’m not on his team, but correct me if I’m wrong with that.

So it would do that except we have all the drive motors set to coast so it doesn’t stop immediately. We then have a separate button set for breaking.

The Vex Drivetrain function has the motor control, proportional drive (PID), proportional turning, and inertial sensor integration built in. This is why many teams prefer to use it over manually grouping left and right motors together. It doesn’t make much of a difference with driver control but it can greatly improve autonomous and programming skills.

4 Likes

Teams that want to code their own drivetrain can use My Blocks to declare their own functions.

In the image below there are two functions: Drive and DriveDistance

  • Drive allows for driver control to operate all six motors.
  • DriveDistance allows the autonomous to navigate the field at specific speeds.

Note that DriveDistance doesn’t account for wheel slip or robots going off course. That requires much more advanced programming which can be created but will take some time and learning.

3 Likes

That is true, for my teams old skills auton (we just did a pushbot auton) we just used the four motor drive train and let the motors that move the middle wheels coast. We got stuck on rings more but the inertial sensor worked well.

I’ve seen a few teams that have done their own PID stuff separately, what would be the reason for this if you could just use the drivetrain function and have it included? I know certain drive setups like holonomic or mechanome might not be possible with it but other than those, why would someone create their own?

1 Like

Yes, that is correct. That is largely because PID is often better if tuned according to the robot’s weight, traction capability, and momentum. Plus it gives the freedom to decide how you want the PID to operate. If you use VEXCode Pro or use PROS, you can code your own PID infastructure yourself, if you know how to code it (one of my tutorials show how to code one). And from that, you can customize it to how you like it, like a slew rate to reduce skidding, PD and PID hybrid, or change the constants to make the PID softer or snappier based on use-case.

It is crazy how useful custom-made PID is. You can quite literally make any system work well with a well-made PID algorithm and pre-step logic.

6 Likes

Okay, so how do I call it to drive? what do we do in the main func to make it drive “x” inches?