|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools |
Rating:
|
Display Modes |
|
|
|
#1
|
|||
|
|||
|
Robot Spins on Start
Hello, our team is reconstructing a robot, and it is simply giving full power to the chassis motors when starting. It is not a programming issue, as it is disabled, and there is no code in the disabled method. Any thoughts? It still happens whenever the PWM cables are removed.
|
|
#2
|
||||
|
||||
|
Re: Robot Spins on Start
Just to be safe, can you provide your code?
Is there any short or problem with your motor controllers that could be providing the motors power? |
|
#3
|
||||
|
||||
|
Re: Robot Spins on Start
Verify that it can happen while the robot is disabled and when the PWMs are unplugged. If this is the case then you have an electrical issues which you should be able to find by tracing each of your wires.
If you can't find it visually you could first unplug everything, then slowly plug things back in (after turning the robot off again) and finding which individual thing is causing, or part of the problem. Do this as a last resort though, as forcing your robot to short like this isn't the best solution. Last edited by Monochron : 18-11-2014 at 18:30. |
|
#4
|
|||
|
|||
|
Re: Robot Spins on Start
I am our team's programmer, so I will post code, but I am certain that it is not the issue.
This code is from Ultimate Ascent, but it was our very basic rookie code. Code: Code:
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2008. 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 edu.wpi.first.wpilibj.templates;
import edu.wpi.first.wpilibj.Jaguar;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.SimpleRobot;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.camera.AxisCamera;
/**
* The VM is configured to automatically run this class, and to call the
* functions corresponding to each mode, as described in the SimpleRobot
* documentation. If you change the name of this class or the package after
* creating this project, you must also update the manifest file in the resource
* directory.
*/
public class RobotTemplate extends SimpleRobot {
/**
* This function is called once each time the robot enters autonomous mode.
*/
RobotDrive chassis = new RobotDrive (1, 2);
Joystick leftStick = new Joystick(1);
Joystick rightStick = new Joystick(2);
Jaguar shooterMotor1 = new Jaguar(3);
Jaguar shooterMotor2 = new Jaguar(4);
AxisCamera camera;
public void autonomous() {
/*
chassis.setSafetyEnabled(false);
chassis.drive(-0.5, 0.0);
Timer.delay(2.0);
chassis.drive(0.0, 0.0);
*/
}
public void disabled() {
chassis.drive(0.0, 0.0);
}
/**
* This function is called once each time the robot enters operator control.
*/
public void operatorControl() {
chassis.setSafetyEnabled(true);
// value from joystick's wheel
double v1;
camera = AxisCamera.getInstance();
chassis.drive(0.0, 0.0);
while (isOperatorControl() && isEnabled()) {
double left = leftStick.getY();
double right = rightStick.getY();
// if (left > -.1 && left < .1)
// {
// left = 0;
// }
// if (right > -.1 && right < .1)
// {
// right = 0;
// }
if (right < 0)
{
right = -1 * right * right;
}
if (right > 0)
{
right = right * right;
}
if (left < 0)
{
left = -1 * left * left;
}
if (left > 0)
{
left = left * left;
}
chassis.tankDrive(left, right);
// get value from the little wheel below stick
v1 = leftStick.getRawAxis(3);
// -1.0 is all the way up, 1.0 all the way down
//System.out.println(v1);
shooterMotor1.set(-v1);
shooterMotor2.set(-v1);
Timer.delay(0.01);
}
}
/**
* This function is called once each time the robot enters test mode.
*/
public void test() {
chassis.setSafetyEnabled(false);
chassis.drive(1, 1);
Timer.delay(2.0);
chassis.drive(-1, -1);
Timer.delay(2.0);
chassis.drive(0.0, 0.0);
}
}
|
|
#5
|
||||
|
||||
|
Re: Robot Spins on Start
This sounds like a common failure mode when voltage is applied to the wrong side of your motor controllers.
Be sure that the power coming from the power distribution board goes into the terminals labelled V+ and V- on the case of your Jaguars. The motor leads should attach to the M+ and M- terminals. Unfortunately, there is no protection against applying power to the wrong side of them, and most times will not work properly again if this has occurred. The best thing to do is to trace all of your wiring to ensure it is going to the proper place. |
|
#6
|
|||
|
|||
|
Re: Robot Spins on Start
Thank you. Apparently, the warning stickers are on the wrong side of all of our Jaguars! I hope we haven't broken them. Can you believe that the warning sticker was on the wrong side? Can we sue?
|
|
#7
|
|||||
|
|||||
|
Re: Robot Spins on Start
Quote:
As for breaking the Jags... Reverse voltage like that does have a tendency to release the magic smoke. If you've smelled magic smoke, your Jags are toast. They might work... but I wouldn't trust them. By the way, Cecil's answer was the first thing I thought of when I saw the problem description... |
|
#8
|
||||
|
||||
|
Re: Robot Spins on Start
Always double check your wiring, and then have another person double check just to be sure. Mistakes happen, and many teams have had the same thing happen (our team is no exception). If you correct the problem and they still work, then use them until they finally do die. I would highly recommend NOT using them in a competition environment again, as they will most likely fail unexpectedly, often at the worst time.
|
|
#9
|
||||
|
||||
|
Re: Robot Spins on Start
Consider doing a root cause analysis to determine why the jags were wired improperly. This would necessarily involve determining who wired them that way, and under what circumstances. This is not a witch hunt. The purpose is not to assign blame. The purpose is to determine what changes need to be made to reduce the likelihood it will happen again. More and/or better training? Certification required in order to be permitted to do electrical work? Mandatory inspection by a second party before powering after wiring? Better labeling on all motor controllers? Better labeling of wires? All of the above? None of the above? Whatever is appropriate for your team. |
|
#10
|
|||||
|
|||||
|
Re: Robot Spins on Start
What warning sticker do you mean?
|
|
#11
|
||||
|
||||
|
Re: Robot Spins on Start
Most Jaguars have a warning sticker that warns against applying an input of reversed polarity. Apparently the OP is saying the Jaguars they got had the stickers on the output side instead of the input side.
|
|
#12
|
||||
|
||||
|
Re: Robot Spins on Start
My bet is that the pwm's are wired backward, so power is going through the signal, which is telling the motor to always be on
|
|
#13
|
||||
|
||||
|
Re: Robot Spins on Start
Power is the center pin.
|
|
#14
|
||||
|
||||
|
Re: Robot Spins on Start
I had this problem with the spike. The pwm was backward, so the compressor was always running. Maybe not the power replacing signal, but still a result of backward pwm.
|
|
#15
|
|||||
|
|||||
|
Re: Robot Spins on Start
Quote:
The Jags are rather known for being easy to wire backwards, for a number of reasons (colored screws that can be easily swapped to denote which wire goes where, difficult markings to read, and there isn't anything really obvious if the screws are swapped around). I've seen someone wire power to both sides of one, and motors to both sides of another one--thankfully that was caught before power-on! I've yet to hear of anybody actually swapping a PWM around on one. Talons and Victors were harder to mistake the markings, but still could have their input/output swapped fairly easily. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|