Go to Post I'm not gonna reinvent the wheel cause I can already buy it :) - Stephen Kowski [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
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 16-05-2015, 17:17
TBots TBots is offline
Registered User
FRC #3350
 
Join Date: Sep 2014
Location: Texarkana
Posts: 39
TBots is an unknown quantity at this point
Talon SRX and Analog Encoders

We just got some Talon SRX motor controllers and are working on understanding all of their potential. Mainly, we need to figure out how to hook up and use a magnetic absolute encoder (MA3) to each of our SRX. The SRX will be what controls the turning of our wheels in a swerve drive.

I've hear that the SRX have 'built-in' PID controllers. Is this true? And if so, do I still need to include PID in our labVIEW programming?

There are several examples of using the talon SRX in the software manual that was included with the SRX, but we are unable to distinguish which of them we are meant to use.

Thank you for the help!
Reply With Quote
  #2   Spotlight this post!  
Unread 16-05-2015, 18:05
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,038
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Talon SRX and Analog Encoders



Quote:
I've hear that the SRX have 'built-in' PID controllers. Is this true?
Yes.


Quote:
And if so, do I still need to include PID in our labVIEW programming?
No. But you do need to do the following:

- connect the feedback sensor directly to the Talon (not the roboRIO)

- use CAN bus (not PWM) to control the Talon

- use the appropriate CAN commands to tell Talon what closed-loop mode you want (e.g. position or speed etc)

- use the appropriate CAN commands to set the gains in the Talon's PID controller.

- use the appropriate CAN commands to communicate the desired setpoint to the Talon's PID so it knows what value you want it to control to.




Last edited by Ether : 16-05-2015 at 18:15.
Reply With Quote
  #3   Spotlight this post!  
Unread 16-05-2015, 19:42
MaGiC_PiKaChU's Avatar
MaGiC_PiKaChU MaGiC_PiKaChU is offline
Drive Coach
AKA: Antoine L.
FRC #3360 (Hyperion)
Team Role: Mentor
 
Join Date: Mar 2014
Rookie Year: 2012
Location: Sherbrooke
Posts: 608
MaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond repute
Re: Talon SRX and Analog Encoders

Quote:
Originally Posted by Ether View Post




Yes.




No. But you do need to do the following:

- connect the feedback sensor directly to the Talon (not the roboRIO)

- use CAN bus (not PWM) to control the Talon

- use the appropriate CAN commands to tell Talon what closed-loop mode you want (e.g. position or speed etc)

- use the appropriate CAN commands to set the gains in the Talon's PID controller.

- use the appropriate CAN commands to communicate the desired setpoint to the Talon's PID so it knows what value you want it to control to.



also you'll need one of those for each talon
http://www.vexrobotics.com/217-4401.html

We had 14 SRX this year, 12 of them with a sensor in the breakout... This is amazing
__________________
2012 - 3360 - Junior member
2013 - 3360 - Lead Programmer, Human player
2014 - 3360 - Lead Programmer, Human player
2015 - 3360 - Lead Programmer, Driver
2016 - 3360 - Mentor, Drive coach



Reply With Quote
  #4   Spotlight this post!  
Unread 16-05-2015, 22:24
TBots TBots is offline
Registered User
FRC #3350
 
Join Date: Sep 2014
Location: Texarkana
Posts: 39
TBots is an unknown quantity at this point
Re: Talon SRX and Analog Encoders

Quote:
Originally Posted by MaGiC_PiKaChU View Post
also you'll need one of those for each talon
http://www.vexrobotics.com/217-4401.html
Is it absolutely necessary to use the breakout board? It may be messy, but could you accomplish the same thing without it? What exactly does it do? Is it just making it easier to use the SRX?
Reply With Quote
  #5   Spotlight this post!  
Unread 16-05-2015, 22:31
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: 521
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: Talon SRX and Analog Encoders

