Go to Post FIRST is all about working with others. - briholton [more]
Home
Go Back   Chief Delphi > Technical > Programming
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 30-01-2017, 20:04
RedDog RedDog is offline
Registered User
AKA: Brian King
FRC #3663 (Cedar Park Robotics)
Team Role: Mentor
 
Join Date: Dec 2010
Rookie Year: 2011
Location: Bothell, WA
Posts: 5
RedDog is an unknown quantity at this point
How to increase the Talon SRX encoder update freq

I am using a Talon SRX with a quadrature encoder attached to it's data port. It is up and running and everything is working fine.

I would like to collect the encoder velocity (talon.getSpeed()) for analysis at a frequency of 50 times/sec. However, it is only being updated 10 times/sec. I understand that this is per the specification. See page 93 of https://www.ctr-electronics.com/Talo...e%20Manual.pdf.

The spec says the update frequency can be increased but I could not find out how to do it. Does anyone know how this can be done? I am using Java.

Thanks
Reply With Quote
  #2   Spotlight this post!  
Unread 30-01-2017, 20:48
solomondg solomondg is online now
Registered User
FRC #2898 (Flying Hedgehogs)
Team Role: Programmer
 
Join Date: Aug 2016
Rookie Year: 2016
Location: Portland, Oregon
Posts: 12
solomondg is an unknown quantity at this point
Re: How to increase the Talon SRX encoder update freq

CANTalon.setStatusFrameRateMs is what you're looking for.

If you have CANTalon mLeftMotor, all you'd have to do to set it to a 50Hz update rate is
mLeftMotor.setStatusFrameRateMs(CANTalon.StatusFra meRate.Feedback, 20);

Careful of saturating the CAN bus.
Reply With Quote
  #3   Spotlight this post!  
Unread 30-01-2017, 23:02
beijing_strbow beijing_strbow is offline
Registered User
FRC #5968 (Cyborg Indians)
Team Role: Programmer
 
Join Date: Aug 2016
Rookie Year: 2016
Location: Kansas
Posts: 48
beijing_strbow is an unknown quantity at this point
Re: How to increase the Talon SRX encoder update freq

How easy is it to use up the CAN bus bandwidth? I was having some issues with finding the position of the robot, and I think it may be partially due to having a low update rate on the encoders compared to the update rate on the roboRIO.

Considering that we have 4 Talons, the PCM, and the PDP connected to the CAN bus, what is the highest refresh rate we can safely use?
Reply With Quote
  #4   Spotlight this post!  
Unread 30-01-2017, 23:04
beijing_strbow beijing_strbow is offline
Registered User
FRC #5968 (Cyborg Indians)
Team Role: Programmer
 
Join Date: Aug 2016
Rookie Year: 2016
Location: Kansas
Posts: 48
beijing_strbow is an unknown quantity at this point
Re: How to increase the Talon SRX encoder update freq

And since I don't seem to have the ability to edit posts, I forgot to add that 2 of the Talons are connected to encoders, and 2 are set to follower mode.
Reply With Quote
  #5   Spotlight this post!  
Unread 31-01-2017, 02:16
solomondg solomondg is online now
Registered User
FRC #2898 (Flying Hedgehogs)
Team Role: Programmer
 
Join Date: Aug 2016
Rookie Year: 2016
Location: Portland, Oregon
Posts: 12
solomondg is an unknown quantity at this point
Re: How to increase the Talon SRX encoder update freq

CAN bandwidth is ~1 Mbps, IIRC. You should be fine in terms of bandwidth, but you don't want to run 8 SRXs at 100Hz each. Your setup sounds like it would work fine.
Reply With Quote
  #6   Spotlight this post!  
Unread 31-01-2017, 02:40
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,600
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: How to increase the Talon SRX encoder update freq

Quote:
Originally Posted by solomondg View Post
CAN bandwidth is ~1 Mbps, IIRC. You should be fine in terms of bandwidth, but you don't want to run 8 SRXs at 100Hz each.
Why not? See section 15.1 of the Talon SRX software reference manual.
Reply With Quote
  #7   Spotlight this post!  
Unread 31-01-2017, 15:12
RedDog RedDog is offline
Registered User
AKA: Brian King
FRC #3663 (Cedar Park Robotics)
Team Role: Mentor
 
Join Date: Dec 2010
Rookie Year: 2011
Location: Bothell, WA
Posts: 5
RedDog is an unknown quantity at this point
Re: How to increase the Talon SRX encoder update freq

Thanks, but it did not make any difference. I did find that getPosition() updated at 50 hz and I can make that work.

Thanks again
Reply With Quote
  #8   Spotlight this post!  
Unread 31-01-2017, 15:19
beijing_strbow beijing_strbow is offline
Registered User
FRC #5968 (Cyborg Indians)
Team Role: Programmer
 
Join Date: Aug 2016
Rookie Year: 2016
Location: Kansas
Posts: 48
beijing_strbow is an unknown quantity at this point
Re: How to increase the Talon SRX encoder update freq

In Section 15.1 of the Software Manual, it says the default update frequency is actually 100 Hz (every 10 ms), as opposed to 10 Hz like you posted earlier.
Reply With Quote
  #9   Spotlight this post!  
Unread 31-01-2017, 21:30
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: 549
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: How to increase the Talon SRX encoder update freq

The selected sensor speed is updated every 20ms by default...

Section 20.2. Feedback Status
The Feedback Status frame has a default period of 20ms, and provides…"Sensor Velocity: Velocity of the selected sensor"

...and can be overridden with the status frame rate API.

You should be fine on CAN bandwidth, but the SRX Software manual explains how to check the utilization in the driver station if need be.
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 01: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