Go to Post The extra button could also just be a spare, but that's far less interesting than other possibilities, so let's keep speculating. - Caleb Sykes [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 Rating: Thread Rating: 5 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 03-10-2011, 21:59
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
FRC FPGA usage

Today, I had a discussion with Eric Yahrmatter about the cRio, specifically the FPGA. We talked about the possibility of pushing hard RT tasks (especially PID control loops) to the FPGA, relieving the processor of the hard RT tasks and allowing it to do more functionally advanced things without worrying about bogging down the hard RT tasks.

Does anyone have opinions on opening the FPGA to teams? Opening the FPGA to hard RT tasks (like PID controls) would allow more freedom on the processor to implement processor-intensive tasks (such as vision processing) without worrying about the consequences of full CPU usage, and would make the control loops more stable and faster response at the same time.

If allowed, I would recommend that it be discouraged to teams without a good programming resource, as it could be more trouble than it is worth unless the programmer knows exactly what they are doing.

In case anyone is in the dark and has no idea what I am talking about:
-An FPGA (Field Programmable Gate Array) is essentially configurable hardware, allowing you to essentially write hardware. FPGA's can be used for very fast hard multi-threaded RT tasks, as blocks of hardware can execute synchronously - there is no single processor executing a single instruction. They are good for doing fast math operations in parallel.
-The FPGA in the cRio interfaces the hardware IO to the processor. In order to read the IO, there must be FPGA code which does the reading and returns the result to the processor (likewise in reverse). Currently, FIRST provides an image which must be used, which defines some standard IO (raw IO, PWM output, encoder/counters, accumulators, etc.)

Please note that we have not yet received our 2012 beta test information. This is pure speculation.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
Reply With Quote
  #2   Spotlight this post!  
Unread 04-10-2011, 00:34
Tristan Lall's Avatar
Tristan Lall Tristan Lall is offline
Registered User
FRC #0188 (Woburn Robotics)
 
Join Date: Aug 2001
Rookie Year: 1999
Location: Toronto, ON
Posts: 2,484
Tristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond repute
Re: FRC FPGA usage

I'm not sure what to think:
  1. I guess it would be nice to have an FPGA available for custom high-speed processing. Right now it's theoretically possible with an external FPGA, but the cost constraints make it quite difficult. Maybe you could run some of the machine vision on the FPGA as well.* (I'm assuming that there's lots of headroom available on the FPGA, but I don't know how many gates and I/O resources are necessary to implement common image processing tasks, and how many are absorbed by the existing firmware.)
  2. It's easy to let this get out of hand. The < 20 teams that have the resources to program in VHDL are going to obliterate the competition with fancy autonomous modes, while the > 500 teams that have never had a proper autonomous mode will be that much further away from the rapidly evolving state of the art. (It could be roughly likened to giving teams large brushless DC motors, without providing a robust motor controller—but letting teams build or implement their own controller, if they can figure it out.)
Maybe the right balance could be that FIRST expands the capabilities of the default FPGA firmware in a modular fashion, while simultaneously permitting teams to combine both mandatory and custom VHDL modules (to be compiled by the team at their own risk).

*Or is vision already on the FPGA, and only being invoked by the program?
Reply With Quote
  #3   Spotlight this post!  
Unread 04-10-2011, 00:45
connor.worley's Avatar
connor.worley connor.worley is offline
Registered User
FRC #0973 (Greybots)
Team Role: Mentor
 
Join Date: Mar 2011
Rookie Year: 2010
Location: Berkeley/San Diego
Posts: 601
connor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond repute
Re: FRC FPGA usage

Quote:
Originally Posted by Tristan Lall View Post
The < 20 teams that have the resources to program in VHDL are going to obliterate the competition with fancy autonomous modes
I'm doubtful about this. FIRST has been leaning towards simple autonomous challenges. I don't think anyone will be able to properly implement something complicated enough that it requires the extra power, and even if they do, they're probably over-engineering things. Sure, open it up to teams, but I don't see it providing a massive competitive advantage.
__________________
Team 973 (2016-???)
Team 5499 (2015-2016)
Team 254 (2014-2015)

Team 1538 (2011-2014)
2014 Driver (25W 17L 1T)
日本語でOK
Reply With Quote
  #4   Spotlight this post!  
Unread 04-10-2011, 00:58
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: FRC FPGA usage