Quote:
Originally Posted by TBots View Post
Is it absolutely necessary to use the breakout board? It may be messy, but could you accomplish the same thing without it? What exactly does it do? Is it just making it easier to use the SRX?
Here's a snippet from the link Ether mentioned....
Quote:
This breakout board is designed specifically for use with the Talon SRX - it scales a native 5V analog signal to a Talon SRX compliant 3.3V, helping 5V magnetic shaft encoders to "just work" without additional circuitry.
...
See section 1.4.7 of the Talon SRX User's Guide for more details.
So in other words the MA3 is a 0-5V sensor, but the Talon analog input takes 0-3.3V (also in electrical specs in user's guide).
Reply With Quote
  #6   Spotlight this post!  
Unread 16-05-2015, 23:08
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,038
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Talon SRX and Analog Encoders

Quote:
Originally Posted by ozrien View Post
Here's a snippet from the link Ether mentioned...
Gotta give Antoine credit for that link :-)


Reply With Quote
  #7   Spotlight this post!  
Unread 17-05-2015, 00:10
TBots TBots is offline
Registered User
FRC #3350
 
Join Date: Sep 2014
Location: Texarkana
Posts: 39
TBots is an unknown quantity at this point
Re: Talon SRX and Analog Encoders

Alright I understand what is it now, but is it the only way to turn 5V of analog signal to 3.3? I'm asking because while the breakout board would be helpful, it doesn't look like we will be getting it any time soon seeing how it is currently sold out.

I still think it might be possible to recreate it, but maybe I don't yet understand the uniqueness of it. The talon SRX user guide makes the comment that the board is useful in the aspect that is uses "a resistor divider and voltage buffer" to make the 5V to 3.3V transition. What are these, and where are they located on the board? Is is something to do with the A63A?
Reply With Quote
  #8   Spotlight this post!  
Unread 17-05-2015, 00:24
MaGiC_PiKaChU's Avatar
MaGiC_PiKaChU MaGiC_PiKaChU is offline
Drive Coach
AKA: Antoine L.
FRC #3360 (Hyperion)
Team Role: Mentor
 
Join Date: Mar 2014
Rookie Year: 2012
Location: Sherbrooke
Posts: 608
MaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond repute
Re: Talon SRX and Analog Encoders

Quote:
Originally Posted by TBots View Post
Alright I understand what is it now, but is it the only way to turn 5V of analog signal to 3.3? I'm asking because while the breakout board would be helpful, it doesn't look like we will be getting it any time soon seeing how it is currently sold out.

I still think it might be possible to recreate it, but maybe I don't yet understand the uniqueness of it. The talon SRX user guide makes the comment that the board is useful in the aspect that is uses "a resistor divider and voltage buffer" to make the 5V to 3.3V transition. What are these, and where are they located on the board? Is is something to do with the A63A?
we made a custom 5 to 3.3V converter on a breadboard at first...
pretty simple, but would highly recommend the breakouts with the designed cable
Attached Thumbnails
Click image for larger version

Name:	Dn3dX.gif
Views:	63
Size:	18.1 KB
ID:	19001  
__________________
2012 - 3360 - Junior member
2013 - 3360 - Lead Programmer, Human player
2014 - 3360 - Lead Programmer, Human player
2015 - 3360 - Lead Programmer, Driver
2016 - 3360 - Mentor, Drive coach



Reply With Quote
  #9   Spotlight this post!  
Unread 17-05-2015, 00:43
TBots TBots is offline
Registered User
FRC #3350
 
Join Date: Sep 2014
Location: Texarkana
Posts: 39
TBots is an unknown quantity at this point
Re: Talon SRX and Analog Encoders

What is the "Q1" in the diagram?

Did it still work with the breadboard design? I mean, was there a major flaw in it, or did the breakout board just work better?

Yes the breakout board would be preferable, but if there is no way to get it at this moment, we would like to try alternate methods.
Reply With Quote
  #10   Spotlight this post!  
