Autonomous - controlling drivetrain motors separately

In our team’s autonomous coding for Full Volume, we are using a “MyBlock” so that the robot straightens itself as it moves. However, as it does this, each motor is fine-tuned to its own velocity using the inertial sensor. We also need to turn the robot to each goal’s heading and rotation to score points. However, this can only be done with a drivetrain. Is there any way for the motors to be controlled individually at some points in time, but controlled together by the drivetrain at other points in time?

You either have a drivetrain or not a drivetrain. You can’t switch in the middle of your code.

You don’t ever “need” to use a drivetrain. You can always write functions that will control the motors independently, and that will give you the most control over your robot.

If your programmer did P or PI or PID to write the “MyBlock,” then I’m confident that it can be modified to make the bot turn to a heading.

If you do need a hint,

just use a P loop.

you do not need to use a drivetrain to turn the motor. Just make a function to spin the motor until the inertial sensor’s desired heading value is reached.

For my autonomous, I just code the motors separately, I don’t think its necessary to add a drivetrain to do what you want to do

You would have to code the motors separately, and make the MyBlock individually for each motor.

1 Like

My code always worked better when it was set up on a drive train in both autonomous and controlling.

Idk maybe (i think this might be the case) i just can’t code with drivetrain, it has messed up my auton so many times, i don’t even know why though, guess it just throws me off
For controller is interesting, I suppose you use one joystick instead of two?

You can do it either way. I have always liked two.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.