![]() |
Talon SRX spamming forward and backward constantly
Hello everybody,
So our robot's Talon's are reversing forward and backward during teleOP and Auton. During the Auton program it's set to move forward a single motor at half speed for half a second then stop. What actually happens is 2 motors continually go forward and backward at full speed(I think). We have the Talons in a CAN daisy chain sequence and are using c++ to program it. Any help would be much appreciated. |
Re: Talon SRX spamming forward and backward constantly
Can you post the code you're using to control said motors? (Just to eliminate the possibility of the code being the issue).
|
Re: Talon SRX spamming forward and backward constantly
Try calibrating it. That might solve the problem if it is not codes problem.
|
Re: Talon SRX spamming forward and backward constantly
My spitball guess is that both Talons have the same CAN address, and one is on the left side of the robot, and the other is on the right side of the robot. When you send the command, both motors respond by rotating in the same direction. However, as the motors are oriented in opposite directions, one of them appears to be going backward.
|
Re: Talon SRX spamming forward and backward constantly
Do you ever explicitly tell the motors to stop moving?
|
Re: Talon SRX spamming forward and backward constantly
I think Wenry may be in class, so his responses will be a bit delayed. I was at the build last night and helped him with his troubleshooting, so I will take a stab at answering your questions.
@Asymons - I don't have direct access to the code that was being used (it hasn't been pushed to our repo yet), but the final test was really simple. I'll try to replicate it here. We had a command with the following methods: Code:
void TestTalonCommand::Initialize()The setMotorSpeed method is in our subclass of RobotDrive, and implemented like this: Code:
void Drive::setMotorSpeed(unsigned int motorID, float speed)The Talons are in kThrottle or kPercentVbus mode (Both are names for ControlMode 0). @Munchskull - I was wondering about that, but since the robot uses CAN instead of PWM I didn't think normal calibration applied. At least, I couldn't find anything in the Talon SRX User Guide for calibrating the Talons for CAN. Do you have documentation on how we could do this? @GeeTwo - All of the Talons have unique IDs in the web interface. They are also all using the latest (1.4) version of the firmware. @Christopher149 - Yes. This is the part that is exceptionally puzzling. When the move command is sent (either by moving the joystick or by calling Set()) the motors begin moving. However, when the joystick is returned to center or the command ends, the motors do not stop until the robot is disabled. Thanks to all of you for responding. |
Re: Talon SRX spamming forward and backward constantly
PWM Calibration has no effect when controlling Talon SRXs over CAN bus.
It sounds like a programming issue, can you just post it in it's entirety? Or PM me a link and I can run it on my robot. |
Re: Talon SRX spamming forward and backward constantly
Sorry if this doesn't look pretty i'm new to forms. Also if i should add anything else just let me know please. Thank you for helping
TestTalonCommand.cpp file Code:
#include "TestTalonCommand.h"Code:
#ifndef TEST_TALON_COMMAND_HCode:
#include "MecanumDriveTrain.h"Code:
#ifndef MECANUM_DRIVE_TRAIN_H#ifndef ENCODER_DRIVE_H Code:
#define ENCODER_DRIVE_HCode:
#include "EncoderDrive.h" |
Re: Talon SRX spamming forward and backward constantly
Also here is the link to our repository https://github.com/FRC2539/command-based/tree/rrush. Thanks all for the help.
|
Re: Talon SRX spamming forward and backward constantly
Arrived at the build site, here's what we're dealing with https://www.youtube.com/watch?v=_ALFjkahQuk. Thanks again for the help.
|
Re: Talon SRX spamming forward and backward constantly
Quote:
|
Re: Talon SRX spamming forward and backward constantly
Quote:
|
Re: Talon SRX spamming forward and backward constantly
Quote:
|
Re: Talon SRX spamming forward and backward constantly
We are having very similar problems with our drive system. We are running Talon SRX's using CAN and mechanum drive using C++ IterativeRobot. We have some motors not turning and others spin slowly in the wrong direction while other motors are running at full speed. We are also seeing some CAN errors from the PDB not responding on the DriverStation messages.
The Talons all have unique CAN IDs and have had a firmware update (from memory, I think they're running version 1.4). Same with the PDB (I think it's firmware level is 1.37). We are driving the motors using the RobotDrive. 2539: If you figure this out, please post your solution. I was going to try increasing the control period on the CANTalon's, but I'm not confident this will work. Thanks |
Re: Talon SRX spamming forward and backward constantly
There is definitely something wrong with that robot app. Running it on my bot it looks like two things are trying to drive all the Talons, it keeps switching between zero and nonzero values. I'll keep digging...
|
| All times are GMT -5. The time now is 01:47. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi