Why doesn't our robot work!

Howdy everyone,
Our robot has 3 sparks, 2 motors, 1 camera.
Our CAN isn’t showing up on the web interface.
Our sparks don’t respond to the our controls.
Our camera doesn’t work either but this is way less important.
It seems we do have radio communication, and the roboRIO responds but simply put it just doesn’t do.

Feel free to ask me any questions!

~ Matthew

What is the third spark doing if you only have 2 motors?

The third spark is for the lifter.

You’re going to have to post some code or some pictures or both to get help this close to bag time.

Do the Sparks have any lights? How are they wired to the Rio?

The sparks all have power because they have a blue light blinking. They are wired to the RoboRIO via PWM cables. I can post our code if y’all want.
Our code is basically the default robot code.

Apparently we are getting a new error: Output not updated often enough.

What project template did you use? Probably iterative? That error means your code is getting stuck. You have to send a command the motors every cycle.

Our team had to bag but we’ll be testing during the competition. Our latest solution has been to turn off the motor safety. We of course couldn’t test it but we’re still open to solutions.

Thanks!

Teams will be able to help you at your event. Reach out now to nearby teams and start reading code that other teams published.

Figure out how to run the roborio simulator and you can do some testing before your event.

Thanks! I will keep that in mind.
We’ll try to figure out the simulator in the mean time.
Thank you so much for helping me!

Feel free to PM me your code and I can take a look if you’d like.

Please contact Mn Mentors on Call. They can help immediately and then at your regional.

http://mnfirst.org/first-community-resources/mn-mentors-on-call/

Also - 4607 is at Medtronic Foundation Regional and our Programming Helpline members will be there to assist as well.

Hey, I’m more than willing to help you out with your problems. I’m down is Prior Lake and have a test board or two laying around. I would be more than happy to work with your code and iron out your errors with you. Just let me know

Here is our code:


/* 2017-2018 Robot (FRC Power Up)
 * 
 */

/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
/* Open Source Software - may be modified and shared by FRC teams. The code   */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project.                                                               */
/*----------------------------------------------------------------------------*/

// TODO Add Vision Sensor (D)
// TODO Add Camera

package org.usfirst.frc.team2232.robot;

import edu.wpi.first.wpilibj.CameraServer;
import edu.wpi.first.wpilibj.Compressor;
import edu.wpi.first.wpilibj.DigitalInput;
import edu.wpi.first.wpilibj.DoubleSolenoid;
import edu.wpi.first.wpilibj.Encoder;
import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.Spark;
import edu.wpi.first.wpilibj.drive.DifferentialDrive;

/**
 * This is a demo program showing how to use Mecanum control with the RobotDrive
 * class.
 */
public class Robot extends IterativeRobot {

	private static final int kRearLeftChannel = 2;
	private static final int kRearRightChannel = 0;
	private static final int kLiftChannel = 1;
	final boolean useCamera = false;

	// Spark frontLeft;
	Spark rearLeft;
	// Spark frontRight;
	Spark rearRight;
	Spark lift;

	Compressor compressor;

	DoubleSolenoid gripper = new DoubleSolenoid(1, 2);

	DigitalInput boxDetector;

	//Encoder encoder;

	boolean lifting;

	double liftTo;

	private static final int kJoystickChannel = 0;

	private DifferentialDrive m_robotDrive;
	private Joystick m_stick;

	@Override
	public void robotInit() {
		
		// frontLeft = new Spark(kFrontLeftChannel);
		rearLeft = new Spark(kRearLeftChannel);
		rearLeft.setSafetyEnabled(false);
		// frontRight = new Spark(kFrontRightChannel);
		rearRight = new Spark(kRearRightChannel);
		lift = new Spark(kLiftChannel);
		compressor = new Compressor(0);
		compressor.setClosedLoopControl(true);
		boxDetector = new DigitalInput(0);
		//encoder = new Encoder(1, 2, false, Encoder.EncodingType.k4X);
		lifting = false;
		if (useCamera) {
			//CameraServer.getInstance().startAutomaticCapture();
		}

		// Invert the left side motors.
		// You may need to change or remove this to match your robot.
		// frontLeft.setInverted(true);
		rearLeft.setInverted(true);

		m_robotDrive = new DifferentialDrive(rearLeft, rearRight);

		m_stick = new Joystick(kJoystickChannel);

		
	}

	public void teleopInit() {
		lifting = false;
	}

