Go to Post If it gets people talking about not only robots but science and technology, it's all good. - Koko Ed [more]
Home
Go Back   Chief Delphi > Technical > Control System > FRC Control System
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 11-01-2012, 02:02
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
Maximum rate for encoders hooked to cRio?

What is the maximum pulse rate from an encoder that the cRio can read? Will this drastically affect processor time?

We're looking at running 2 encoders at a fairly high rate (1400+rpm) which will result in a pulse rate of around 360X28=10080 pulses /second.
Reply With Quote
  #2   Spotlight this post!  
Unread 11-01-2012, 07:58
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: Maximum rate for encoders hooked to cRio?

See the short discussion here.
Reply With Quote
  #3   Spotlight this post!  
Unread 11-01-2012, 08:15
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Maximum rate for encoders hooked to cRio?

The other thread gave rates, but it wasn't explicitly stated that the encoders are polled by the FPGA and cause no interrupt traffic to the CPU.

Greg McKaskle
Reply With Quote
  #4   Spotlight this post!  
Unread 12-02-2013, 21:04
de_ de_ is offline
Registered User
AKA: Dave Edwards
FRC #1310 (Runnymede Robotics)
Team Role: Mentor
 
Join Date: Apr 2005
Rookie Year: 2005
Location: Toronto, Ontario
Posts: 256
de_ is a jewel in the roughde_ is a jewel in the roughde_ is a jewel in the roughde_ is a jewel in the rough
Re: Maximum rate for encoders hooked to cRio?

Its my understanding that only certain all Digital Side Card DI channels have interrupts handled by the FPGA (something line DI1-4). Anyone confirm this or know where that is documented ?
Reply With Quote
  #5   Spotlight this post!  
Unread 12-02-2013, 21:16
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Maximum rate for encoders hooked to cRio?

Looking at the LV API, it appears as though any channels can be used for encoders, and again, no interrupts are used, the digital lines are polled. It is possible to get the FPGA to raise an interrupt based on the state of a digital line, and it appears that all lines are possible.

You may be thinking of the analog resources as only the first two channels ont he first module supports accumulation of gyro.

Greg McKaskle
Reply With Quote
  #6   Spotlight this post!  
Unread 12-02-2013, 21:30
de_ de_ is offline
Registered User
AKA: Dave Edwards
FRC #1310 (Runnymede Robotics)
Team Role: Mentor
 
Join Date: Apr 2005
Rookie Year: 2005
Location: Toronto, Ontario
Posts: 256
de_ is a jewel in the roughde_ is a jewel in the roughde_ is a jewel in the roughde_ is a jewel in the rough
Re: Maximum rate for encoders hooked to cRio?

If the DI lines are all only polled by the CPU, then the I/O rates would be a small fraction of the 35,000 I/0s /sec rate the FPGA can handle. Ouch
Reply With Quote
  #7   Spotlight this post!  
Unread 12-02-2013, 21:53
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: Maximum rate for encoders hooked to cRio?

What do you mean, Dave? The FPGA "polls" all its inputs simultaneously.
Reply With Quote
  #8   Spotlight this post!  
Unread 12-02-2013, 22:02
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,562
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: Maximum rate for encoders hooked to cRio?

Quote:
Originally Posted by de_ View Post
Its my understanding that only certain all Digital Side Card DI channels have interrupts handled by the FPGA (something line DI1-4). Anyone confirm this or know where that is documented ?
The FPGA supports 4 encoders in 4x mode. These can be any of the DIO pins. It also supports 8 encoders in 1x or 2x mode or counters on any DIO pin.
Reply With Quote
  #9   Spotlight this post!  
Unread 12-02-2013, 22:06
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,044
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: Maximum rate for encoders hooked to cRio?

Quote:
Originally Posted by Tom Line View Post
Will this drastically affect processor time?
No. The FPGA handles the polling of the encoder pulses. It is separate from the CPU. The FPGA counts and times the pulses, then provides that info to the CPU (when your software asks for it).

Quote:
What is the maximum pulse rate from an encoder that the cRio can read?
The FPGA polls the DIO channels at 153257 Hz, so the FPGA can count edges that are no less than 6.525 microseconds apart.

Also, for a quadrature signal, the edges from both channels must be at least that far apart from each other, or the FPGA will not be able to tell which channel's rising edge occurred first.

So the max rpm depends on how your encoder is configured. For example:

US Digital 360 CPR E4P encoder.

Each encoder channel is connected to a separate DIO channel.

The encoder has 360 rising edges plus 360 falling edges on each channel (total 720 edges per channel)

Assume perfect 90 degrees phase between the 2 encoder channels.

Instantiated from the Encoder class as 4X.

Theoretical maximum encoder speed that the FPGA can process with the encoder in this configuration:

60*153257/(4*360) = 6386 RPM

However, per the encoder datasheet, the typical installed tolerance for the
quadrature phase is 90 +/- 10 degrees. Assuming it's 10 degrees off:

60*153257/((180/(90-10))*2*360) = 5676 RPM

Per the encoder datasheet, the maximum installed tolerance for the
quadrature phase is 90 +/- 60 degrees. Assuming it's 60 degrees off:

60*153257/((180/(90-60))*2*360) = 2129 RPM


Reply With Quote
  #10   Spotlight this post!  
Unread 13-02-2013, 12:30
de_ de_ is offline
Registered User
AKA: Dave Edwards
FRC #1310 (Runnymede Robotics)
Team Role: Mentor
 
Join Date: Apr 2005
Rookie Year: 2005
Location: Toronto, Ontario
Posts: 256
de_ is a jewel in the roughde_ is a jewel in the roughde_ is a jewel in the roughde_ is a jewel in the rough
Re: Maximum rate for encoders hooked to cRio?

Since we have gone this far, it sounds like the FPGA and 9403 I/O card are cponservatively capable of say 5000+ rpm per quadrature encoder. Hopefully the encoder and the Digital side car D/I electronics & the cable to the CRio bandwidth are also rated for those rates. Note a grayhill 61R256 encoder is only rated for 300 RPM.

A quad encoder takes 2 of the 14 DI ports so does that mean the system could handle 7 quad encoders each running at 5000 rpm ? (or is there a limit in wpilib but not in the CRio / fpga for example).

It also sounds that if you are not using quadrature encoding (ie only single rising edge detection) and only using a single DI port (ie don't need to know the rotation direction), 14 channels of 10,000 RPM (at 256 rising edges per revolution: or 2,560,000 rpm at a single rising edge per revolution (as long as the 6.525 microseconds is maintained ? ) ?

perfect conditions example assuming 6.525 us for up pulse, 6.525 for down, single pulse per rotation, 0 phase error max RPM might appear to be 60 / (2 * 0.000006525) = 4.8M rpm. Sounds like I have something wrong here

Just trying to understand the envelop of capability of the Crio/FPGA product.
Back to building robots and trying to do pid on a 7200 rpm motor.

Last edited by de_ : 13-02-2013 at 12:43.
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 07:55.

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