Go to Post Our prototypes are good and running, now just need to do some magic to transform all that wood to aluminum. :eek: - FIRSTMa2104 [more]
Home
Go Back   Chief Delphi > Technical > Electrical
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 05-04-2016, 11:11
RyanN's Avatar
RyanN RyanN is offline
RyanN
AKA: Ryan Nazaretian
FRC #4901 (Garnet Squadron)
Team Role: Mentor
 
Join Date: Jun 2006
Rookie Year: 2005
Location: Columbia, SC
Posts: 1,126
RyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond repute
Re: Victor SP toggling from neutral to forward when enabled

Quote:
Originally Posted by Aventek View Post
When our robot is enabled, one of our victor sp's constantly swaps from neutral to forward.
we have tried:
  • swapping the victor with a new one
  • swapping and reimaging the roboRIO
  • changing the cables to and from victor(power and motor output)
  • swapping PWM location on the roboRIO
This is dumbfounding our team and we have no idea whats up with the ghost motor. The only possibility we have thought of is the code, but we cannot find anything. If anyone could take a look at the code or has any idea what else could be the problem, please comment. This is our repository on GitHub: https://github.com/Aventek/ExarchCode
My best guess, as it seems like a really common issue that I debug, is that you are setting the motor speed in two different places.

What motor is giving you trouble in the code? I have found these:
Code:
public static final int leftRearDrivePWM = 3;//3
public static final int leftFrontDrivePWM = 2;//0
public static final int rightRearDrivePWM = 1;//1 
public static final int rightFrontDrivePWM = 0;//2 
public static final int leftLaunchPWM = 4; 
public static final int rightLaunchPWM = 5;
public static final int liftAnglerPWM = 6;  
public static final int liftAngler2PWM =7;
public static final int launchAnglerPWM = 8;
public static final int intakeArmsPMW = 9;
Looking through your code, I'm placing my bets on the launch motor.

In commands/Launch.java, you're calling Robot.launcher.launch(shootSpeed) and Robot.launcher.intakeControl(0):
Code:
protected void execute() {
		
		// spinning launcher motors
		if (Robot.oi.buttonLaunch.get()) {
			// when lBump is held down run motors for launching
			Robot.launcher.launch(shootSpeed);
			Robot.launcherState = LauncherState.LAUNCH;
		} else if (Robot.oi.buttonIntake.get()) {
			// when rBump is held down run motors for intake
			Robot.launcherState = LauncherState.INTAKE;
			Robot.launcher.launch(loadSpeed);
			Robot.launcher.intakeControl(barSpeed);
			Robot.launcherState = LauncherState.INTAKE;
		} else if (auto){
			Robot.launcher.launch(shootSpeed);
			Robot.launcher.intakeControl(0);
			Robot.launcherState = LauncherState.AUTO;
			
		} else {
			// when neither are held down dont run motors
			Robot.launcher.intakeControl(0);
			Robot.launcher.launch(0);
			Robot.launcherState = LauncherState.STILL;
		}
		
		if(Robot.anglerState != AnglerState.PID){
			// activate angler
			if (Robot.oi.buttonShooterDown.get()) {
				// when B is held down angle launcher down
				Robot.launcher.angleLauncher(motorDownSpeed);
				Robot.anglerState = AnglerState.ANGLING_DOWN;
			} else if (Robot.oi.buttonShooterUp.get()) {
				// when X is held down, angle launcher up
				Robot.launcher.angleLauncher(motorUpSpeed);
				Robot.anglerState = AnglerState.ANGLING_UP;
			} else {
				// stop angling
				Robot.launcher.angleLauncher(0);
				Robot.anglerState = AnglerState.STILL;
			}
		}
		
		//control servo based on state
		if(Robot.servoState == ServoState.RETRACTED){
//			Robot.launcher.servoControl(extendedPosition);
		} else if(Robot.servoState == ServoState.EXTENDED){
//			Robot.launcher.servoControl(retractedPosition);
		}

	}
Take a look at the subsystem code for those two commands in subsystem/Launcher.java:
Code:
	public void intakeControl(double speed){
		
		leftLaunch.set(-.4);
		rightLaunch.set(-.4);
		intakeBar.set(speed);
	
	}

	// sets launch motors to spin and then set servo to firing position
	public void launch(double speed) {

		// setting launch motors
		leftLaunch.set(speed);
		rightLaunch.set(speed);

	}
You're setting the speed in two different places. That will cause issues.
__________________
Garnet Squadron
FRC 4901
Controls Mentor
@rnazaretian

Previous mentor and student from Team Fusion, FRC 364
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 10:38.

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