OCCRA
Go to Post Look at the problem and find the simplest solution. Don't look at a solution and try to find a problem to solve with it. - apalrd [more]
Home
Go Back   Chief Delphi > Technical > Technical Discussion
CD-Media  
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 04-16-2018, 12:24 PM
Kulkinz's Avatar
Kulkinz Kulkinz is offline
Registered User
AKA: Cool Kornak
FRC #4334 (Alberta Tech Alliance)
Team Role: Programmer
 
Join Date: Feb 2018
Rookie Year: 2018
Location: Calgary
Posts: 8
Kulkinz is an unknown quantity at this point
Question How do we make it so our bot comes to a slow stop?

Not sure where is the best place to put this, so I am putting it here.

Our robot drives around well, but when we let go of our left stick, it comes to a complete stop almost immediately. That's fine the majority of the time, but we are working on a summer project where we don't want that to happen. We want it so that once you let go of the stick, it will slow down, but not stop right away. How should that be implemented? Is there something we need to do electrically with our speed controllers? Do we need to do something in the code (we use Java)? Any help would be useful.
Reply With Quote
  #2   Spotlight this post!  
Unread 04-16-2018, 12:29 PM
pkrishna3082's Avatar
pkrishna3082 pkrishna3082 is offline
love/hate relationship with swerve
AKA: Parthiv Krishna
FRC #3082 (Chicken Bot Pie) and FTC #13471 Mentor (Vortechs)
Team Role: Leadership
 
Join Date: Mar 2017
Rookie Year: 2016
Location: Minnetonka, MN, USA
Posts: 872
pkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond repute
Re: How do we make it so our bot comes to a slow stop?

Which speed controllers are you using? Any of the FRC-legal speed controllers will allow you to configure them into "Coast" mode instead of "Brake" mode, which will prevent these abrupt stops. However, each one is different, so let me know which one you're using so that I can help you
__________________

“Screws fall out all the time. The world is an imperfect place.”
2010-2011: FLL 11083, 13873 (Minnetonka Silver) - Programmer
2016-: FRC 3082 (Chicken Bot Pie) - Engineering Captain, Driver, Programming Lead
2017-: FTC 13471 (Minnetonka) - Founding Mentor
Reply With Quote
  #3   Spotlight this post!  
Unread 04-16-2018, 12:36 PM
Kulkinz's Avatar
Kulkinz Kulkinz is offline
Registered User
AKA: Cool Kornak
FRC #4334 (Alberta Tech Alliance)
Team Role: Programmer
 
Join Date: Feb 2018
Rookie Year: 2018
Location: Calgary
Posts: 8
Kulkinz is an unknown quantity at this point
Re: How do we make it so our bot comes to a slow stop?

We are using Talon SRXs.
Reply With Quote
  #4   Spotlight this post!  
Unread 04-16-2018, 12:40 PM
AriMB's Avatar
AriMB AriMB is online now
The Philadelphian emigrant
AKA: Ari Meles-Braverman
FRC #5987 (Galaxia)
Team Role: Mentor
 
Join Date: Mar 2015
Rookie Year: 2012
Location: Haifa, Israel
Posts: 1,832
AriMB has a reputation beyond reputeAriMB has a reputation beyond reputeAriMB has a reputation beyond reputeAriMB has a reputation beyond reputeAriMB has a reputation beyond reputeAriMB has a reputation beyond reputeAriMB has a reputation beyond reputeAriMB has a reputation beyond reputeAriMB has a reputation beyond reputeAriMB has a reputation beyond reputeAriMB has a reputation beyond repute
Re: How do we make it so our bot comes to a slow stop?

In that case, you set the brake/coast mode in software. You can either do it via the webdash (roborio-TEAM-frc.local) or set it programmically in your code. There are methods in all of the languages to select brake/coast mode, and if you set it programmatically you can even change it mid-match depending on how you want the robot to act.
__________________
Studying MechE at the Technion - Israel Institute of Technology
2017-present: FIRST Israel CSA/FTAA
2017-present: FRC 5987 Technical Mentor 18isr2 18isr4 18isrcmp 18carv
2012-2016: FRC 423 Member 15njtab 15padre 16paphi
Reply With Quote
  #5   Spotlight this post!  
Unread 04-16-2018, 12:41 PM
pkrishna3082's Avatar
pkrishna3082 pkrishna3082 is offline
love/hate relationship with swerve
AKA: Parthiv Krishna
FRC #3082 (Chicken Bot Pie) and FTC #13471 Mentor (Vortechs)
Team Role: Leadership
 
Join Date: Mar 2017
Rookie Year: 2016
Location: Minnetonka, MN, USA
Posts: 872
pkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond repute
Re: How do we make it so our bot comes to a slow stop?

Quote:
Originally Posted by Kulkinz View Post
We are using Talon SRXs.
In Java you are going to want to call

Code:
talon.setNeutralMode(NeutralMode.Coast);
for each of your drive controllers. For example, this is what we have in our drivetrain subsystem:

