Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Victors not working please help (http://www.chiefdelphi.com/forums/showthread.php?t=92375)

tomy 19-02-2011 20:09

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?????????

tomy 19-02-2011 22:12

Re: Victors not working please help
 
anyone?

CodeMonkeyMatt 19-02-2011 22:20

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?

theprgramerdude 20-02-2011 00:17

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.

dboisvert 20-02-2011 00:34

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.

CodeMonkeyMatt 20-02-2011 01:42

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.

theprgramerdude 20-02-2011 02:12

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...
}

tomy 20-02-2011 09:09

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

theprgramerdude 20-02-2011 10:11

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.

Mr. Lim 20-02-2011 10:21

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.

tomy 20-02-2011 11:19

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

tomy 20-02-2011 12:33

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)

tomy 20-02-2011 15:25

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);

tomy 20-02-2011 18:19

Re: Victors not working please help
 
anyone got advice?

CodeMonkeyMatt 20-02-2011 18:24

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.


All times are GMT -5. The time now is 13:39.

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