Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   General Forum (http://www.chiefdelphi.com/forums/forumdisplay.php?f=16)
-   -   Programming Victors in Java (http://www.chiefdelphi.com/forums/showthread.php?t=126379)

18mfogwell 13-02-2014 09:07

Programming Victors in Java
 
The window motor on our robot is not working. Is the problem in our program??

if(operator.getRawButton(6))
{
Pulley.set(-1.0);
}
else if(operator.getRawButton(3))
{
Pulley.set(1.0);
}
else
{
Pulley.set(0);
}

if(operator.getRawButton(4))
{
Scoop.set(-1.0);
}
else if(operator.getRawButton(5))
{
Scoop.set(1.0);
}
else
{
Scoop.set(0);
}

if(operator.getRawButton(1))
{
Window.set(-1.0);
}
else if(operator.getRawButton(2))
{
Window.set(1.0);
}
else
{
Window.set(0);
}

Any help would be greatly appreciated!

Thanks!!

eddie12390 13-02-2014 09:11

Re: Programming Victors in Java
 
Can you also post the declaration and initialization of the Victor object?

The things that you have posted seem to be alright, do the other motors work correctly?

notmattlythgoe 13-02-2014 09:13

Re: Programming Victors in Java
 
Code:

if(operator.getRawButton(6)) {
    Pulley.set(-1.0);
} else if(operator.getRawButton(3)) {
    Pulley.set(1.0);
} else  {
    Pulley.set(0);
}

if(operator.getRawButton(4)) {
    Scoop.set(-1.0);
} else if(operator.getRawButton(5)) {
    Scoop.set(1.0);
} else {
    Scoop.set(0);
}

if(operator.getRawButton(1)) {
    Window.set(-1.0);
} else if(operator.getRawButton(2)) {
    Window.set(1.0);
} else  {
    Window.set(0);
}

One thing just for future reference. Convention when writing java is to name your variables with a lowercase letter for the first letter. Also, can I see the code you used to set up the motors? What is the light doing on the motor controller when you try to run it?

P.S. I didn't change anything in the code, just reorganized it a bit.

18mfogwell 13-02-2014 09:16

Re: Programming Victors in Java
 
Yes, drive motors work (they are not listed in the program above) but none of the motors on victors work which are the ones in the program above.


What is the declaration and initialization of the Victor?

eddie12390 13-02-2014 09:17

Re: Programming Victors in Java
 
Quote:

Originally Posted by 18mfogwell (Post 1342325)
Yes, drive motors work (they are not listed in the program above) but none of the motors on victors work which are the ones in the program above.


What is the declaration and initialization of the Victor?

The part where you say Victor Window = new Victor(port);

notmattlythgoe 13-02-2014 09:18

Re: Programming Victors in Java
 
Quote:

Originally Posted by 18mfogwell (Post 1342325)
Yes, drive motors work (they are not listed in the program above) but none of the motors on victors work which are the ones in the program above.


What is the declaration and initialization of the Victor?

It's the part where you did this:

Code:

Victor Window = new Victor(1);
Are the lights on the victors indicating the motors should be moving, are they blinking orange, or are they staying solid orange?

18mfogwell 13-02-2014 09:18

Re: Programming Victors in Java
 
1 Attachment(s)
Here is our whole code.

18mfogwell 13-02-2014 09:19

Re: Programming Victors in Java
 
The victors blink orange.

notmattlythgoe 13-02-2014 09:20

Re: Programming Victors in Java
 
Quote:

Originally Posted by 18mfogwell (Post 1342331)
The victors blink orange.

That means that they are never getting communication with the cRIO, are you sure that the PWM's are plugged into the correct channels on the digital sidecar?

18mfogwell 13-02-2014 09:33

Re: Programming Victors in Java
 
Yes. We double checked that they were plugged in correctly, and we put on a brand new Digital Sidecar so no ports should be broken.

Any other ideas?

notmattlythgoe 13-02-2014 09:34

Re: Programming Victors in Java
 
Quote:

Originally Posted by 18mfogwell (Post 1342336)
Yes. We double checked that they were plugged in correctly, and we put on a brand new Digital Sidecar so no ports should be broken.

Any other ideas?

It's not a code issue that I can see. What motor controllers are you using for your drivetrain?

18mfogwell 13-02-2014 09:35

Re: Programming Victors in Java
 
Quote:

Originally Posted by notmattlythgoe (Post 1342337)
It's not a code issue that I can see. What motor controllers are you using for your drivetrain?

Jaguars for the driving.

eddie12390 13-02-2014 09:36

Re: Programming Victors in Java
 
Quote:

Originally Posted by 18mfogwell (Post 1342336)
Yes. We double checked that they were plugged in correctly, and we put on a brand new Digital Sidecar so no ports should be broken.

Any other ideas?

Can you take the PWM cable out of the Window motor Victor and verify that all of the pins are 100% straight? Plugging the PWM cable in correctly can sometimes take a few tries and if the pins are even a little bent they may not have been making good contact.

Based on the Victor datasheet, the problem that you are describing is an improperly wired PWM cable or no PWM cable at all.

Code:

Indication
: Flashing ORANGE indicator on power up.
Problem
: No PWM signal.
Possible Solutions
:
1.
Ensure the transmitter and receiver are powered ON.

2.
The PWM cable may be improperly connected.
Check wire color-coding at each end. Check that
the connector is not off a
pin at the receiver end.

3.
Check for a good PWM signal by connecting a
known good servo to the PWM extension cable. If
the servo does not move, this can indicate either:
a) a faulty receiver
b) an improperly connected cable
c) a bad PWM extension cable


Ether 13-02-2014 09:37

Re: Programming Victors in Java
 
Quote:

Originally Posted by 18mfogwell (Post 1342336)
Any other ideas?

Determine if you are actually getting a PWM signal in your PWM cable.

You can use an oscilloscope, or a simple digital voltmeter*, or you can plug the cable into a known-good Jaguar or Talon to test it.

* ask if you want more detail how to do this

18mfogwell 13-02-2014 10:30

Re: Programming Victors in Java
 
We think that we have verified the problem is in the code. Can somebody look at the code again and double check for errors?

Thanks!


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

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