Code:
srxLeftMaster.setNeutralMode(NeutralMode.Coast);
srxLeftSlave.setNeutralMode(NeutralMode.Coast);
srxRightMaster.setNeutralMode(NeutralMode.Coast); 
srxRightSlave.setNeutralMode(NeutralMode.Coast);
Test it out, I think it should be what you're looking for. If it's still too abrupt, you are going to want to implement some sort of voltage ramp, which can also be done directly on the Talon SRX. Coast mode should work, though.

Hope that helps.
__________________

“Screws fall out all the time. The world is an imperfect place.”
2010-2011: FLL 11083, 13873 (Minnetonka Silver) - Programmer
2016-: FRC 3082 (Chicken Bot Pie) - Engineering Captain, Driver, Programming Lead
2017-: FTC 13471 (Minnetonka) - Founding Mentor
Reply With Quote
  #6   Spotlight this post!  
Unread 04-16-2018, 12:42 PM
Kulkinz's Avatar
Kulkinz Kulkinz is offline
Registered User
AKA: Cool Kornak
FRC #4334 (Alberta Tech Alliance)
Team Role: Programmer
 
Join Date: Feb 2018
Rookie Year: 2018
Location: Calgary
Posts: 8
Kulkinz is an unknown quantity at this point
Re: How do we make it so our bot comes to a slow stop?

Ah. Thanks for the help. If we have to switch to Victor SPXs for whatever reason, can we also set it in webdash or only in code?
Reply With Quote
  #7   Spotlight this post!  
Unread 04-16-2018, 12:48 PM
pkrishna3082's Avatar
pkrishna3082 pkrishna3082 is offline
love/hate relationship with swerve
AKA: Parthiv Krishna
FRC #3082 (Chicken Bot Pie) and FTC #13471 Mentor (Vortechs)
Team Role: Leadership
 
Join Date: Mar 2017
Rookie Year: 2016
Location: Minnetonka, MN, USA
Posts: 872
pkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond reputepkrishna3082 has a reputation beyond repute
Re: How do we make it so our bot comes to a slow stop?

From what I understand, the mode that you specify in the roboRIO Configuration WebDashboard is the default mode, and the motor controller will be in that one upon startup. Any explicit changes in code will override that. So in theory, either way should work. However, I am more comfortable setting it in the program, because if you swap out a motor controller it will behave as you expect.

I believe that this is the case with both Talon SRX and Victor SPX. CTRE has done a good job making them behave very similarly on the software side.
__________________

“Screws fall out all the time. The world is an imperfect place.”
2010-2011: FLL 11083, 13873 (Minnetonka Silver) - Programmer
2016-: FRC 3082 (Chicken Bot Pie) - Engineering Captain, Driver, Programming Lead
2017-: FTC 13471 (Minnetonka) - Founding Mentor
Reply With Quote
  #8   Spotlight this post!  
Unread 04-16-2018, 01:48 PM
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #6367 (), FRC #7240 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,413
virtuald has a reputation beyond reputevirtuald has a reputation beyond reputevirtuald has a reputation beyond reputevirtuald has a reputation beyond reputevirtuald has a reputation beyond reputevirtuald has a reputation beyond reputevirtuald has a reputation beyond reputevirtuald has a reputation beyond reputevirtuald has a reputation beyond reputevirtuald has a reputation beyond reputevirtuald has a reputation beyond repute
Re: How do we make it so our bot comes to a slow stop?

Quote:
Originally Posted by pkrishna3082 View Post
From what I understand, the mode that you specify in the roboRIO Configuration WebDashboard is the default mode, and the motor controller will be in that one upon startup. Any explicit changes in code will override that. So in theory, either way should work. However, I am more comfortable setting it in the program, because if you swap out a motor controller it will behave as you expect.

I believe that this is the case with both Talon SRX and Victor SPX. CTRE has done a good job making them behave very similarly on the software side.
My understanding is that whatever you set (whether via webdash or via code) will get persisted into the startup configuration for the SRX. In effect, the last setting of the setting wins.
__________________
Maintainer of RobotPy (Python for FRC) & WPILib Contributor
Creator of pyfrc (Robot Simulator + utilities for Python), pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript), and lots more...

Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
Reply With Quote
  #9   Spotlight this post!  
Unread 04-16-2018, 04:40 PM
gerthworm's Avatar
gerthworm gerthworm is offline
Making the 1's and 0's
FRC #1736 (Robot Casserole)
Team Role: Mentor
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Peoria, IL
Posts: 744
gerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond repute
Re: How do we make it so our bot comes to a slow stop?

Quote:
Originally Posted by Kulkinz View Post
Not sure where is the best place to put this, so I am putting it here.

Our robot drives around well, but when we let go of our left stick, it comes to a complete stop almost immediately. That's fine the majority of the time, but we are working on a summer project where we don't want that to happen. We want it so that once you let go of the stick, it will slow down, but not stop right away. How should that be implemented? Is there something we need to do electrically with our speed controllers? Do we need to do something in the code (we use Java)? Any help would be useful.

Brake coast mode is likely the answer, as others have stated.

If you do attempt to do something in software as well, a few general questions:
-Is it ok that you will be commanding the robot to move when the driver is giving a zero command? Is it always ok?
-For safety's sake, do you need to have an additional on-the-controller "estop" mechanism that immediately stops movement?

Usually when software takes direct control away from the driver, I believe this is a good analysis to at least think through.
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 05:55 PM.

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


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi