Go to Post FIRST may very well be the healthiest drug on the market. - Herodotus [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
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 18-12-2016, 18:36
Robodragons4630 Robodragons4630 is offline
CHS Robodragons Programming
AKA: Noah Jarnigan
FRC #4630 (Robodragons)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2014
Location: Clinton, Tennessee
Posts: 15
Robodragons4630 is an unknown quantity at this point
C++ motor assignments

I am new to c++ and I'm trying to figure out how to use two different types of motor controllers on a 4 wheel base. I know how to do it in LabVIEW and am curious if i can do it in C++. Thanks for the help!!

Below is what I'm talking about in LabVIEW so hopefully its easier to understand what I'm asking.
Attached Thumbnails
Click image for larger version

Name:	motorexample.jpg
Views:	20
Size:	55.7 KB
ID:	21370  

Last edited by Robodragons4630 : 18-12-2016 at 18:43.
Reply With Quote
  #2   Spotlight this post!  
Unread 18-12-2016, 18:52
Bkeeneykid's Avatar
Bkeeneykid Bkeeneykid is offline
#wheatcoastneatcoast
AKA: Devin Keeney
FRC #1982 (Cougar Robotics); Season Long Fantasy FIRST (F3)
Team Role: Student
 
Join Date: Feb 2015
Rookie Year: 2015
Location: Lenexa, Kansas
Posts: 273
Bkeeneykid has much to be proud ofBkeeneykid has much to be proud ofBkeeneykid has much to be proud ofBkeeneykid has much to be proud ofBkeeneykid has much to be proud ofBkeeneykid has much to be proud ofBkeeneykid has much to be proud ofBkeeneykid has much to be proud of
Re: C++ motor assignments

You definitely can, but posting code of why you can't do it it always helpful. From an electrical perspective, this is a TERRIBLE idea. I can't tell what configuration you have them in here, but it's most likely one of two situations:
  1. One Type of motor controller for each drive side. This means that you will not drive straight. Both the SRX and SR are fairly linear (compared to some worse off offenders *cough* victor 888 *cough*), but you will never be able to drive straight. For autonomous, your encoders are going to do extra works that you don't need them to do, and driving in teleop can be harder as well.
  2. One motor controller of each type on each side. This means that if they aren't outputting the same voltage, one of the motors is getting back driven (maybe a better word, reverse stalling?) and can get damaged over time because of this. It's not a great idea as it also draws more current because one motor is stalled and the other is getting back driven.

If you are REALLY content on this, it's fairly simple. Just declare your various types of motor controllers, then put those four (or two) motor controllers into the RobotDrive constructor class. See more here: https://wpilib.screenstepslive.com/s...botdrive-class
__________________

F4 Network Website Designer

2010-2012: A Whole Buncha FLL Teams; Team Spirit, Gracious Professionalism Award winner
2015-Current: FRC 1982, Captain, Electrical Lead
Beginning FIRST Volunteer

Moderator on the FIRSTwiki
Reply With Quote
  #3   Spotlight this post!  
Unread 18-12-2016, 19:09
Robodragons4630 Robodragons4630 is offline
CHS Robodragons Programming
AKA: Noah Jarnigan
FRC #4630 (Robodragons)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2014
Location: Clinton, Tennessee
Posts: 15
Robodragons4630 is an unknown quantity at this point
Re: C++ motor assignments

Quote:
Originally Posted by Bkeeneykid View Post
You definitely can, but posting code of why you can't do it it always helpful. From an electrical perspective, this is a TERRIBLE idea. I can't tell what configuration you have them in here, but it's most likely one of two situations:
  1. One Type of motor controller for each drive side. This means that you will not drive straight. Both the SRX and SR are fairly linear (compared to some worse off offenders *cough* victor 888 *cough*), but you will never be able to drive straight. For autonomous, your encoders are going to do extra works that you don't need them to do, and driving in teleop can be harder as well.
  2. One motor controller of each type on each side. This means that if they aren't outputting the same voltage, one of the motors is getting back driven (maybe a better word, reverse stalling?) and can get damaged over time because of this. It's not a great idea as it also draws more current because one motor is stalled and the other is getting back driven.

If you are REALLY content on this, it's fairly simple. Just declare your various types of motor controllers, then put those four (or two) motor controllers into the RobotDrive constructor class. See more here: https://wpilib.screenstepslive.com/s...botdrive-class
I plan on using the motors in a 4 wheel drive mecanum base. The configuration is going to be cross. Mecanum wheels by default are crossed so I saw no harm in doing the same with the motor controllers. If there is a true issue with this other than prolonged use can cause then I will look over other possibilities. Thanks for the response!
Reply With Quote
  #4   Spotlight this post!  
Unread 18-12-2016, 19:12
Bkeeneykid's Avatar
Bkeeneykid Bkeeneykid is offline
#wheatcoastneatcoast
AKA: Devin Keeney
FRC #1982 (Cougar Robotics); Season Long Fantasy FIRST (F3)
Team Role: Student
 
Join Date: Feb 2015
Rookie Year: 2015
Location: Lenexa, Kansas
Posts: 273
Bkeeneykid has much to be proud ofBkeeneykid has much to be proud ofBkeeneykid has much to be proud ofBkeeneykid has much to be proud ofBkeeneykid has much to be proud ofBkeeneykid has much to be proud ofBkeeneykid has much to be proud ofBkeeneykid has much to be proud of
Re: C++ motor assignments

Quote:
Originally Posted by Robodragons4630 View Post
I plan on using the motors in a 4 wheel drive mecanum base. The configuration is going to be cross. Mecanum wheels by default are crossed so I saw no harm in doing the same with the motor controllers. If there is a true issue with this other than prolonged use can cause then I will look over other possibilities. Thanks for the response!
Mecanum wheels are a little different. I guess it was bad of me for assuming tank drive. With mecanum drives, there's significantly less issue than a tank drive. Because each one is on rollers, you don't have issues of stalling and back driving that you would with the second example up there. You still have issues with potentially offset voltage, but that's pretty easy to solve with a encoder on each wheel. That's expensive, and you might as well just buy more motor controllers with that money, but it'll work. Good luck with your project!
__________________

F4 Network Website Designer

2010-2012: A Whole Buncha FLL Teams; Team Spirit, Gracious Professionalism Award winner
2015-Current: FRC 1982, Captain, Electrical Lead
Beginning FIRST Volunteer

Moderator on the FIRSTwiki
Reply With Quote
  #5   Spotlight this post!  
Unread 18-12-2016, 19:22
Robodragons4630 Robodragons4630 is offline
CHS Robodragons Programming
AKA: Noah Jarnigan
FRC #4630 (Robodragons)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2014
Location: Clinton, Tennessee
Posts: 15
Robodragons4630 is an unknown quantity at this point
Re: C++ motor assignments

Quote:
Originally Posted by Bkeeneykid View Post
Mecanum wheels are a little different. I guess it was bad of me for assuming tank drive. With mecanum drives, there's significantly less issue than a tank drive. Because each one is on rollers, you don't have issues of stalling and back driving that you would with the second example up there. You still have issues with potentially offset voltage, but that's pretty easy to solve with a encoder on each wheel. That's expensive, and you might as well just buy more motor controllers with that money, but it'll work. Good luck with your project!
Alright thanks! Well our team is currently breaking off into 3 groups and we are building 2 KOP drop six bases and one mecanum to teach the new people how stuff works. So I thought by using TalonSR's for PWMs and TalonSRX's for can would teach mechanical, electrical, and programming the disadvantages, advantages, and how to do both types of motor controllers.

(Yes I said drop 6 and we are only using one cim for each gear box on those. I understand they will drift and I planed to use that to my advantage because it would throw in a curveball that the new programmers would have to figure out how to get around in the fastest and easiest time possible. A good prep. for build season )
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 10:02.

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