Go to Post I don't know about the rest of you, but I do this to give kids an opportunity that I never had. - Jack Jones [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

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 16-02-2015, 09:12
JML's Avatar
JML JML is offline
Jlyon
AKA: Jlyon
FRC #3044 (0xBe4)
Team Role: Programmer
 
Join Date: Oct 2012
Rookie Year: 2012
Location: 3044
Posts: 17
JML is an unknown quantity at this point
Talon SRX Encoders

Our team is using 8 Talon SRX Motor controllers to drive our robot with a swerve drive drive train. there are quadrature encoders on the wheels for rotation, which are wired into breakout boards on the Talon SRX Controllers. This created an inconsistency in the drive as compared to when they are plugged directly into the RoboRIO, as the encoder values are 4 times higher than we would expect them to be, so we divided them by four to simply test if the system would work, but there is still some shakyness in the wheels.

According to the Talon SRX software manual (Page 66):

Quote:
17.1. (Quadrature) Encoder Position
When measuring the position of a Quadrature Encoder, the position is measured in 4X encoder
edges. For example, if a US Digital Encoder with a 360 cycles per revolution (CPR) will count
1440 units per rotation when read using “Encoder Position” or “Sensor Position”.

The velocity units of a Quadrature Encoder is the change in Encoder Position per TvelMea
(TvelMeas=0.1sec). For example, if a US Digital Encoder (CPR=360) spins at 20 rotations per
second, this will result in a velocity of 2880 (28800 position units per second).
It was brought up that the Talons could be summing together four values, or the input could be lagging behind by four ticks, which would cause the issue we are seeing. If anyone knows how this functionality is implemented or if we could "turn it off" that would be very helpful, I cant seem to find anything in the talon documentation about this, other than the section i posted, i will check the roboRIO web interface as soon as i get to our robot to see if it is something about it there
  #2   Spotlight this post!  
Unread 16-02-2015, 09:38
Jefferson Jefferson is offline
Registered User
AKA: Jeff Clements
FRC #0016 (Bomb Squad)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Mountain Home, AR
Posts: 258
Jefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond repute
Re: Talon SRX Encoders

Quote:
Originally Posted by JML View Post
Our team is using 8 Talon SRX Motor controllers to drive our robot with a swerve drive drive train. there are quadrature encoders on the wheels for rotation, which are wired into breakout boards on the Talon SRX Controllers. This created an inconsistency in the drive as compared to when they are plugged directly into the RoboRIO, as the encoder values are 4 times higher than we would expect them to be, so we divided them by four to simply test if the system would work, but there is still some shakyness in the wheels.

According to the Talon SRX software manual (Page 66):



It was brought up that the Talons could be summing together four values, or the input could be lagging behind by four ticks, which would cause the issue we are seeing. If anyone knows how this functionality is implemented or if we could "turn it off" that would be very helpful, I cant seem to find anything in the talon documentation about this, other than the section i posted, i will check the roboRIO web interface as soon as i get to our robot to see if it is something about it there
The Talons are always in 4X mode, and I don't believe there is a way to change that. I'm guessing the encoder objects on the roboRIO are in 1X mode. Is there an issue with simply multiplying your setpoint by 4?
  #3   Spotlight this post!  
Unread 16-02-2015, 10:23
Levansic's Avatar
Levansic Levansic is offline
Registered User
AKA: Len Evansic
FRC #0585 (Cyber Penguins)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2008
Location: Tehachapi, CA
Posts: 185
Levansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud of
Re: Talon SRX Encoders

What is the time delay in the loop that sends motor commands?

Using the Talons with encoders requires communication over CAN. There will be more latency than issuing a PWM command. In human-scale timing, it is imperceptible, but it is enough to make control loops appear to behave differently if the assumption is that you have a very fast and very consistent timing in your loop.

I don't know what programming language you are using, but for our team using LabView, we decoupled our control loops from the loop issuing motor commands. In this way, our correcting control runs as fast as we can get new data from our feedback sensor (a gyro), and the motor commands are issued more slowly, which allows for the CAN latency.

One last thing you may want to look at is the PIDF tuning on the talon itself. The PID on the talon runs at a very fast rate. The coefficients used on it will not be the same as what you would use on the RoboRio. You have to tune those to the motors and gearing attached. You may have an aggressive or unstable set of coefficients loaded on the Talons, which may be just fine when running on the RoboRio, or vice versa. I would reccomend making a program that ramps the speed up and down in both directions to tune the PID parameters. Step functions are fine for setting the P and I terms, but really good control can be attained by further tuning the D and F with a sawtooth input.
  #4   Spotlight this post!  
Unread 16-02-2015, 10:28
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,113
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: Talon SRX Encoders

Are you doing the closed-loop control in the roboRIO code, and just using the Talon SRX as a way to read the encoder values? Doing that will result in some sensor lag, because the CAN communication is not instantaneous. The Talon status frames from the Talons are sent periodically. If you have enough CAN bandwidth, you can change their rate to be sent more often, which should help.
  #5   Spotlight this post!  
Unread 16-02-2015, 14:28
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: 531
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: Talon SRX Encoders

Quote:
but there is still some shakyness in the wheels.
Jlyon, I think you need to better explain that. I would put the RIO encoders into 4X mode and retest so you can compare apples to apples.

Quote:
or the input could be lagging behind by four ticks
4 Ticks? That sounds pretty accurate to me. Unless your encoders are very low resolution.

Please read section 16.9 if the observation is that the Talon encoders are "behind" the RIO encoders only when encoders are spinning. In which case do the math to see what 20ms of lag (at your RPM) should do in terms of encoder difference If that's a problem tweak the status frame rate to be faster (section 20.5).

If you problem is that there is error between Rio and Talon when the encoders are still then the root-cause has nothing to do with the frame rate.

If you're using LabVIEW (you didn't mention what language you were using) avoid calling Motor-Enable continuously since that will re-set the sensor position.
Closed Thread


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 21:12.

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