	@Override
	public void teleopPeriodic() {
		// Use the joystick X axis for lateral movement, Y axis for forward
		// movement, and Z axis for rotation.
		// Below is the boxDectector, -> FIXED: accidently wired opposite, too lazy to change. Add
		// DON'T: inverse (!) before the boolean
		System.out.println("Detection: " + boxDetector.get());
		m_robotDrive.tankDrive(m_stick.getX(), m_stick.getY());  
		
		if (m_stick.getRawButton(3)) {
			lift.setSpeed(1);
			lifting = false;
		} else if (m_stick.getRawButton(4)) {
			lift.setSpeed(-1);
			lifting = false;
		} else if (lifting) {
			//double currentPosition = encoder.getDistance();
/*
			if (Math.abs(currentPosition - liftTo) < 0.01) {
				lift.setSpeed(0);
			} else if (liftTo > currentPosition) {
				lift.setSpeed(1);
			} else if (liftTo < currentPosition) {
				lift.setSpeed(-1);
			}*/
			System.out.println("SDFSD");

		} else {
			lift.setSpeed(0);
		}
		if (m_stick.getRawButton(5)) {
			gripper.set(DoubleSolenoid.Value.kForward);
		} else if (boxDetector.get()) {
			gripper.set(DoubleSolenoid.Value.kReverse);
		} else if (m_stick.getRawButton(6)) {
			gripper.set(DoubleSolenoid.Value.kReverse);
		} else {
			gripper.set(DoubleSolenoid.Value.kForward);

		}
		if (m_stick.getRawButton(7)) {
			lifting = true;
			liftTo = 0.5;
		}

		/*
		 * if(m_stick.getRawButton(7)) {
		 * doublesoleniod2.set(DoubleSolenoid.Value.kForward); } else
		 * if(m_stick.getRawButton(9)) {
		 * doublesoleniod2.set(DoubleSolenoid.Value.kReverse); } else {
		 * doublesoleniod2.set(DoubleSolenoid.Value.kOff);
		 * 
		 * } if(m_stick.getRawButton(11)) {
		 * doublesoleniod3.set(DoubleSolenoid.Value.kForward); } else
		 * if(m_stick.getRawButton(12)) {
		 * doublesoleniod3.set(DoubleSolenoid.Value.kReverse); } else {
		 * doublesoleniod3.set(DoubleSolenoid.Value.kOff);
		 * 
		 * }
		 */
	}
}

Thanks in advance!

EDIT:
Here is the code we used to just try Tank Drive (We used different wheels before we had to redo the frame)


/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
/* Open Source Software - may be modified and shared by FRC teams. The code   */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project.                                                               */
/*----------------------------------------------------------------------------*/

package org.usfirst.frc.team2232.robot;

import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.Spark;
import edu.wpi.first.wpilibj.drive.DifferentialDrive;

/**
 * This is a demo program showing the use of the RobotDrive class, specifically
 * it contains the code necessary to operate a robot with tank drive.
 */
public class Robot extends IterativeRobot {
	private DifferentialDrive m_myRobot;
	private Joystick m_leftStick;

	@Override
	public void robotInit() {
		m_myRobot = new DifferentialDrive(new Spark(0), new Spark(1));
		m_leftStick = new Joystick(0);
	}

	@Override
	public void teleopPeriodic() {
		m_myRobot.tankDrive(m_leftStick.getY(),m_leftStick.getX());
	}
}

Flashing blue means the SPARKs aren’t receiving a signal. If you don’t get this figured out before unbag, one of the early things I’d do is try replacing the SPARKs with some servos for testing purposes. If the servos work OK (swing one direction on forward, the other on reverse, to the middle when the joystick is released), start checking the PWM cables. If they don’t work, (and the servos are known good) it’s inside the RIO, most likely code but possibly a bad RIO, or shorted pins (e.g. swarf on the board).

With respect to your CANbus issues, have you used Phoenix Lifeboat to re-enable the functionality for the roboRIO web interface?

https://wpilib.screenstepslive.com/s/currentCS/m/getting_started/l/801080-new-for-2018

Are your PWM cables plugged in backwards? We had a similar error during offseason and discovered the PWM cables were plugged in wrong on the SPARKs.

My team will be at your regional, so come by and ask if you need help. I will not personally be there, but I guarantee you will get the help you need. We have always helped any teams that have asked, from programming to rewiring to mechanical help to constructing a new robot if need be. There will also be tons of outstanding teams at the Medtronic Foundation Regional that are quite selfless in giving help, so I am confident that you will have a working robot by Friday.

So terribly sorry, since they have changed the name to Medtronic, I mistakenly thought it was North Star. We will not be at 10,000 Lakes (now Medtronic), but across the way at North Star (which i mistakenly thought was Medtronic). I would take the advise of others in this thread and reach out for help. As I said before, there will be tons of outstanding teams willing to help you guys out. Just be sure to do so sooner then later. Best of luck.