Go to Post So why are we trying to go to Mars? It's because it's bigger, better, and bolder. Doing what nearly no other team can do, and defying all those who say it can't be done. That reward is a lot more than 9 points. - Mike [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 19-02-2011, 20:09
tomy tomy is offline
Registered User
FRC #3038 (I.C.E. Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Stacy, Minnesota
Posts: 495
tomy has a spectacular aura abouttomy has a spectacular aura about
Exclamation Victors not working please help

So this is our first year of using a second side car and its not working... here is the code:

Code:
vicShoulder(6,10);
we have power to the second side car and all the lights come on we do not have a light connected to it. we have the the power and connected. when we turn on our robot the victor status light blinks orange. we have tried these things:
  • switching pwms
  • swithing the pwm to the first side car and chaning the code
  • switching ports on the second side car
  • hooking up one of our jaguras to the pwm in the first side car

and it still blinks orange

any ideas?????????
Reply With Quote
  #2   Spotlight this post!  
Unread 19-02-2011, 22:12
tomy tomy is offline
Registered User
FRC #3038 (I.C.E. Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Stacy, Minnesota
Posts: 495
tomy has a spectacular aura abouttomy has a spectacular aura about
Re: Victors not working please help

anyone?
Reply With Quote
  #3   Spotlight this post!  
Unread 19-02-2011, 22:20
CodeMonkeyMatt CodeMonkeyMatt is offline
Registered User
FRC #2605
 
Join Date: Jan 2011
Rookie Year: 2008
Location: WA
Posts: 46
CodeMonkeyMatt is on a distinguished road
Re: Victors not working please help

Is it safe to assume that you declared vicShoulder as a Victor and not a Jaguar?

Can you get a Jaguar working on the second sidecar?
Reply With Quote
  #4   Spotlight this post!  
Unread 20-02-2011, 00:17
theprgramerdude theprgramerdude is offline
WPI Freshman
AKA: Alex
FRC #2503 (Warrior Robotics)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2008
Location: Brainerd, Minnesota
Posts: 347
theprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud of
Re: Victors not working please help

Could you post a more thorough section of the code, rather than one line? It'd help us a lot more in figuring things out.
__________________
Attending: MN Duluth Regional
Reply With Quote
  #5   Spotlight this post!  
Unread 20-02-2011, 00:34
dboisvert dboisvert is offline
Registered User
AKA: Dan Boisvert
FRC #2405 (Divided by Zero)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Michigan
Posts: 57
dboisvert is an unknown quantity at this point
Re: Victors not working please help

Make sure you are declaring the victor properly

Code:
Victor* vicShoulder;
Further down, you should have something along these lines
Where the PWM number is where you plug it into your digital sidecar

Code:
vicShoulder = new Victor(PWMNUMBERHERE);
Once the victor has been declared and constructed you need to actually call it or set it to some value

Code:
vicShoulder->Set(float value of speed);
Remember that once you set it you will want to also shut it back off by sending it a 0


Make the appropriate changes, and if still does not work put a multimeter on the proper pwm output channel to see if its a bad victor or not.
Reply With Quote
  #6   Spotlight this post!  
Unread 20-02-2011, 01:42
CodeMonkeyMatt CodeMonkeyMatt is offline
Registered User
FRC #2605
 
Join Date: Jan 2011
Rookie Year: 2008
Location: WA
Posts: 46
CodeMonkeyMatt is on a distinguished road
Re: Victors not working please help