The FPGA is pretty full as it is today. It fails to meet timing 30% of the times it's built. There is no vision processing in the FPGA today. Given that the camera teams use is Ethernet based and not a raw sensor connected directly to the FPGA I/O, the cost of getting the image into the FPGA generally outweighs any processing benefit.

As for PID, the PWM interface to the motor controllers is so slow that the RT processor can easily keep up even when heavily taxed, assuming task priorities are assigned reasonably. The CAN interface is not directly accessible by the FPGA, so that route won't benefit either.

So far I haven't heard any compelling reasons to make the FPGA design open. However, the fact that the safety mechanisms are mostly implemented in the FPGA is a very good reason not to open the design. Potentially future technologies like partial reconfiguration would remove that concern.

I'm always open to evaluating specific feature requests for the FPGA design.

-Joe
Reply With Quote
  #5   Spotlight this post!  
Unread 04-10-2011, 02:33
AustinSchuh AustinSchuh is offline
Registered User
FRC #0971 (Spartan Robotics) #254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Feb 2005
Rookie Year: 1999
Location: Los Altos, CA
Posts: 803
AustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond repute
Re: FRC FPGA usage

Quote:
Originally Posted by jhersh View Post
I'm always open to evaluating specific feature requests for the FPGA design.
Not to hijack the thread too much, but could we get a couple more 4x encoder decoders? The actual encoder logic shouldn't be complicated enough that it uses a bunch of gates. I have known a couple of teams who have run into the limit.
Reply With Quote
  #6   Spotlight this post!  
Unread 04-10-2011, 06:41
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: FRC FPGA usage

You don't need VHDL. LabVIEW can be used to program the FPGA.

I wouldn't mind a fairly plug and play architecture, with mandatory blocks and standard/custom blocks. To make space for custom blocks, just get rid of what you don't use (extra encoder modules, extra accumulators, SPI, etc.)

I'm not saying the FPGA should be opened. I'm asking what everyone thinks about either side of the issue.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
Reply With Quote
  #7   Spotlight this post!  
Unread 04-10-2011, 08:08
Unsung FIRST Hero
Al Skierkiewicz Al Skierkiewicz is offline
Broadcast Eng/Chief Robot Inspector
AKA: Big Al WFFA 2005
FRC #0111 (WildStang)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1996
Location: Wheeling, IL
Posts: 10,795
Al Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond repute
Re: FRC FPGA usage

Joe,
Can you go into a little more depth on the safety issues with the FPGA? These are the used for field controls during a match, correct? Thanks.
__________________
Good Luck All. Learn something new, everyday!
Al
WB9UVJ
www.wildstang.org
________________________
Storming the Tower since 1996.
Reply With Quote
  #8   Spotlight this post!  
Unread 04-10-2011, 10:34
Tom Bottiglieri Tom Bottiglieri is offline
Registered User
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 2003
Location: San Francisco, CA
Posts: 3,187
Tom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond repute
Re: FRC FPGA usage

It's always seemed to me that the motors, controllers, and generally sloppy mechanical systems we have aren't good enough to warrant any control loops faster than like 1kHz. You should be able to hit that.

(assuming you think the gain in speed outweighs the risk of using the Jaguar controllers, which IMHO it does not)
Reply With Quote
  #9   Spotlight this post!  
Unread 04-10-2011, 14:48
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: FRC FPGA usage

I believe it makes a lot of sense to consider the FPGA the equivalent of the "master" processor of the old IFI system, and to keep it completely off limits for team use. It helps make the cRIO failsafe.

Right now, the only reason I would entertain for opening it up would be to let teams use presently unsupported cRIO modules.
Reply With Quote
  #10   Spotlight this post!  
Unread 04-10-2011, 16:40
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: FRC FPGA usage

Quote:
Originally Posted by AustinSchuh View Post
Not to hijack the thread too much, but could we get a couple more 4x encoder decoders? The actual encoder logic shouldn't be complicated enough that it uses a bunch of gates. I have known a couple of teams who have run into the limit.
I used to have 8 of them, but removed 4 of them for space reasons. Part of the reason I selected them to remove is because the counters can already handle the 1x and 2x encoder cases. I think it's a good chance to teach engineering trade-offs (choosing where to allocate the 4x vs 2x decoding).

-Joe
Reply With Quote
  #11   Spotlight this post!  
Unread 04-10-2011, 16:43
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: FRC FPGA usage

