Go to Post This is the weird precipice between insane and innovative. - CalTran [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 31-01-2017, 11:32
fovea1959's Avatar
fovea1959 fovea1959 is offline
Herder of programmers
AKA: Doug Wegscheid
FRC #3620 (The Average Joes)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2011
Location: St Joseph
Posts: 336
fovea1959 will become famous soon enough
Programming six motor drive in Java (or c++)

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?
Reply With Quote
  #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
  #3   Spotlight this post!  
Unread 31-01-2017, 12:04
Brian Selle's Avatar
Brian Selle Brian Selle is online now
Mentor
FRC #3310 (Black Hawk Robotics)
Team Role: Engineer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Texas
Posts: 170
Brian Selle has a spectacular aura aboutBrian Selle has a spectacular aura aboutBrian Selle has a spectacular aura about
Re: Programming six motor drive in Java (or c++)

^^ This is what I going to suggest if you are using PWM. We use Talon SRX controllers with CAN and you can slave controllers together through software.
__________________
2016 Curie Quarter-Finalist (5803, 3310, 2168, 5940), Lubbock Regional Winner (3310, 4063, 4301), Arkansas Regional Winner (16, 3310, 6055)
2015 Newton Quarter-Finalist (3130, 2468, 3310, 537), Lubbock Regional Winner (2468, 3310, 4799)
2014 Galileo Quarter-Finalist (2052, 70, 3310, 3360), Colorado Regional Winner (1138, 3310, 2543)
2013 Archimedes Semi-Finalist (126, 3310, 1756), Texas Robot Roundup Winner (3310, 624, 2848), Dallas Regional Winner (148, 3310, 4610)
2012 Dallas West Regional Winner (935, 3310, 4206)
Reply With Quote
  #4   Spotlight this post!  
Unread 31-01-2017, 12:29
ozrien's Avatar
ozrien ozrien is offline
Omar Zrien
AKA: Omar
no team
Team Role: Mentor
 
Join Date: Sep 2006
Rookie Year: 2003
Location: Sterling Heights, MI
Posts: 549
ozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond repute
Re: Programming six motor drive in Java (or c++)

Good starting place I think.
https://github.com/CrossTheRoadElec/...on_ArcadeDrive
Reply With Quote
  #5   Spotlight this post!  
Unread 31-01-2017, 13:18
Adnewhouse's Avatar
Adnewhouse Adnewhouse is offline
Registered User
FRC #0639
Team Role: College Student
 
Join Date: Jun 2013
Rookie Year: 2012
Location: Ithaca, NY
Posts: 21
Adnewhouse is an unknown quantity at this point
Re: Programming six motor drive in Java (or c++)

Quote:
Originally Posted by WSiggs View Post
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.
This is what I also recommend you guys do. Re-implementing arcade/tank drive is super trivial and also gives you more control over what's going on under the hood.


On a side note, in 2014 we had 6 drive motors and implemented our own drive subsystem that automatically switched on motors based on the amount of current the drive train was pulling. It would also stagger motor startup to try and prevent brown outs. Basically when we were just driving around at a constant velocity it would only use one cim per side. The moment we hit an obstacle, the current used by that single cim would spike up and the robot code would bring online more motors to give the robot extra oomph and help break static friction. We called it hammer drive, because when we ran into other robots we would hit them like a hammer. You might want to experiment with something like this if you have time.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 14:52.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi