Go to Post Active control of game pieces throughout all stages of your robot's interactions with it is critical. Never let gravity/inertia control the game piece. If you want a game piece to go somewhere, you MAKE it go there. - Jeremy Germita [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 02-25-2015, 02:59 PM
King Nerd III's Avatar
King Nerd III King Nerd III is offline
Chief Programmer/Head of Autonomous
AKA: Isaac
FRC #1410 (The Kraken)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Denver, CO
Posts: 113
King Nerd III is an unknown quantity at this point
Inverting Talon SRX

So a few days ago we were putting together the code for an elevator and realized that the limit switches were backwards, basically the top limit switch stops it if it is going down and bottom stops it if it is going up. We are using the Talon SRX with the CAN bus and I was just wondering if there would be a way to invert it in the code? I know we can do it physically, and will probably end up doing that, but code would be much easier. I looked in the manual and couldn't find anything, so maybe it is hidden? I know with a Talon SR we can do random_motor->SetInvertedMotor(can't remember if it's bool); but it doesn't work with an SRX. Any ideas?
Reply With Quote
  #2   Spotlight this post!  
Unread 02-25-2015, 03:32 PM
FrankJ's Avatar
FrankJ FrankJ is offline
Robot Mentor
FRC #2974 (WALT)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2009
Location: Marietta GA
Posts: 1,886
FrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond repute
Re: Inverting Talon SRX

The procedure is documented in talon programming manual. But the "forward" limit switch stops the controller in the "forward direction" That might be down. Also if you are using normally closed limited switches you need to set that in the talon web dashboard. The default is N.O.
__________________
If you don't know what you should hook up then you should read a data sheet
Reply With Quote
  #3   Spotlight this post!  
Unread 02-25-2015, 03:39 PM
King Nerd III's Avatar
King Nerd III King Nerd III is offline
Chief Programmer/Head of Autonomous
AKA: Isaac
FRC #1410 (The Kraken)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Denver, CO
Posts: 113
King Nerd III is an unknown quantity at this point
Re: Inverting Talon SRX

Quote:
Originally Posted by FrankJ View Post
The procedure is documented in talon programming manual. But the "forward" limit switch stops the controller in the "forward direction" That might be down. Also if you are using normally closed limited switches you need to set that in the talon web dashboard. The default is N.O.
I looked in the manual in there really is nothing as easy as random_motor->SetInvertedMotor(); which is inconvenient. A search of the manual brings up inverting a slave motor, but it doesn't really help. I think we will just stick with moving the forward limit switch to the bottom, and reverse to the top.
Thanks for the help!
Reply With Quote
  #4   Spotlight this post!  
Unread 02-25-2015, 03:47 PM
ozrien's Avatar
ozrien ozrien is offline
Omar Zrien
AKA: Omar
no team
Team Role: Mentor
 
Join Date: Sep 2006
Rookie Year: 2003
Location: Sterling Heights, MI
Posts: 516
ozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant future
Re: Inverting Talon SRX

You will need to fix it in the wiring. If the Talon is green (positive throttle) it will only check the forward limit switch. What causes the Talon to be green (closed-loop, slaving, slave-invert) instead of red (Reverse) can be controlled by Reverse Sensor and Reverse Closed-Loop output. But the limit switch is compared against the final output.
Reply With Quote
  #5   Spotlight this post!  
Unread 02-25-2015, 03:50 PM
King Nerd III's Avatar
King Nerd III King Nerd III is offline
Chief Programmer/Head of Autonomous
AKA: Isaac
FRC #1410 (The Kraken)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Denver, CO
Posts: 113
King Nerd III is an unknown quantity at this point
Re: Inverting Talon SRX

Quote:
Originally Posted by ozrien View Post
You will need to fix it in the wiring. If the Talon is green (positive throttle) it will only check the forward limit switch. What causes the Talon to be green (closed-loop, slaving, slave-invert) instead of red (Reverse) can be controlled by Reverse Sensor and Reverse Closed-Loop output. But the limit switch is compared against the final output.
Yeah, that's what I thought. I wish we didn't have to do that, but as long as it works it's fine.
Reply With Quote
  #6   Spotlight this post!  
Unread 02-25-2015, 03:51 PM
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Inverting Talon SRX

Quote:
Originally Posted by King Nerd III View Post
I know with a Talon SR we can do random_motor->SetInvertedMotor(can't remember if it's bool); but it doesn't work with an SRX. Any ideas?
The SetInvertedMotor() method is generic to any motor speed controller. What makes you think it doesn't work with a Talon SRX?
Reply With Quote
  #7   Spotlight this post!  
Unread 02-25-2015, 03:56 PM
King Nerd III's Avatar
King Nerd III King Nerd III is offline
Chief Programmer/Head of Autonomous
AKA: Isaac
FRC #1410 (The Kraken)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Denver, CO
Posts: 113
King Nerd III is an unknown quantity at this point
Re: Inverting Talon SRX