Quote:
Originally Posted by Al Skierkiewicz View Post
Joe,
Can you go into a little more depth on the safety issues with the FPGA? These are the used for field controls during a match, correct? Thanks.
The FPGA has a hardware watchdog timer that will stop all PWM, Relay, and Solenoid signals in the event that the RT processor does not indicate that the FMS is still allowing the robot to run. By keeping the FPGA inaccessible to teams, we can ensure that this functionality is not compromised and hence the robot is fail-safe.

-Joe
Reply With Quote
  #12   Spotlight this post!  
Unread 06-10-2011, 08:32
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,752
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: FRC FPGA usage

Can the FPGA can be opened?
Yes, technically it can.

Why is it closed in the first place?
It implements the safety override, putting the robot outputs into a safe state ...
1. whenever the FTA chooses
2. whenever the drivers or coach or anyone else punches the estop button
3. in those situations when the team code is not updating outputs -- watchdog
3. when the RT communication stops receiving driver station communications

--------------

Rephrasing the topic slightly to focus on better control options.
What mechanisms would you want enhanced control over?
What sensors will provide the rapid measurements?
What actuators will provide rapid response?
What timing numbers are we talking about? -- milliseconds, microseconds, nanoseconds, or what?

I rephrased the question because plenty of RT computers don't have FPGAs. They have a realtime OS that allocates the CPU carefully using enhanced scheduling features such as priorities. The cRIO has those features AND and FPGA.

The default code really doesn't use these mechanisms by default because they are a bit more complex, but once a team has the basics under their belt, the next thing to do is to measure the performance, identify issues, and IF the problem is code latency or jitter, you reach for the RT features of the language/OS. If the problem is slop in your chain or gear train, better code timing may not be the best approach.

If there are other things you want to use the FPGA for, what are they?

Greg McKaskle
Reply With Quote
  #13   Spotlight this post!  
Unread 06-10-2011, 10:28
Unsung FIRST Hero
Al Skierkiewicz Al Skierkiewicz is offline
Broadcast Eng/Chief Robot Inspector
AKA: Big Al WFFA 2005
FRC #0111 (WildStang)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1996
Location: Wheeling, IL
Posts: 10,795
Al Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond repute
Re: FRC FPGA usage

Greg and Joe,
Is there a way to store a value in non-volatile memory somewhere. It might be a great diagnostic tool to know what command might have executed just prior to a shutdown. In the finals this year at champs one team would lose all function several seconds into the match. It did not appear that it stopped at the end of auton but just slightly after. The team was stumped as to what when on.
Al
__________________
Good Luck All. Learn something new, everyday!
Al
WB9UVJ
www.wildstang.org
________________________
Storming the Tower since 1996.
Reply With Quote
  #14   Spotlight this post!  
Unread 06-10-2011, 13:43
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: FRC FPGA usage

Quote:
Originally Posted by Al Skierkiewicz View Post
Is there a way to store a value in non-volatile memory somewhere.
The entire cRIO filesystem is non-volatile memory. To store a value for later inspection, just write it to a file.

Quote:
It might be a great diagnostic tool to know what command might have executed just prior to a shutdown.
A cheap way to do that sort of diagnostics might be to write the value to the Driver Station display. Each new value will overwrite the previous one, and the last value to be displayed will remain there until the DS is shut down. The "value" that gets printed can be a nicely-formatted, easily-understood text string.
Reply With Quote
  #15   Spotlight this post!  
Unread 06-10-2011, 14:13
Unsung FIRST Hero
Al Skierkiewicz Al Skierkiewicz is offline
Broadcast Eng/Chief Robot Inspector
AKA: Big Al WFFA 2005
FRC #0111 (WildStang)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1996
Location: Wheeling, IL
Posts: 10,795
Al Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond repute
Re: FRC FPGA usage

Alan,
I am thinking this needs to be something that can't be over-written by accident, can easily be retrieved by someone in the know or can be ported to a file on the FMS. As you know, I hate seeing a robot fail on the field with no way to determine the root cause other than to suspect a programming error by a zealous software person or an intermittent electrical problem. "Just the facts, ma'am, just the facts."
Was it a link failure, a power failure, a code failure, a hardware failure? Even if the error code can be ported to the indicator to flash a code, that might help teams (check engine flash codes). I (we) feel all too helpless when we see a robot fail match after match for a whole weekend without the ability to take corrective action. Our limit should be one failure per weekend per team. I witnessed that at every event I attended. Personally, I don't like winning when the opposition is down a robot and I don't like being incapable of helping.
__________________
Good Luck All. Learn something new, everyday!
Al
WB9UVJ
www.wildstang.org
________________________
Storming the Tower since 1996.
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 16: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