Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Electrical (http://www.chiefdelphi.com/forums/forumdisplay.php?f=53)
-   -   Twitchy Motors (http://www.chiefdelphi.com/forums/showthread.php?t=143663)

hwu24110 12-02-2016 18:14

Re: Twitchy Motors
 
These are the images











Those are 40 Amp breakers

nighterfighter 12-02-2016 18:28

Re: Twitchy Motors
 
The wiring looks correct to me (except for your lack of CAN). Does not having the roboRIO connected to the PDP cause any watchdog errors? Not sure...

Anyway, you could try 4 different PWM ports to see if maybe those ports are bad.

Also if you post your code we can rule out the code being an issue.

Mark McLeod 12-02-2016 18:42

Re: Twitchy Motors
 
The wiring looks good to me too.

Take a look at the Driver Station Log File after these twitches occur.
To see if the Event List or the graphs show unusual behavior.

nighterfighter 12-02-2016 18:43

Re: Twitchy Motors
 
The new radio is 12V, the old radio is 5V.

Edit: Weird, I got an email saying a new post said that the voltage should be changed. Ignore this post I guess

Edit2: Also, when youre testing, do you have the robot up on blocks, so the wheels arent touching the ground? Its possible that they are drawing too much current.

hwu24110 12-02-2016 18:58

Re: Twitchy Motors
 
We do prop it on blocks when we test it.

I swapped the PWM ports to 4, 5, 6, and 7 and it still twitches.

Code:

package org.usfirst.frc.team988.robot;


import edu.wpi.first.wpilibj.SampleRobot;
import edu.wpi.first.wpilibj.Talon;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.Victor;
import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;

public class Robot extends SampleRobot {
    Joystick stickL;
    Joystick stickR;
    final String defaultAuto = "Default";
    final String customAuto = "My Auto";
    SendableChooser chooser;
    Talon LF;
    Talon RF;
    Talon LR;
    Talon RR;

    public Robot() {
        stickL = new Joystick(0);
        stickR = new Joystick(1);
        LF = new Talon(4);
        RF = new Talon(5);
        LR = new Talon(6);
        RR = new Talon(7);
       
    }
   
    public void robotInit() {
        chooser = new SendableChooser();
        chooser.addDefault("Default Auto", defaultAuto);
        chooser.addObject("My Auto", customAuto);
        SmartDashboard.putData("Auto modes", chooser);
    }

    public void autonomous() {
           
            String autoSelected = (String) chooser.getSelected();
//                String autoSelected = SmartDashboard.getString("Auto Selector", defaultAuto);
                System.out.println("Auto selected: " + autoSelected);
           
            switch(autoSelected) {
            case customAuto:
            break;
            case defaultAuto:
            default:
            break;
            }
    }

    public void operatorControl() {
        LF.setSafetyEnabled(true);
        LR.setSafetyEnabled(true);
        RF.setSafetyEnabled(true);
        RR.setSafetyEnabled(true);
        while (isOperatorControl() && isEnabled()) {
            LF.set(-stickL.getRawAxis(1));
            LR.set(-stickL.getRawAxis(1));
            RF.set(stickR.getRawAxis(1));
            RR.set(stickR.getRawAxis(1));
            Timer.delay(0.005);                // wait for a motor update time
        }
    }

    /**
    * Runs during test mode
    */
    public void test() {
    }
}


hwu24110 12-02-2016 19:11

Re: Twitchy Motors
 
I do not know if anything is out of the ordinary for the event logs since I don't know what to look for. Is there anything that would be a big sign something is wrong?

JamesCH95 12-02-2016 19:13

Re: Twitchy Motors
 
Check main power connections and battery/battery voltage.

(didn't read the whole thread, this has been the cause of many a twitchy motor though...)

nighterfighter 12-02-2016 19:28

Re: Twitchy Motors
 
The code looks correct also, only thing I can think of is instead of doing GetRawAxis(1), try getY(), but that shouldn't make a difference.

You said that you tried just setting their value to a constant? 0 or 1, and it still twitched? If it twitches with a value at 1, it could be a power issue, but if it twitches at 0, that sounds like a roboRIO issue.

Make sure there are no metal shavings in the PWM ports on the roboRIO.

Last thing I would try, hook up another Talon and put a new motor on it. Unplug the other Talons and comment them out. See if it twitches with just one Talon/motor.

hwu24110 12-02-2016 21:32

Re: Twitchy Motors
 
I set it to a value of 0 and we've ran the vacuum over it a few times already.

nighterfighter 12-02-2016 21:40

Re: Twitchy Motors
 
Hm. Do the motors twitch if the joysticks are unplugged?

Also I would try reimaging the roboRIO.

Chris_Ely 12-02-2016 21:44

Re: Twitchy Motors
 
You have a really long wire run between the battery and the PDB. This will cause a significant voltage drop under load. You should keep your wire runs as short as possible. This may or may not be causing the twitchy motor issue, but it could cause problems for you in the future.

Can you post a driver station log of the battery voltage for when the twitching occurs?

hwu24110 12-02-2016 21:58

Re: Twitchy Motors
 
The motors do twitch when the joysticks are unplugged.

We have tried reimaging the roborio multiple times already.

Where can I find the driver station logs?

Chris_Ely 12-02-2016 22:08

Re: Twitchy Motors
 
Quote:

Originally Posted by hwu24110 (Post 1539440)
Where can I find the driver station logs?

This article explains how to view the logs. They are under the Diagnostics tab in the driver's station.
Just post a screenshot of one of the graphs.

evanperryg 12-02-2016 23:03

Re: Twitchy Motors
 
Quote:

Originally Posted by Chris_Ely (Post 1539437)
You have a really long wire run between the battery and the PDB. This will cause a significant voltage drop under load. You should keep your wire runs as short as possible. This may or may not be causing the twitchy motor issue, but it could cause problems for you in the future.

Can you post a driver station log of the battery voltage for when the twitching occurs?

Line resistance on a 5ft line of 22AWG PWM signal wire is about 0.08 ohms, and considering OP's cables don't even look that long, line resistance is most likely not a factor here. OP, If those are custom made cables, I'd suggest you check your terminals for faulty crimps. It's easy to mess those up. Also, try adding in your CAN runs between the PCM, rRio and PDP. It's far-fetched, especially considering the rRIO has little more than a terminating resistor for the CAN line, but I wonder if this could be a factor. Also, your breaker power runs are ridiculously long, try cutting those down, a lot.

philso 12-02-2016 23:13

Re: Twitchy Motors
 
Do you have a PWM Generator such as the AndyMark ThriftyThrottle? You can use something like that to totally eliminate the RoboRio and the software from the equation. People who fly model airplanes or helicopters often have something like this too.

http://www.andymark.com/Thrifty-Throttle-p/am-2936a.htm


All times are GMT -5. The time now is 22:38.

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