Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   General Forum (http://www.chiefdelphi.com/forums/forumdisplay.php?f=16)
-   -   Motor only responds to one way (http://www.chiefdelphi.com/forums/showthread.php?t=127822)

18mfogwell 13-03-2014 11:26

Motor only responds to one way
 
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

Re: Motor only responds to one way
 
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

Re: Motor only responds to one way
 
Quote:

Originally Posted by 4ndr3wl (Post 1358565)
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

Re: Motor only responds to one way
 
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/...artedGuide.pdf) you should have two vertical jumpers on the far right pins.

18mfogwell 13-03-2014 12:12

Re: Motor only responds to one way
 
Quote:

Originally Posted by 4ndr3wl (Post 1358582)
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/...artedGuide.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.

silverD 13-03-2014 12:30

Re: Motor only responds to one way
 
Quote:

Originally Posted by 18mfogwell (Post 1358587)
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:

cgmv123 13-03-2014 12:38

Re: Motor only responds to one way
 
Quote:

Originally Posted by silverD (Post 1358595)
Make sure there are 2 jumpers set as such in this picture. If so, re-seat them:

They can be turned 180° (automatic ramp mode), but they need to be there.

gpetilli 13-03-2014 13:52

Re: Motor only responds to one way
 
Quote:

Originally Posted by 18mfogwell (Post 1358587)
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

Re: Motor only responds to one way
 
Quote:

Originally Posted by gpetilli (Post 1358616)
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?

ErvinI 15-03-2014 22:21

Re: Motor only responds to one way
 
Quote:

Originally Posted by 18mfogwell (Post 1359378)
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

Re: Motor only responds to one way
 
Quote:

Pulley.set(operator.getY());
We always use it like this:

Quote:

Pulley.set(operator.getAxis(Joystick.AxisType.kY);

18mfogwell 15-03-2014 22:28

Re: Motor only responds to one way
 
Quote:

Originally Posted by ErvinI (Post 1359384)
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

Re: Motor only responds to one way
 
Quote:

Originally Posted by 18mfogwell (Post 1359388)
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

Re: Motor only responds to one way
 
Quote:

Originally Posted by lucas.alvarez96 (Post 1359385)
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

Re: Motor only responds to one way
 
Quote:

Originally Posted by Alan Anderson (Post 1359439)
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());


All times are GMT -5. The time now is 03:45.

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