Need help with 4 CIM programming

HI! We are Team 3131 Gladstone Robotics, and we need help on programming a 4 CIM robot to drive. In the past, we have only used 2 CIM’s. But this year we are using 4. We have 2 CIM’s on each side of the robot. We don’t know what to do and would love the help. We are using VSCode Java for our programming software and language. Thank you in advance for the help!

-Team 3131 Gladstone Robotics

So there are a few way to skin that particular cat. Depending on your motor controller, you could use follower mode (CAN / smart motor controllers), WPILib’s SpeedControllerGroup, or PWM splitter cables. Likely the middle option is most sensible for you. Please share what motor controllers you’re using if you’d like a more definitive answer on the “optimal” way to approach this problem.

The general gist is that instead of commanding each “motor”, you’d command the speed controller group (or with follower it’d be commanding two motor controllers and the others output what those “parent” ones were commanded to do).

This example from WPILib has a differentialdrive object in use, you’d construct a differentialdrive object of two speedcontrollergroups and pass that in instead.

Hope this is helpful!

Ya as @krf use the DifferentialDrive example on VS code and adapt it to your specific motor controllers, and make sure that

leftMotor2.follow(leftMotor1);

And same for right side otherwise your motors will drag

(Note: this is command based Java not timed based)

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