Unread 17-05-2015, 00:54
MaGiC_PiKaChU's Avatar
MaGiC_PiKaChU MaGiC_PiKaChU is offline
Drive Coach
AKA: Antoine L.
FRC #3360 (Hyperion)
Team Role: Mentor
 
Join Date: Mar 2014
Rookie Year: 2012
Location: Sherbrooke
Posts: 608
MaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond repute
Re: Talon SRX and Analog Encoders

Quote:
Originally Posted by TBots View Post
What is the "Q1" in the diagram?

Did it still work with the breadboard design? I mean, was there a major flaw in it, or did the breakout board just work better?

Yes the breakout board would be preferable, but if there is no way to get it at this moment, we would like to try alternate methods.
breadboard works, just takes a lot of space... As this is an offseason project, you should be fine.
breakout also allows you to use multiple sensors easily on a single SRX.

this diagram is an easier circuit you could use. The other was working both ways

http://www.savagecircuits.com/attach...6&d=1430452949
__________________
2012 - 3360 - Junior member
2013 - 3360 - Lead Programmer, Human player
2014 - 3360 - Lead Programmer, Human player
2015 - 3360 - Lead Programmer, Driver
2016 - 3360 - Mentor, Drive coach



Reply With Quote
  #11   Spotlight this post!  
Unread 17-05-2015, 01:08
TBots TBots is offline
Registered User
FRC #3350
 
Join Date: Sep 2014
Location: Texarkana
Posts: 39
TBots is an unknown quantity at this point
Re: Talon SRX and Analog Encoders

looks good Thank you for the help!
Reply With Quote
  #12   Spotlight this post!  
Unread 24-05-2015, 15:00
TBots TBots is offline
Registered User
FRC #3350
 
Join Date: Sep 2014
Location: Texarkana
Posts: 39
TBots is an unknown quantity at this point
Re: Talon SRX and Analog Encoders

Ether, what did you mean when you said this?

Quote:
Originally Posted by Ether View Post

use the appropriate CAN commands to set the gains in the Talon's PID controller.
Do you mean the difference in the current position of the encoder and the set point?
Reply With Quote
  #13   Spotlight this post!  
Unread 24-05-2015, 15:52
MaGiC_PiKaChU's Avatar
MaGiC_PiKaChU MaGiC_PiKaChU is offline
Drive Coach
AKA: Antoine L.
FRC #3360 (Hyperion)
Team Role: Mentor
 
Join Date: Mar 2014
Rookie Year: 2012
Location: Sherbrooke
Posts: 608
MaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond repute
Re: Talon SRX and Analog Encoders

Quote:
Originally Posted by TBots View Post
Ether, what did you mean when you said this?

Do you mean the difference in the current position of the encoder and the set point?
You have a command probably called "SetPID"... It allows you to place your parameters for the PID control, when you control with the position. You call this once before your control loop. if you never worked with PIDs before, I'm pretty sure Ether could help you
__________________
2012 - 3360 - Junior member
2013 - 3360 - Lead Programmer, Human player
2014 - 3360 - Lead Programmer, Human player
2015 - 3360 - Lead Programmer, Driver
2016 - 3360 - Mentor, Drive coach



Reply With Quote
  #14   Spotlight this post!  
Unread 24-05-2015, 16:26
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,038
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Talon SRX and Analog Encoders

Quote:
Originally Posted by TBots View Post
Do you mean the difference in the current position of the encoder and the set point?
No. Watch this video. It explains what PID gains are.


Reply With Quote
  #15   Spotlight this post!  
Unread 24-05-2015, 22:54
TBots TBots is offline
Registered User
FRC #3350
 
Join Date: Sep 2014
Location: Texarkana
Posts: 39
TBots is an unknown quantity at this point
Re: Talon SRX and Analog Encoders

Ah I see, you just mean the constants associated with PID. I understand now.

How frequent is the tele-op code executed on the roboRIO?

I need to know so I can choose the sensitivity of the joystick. Ill then use the values of the joystick in the math for the set point.
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 23:14.

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