Go to Post Those poor suckers on the West coast get three hours LESS sleep than we do afterward. Anyone else glad to see that crate go every year, regardless of what's in it? - Rich Kressly [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 05-02-2015, 19:25
rsaccone rsaccone is offline
Registered User
FRC #3950
 
Join Date: Feb 2013
Location: Glen Head, NY
Posts: 23
rsaccone is an unknown quantity at this point
When Switching between Enable and Disable mode Talon SRX stop working

Hi,

We are having an intermittent problem with our Robot Code. Currently we only have a drive subsystem active with an associated DriveCommand. It all works (meaning wheels spin and change direction with the joystick) when we initially deploy the code from Eclipse and often when we come up from a reboot of the robot. However, sometimes when we switch between disable and enable mode the Talon SRXs no longer receive a signal. We have debugged our code and are certain that when this occurs the joystick values are being read and being fed into the robotDrive->MecanumDrive_Cartsian method. If we bring up the RoboRio3950 Web based System Configuration and examine the talons with a self-test, when they are working they are in mode 0 and we can see a non-zero throttle value being applied. However when we get into the state where we are enabled and the wheels aren't moving the self-test reveals that the Mode is 15 and the throttle value is 0.

Does anyone have a suggestion as to why this might be happening?

Thanks,
Rob
Reply With Quote
  #2   Spotlight this post!  
Unread 05-02-2015, 19:45
ozrien's Avatar
ozrien ozrien is online now
Omar Zrien
AKA: Omar
no team
Team Role: Mentor
 
Join Date: Sep 2006
Rookie Year: 2003
Location: Sterling Heights, MI
Posts: 523
ozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond repute
Re: When Switching between Enable and Disable mode Talon SRX stop working

Did you read section 16.12 of the Talon SRX Software Reference Manual?

Also could be motor safety enable. Checkout section 19 and section 16.14 (Motor Safety disable features) in the Talon SRX Software Reference Manual.
Reply With Quote
  #3   Spotlight this post!  
Unread 05-02-2015, 20:05
rsaccone rsaccone is offline
Registered User
FRC #3950
 
Join Date: Feb 2013
Location: Glen Head, NY
Posts: 23
rsaccone is an unknown quantity at this point
Re: When Switching between Enable and Disable mode Talon SRX stop working

Thanks for the pointers. I'll give what is suggested in them a try.

Regards,
Rob
Reply With Quote
  #4   Spotlight this post!  
Unread 06-02-2015, 07:44
ericomoura ericomoura is offline
Registered User
FRC #0383 (Brazilian Machine)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Brazil
Posts: 12
ericomoura is an unknown quantity at this point
Re: When Switching between Enable and Disable mode Talon SRX stop working

Do you have an error showing up in the DS when this happens? If there's a motor safety error such as this one, you may have the same problem we have. I made this thread and got quite a few replies so you might get something from there. We still haven't found what's causing it, but maybe it'll be enough for you.
Reply With Quote
  #5   Spotlight this post!  
Unread 06-02-2015, 09:36
rsaccone rsaccone is offline
Registered User
FRC #3950
 
Join Date: Feb 2013
Location: Glen Head, NY
Posts: 23
rsaccone is an unknown quantity at this point
Re: When Switching between Enable and Disable mode Talon SRX stop working

Yes, we are seeing the output not being updated often enough message. I am going to try implementing some of the code that is in the Talon Software guide. Specifically doing a Set(0) on each motor when we are initializing teleop and auto mode. I am also going to experiment with disabling motor safety mode.

Thanks,
Rob
Reply With Quote
  #6   Spotlight this post!  
Unread 06-02-2015, 21:10
rsaccone rsaccone is offline
Registered User
FRC #3950
 
Join Date: Feb 2013
Location: Glen Head, NY
Posts: 23
rsaccone is an unknown quantity at this point
Re: When Switching between Enable and Disable mode Talon SRX stop working

