Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Robot Arm Victor Motor (http://www.chiefdelphi.com/forums/showthread.php?t=92025)

Robby Unruh 16-02-2011 17:18

Robot Arm Victor Motor
 
Our team's mechanical engineer insist's our arm not working is a program error. I don't think so, so I just want to double check here.

Code:

Victor arm;

public void robotMain() {
    arm = new Victor(10);
}

public void operatorControl() {
    while(isOperatorControl()) {
        getWatchdog().setEnabled(true);
        getWatchdog().feed();

        if(joy.getRawButton(10)) {
            arm.set(-0.2); // arm goes down.
        } else if(joy.getRawButton(11)) {
            arm.set(0.2); // arm goes up.
        }
    }
}


Joe Ross 16-02-2011 17:24

Re: Robot Arm Victor Motor
 
Can you describe what the problem with the arm is? Just looking at the code, once the arm starts moving, the arm will always be moving in one direction or the other, which might not be desirable.

Robototes2412 16-02-2011 17:30

Re: Robot Arm Victor Motor
 
Code:

public void operatorControl() {
    while(isOperatorControl()) {
        getWatchdog().setEnabled(true);
        getWatchdog().feed();

        if(joy.getRawButton(10)) {
            arm.set(-0.2); // arm goes down.
        } else if(joy.getRawButton(11)) {
            arm.set(0.2); // arm goes up.
        } else {
            arm.set(0);
        }
    }
}

Did you check the pwm?

Robby Unruh 16-02-2011 18:05

Re: Robot Arm Victor Motor
 
Sorry, I mean the arm doesn't move at all.
It is plugged in to channel 10.

Patrickwhite 16-02-2011 19:24

Re: Robot Arm Victor Motor
 
Can you show us where you initialize arm? That may be the problem.

Robby Unruh 16-02-2011 19:55

Re: Robot Arm Victor Motor
 
Quote:

Originally Posted by Patrickwhite (Post 1024668)
Can you show us where you initialize arm? That may be the problem.

All arm-related code is given above. It is initalized in the robotMain function.

Joe Ross 16-02-2011 20:06

Re: Robot Arm Victor Motor
 
Here's a number of non-code related things that could cause a motor not to move:

You didn't enable the robot on the driver station
You didn't plug the PWM cables from the victor to the digital sidecar PWM ports
The PWM cable missed the connector inside the shroud on the victor (this is very easy to do).
You didn't power the digital sidecar
The digital sidecar isn't plugged into the digital module in slot 4 of the cRIO
You have the PWM cables plugged in backwards. B is for black wire.
You have the PWM cables plugged into the wrong PWM ports on the digital sidecar.
The circuit breaker is immediately tripping.
The speed controller isn't powered.
The motor isn't connected to the speed controller.

Knowing what the LED is doing on the speed controller would help narrow down the problem

Robby Unruh 17-02-2011 08:49

Re: Robot Arm Victor Motor
 
Quote:

Originally Posted by Joe Ross (Post 1024687)
You didn't enable the robot on the driver station
You didn't plug the PWM cables from the victor to the digital sidecar PWM ports
The PWM cable missed the connector inside the shroud on the victor (this is very easy to do).
You didn't power the digital sidecar
The digital sidecar isn't plugged into the digital module in slot 4 of the cRIO
You have the PWM cables plugged in backwards. B is for black wire.
You have the PWM cables plugged into the wrong PWM ports on the digital sidecar.
The circuit breaker is immediately tripping.
The speed controller isn't powered.
The motor isn't connected to the speed controller.

We covered the majority of those grounds last night. We plan on re-checking today after school.

However, the motor is getting power, and is blinking orange.

drakesword 17-02-2011 08:56

Re: Robot Arm Victor Motor
 
Are you sure you are pushing "Button 10 and Button 11"?

For laughs and tickles try using the joystick value to eliminate any posability that it is the mechanical/elecrtical problems.

x2 on checking the connection of the pwm cable.

I hated redoing pwm cables on the victors they always seem to not go into the header when you need it to!

Jared Russell 17-02-2011 09:01

Re: Robot Arm Victor Motor
 
Blinking orange on the Victor suggests a problem with the PWM cable connection (or you never initialized "arm").

Robby Unruh 17-02-2011 09:14

Re: Robot Arm Victor Motor
 
Quote:

Originally Posted by Jared341 (Post 1024985)
Blinking orange on the Victor suggests a problem with the PWM cable connection (or you never initialized "arm").

In the actual code we had only done:

Code:

Victor arm = new Victor(10);
outside of robotMain. Could that actually be the problem? I never thought it mattered.

omalleyj 17-02-2011 11:27

Re: Robot Arm Victor Motor
 
Are you sure that 0.2 will overcome the inertia of the arm? Do the motors hum or get warm at all? You can test the output side of the victor with a multimeter.

Robby Unruh 17-02-2011 11:39

Re: Robot Arm Victor Motor
 
Quote:

Originally Posted by omalleyj (Post 1025097)
Are you sure that 0.2 will overcome the inertia of the arm? Do the motors hum or get warm at all? You can test the output side of the victor with a multimeter.

The multimeter shows no change.

omalleyj 17-02-2011 11:55

Re: Robot Arm Victor Motor
 
Quote:

Originally Posted by Robby Unruh (Post 1025106)
The multimeter shows no change.

The code shown is too simple to be 'wrong'. (though the addition of else ... 0.0 is a good idea).
The initialization issue mentioned by Jared341 would throw an exception (null pointer) in most, but not all cases. You need to make sure the object stays in scope all the time. Its not clear from your response to him if it does or not. Are you leaving the scope of the declaration right after setting the motor for instance? That would show no errors and not work.

Robby Unruh 17-02-2011 12:04

Re: Robot Arm Victor Motor
 
Quote:

Originally Posted by omalleyj (Post 1025109)
The code shown is too simple to be 'wrong'. (though the addition of else ... 0.0 is a good idea).
The initialization issue mentioned by Jared341 would throw an exception (null pointer) in most, but not all cases. You need to make sure the object stays in scope all the time. Its not clear from your response to him if it does or not. Are you leaving the scope of the declaration right after setting the motor for instance? That would show no errors and not work.

What do you mean "leaving the scope"?

omalleyj 17-02-2011 12:32

Re: Robot Arm Victor Motor
 
Quote:

Originally Posted by Robby Unruh (Post 1025112)
What do you mean "leaving the scope"?

An object only exists when in scope. For instance if you declare a variable in a method it is created and destroyed when the method is entered and exited.
I usually declare a motor in a class and call that classes constructor from my top level class (I use SimpleRobot usually) that way the motor exists from when the class is first instantiated and never goes away until exit.

The scenario I mentioned in the previous post only occurs when you do something like

public void motorStuff(){
motor = new Jaguar(1);
Jaguar.set(0.5);
}

The motor controller object will go away before it has time to do anything. Even if you call it repeatedly it won't last long enough to run for more than microseconds.

It doesn't seem to be the problem from the code you posted, but it doesn't hurt to ask.

Jared Russell 17-02-2011 13:26

Re: Robot Arm Victor Motor
 
Quote:

Originally Posted by Robby Unruh (Post 1024976)
...and is blinking orange.

To me, this remains the most conspicuous clue. A blinking orange speed controller is one that does not have a working connection to a properly configured PWM port on the digital sidecar. Be absolutely, positively sure your PWM connector is fully seated at both ends.

Robby Unruh 17-02-2011 15:03

Re: Robot Arm Victor Motor
 
Our mechanical team is tinkering with it now. I'll let you guys know what happens in the end. Thanks for all the advice.

DCRich 18-02-2011 23:56

Re: Robot Arm Victor Motor
 
Try connecting the arm to a pwm port with an address less than 9 (ie. 1 to 8). I have not personally used so many motors in the past but the schematics show that channels 9 and 10 are wired slightly differently than 1 - 8. You should try using a higher pulse duty cycle. Finally check to make sure that the black wire in the WRB cable is in the correct position. Victors allow the wire header to be inserted backwards.


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

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