![]() |
Twitchy Motors
So we have another problem with the roborio (the connection issue is fixed). I noticed that the motors twitch, regardless if it is a Talon SR or VIctor SP. We have tried another schools Talon SRs and PWMs, it still twitches, so I think it may be an issue with the wiring or the physical roborio. It is not a shortage since the electronics board is mounted on a wooden board and the only wires touching the metal frame are the motor wires and the battery cables, which I am fairly sure is not causing the issue.
|
Re: Twitchy Motors
What programming language?
Is it possible you're addressing motors from more than one area in your program? It's a favorite mistake I find with my students. They forget that somewhere else in the program a motor is set to 0 and in another part they're trying to run it at some speed. Causes motor twitch. |
Re: Twitchy Motors
I am using Java. There are only four lines of codes that tell the motors to do something.
LF.set(-stickL.getRawAxis(1)); LR.set(-stickL.getRawAxis(1)); RF.set(stickR.getRawAxis(1)); RR.set(stickR.getRawAxis(1)); I can determine these are the only lines of code that make the motors move by commenting them out. When I do that, the talons blink orange. |
Re: Twitchy Motors
It sounds like it is something wrong with the joystick. What joystick are you using? You should be able to recalibrate your joystick to fix it.
|
Re: Twitchy Motors
Put the robot up on some blocks of wood, and change your teleop code to this:
Code:
LF.set(-1.0); |
Re: Twitchy Motors
Check the battery voltage. Sometimes with brownout protection the wheels will be a bit twitchy.
|
Re: Twitchy Motors
We've seen the same behavior from victor sp's in past years. Our best guess is that they can be sensitive to noise on the PWM wire. Are your PWM wires running along side power wires?
|
Re: Twitchy Motors
Quote:
|
Re: Twitchy Motors
Need more description of the symptoms.
For all we know the drive motors are wired into 30amp breakers, rather than 40a breakers. |
Re: Twitchy Motors
I have tried setting each motor to a value of 0 and it still twitches.
I do not have the robot in front of me to confirm the breakers. We've calibrated the victors and talons multiple times. I don't think we're calibrating it incorrectly. |
Re: Twitchy Motors
Quote:
|
Re: Twitchy Motors
Yes, I had made sure of that.
|
Re: Twitchy Motors
Perhaps photos of your wiring setup would help identify additional potential problems/solutions.
P.S. I do have a rookie team describing motor controller twitching, too, but they always have the robot apart when I've been visiting so I haven't been able to diagnose it yet. |
Re: Twitchy Motors
You could also post all of your code, that will help us make sure something isn't inadvertently happening.
|
Re: Twitchy Motors
Quote:
Since we are getting a strange error in the driver station about PWM (something like PWM 0FRC in some WPIlib). |
Re: Twitchy Motors
These are the images
![]() ![]() ![]() ![]() ![]() Those are 40 Amp breakers |
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. |
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. |
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. |
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; |
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?
|
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...) |
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. |
Re: Twitchy Motors
I set it to a value of 0 and we've ran the vacuum over it a few times already.
|
Re: Twitchy Motors
Hm. Do the motors twitch if the joysticks are unplugged?
Also I would try reimaging the roboRIO. |
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? |
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? |
Re: Twitchy Motors
Quote:
Just post a screenshot of one of the graphs. |
Re: Twitchy Motors
Quote:
|
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 |
Re: Twitchy Motors
Quote:
|
Re: Twitchy Motors
Quote:
|
Re: Twitchy Motors
Pretty sure his team left the power wires long knowing that this is just a test board and they will shorten them to fit the final configuration of their electronics...;) We'll take a look at it when his team visits us again this weekend.
|
Re: Twitchy Motors
![]() |
Re: Twitchy Motors
Voltage dropping that low in such a 'spikey' shape screams main power issue or battery issue.
|
Re: Twitchy Motors
![]() I swapped out the battery cables for shorter ones and switched out the battery. I still experience twitching. |
Re: Twitchy Motors
What terminals are you using for the 6awg connections?
Is there any wiggle in any of the 6awg connections? Is there any wiggle in any of the PCM/robot controller hookups? Have you run a load test on any of your batteries? (like a battery beak) |
Re: Twitchy Motors
The terminals are labelled Burndy 6 Str Cu Blue Die 374 or 7.
I don't feel any wiggle from the 6 AWG connections I don't feel any wiggle from the robot controller connections either We don't have a battery beak. |
Re: Twitchy Motors
Personally, I don't think the batteries are the cause of the twitchy motors, mainly because they are twitching even when the code is set to give them a value of 0. That leads me to think there is either a short in the PWM wires, causing it to send a false signal to the Talon, or the roboRIO is malfunctioning.
That being said, having loose connections aren't good. And the voltage drop isn't "good", but 9 volts won't shutdown everything. hwu24110: Could you take a video of the motors twitching, with the joysticks unplugged and the code having the motors set to 0? If you could also get the video of the Talons that would be helpful. |
Re: Twitchy Motors
https://www.youtube.com/watch?v=nj-J...ature=youtu.be
I note that when one side moved, it would always move in that direction. The other side of the robot when it twitches moves in the other direction. |
Re: Twitchy Motors
Is your driver station showing any errors?
Is your PDP hooked up to the CAN? It seems like it isn't hooked up because the lights are flashing on it. Do you have any non PWM speed controllers you can test? (So a Talon SRX, and test it over CAN) |
Re: Twitchy Motors
THe only error that is showing up is that there isn't a controller connected
Today I hooked up the PDP to a PCM that is connected to the Roborio (The team wanted to test pneumatics). I can take photos of it tomorrow if you suspect there is something wrong with the wiring. I have a few Jaguar Controllers but I have no experience with CAN wires. |
Re: Twitchy Motors
We have also been experiencing the same twitching motors problem lately. We do not think it is an issue with the electronics as it does not twitch when the robot is enabled in autonomous. We are going to check the joysticks tomorrow and see if that could be the issue for us.
|
Re: Twitchy Motors
After watching the video, I would swear that you are running into the same issue that our bot was last year that I posted in this thread:
http://www.chiefdelphi.com/forums/sh...d.php?t=134694 Our issue is only when using PWM 0 (very bad) and 1 (not bad, but still present). Moving to 2 & 3, the issue cleared up. Our random fires were even in Disabled mode and sometimes lasting for 3 or 4 seconds at a time. Just for fun today, we tested the wiring this year using PWM 0 & 1 and the problem is still present with all new wiring/motors/controllers/code. As a side, I'm assuming that your 4 motors are really 2 sets of 2 motors. Wouldn't you want to use a Y-cable on each pair so that they are getting the same signal at the same time and just calling them LEFT and RIGHT (or similar) in the code? |
Re: Twitchy Motors
I've already tried swapping the ports 0, 1, 2, and 3 with 4, 5, 6, and 7.
As this was a test board, I didn't feel like scrounging around the PWM bin for Y cables. If you feel like that is the issue, I might try it out tomorrow. |
Re: Twitchy Motors
Quote:
Before swapping out for Y-cables, have you tried removing 3 of the existing ones and seeing if the issue is still occurring? Only have one connected at a time and see if you can narrow down the specific cable/port/controller combination that triggers the condition? The video only shows one side of the drive train twitching so I'm not sure if the other side is doing it as well like ours was. |
Re: Twitchy Motors
In addition to what Nate said:
This only occurs when the robot is enabled, correct? Another thing you could try, although I imagine it will have no effect, is try switching languages to C++ and see if the problem still occurs. Just use the default example code and see if it twitches. |
Re: Twitchy Motors
Both sides twitch. I removed all but one PWM for each talon and each talon individually twitches.
I set it to autonomous and found it didn't twitch. I set each motor value to 0 and found it still didn't twitch. To make sure I coded it right, I set one side to a value of 1 and it moved constantly at full speed while the other side didn't move at all. It only twitches when enabled in TeloOp. |
Re: Twitchy Motors
Huh. Well I switched C++ and slightly modified the code (someone should check if I entered the motor ports correctly) and the motors didn't twitch.
Code:
#include "WPILib.h" |
Re: Twitchy Motors
That C++ code is correct, and if it didn't twitch then the problem seems to be with Java.
Do you have the latest updates and everything installed for Java/WPILib? |
Re: Twitchy Motors
Quote:
Do you have any dead-band in your software so that the joysticks must move a significant amount before the system responds? I did not notice any mention of dead-band in this thread yet. In Auto-mode, dead-band is not an issue since the software should be ignoring your joysticks. Perhaps set your dead-band to some large value to see what effect it has. |
Re: Twitchy Motors
I can't check the firmware version because the web dashboard is showing a white screen. (If I remember correctly, the version number is 3.0.0f0)
My eclipse plugins versions are now updated to 0.1.0.201602112135. When I image the roborio I use the FRC_roboRIO_2016_v19.zip image. The JRE is ARMv7 Linux - VFP, SOftFP ABI, Little Endian^2. Since I updated the eclipse plugins, I now have this message in the driver station: ERROR 1 PWM 7... Output not updated often enough. java.lang.Thread.run(Thread.java:745) ERROR 1 PWM 6... Output not updated often enough. java.lang.Thread.run(Thread.java:745) ERROR 1 PWM 5... Output not updated often enough. java.lang.Thread.run(Thread.java:745) ERROR 1 PWM 4... Output not updated often enough. java.lang.Thread.run(Thread.java:745) |
Re: Twitchy Motors
I do not have any dead band. Earlier I tested it by setting the values to 0 and it still twitched, so i don't think it's the controllers.
![]() I unplugged the controller so it wouldn't receive any input. |
Re: Twitchy Motors
You need some dead-band. It allows your system to ignore the noise that you will invariably have coming out of your joysticks. Do a search on this forum for how to properly implement the dead-band.
|
Re: Twitchy Motors
I've implemented a deadband, but it still twitches.
Code:
public void operatorControl() { |
Re: Twitchy Motors
Have you tried switching out the joystick or game pad?
|
Re: Twitchy Motors
Yes, I've swapped between an xbox controller and two Logitech Extreme 3D Pro joysticks. I don't think it's the controller because I've also tried running it without controllers and it still twitches.
|
Re: Twitchy Motors
In your Java code, you are addressing each Talon individually, and it is causing the motors to Twitch.
In the C++ code, the motors are NOT twitching, when you are calling the ArcadeDrive method. Try addressing each talon in C++ and see if it twitches. Try this code and see if it twitches: Code:
#include "WPILib.h" |
Re: Twitchy Motors
Neither time did it twitch.
I modified the code because you were using myrobot when it didn't exist. Code:
#include "WPILib.h" |
Re: Twitchy Motors
We found the solution. It was because we were missing motor.setExpiration(0.1)
Code:
public Robot() { |
Re: Twitchy Motors
Quote:
|
Re: Twitchy Motors
First, sorry for leaving the myRobot object in there. I wrote the code at midnight, in Notepad.
Second, glad to hear you solved the problem. Kinda surprised it took all of us that long to figure it out, something as silly as a timeout. Although I'm not sure why the motor would twitch with values of 0, even if the timeout was tripping like that. |
Re: Twitchy Motors
Quote:
|
Re: Twitchy Motors
It's for the Safety and sets the maximum period or window within which a motor Set for that particular motor must be received to avoid automatic shutdown of the PWM output.
It's essentially to avoid a runaway robot if the code locks up, or gets blocked by a debugging session, after sending a full speed ahead command. |
Re: Twitchy Motors
Quote:
|
| 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