Go to Post Just like any good hardware or software product, "insert foot before putting mouth in gear"..... - dhitchco [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

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 01-02-2010, 14:44
Bryscus's Avatar
Bryscus Bryscus is offline
EE, CpE
AKA: Bryce B.
FRC #0180 (SPAM)
Team Role: Engineer
 
Join Date: Jan 2009
Rookie Year: 1999
Location: Jupiter, FL
Posts: 173
Bryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud of
RobotDrive Bug?

Hi Guys,

I have a weird situation that I've come across. I'll start with the back story:

Using last year's cRio setup, we have 4 Jags and 4 Victors. I have implemented the CAN interface using the Jags. Our robot requires 5 Jags to drive. Hence, I have a dilemma where I'm short one Jaguar. So the quick fix was to use 4 Jags and 1 Victor. This would not be the final configuration, but I figured it would work for the meantime. Just to get something up and running quickly, I made use of the RobotDrive class. I instantiated the class in its 4 wheel drive mode and used the arcade function using 3 Jags and 1 Victor (again, I know this isn't necessarily a good idea). The 4th Jag is being used for position control using the closed-loop position mode on the Jags over the CAN interface. I then make use of the ArcadeDrive method of RobotDrive. Now, all the parts work separately, but when put together I can't get position mode anymore. Hence, the potential bug I'm seeing.

When I remove the Victor and replace it with a Jag, the code runs just fine. HOWEVER, I'm not sure why this SHOULDN'T work because the constructor for the 4 wheel drive method uses the SpeedController class from which both the Victors and Jags are derived. Thus, I'm at a loss to determine why this is happening. Everything seems fine in the provided WPI source code, but for some reason using a Victor hoses something else which then kills my CAN control. The position Jag will then move, but it won't move with feedback (like it's in kPercentVoltage mode or something).

Does anyone have any ideas?

- Bryce
__________________
The opulence of the front office decor varies inversely with the fundamental solvency of the firm.
  #2   Spotlight this post!  
Unread 01-02-2010, 15:27
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,587
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: RobotDrive Bug?

I'm having trouble following what you are doing in your code. Are you constructing a RobotDrive object with 3 CanJaguars and one Victor?

Regardless of whether you can get the software to work, I would not mix Jaguars and Victors in the same drivetrain and especially not in the same transmission. Look at these speed curves and think about what happens when you have an output of .1 to both the Jaguar and the Victor and the Jaguar is going 10% speed and the Victor is going 50%. You're motors will be fighting the whole time.
  #3   Spotlight this post!  
Unread 02-02-2010, 11:09
Bryscus's Avatar
Bryscus Bryscus is offline
EE, CpE
AKA: Bryce B.
FRC #0180 (SPAM)
Team Role: Engineer
 
Join Date: Jan 2009
Rookie Year: 1999
Location: Jupiter, FL
Posts: 173
Bryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud of
Re: RobotDrive Bug?

Quote:
Originally Posted by Joe Ross View Post
I'm having trouble following what you are doing in your code. Are you constructing a RobotDrive object with 3 CanJaguars and one Victor?

Regardless of whether you can get the software to work, I would not mix Jaguars and Victors in the same drivetrain and especially not in the same transmission. Look at these speed curves and think about what happens when you have an output of .1 to both the Jaguar and the Victor and the Jaguar is going 10% speed and the Victor is going 50%. You're motors will be fighting the whole time.
Thanks for your reply Joe, but how many times did I mention that this is only a temporary hack? Regardless of whether it's a smart thing to do, the code should still work. And yes, essentially it breaks when I instantiate with 3 Jags and 1 Victor. What's worse is that it breaks other code that isn't even part of the same class.

- Bryce
__________________
The opulence of the front office decor varies inversely with the fundamental solvency of the firm.
  #4   Spotlight this post!  
Unread 02-02-2010, 15:20
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: RobotDrive Bug?

Quote:
Originally Posted by Bryscus View Post
Thanks for your reply Joe, but how many times did I mention that this is only a temporary hack? Regardless of whether it's a smart thing to do, the code should still work. And yes, essentially it breaks when I instantiate with 3 Jags and 1 Victor. What's worse is that it breaks other code that isn't even part of the same class.

- Bryce
Bryce,

Can you describe exactly what happens? It's possible you found a bug, but we'll need you to do more experimentation to narrow it down.

You are using C++, right? I can't tell since you are in the generic Programming forum.

Are you getting any errors (in the diagnostics tab on the Driver Station)... the C++ classes use the ErrorBase and depending on where the errors get passed could cause this type of behavior. Other than that, I have no idea what could cause it.

-Joe
  #5   Spotlight this post!  
Unread 02-02-2010, 16:04
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: RobotDrive Bug?

Quote:
Originally Posted by Bryscus View Post
...The 4th Jag is being used for position control using the closed-loop position mode on the Jags over the CAN interface...
If you have 4 jags and 1 vic, put the 4 jags on drive and the vic on position control. I would do that much much much faster than putting a drive motor on a jag and a drive motor on a vic. The software will probably thank you too.

What is the advantage of using the CanJaguar's position control? You have analog inputs on the cRio, and since programmable controllers in FRC (back in the day... 1997?) people have been writing simple code to control position.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
  #6   Spotlight this post!  
Unread 03-02-2010, 10:29
Bryscus's Avatar
Bryscus Bryscus is offline
EE, CpE
AKA: Bryce B.
FRC #0180 (SPAM)
Team Role: Engineer
 
Join Date: Jan 2009
Rookie Year: 1999
Location: Jupiter, FL
Posts: 173
Bryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud of
Re: RobotDrive Bug?

Quote:
Originally Posted by jhersh View Post
Bryce,

Can you describe exactly what happens? It's possible you found a bug, but we'll need you to do more experimentation to narrow it down...

-Joe
Joe,

I'll look for messages tonight and try to get back to you.

Quote:
Originally Posted by apalrd View Post
If you have 4 jags and 1 vic, put the 4 jags on drive and the vic on position control. I would do that much much much faster than putting a drive motor on a jag and a drive motor on a vic. The software will probably thank you too.

What is the advantage of using the CanJaguar's position control? You have analog inputs on the cRio, and since programmable controllers in FRC (back in the day... 1997?) people have been writing simple code to control position.
apalrd,

Yes, you are correct about your description. We could set it up that way you specify with closed loop calculations being performed on the cRio itself. I started on SPAM 10 years ago and have seen the capability of even the old controllers (back in the PBasic days). But currently, our final assembly has a motor with quad encoder attached, hence the reason for trying this. I was using the Jag in position control mode because that is what the final configuration will be. Why write code for something that will not be used again? I will repeat myself again though...that is not the focus of my original post. The point is, however stupid it may be, that the RobotDrive class hoses another Jag (at least that appears to be what I'm seeing) when two different SpeedController inherited classes are passed to the RobotDrive class. We meet tonight and I will try to post a more detailed description.

- Bryce

P.S. It's really just a moot point because I have already replaced the Victor with a Jag in the box. I just thought I'd bring up some weird behavior that I witnessed.
__________________
The opulence of the front office decor varies inversely with the fundamental solvency of the firm.

Last edited by Bryscus : 03-02-2010 at 10:31.
Closed Thread


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
RobotDrive + PIDController = possible? oddjob C/C++ 4 14-01-2010 23:33
editing robotDrive class help mikelowry C/C++ 2 07-10-2009 13:25
need help understanding c code in robotdrive mahmosh C/C++ 14 16-01-2009 08:56
bug? Duke 13370 CD Forum Support 4 30-12-2003 21:44
Bug Matt Leese CD Forum Support 7 14-06-2001 12:18


All times are GMT -5. The time now is 21:22.

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