Adding more motors for tank drive

This is the first time our team is using python and we’ve been trying to figure out how to change our original code that had a cim on each side to having two cims on each side. It’s probably not that complex but we don’t understand the software super well. We need the new cims to be inverted.

Not familiar with Python, but it should be as simple as either adding 2 new speed controller objects to your RobotDrive object, or if you aren’t using a robotdrive object, just add 2 more motor controllers and address them like you do the other 2.

Edit: You might need to add a constructor inside of the robotdrive class that accepts 4 speed controllers, and assigns them to each side of the robot correctly.

Post your code?

In any language, it’s just a matter of telling the RobotDrive object to use multiple motors. Check out the docs at http://robotpy.readthedocs.org/en/latest/wpilib/RobotDrive.html

The great thing about using python is the pyfrc simulator… the simulator has full support for 4-motor drivetrains too. Check out this physics example: https://github.com/robotpy/pyfrc/tree/master/samples/physics-4wheel

Alternatively you could keep the code the same and run y splitters for the pwm ports.

Assuming they aren’t using CAN. But they also need the CIMS to be inverted, although they can just reverse the polarity from the speed controller output.

If the motor is on the same side as the motor it is getting y connected to then it shouldn’t need to be inverted unless the internal coil was reversed.