Actually dboisvert, I suspect that tomy's writing his code based off the simple robot class, which doesn't use pointers, but creates objects directly. For that the syntax would be*:
Code:
Victor vicShoulder;
Then at the robot constructor:
Code:
RobotClassName():
vicShoulder(slotNum, portNum)
{
...
And then to use it:
Code:
vicShoulder.Set(speed);
Someone correct me if I'm wrong, especially tomy if this isn't how you're attempting to run the Victor.

I agree on your other points though. I don't know how many times I've forgotten to turn off a motor, or how many times I've poured through my code only to discover an electrical failure was the problem.

Also agree with theprgramerdude, more code = more help.


*This was from memory, so it might be off a little. Idea's the same though.
Reply With Quote
  #7   Spotlight this post!  
Unread 20-02-2011, 02:12
theprgramerdude theprgramerdude is offline
WPI Freshman
AKA: Alex
FRC #2503 (Warrior Robotics)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2008
Location: Brainerd, Minnesota
Posts: 347
theprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud of
Re: Victors not working please help

I believe Code Monkey has it exactly correct. Also, be sure you're not wiring the PWM cable in backwards to the Victor, as there are no markings if I can remember right on the case. In addition, make sure you initialize it right, with the ClassConstructor():
blablaobject(stuff),
morestuff(otherstuff),
vicShoulder(6,10) <- These lines are where you should make sure to initialize the constructors, and they have to be in the order you specified them in the class template.
{
more stuff here...
}
__________________
Attending: MN Duluth Regional
Reply With Quote
  #8   Spotlight this post!  
Unread 20-02-2011, 09:09
tomy tomy is offline
Registered User
FRC #3038 (I.C.E. Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Stacy, Minnesota
Posts: 495
tomy has a spectacular aura abouttomy has a spectacular aura about
Re: Victors not working please help

this is parts of our code:

Code:
 
RobotClass;
             Victor vicShoulder;

RobotVoid;
             vicshoulder(6,1);

WhileinOperatorControl{
.....
if(armstick2.getY()){
    vicShoulder.set(armstick2.getY);
}
i believe that is what we have

could it be an older victor that we cant program anymore cause we got stuff from an older team and the victors look old but they turn on and the fan works its just that the light blinks orange
Reply With Quote
  #9   Spotlight this post!  
Unread 20-02-2011, 10:11
theprgramerdude theprgramerdude is offline
WPI Freshman
AKA: Alex
FRC #2503 (Warrior Robotics)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2008
Location: Brainerd, Minnesota
Posts: 347
theprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud of
Re: Victors not working please help

Well, the first part looks funky and strange to me, as its still a bit out of scope (referring to, we need the code around the lines too), but what really caught my eye was the last few. Your "if" code makes no sense; what it's doing right now is getting the Y value off the joystick and checking whether its centered or not... that, and the Set command requires a capital S. Why not just remove the if statement altogether? It's useless.


All Victor 884's are the same; to my knowledge they haven't changed since they came out.

At the top of your code you have
vicshoulder(6,1);
For one thing, the S isn't capitalized again, and.... you need to initialize the Victor object in the class initilization section above the braces.
I'll put some of my similiar code here later.
__________________
Attending: MN Duluth Regional
Reply With Quote
  #10   Spotlight this post!  
Unread 20-02-2011, 10:21
Mr. Lim Mr. Lim is offline
Registered User
AKA: Mr. Lim
no team
Team Role: Leadership
 
Join Date: Jan 2004
Rookie Year: 1998
Location: Toronto, Ontario
Posts: 1,125
Mr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond repute
Re: Victors not working please help

Check that the PWM cable is inserted fully into the Victor, and all the pins are lining up perfectly straight into the connector. Sounds simple, but is often incredibly hard to do. The easy way to check is to pull the PWM cable out of the Victor, and if any, or all of your pins aren't PERFECTLY STRAIGHT, then you likely inserted it wrong. Even the slightest bit of deflection means that you likely missed the connector inside the Victor.

Inserting your PWM cable into the Victor should take almost no downward force, if aligned perfectly. If you have to push a little too hard to get the connector in, you've plugged it in wrong.
__________________
In life, what you give, you keep. What you fail to give, you lose forever...
Reply With Quote
  #11   Spotlight this post!  
Unread 20-02-2011, 11:19
tomy tomy is offline
Registered User
FRC #3038 (I.C.E. Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Stacy, Minnesota
Posts: 495
tomy has a spectacular aura abouttomy has a spectacular aura about
Re: Victors not working please help

Lol that was the wrong if statement

We are using two sensors with our shoulder joint and I do not have the code with me at the moment
Reply With Quote
  #12   Spotlight this post!  
Unread 20-02-2011, 12:33
tomy tomy is offline
Registered User
FRC #3038 (I.C.E. Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Stacy, Minnesota
Posts: 495
tomy has a spectacular aura abouttomy has a spectacular aura about
Re: Victors not working please help

Could it be that in my code i have an if statement that means this:

if the arm is triggering the front sensor the shoulder will not move unless you give a negative value. and if it is on the back sensor it will not move unless its on the front sensor.

But we do not have the senors hooked up yet, so could that be it?

For right now without the sensors on there cant i just do something like this to drive my shoulder joint?

Code:
vicShoulder.Set(armstick.GetY)
Reply With Quote
  #13   Spotlight this post!  
Unread 20-02-2011, 15:25
tomy tomy is offline
Registered User
FRC #3038 (I.C.E. Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Stacy, Minnesota
Posts: 495
tomy has a spectacular aura abouttomy has a spectacular aura about
Re: Victors not working please help

or do i have to something like this?

Code:
vic.Shoulder.Get(armstick.GetY);
or this

Code:
vic.Shoulder.Set->(armstick.GetY);
Reply With Quote
  #14   Spotlight this post!  
Unread 20-02-2011, 18:19
tomy tomy is offline
Registered User
FRC #3038 (I.C.E. Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Stacy, Minnesota
Posts: 495
tomy has a spectacular aura abouttomy has a spectacular aura about
Re: Victors not working please help

anyone got advice?
Reply With Quote
  #15   Spotlight this post!  
Unread 20-02-2011, 18:24
CodeMonkeyMatt CodeMonkeyMatt is offline
Registered User
FRC #2605
 
Join Date: Jan 2011
Rookie Year: 2008
Location: WA
Posts: 46
CodeMonkeyMatt is on a distinguished road
Re: Victors not working please help

If you're trying to read data from sensors that aren't hooked up and using that to determine whether or not to move, that could by your problem.

To run the Victor, you'll want the first one you posted. I'm sure you had the wrong syntax because you were typing from memory, not because you don't know it, but make sure it's
Code:
vicShoulder.Set(stickName.GetY())
Not
Code:
vicShoulder.Set(stickName.GetY)
Note the parentheses. If you don't have it, it should give a compiler error though, so probably not your problem.
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 03:07.

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