Go to Post While we discuss this stuff, let's keep our heads on straight. Open your eyes and look around you. Let's celebrate our common goal while accepting our differences. - Andy Baker [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 02-02-2016, 01:25
Tom Line's Avatar
Tom Line Tom Line is offline
Raptors can't turn doorknobs.
FRC #1718 (The Fighting Pi)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 1999
Location: Armada, Michigan
Posts: 2,513
Tom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond repute
Re: Encoder resolution on fast turning shafts

There was a very lengthy discussion about jitter, sampling, and RPM calculation in 2012. To make a long discussion short, if you are using the period function in LabVIEW, you may actually be better off with a 1 count per rotation encoder to maximize the period and make your RPM calculation more accurate. We used it very successfully in 2012, and 2013. This will also eliminate any worries you may have about loading the roborio.

This is somewhat counter-intuitive if you are thinking about calculating RPM using "number of ticks" divided by time.
  #2   Spotlight this post!  
Unread 02-02-2016, 15:24
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: Encoder resolution on fast turning shafts

Quote:
Originally Posted by Tom Line View Post
There was a very lengthy discussion about jitter, sampling, and RPM calculation in 2012. To make a long discussion short, if you are using the period function in LabVIEW, you may actually be better off with a 1 count per rotation encoder to maximize the period and make your RPM calculation more accurate.
While much of that discussion still holds to some extent, much of it is not all that applicable given the roboRIO's vastly faster DIO, unless you have a blindingly fast encoder signal.

Quote:
Originally Posted by Tom Line View Post
We used it very successfully in 2012, and 2013. This will also eliminate any worries you may have about loading the roborio.
The roboRIO and the cRIO does / did all quadrature decoding in the FPGA. It incurs no more or less load on the system sitting unswitched vs. switching quickly.

Last edited by jhersh : 02-02-2016 at 18:01.
  #3   Spotlight this post!  
Unread 02-02-2016, 15:35
Thad House Thad House is offline
Volunteer, WPILib Contributor
no team (Waiting for 2021)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Thousand Oaks, California
Posts: 1,087
Thad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond repute
Re: Encoder resolution on fast turning shafts

Quote:
Originally Posted by jhersh View Post
While much of that discussion still holds to some extent, much of it is not all that applicable given the roboRIO's vastly faster DIO, unless you have a blindingly fast encoder signal.



The roboRIO and the cRIO do / did all quadrature decoding in the FPGA. It incurs no more or less load on the system sitting unswitched vs. switching quickly.
Joe, do you know exactly what the pulses per second rating for encoders/counters in the FPGA is? I remember that the cRIO was right around 40,000, and I remember hearing that the RoboRIO was in the realm of 100,000, but I would like to know for sure. It would also be nice to have this documented somewhere if possible.

EDIT: Nevermind. I didn't see the 25ns number above. Does that mean that that the RoboRIO can take 40,000,000 edge to edge pulses per second, or am I screwing my math up somewhere. That number just seems incredibly high, but I could see it being that high.
__________________
All statements made are my own and not the feelings of any of my affiliated teams.
Teams 1510 and 2898 - Student 2010-2012
Team 4488 - Mentor 2013-2016
Co-developer of RobotDotNet, a .NET port of the WPILib.

Last edited by Thad House : 02-02-2016 at 15:39.
  #4   Spotlight this post!  
Unread 02-02-2016, 15:50
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,042
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: Encoder resolution on fast turning shafts

Quote:
Originally Posted by Thad House View Post
EDIT: Nevermind. I didn't see the 25ns number above. Does that mean that that the RoboRIO can take 40,000,000 edge to edge pulses per second
It means the roboRIO samples the edges at 40MHz, and timestamps them with a 40MHz clock (25ns resolution) when detected.

So no, you wouldn't get a usable reading at 40M edges per second.

Note: back in 2012, the cRIO FPGA took samples at only 153KHz, and timestamped them with a 1MHz clock. That's why we had all the discussions back then.




Last edited by Ether : 02-02-2016 at 15:54.
  #5   Spotlight this post!  
Unread 02-02-2016, 16:04
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: Encoder resolution on fast turning shafts

Quote:
Originally Posted by Thad House View Post
Joe, do you know exactly what the pulses per second rating for encoders/counters in the FPGA is? I remember that the cRIO was right around 40,000, and I remember hearing that the RoboRIO was in the realm of 100,000, but I would like to know for sure. It would also be nice to have this documented somewhere if possible.

EDIT: Nevermind. I didn't see the 25ns number above. Does that mean that that the RoboRIO can take 40,000,000 edge to edge pulses per second, or am I screwing my math up somewhere.
If you look at "roboRIO Specifications" linked from here, in the Digital I/O section on page 4, it references "minimum pulse width". That's the hardware limit. The FPGA implementation uses a 40 MHz clock as the timebase to run the decoder logic and the I/O logic. That means the FPGA is the limiting factor by a small margin. There are complications (discussed earlier) with respect to the sampling and ensuring no two edges are detected in the same sample period. To ensure that is avoided, divide the rate by 2. That means 20,000,000 edges per second should be guaranteed to decode. That edge rate would mean 5,000,000 rising edges on the A encoder output per second (assuming very small phase error in your encoder both A to B and rising to falling).

Quote:
Originally Posted by Thad House View Post
That number just seems incredibly high, but I could see it being that high.
Quote:
Originally Posted by jhersh View Post
...the roboRIO's vastly faster DIO...
It is incredibly high... by comparison to the previous system anyway.
  #6   Spotlight this post!  
Unread 02-02-2016, 17:07
Qormix Qormix is offline
Programming Captain
AKA: Marc Levesque
FRC #4976 (Rebel Robotics)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Canada
Posts: 9
Qormix is an unknown quantity at this point
Re: Encoder resolution on fast turning shafts

Hello My team is trying to use the VersaPlanetary Integrated Encoder to reach about 12000 rpm. The documentation on vex pro says 15000 rpm max but looking at the talon SRX software documentation says 10000 rpm max and we seem to be maxing out the rpm.
__________________
Team 4976
-------------------------------------------
Marc Levesque - Programmer
  #7   Spotlight this post!  
Unread 02-02-2016, 17:45
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: 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: Encoder resolution on fast turning shafts

Quote:
Originally Posted by Qormix View Post
Hello My team is trying to use the VersaPlanetary Integrated Encoder to reach about 12000 rpm. The documentation on vex pro says 15000 rpm max but looking at the talon SRX software documentation says 10000 rpm max and we seem to be maxing out the rpm.
The mag encoder spec says 15000rpm, not 10000rpm. Section 1.4 in Mag Encoder User's Guide.

The 10000RPM in section 7.5.4 in SRX Software Reference Manual is a typo. I'll fix it soon.

And also...
http://www.chiefdelphi.com/forums/sh...63&postcount=6
  #8   Spotlight this post!  
Unread 04-02-2016, 19:12
Qormix Qormix is offline
Programming Captain
AKA: Marc Levesque
FRC #4976 (Rebel Robotics)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Canada
Posts: 9
Qormix is an unknown quantity at this point
Re: Encoder resolution on fast turning shafts

Thanks, still can't seem to get it work are current using java and have set the feedback device to ctre mag relative and are unable to read an rpm above 5000 we are using java any suggestions

Edit.

We updated the firmware and it worked. *facepalm*
__________________
Team 4976
-------------------------------------------
Marc Levesque - Programmer

Last edited by Qormix : 04-02-2016 at 19:34.
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 08:49.

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