Quote:
Originally Posted by Alan Anderson View Post
The SetInvertedMotor() method is generic to any motor speed controller. What makes you think it doesn't work with a Talon SRX?
The fact that when I do the following with a CANTalon object:
right_motor->SetInvertedMotor();
It says it can't resolve SetInveretedMotor(), and also the header files for both CANTalon and CANSpeedController do not have this method.

Last edited by King Nerd III : 02-25-2015 at 04:13 PM.
Reply With Quote
  #8   Spotlight this post!  
Unread 02-25-2015, 05:42 PM
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Inverting Talon SRX

Quote:
Originally Posted by King Nerd III View Post
The fact that when I do the following with a CANTalon object:
right_motor->SetInvertedMotor();
It says it can't resolve SetInveretedMotor(), and also the header files for both CANTalon and CANSpeedController do not have this method.
I don't see that method in the non-CAN Jaguar or Talon headers either. I'm pretty sure that's because it's a RobotDrive function. Are you able to get a random_motor->SetInvertedMotor(true); to compile when random_motor is a Talon SR, as your original post implies?

I should stop being subtle. It isn't working.
Reply With Quote
  #9   Spotlight this post!  
Unread 02-25-2015, 08:47 PM
King Nerd III's Avatar
King Nerd III King Nerd III is offline
Chief Programmer/Head of Autonomous
AKA: Isaac
FRC #1410 (The Kraken)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Denver, CO
Posts: 113
King Nerd III is an unknown quantity at this point
Re: Inverting Talon SRX

Quote:
Originally Posted by Alan Anderson View Post
I don't see that method in the non-CAN Jaguar or Talon headers either. I'm pretty sure that's because it's a RobotDrive function. Are you able to get a random_motor->SetInvertedMotor(true); to compile when random_motor is a Talon SR, as your original post implies?

I should stop being subtle. It isn't working.
Nah, that doesn't work either. I agree that it is probably a robot drive thing, which won't help with an elevator.
Reply With Quote
  #10   Spotlight this post!  
Unread 02-25-2015, 10:45 PM
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,168
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Re: Inverting Talon SRX

And like Omar said this is all internal to the Talon - when it is green it is looking for the "forward" limit no matter the software convention.
__________________
Fast, cheap or working - pick any two!
Reply With Quote
  #11   Spotlight this post!  
Unread 02-25-2015, 10:53 PM
King Nerd III's Avatar
King Nerd III King Nerd III is offline
Chief Programmer/Head of Autonomous
AKA: Isaac
FRC #1410 (The Kraken)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Denver, CO
Posts: 113
King Nerd III is an unknown quantity at this point
Re: Inverting Talon SRX

Quote:
Originally Posted by wireties View Post
And like Omar said this is all internal to the Talon - when it is green it is looking for the "forward" limit no matter the software convention.
That kind of sucks, now we have to unsolder and all that. The last time we soldered was a nightmare, I don't want to go through that again!

We'll do it, though. For the team!
Reply With Quote
  #12   Spotlight this post!  
Unread 02-25-2015, 10:55 PM
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,168
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Re: Inverting Talon SRX

Quote:
Originally Posted by King Nerd III View Post
That kind of sucks, now we have to unsolder and all that. The last time we soldered was a nightmare, I don't want to go through that again!

We'll do it, though. For the team!
Use connectors for all sensors and motors so they can be removed/replaced easily. It makes repairs (especially under stress) much easier.
__________________
Fast, cheap or working - pick any two!
Reply With Quote
  #13   Spotlight this post!  
Unread 02-25-2015, 10:59 PM
King Nerd III's Avatar
King Nerd III King Nerd III is offline
Chief Programmer/Head of Autonomous
AKA: Isaac
FRC #1410 (The Kraken)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Denver, CO
Posts: 113
King Nerd III is an unknown quantity at this point
Re: Inverting Talon SRX

Quote:
Originally Posted by wireties View Post
Use connectors for all sensors and motors so they can be removed/replaced easily. It makes repairs (especially under stress) much easier.
We're using an encoder breakout board so it has to be soldered, we don't want to risk it coming apart. But we did this:

[board]~~wire~~[pwm connector][pwm connector]~~wire~~[sensor]

It works well enough!
Reply With Quote
  #14   Spotlight this post!  
Unread 02-26-2015, 12:53 AM
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: Inverting Talon SRX

Quote:
Originally Posted by wireties View Post
And like Omar said this is all internal to the Talon - when it is green it is looking for the "forward" limit no matter the software convention.
Is it really that important that forward be up!? I get that it's a little more straightforward, but if you reverse the output and make the top "red" and the bottom "green" then you don't need to rewire, right? You were wanting a software workaround, so a slight inconvenience of needing to invert a number seems reasonable.
Reply With Quote
  #15   Spotlight this post!  
Unread 02-26-2015, 01:04 AM
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,168
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Re: Inverting Talon SRX

Quote:
Originally Posted by King Nerd III View Post
We're using an encoder breakout board so it has to be soldered, we don't want to risk it coming apart. But we did this:

[board]~~wire~~[pwm connector][pwm connector]~~wire~~[sensor]

It works well enough!
So just reconnecting the PWM-PWM interfaces for the 2 sensors should fix things?
__________________
Fast, cheap or working - pick any two!
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 10:09 AM.

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