View Full Version : Motor only responds to one way
18mfogwell
13-03-2014, 11:26
We are programming with the Attack 3 controller and the motor only goes down.
What should the program be to have the motors go back up?
Key points:
We are using the Y axis
We can only get the motors to go down
Using NetBeans
Andrew Lobos
13-03-2014, 11:32
Are you doing anything before calling the motor controller's set() method? (deadband check, scaling, etc)
When you move the joystick in the up direction, does your motor controller show it is receiving a signal to move in that direction? If so, there may be a mechanical reason that the motor isn't moving rather than software/electrical.
18mfogwell
13-03-2014, 11:43
Are you doing anything before calling the motor controller's set() method? (deadband check, scaling, etc)
When you move the joystick in the up direction, does your motor controller show it is receiving a signal to move in that direction? If so, there may be a mechanical reason that the motor isn't moving rather than software/electrical.
No deadband check or scaling.
The upward motion of the robot has worked before when on buttons, just not through the axis.
This is what the part of the program is currently.
Pulley.set(operator.getY());
Problems with this?
Andrew Lobos
13-03-2014, 12:07
Code-wise that is fine.
Does the motor controller LED react to movement on the joystick?
Also, if you're using Jaguars: I know they have a feature where you can have it handle checking for limit switch stops. I haven't used Jags since 2011, but based on the guide (http://content.vexrobotics.com/docs/217-3367-VEXpro_Jaguar_GettingStartedGuide.pdf) you should have two vertical jumpers on the far right pins.
18mfogwell
13-03-2014, 12:12
Code-wise that is fine.
Does the motor controller LED react to movement on the joystick?
Also, if you're using Jaguars: I know they have a feature where you can have it handle checking for limit switch stops. I haven't used Jags since 2011, but based on the guide (http://content.vexrobotics.com/docs/217-3367-VEXpro_Jaguar_GettingStartedGuide.pdf) you should have two vertical jumpers on the far right pins.
Both LED lights stay solid.
We have the jumpers on brake, if that's what you are saying.
Both LED lights stay solid.
We have the jumpers on brake, if that's what you are saying.
Make sure there are 2 jumpers set as such in this picture. If so, re-seat them:
http://i233.photobucket.com/albums/ee153/natecmiel/jag.jpg (http://s233.photobucket.com/user/natecmiel/media/jag.jpg.html)
Make sure there are 2 jumpers set as such in this picture. If so, re-seat them:
http://i233.photobucket.com/albums/ee153/natecmiel/jag.jpg (http://s233.photobucket.com/user/natecmiel/media/jag.jpg.html)
They can be turned 180° (automatic ramp mode), but they need to be there.
gpetilli
13-03-2014, 13:52
Both LED lights stay solid.
What do you mean by "both" LED lights? There is one LED and it can be one of three colors - Red, yellow or green. yellow is neutral (break in your case). When you say solid, do you mean you get a solid red in one direction and solid green in the other? I believe if it thinks it hit a limit switch, it will blink the direction color. If you only see one color, there is an issue with your commanded value. If you square the joystick value, remember to do joyY * abs(joyY) to preserve the sign.
18mfogwell
15-03-2014, 21:47
What do you mean by "both" LED lights? There is one LED and it can be one of three colors - Red, yellow or green. yellow is neutral (break in your case). When you say solid, do you mean you get a solid red in one direction and solid green in the other? I believe if it thinks it hit a limit switch, it will blink the direction color. If you only see one color, there is an issue with your commanded value. If you square the joystick value, remember to do joyY * abs(joyY) to preserve the sign.
Oops that was a mistake.
The jaguars color doesn't actually change. It stays a solid scarlet color the entire time even when in moves in the one direction and doesn't move in the other.
I do not square the joystick value, should I?
I do not square the joystick value, should I?
Some drivers find that this increases responsiveness, but it is definitely not required (nor will it fix your issue, I think it was mentioned because it will cause the symptoms you are experiencing). If you do, though, make sure you either square it as gpetilli mentioned, or cube it, to allow for negative values.
Is this an issue with the one joystick, or do you guys have extra joysticks to use instead?
lucas.alvarez96
15-03-2014, 22:22
Pulley.set(operator.getY());
We always use it like this:
Pulley.set(operator.getAxis(Joystick.AxisType.kY);
18mfogwell
15-03-2014, 22:28
Some drivers find that this increases responsiveness, but it is definitely not required (nor will it fix your issue, I think it was mentioned because it will cause the symptoms you are experiencing). If you do, though, make sure you either square it as gpetilli mentioned, or cube it, to allow for negative values.
Is this an issue with the one joystick, or do you guys have extra joysticks to use instead?
I just cannot get the program to work on the Y axis. The program for the buttons work fine on the same controller. I thought the code was fine, but obviously not since it isn't working.
Alan Anderson
16-03-2014, 00:01
I thought the code was fine, but obviously not since it isn't working.
Show us your program if you want us to look it over.
18mfogwell
16-03-2014, 10:16
Pulley.set(operator.getAxis(Joystick.AxisType.kY);
Would the Joystick be replaced as "operator" and AxisType replaced as "Y"?
In other words, is this how the code would look? What would need to be replaced?
18mfogwell
16-03-2014, 10:22
Show us your program if you want us to look it over.
Here is the some of the operator control period:
public void operatorControl()
{
double joyL, joyR, joyF;
joyL = joyR = 0;
double speed, Fspeed;
while ( isOperatorControl() && isEnabled() )
{
if(RightDriver.getRawButton(5))
{
speed = 0.88;
}
else if(LeftDriver.getRawButton(5))
{
speed = 0.88;
}
else
{
speed = 0.88;
}
joyL = 0.7*LeftDriver.getRawAxis(2) + 0.3*joyL;
joyR = 0.7*LeftDriver.getRawAxis(4) + 0.3*joyR;
//System.out.println(LeftDriver.getRawAxis(4));
//DriverStationLCD.getInstance().println(DriverStati onLCD.Line.kUser1, 1, "Left: " + joyL*speed + " ");
//DriverStationLCD.getInstance().println(DriverStati onLCD.Line.kUser2, 1, "Right: " + joyR*speed + " ");
drivetrain.tankDrive(-joyL*speed,-joyR*speed);
Pulley.set(operator.getY());
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.