View Single Post
  #2   Spotlight this post!  
Unread 31-01-2017, 11:42
WSiggs WSiggs is offline
Pb Programmer
FRC #4908 (Dragons)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2014
Location: Duxbury Massachusetts
Posts: 38
WSiggs is on a distinguished road
Re: Programming six motor drive in Java (or c++)

Quote:
Originally Posted by fovea1959 View Post
We're a Java shop, and we are running 3 motors per side for drive this year (budget and space willing).

In the past, we have used PWM Y cables to make it all look like 4 motors. This year we want to control all 6 motors independently (easier to troubleshoot and find bad connections @ competition).

The Wpilib drive object only supports 4 motors tops. The solution we used was just to poke the Drive object as usual, then immediately interrogate a controller on each side for it's current power and poke that back into the 3rd motor on each side (the motor that is not part of the Drive object).

The other solution we contemplated was doing a Composite motor object; I think strongback has something like that.

Ours is working fine, but I'm curious how other people solved this problem?
I would recommend making your own drive class, have it extend the RobotDrive class if you want, and set all of the motor values yourself. The main arcade and tank drive methods in the RobotDrive class are simple enough that you can recreate them easily with however many motors you need to.
Reply With Quote