|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||||
|
|||||
|
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.
}
}
}
|
|
#2
|
||||||
|
||||||
|
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. |
|
#3
|
||||
|
||||
|
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);
}
}
}
|
|
#4
|
|||||
|
|||||
|
Re: Robot Arm Victor Motor
Sorry, I mean the arm doesn't move at all.
It is plugged in to channel 10. |
|
#5
|
||||
|
||||
|
Re: Robot Arm Victor Motor
Can you show us where you initialize arm? That may be the problem.
|
|
#6
|
|||||
|
|||||
|
Re: Robot Arm Victor Motor
All arm-related code is given above. It is initalized in the robotMain function.
|
|
#7
|
||||||
|
||||||
|
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 |
|
#8
|
|||||
|
|||||
|
Re: Robot Arm Victor Motor
Quote:
However, the motor is getting power, and is blinking orange. |
|
#9
|
|||
|
|||
|
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! |
|
#10
|
|||||
|
|||||
|
Re: Robot Arm Victor Motor
Blinking orange on the Victor suggests a problem with the PWM cable connection (or you never initialized "arm").
|
|
#11
|
|||||
|
|||||
|
Re: Robot Arm Victor Motor
Quote:
Code:
Victor arm = new Victor(10); |
|
#12
|
|||
|
|||
|
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.
|
|
#13
|
|||||
|
|||||
|
Re: Robot Arm Victor Motor
The multimeter shows no change.
|
|
#14
|
|||
|
|||
|
Re: Robot Arm Victor Motor
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. |
|
#15
|
|||||
|
|||||
|
Re: Robot Arm Victor Motor
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|