Hello,

I looked at the material that was suggested and implemented changes in our robot drive subsystem. In our drive subsystem we are using 4 Talon SRXs controllers and we place them into a RobotDrive object and the use the mecanum methods on the RobotDrive to actually make the wheels spin. Our Robot is a command based robot. We wrote a method in drive subsystem to enable the motors in the drive subsystem. This method is called from TeleOpInit and AutonomousInit to ensure that the motors are enabled and the safety mode is either enabled or disabled depending upon how we configure it in our configuration file. We set the configuration options so that the safety mode is disabled by default.

After doing this we still had issues with the motors sometimes not working when coming out of disabled mode on the Driver Station. When this would occur I could switch back to disable and then enable again and it would usually work. We also discovered that even while enabled and the motors were running for a long stretch some or all of them would eventually stop working. Mysteriously we were still getting the message about the drive output not being updated often enough. This wasn't expected because we verified that the safety mode on each motor was being disabled. We also looked at the RobotDrive code in github and it was there that we noticed that RobotDrive by default turns safety mode on. Once I added the disable on RobotDrive everything seems to work and no longer cuts out. Here's our EnableDriveSubsystem for reference.


Code:
void DriveSubsystem::EnableDriveSubsystem() {
         ConfigMgr *configMgr = ConfigInstanceMgr::getInstance();

         float expiration = 0.0;
         bool enable = configMgr->getBoolVal(ConfigKeys::Drive_EnableSafety, DRIVE_SAFETY_ENABLED_DEFAULT);

         if (enable)
         {
                 expiration=configMgr>getDoubleVal(ConfigKeys::Drive_SafetyTimeOut, DRIVE_SAFETY_TIME_OUT_DEFAULT);
         }

        Logger::GetInstance()->Log(DriveSubsystemLogId,Logger::kINFO, "DriveSubsystem:EnableDriveSubsystem() ->SafetyEnable=%s, timeout=%f\n",
                        enable ? "TRUE" : "FALSE",
                        expiration);

        SetSafetyMode(cANTalon1, enable, expiration);
        SetSafetyMode(cANTalon2, enable, expiration);
        SetSafetyMode(cANTalon3, enable, expiration);
        SetSafetyMode(cANTalon4, enable, expiration);
        robotDrive->SetSafetyEnabled(enable);

        if (enable)
        {
                robotDrive->SetSafetyEnabled(expiration);
        }

        cANTalon1->EnableControl();
        cANTalon2->EnableControl();
        cANTalon3->EnableControl();
        cANTalon4->EnableControl();


        cANTalon1->Set(0);
        cANTalon2->Set(0);
        cANTalon3->Set(0);
        cANTalon4->Set(0);
}
Reply With Quote
  #7   Spotlight this post!  
Unread 13-02-2015, 20:06
Justie Justie is offline
Registered User
FRC #2080
Team Role: Programmer
 
Join Date: Feb 2015
Rookie Year: 2013
Location: Louisiana
Posts: 1
Justie is an unknown quantity at this point
Re: When Switching between Enable and Disable mode Talon SRX stop working

The problem was fixed by our team.

It is not the code, it is not the talons, its the User error.
When you previously ran the robot, you probably hit the DISABLE button while the motors were still running. That made the MotorSafety shut down the motors until the enabled function is activated.

You can still make a fail prevent in your code. For example, if the autonomous is working, and the ref shuts it off while it is driving, the error will occur in TeleOP.

What you can do is enable all of your Talons with a button

example would be:


if(stick.GetRawButton1)
{frontLeft.EnableControl(),
frontRight.EnableControl(),
backLeft.EnableControl(),
backRight.EnableControl()
}
(I dont remember the exact syntax)

You would add that to your TeleOP code.

But overall, dont disable the robot while the drive motors are running.

Last edited by Justie : 13-02-2015 at 21:28.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 14:49.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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