Go to Post ...we are all winners when people come out of this program and strive to make the world a better place. - Patrick Wang [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
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 16-02-2011, 17:18
Robby Unruh's Avatar
Robby Unruh Robby Unruh is offline
*insert random dial-up tone here*
FRC #3266 (Robots R Us)
Team Role: Coach
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Eaton, OH
Posts: 338
Robby Unruh will become famous soon enough
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.
        }
    }
}
__________________
[Robots R Us #3266]
2015: Georgia Southern Classic (Winners / Thanks 1319 & 1648!), Queen City
2014: Crossroads, Queen City
2013: Buckeye, Queen City, Crossroads
2012: Buckeye, Queen City

2011: Buckeye
2010: Buckeye
Reply With Quote
  #2   Spotlight this post!  
Unread 16-02-2011, 17:24
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,590
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: 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.

Last edited by Joe Ross : 16-02-2011 at 17:42.
Reply With Quote
  #3   Spotlight this post!  
Unread 16-02-2011, 17:30
Robototes2412's Avatar
Robototes2412 Robototes2412 is offline
1 * 4 != 14
FRC #2412 (Robototes)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2007
Location: Bellevue
Posts: 312
Robototes2412 is on a distinguished road
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?
__________________
Code:
class team2412(GP):
    def __init__(self):
        GP.__init__(self)
        self.coopertition = True
        self.info = {"name": "Robototes", "school": "Sammamish High School, Bellevue, WA"}
        assert self.kind_people == True
Reply With Quote
  #4   Spotlight this post!  
Unread 16-02-2011, 18:05
Robby Unruh's Avatar
Robby Unruh Robby Unruh is offline
*insert random dial-up tone here*
FRC #3266 (Robots R Us)
Team Role: Coach
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Eaton, OH
Posts: 338
Robby Unruh will become famous soon enough
Re: Robot Arm Victor Motor

Sorry, I mean the arm doesn't move at all.
It is plugged in to channel 10.
__________________
[Robots R Us #3266]
2015: Georgia Southern Classic (Winners / Thanks 1319 & 1648!), Queen City
2014: Crossroads, Queen City
2013: Buckeye, Queen City, Crossroads
2012: Buckeye, Queen City

2011: Buckeye
2010: Buckeye
Reply With Quote
  #5   Spotlight this post!  
Unread 16-02-2011, 19:24
Patrickwhite's Avatar
Patrickwhite Patrickwhite is offline
May the North be with you
FRC #0610 (The Coyotes)
Team Role: Programmer
 
Join Date: Dec 2008
Rookie Year: 2008
Location: Toronto
Posts: 88
Patrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of light
Re: Robot Arm Victor Motor

Can you show us where you initialize arm? That may be the problem.
__________________
while(!going.isTough());
tough.exit();

What will we do tonight, Warfa?
The same thing we do every night, Patrick. Sit and wait for Electrical.
Reply With Quote
  #6   Spotlight this post!  
Unread 16-02-2011, 19:55
Robby Unruh's Avatar
Robby Unruh Robby Unruh is offline
*insert random dial-up tone here*
FRC #3266 (Robots R Us)
Team Role: Coach
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Eaton, OH
Posts: 338
Robby Unruh will become famous soon enough
Re: Robot Arm Victor Motor

Quote:
Originally Posted by Patrickwhite View Post
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.
__________________
[Robots R Us #3266]
2015: Georgia Southern Classic (Winners / Thanks 1319 & 1648!), Queen City
2014: Crossroads, Queen City
2013: Buckeye, Queen City, Crossroads
2012: Buckeye, Queen City

2011: Buckeye
2010: Buckeye
Reply With Quote
  #7   Spotlight this post!  
Unread 16-02-2011, 20:06
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,590
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: 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
Reply With Quote
  #8   Spotlight this post!  
Unread 17-02-2011, 08:49
Robby Unruh's Avatar
Robby Unruh Robby Unruh is offline
*insert random dial-up tone here*
FRC #3266 (Robots R Us)
Team Role: Coach
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Eaton, OH
Posts: 338
Robby Unruh will become famous soon enough
Re: Robot Arm Victor Motor

Quote:
Originally Posted by Joe Ross View Post
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.
__________________
[Robots R Us #3266]
2015: Georgia Southern Classic (Winners / Thanks 1319 & 1648!), Queen City
2014: Crossroads, Queen City
2013: Buckeye, Queen City, Crossroads
2012: Buckeye, Queen City

2011: Buckeye
2010: Buckeye
Reply With Quote
  #9   Spotlight this post!  
Unread 17-02-2011, 08:56
drakesword drakesword is offline
Registered User
AKA: Bryant
FRC #0346 (Robohawks)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: USA
Posts: 200
drakesword is on a distinguished road
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!
Reply With Quote
  #10   Spotlight this post!  
Unread 17-02-2011, 09:01
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,080
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: Robot Arm Victor Motor

Blinking orange on the Victor suggests a problem with the PWM cable connection (or you never initialized "arm").
Reply With Quote
  #11   Spotlight this post!  
Unread 17-02-2011, 09:14
Robby Unruh's Avatar
Robby Unruh Robby Unruh is offline
*insert random dial-up tone here*
FRC #3266 (Robots R Us)
Team Role: Coach
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Eaton, OH
Posts: 338
Robby Unruh will become famous soon enough
Re: Robot Arm Victor Motor

Quote:
Originally Posted by Jared341 View Post
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.
__________________
[Robots R Us #3266]
2015: Georgia Southern Classic (Winners / Thanks 1319 & 1648!), Queen City
2014: Crossroads, Queen City
2013: Buckeye, Queen City, Crossroads
2012: Buckeye, Queen City

2011: Buckeye
2010: Buckeye
Reply With Quote
  #12   Spotlight this post!  
Unread 17-02-2011, 11:27
omalleyj omalleyj is offline
Registered User
AKA: Jim O'Malley
FRC #1279 (Cold Fusion)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2008
Location: New Jersey
Posts: 132
omalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to behold
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.
Reply With Quote
  #13   Spotlight this post!  
Unread 17-02-2011, 11:39
Robby Unruh's Avatar
Robby Unruh Robby Unruh is offline
*insert random dial-up tone here*
FRC #3266 (Robots R Us)
Team Role: Coach
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Eaton, OH
Posts: 338
Robby Unruh will become famous soon enough
Re: Robot Arm Victor Motor

Quote:
Originally Posted by omalleyj View Post
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.
__________________
[Robots R Us #3266]
2015: Georgia Southern Classic (Winners / Thanks 1319 & 1648!), Queen City
2014: Crossroads, Queen City
2013: Buckeye, Queen City, Crossroads
2012: Buckeye, Queen City

2011: Buckeye
2010: Buckeye
Reply With Quote
  #14   Spotlight this post!  
Unread 17-02-2011, 11:55
omalleyj omalleyj is offline
Registered User
AKA: Jim O'Malley
FRC #1279 (Cold Fusion)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2008
Location: New Jersey
Posts: 132
omalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to behold
Re: Robot Arm Victor Motor

Quote:
Originally Posted by Robby Unruh View Post
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.
Reply With Quote
  #15   Spotlight this post!  
Unread 17-02-2011, 12:04
Robby Unruh's Avatar
Robby Unruh Robby Unruh is offline
*insert random dial-up tone here*
FRC #3266 (Robots R Us)
Team Role: Coach
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Eaton, OH
Posts: 338
Robby Unruh will become famous soon enough
Re: Robot Arm Victor Motor

Quote:
Originally Posted by omalleyj View Post
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"?
__________________
[Robots R Us #3266]
2015: Georgia Southern Classic (Winners / Thanks 1319 & 1648!), Queen City
2014: Crossroads, Queen City
2013: Buckeye, Queen City, Crossroads
2012: Buckeye, Queen City

2011: Buckeye
2010: Buckeye
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 13:16.

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