Go to Post You really can't have a bad year. The only way you can is to come out of it and not learn anything. - Dan Petrovic [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
  #31   Spotlight this post!  
Unread 05-08-2010, 20:08
davidthefat davidthefat is offline
Alumni
AKA: David Yoon
FRC #0589 (Falkons)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: California
Posts: 792
davidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud of
Re: Is the crio powerful enough?

Quote:
Originally Posted by kamocat View Post
An FPGA is not a processor. It does not have to work with only four bytes at a time. It doesn't have to grab data from a register, manipulate it, and then put it somewhere else in memory; it can just process the data continuously. It runs in parallel, like analog hardware. Think of it as a million operational amplifiers you can connect in whatever pattern you like, but instead of having to remanufacture it each time, you can reconfigure it electronically. In truth, it actually loads its configuration from non-volatile memory each time it is turned on, as opposed to it being burned in like a CD.

On the cRIO, there is a processor and an FPGA. I'm not sure about the ethernet or RS232, but I know that every one of the eight modules goes through the FPGA to get to the processor. For example, a small part of our FPGA is programmed as an accumulator for the gyro, to integrate degrees/second into absolute degrees. The FPGA is also used to improve the performance of the processor by acquiring data so that interrupts are rarely necessary; when the processor requests an input, the data is right there.

Now, as to how to get access to the FPGA: We aren't given the LabVIEW FPGA module in FRC. That's because
  1. It's believed to be too difficult for highschoolers in 6 weeks.
  2. It contains the system watchdog, and FIRST would be worried about safety hazards if it is disabled.
  3. It is a very valuble product of National Instruments, and it's a lot of what prevents loss of profit through piracy of the software we get for free. If we were to buy this software and a cRIO, it would be around $8,000 (single license).
Now, with that said, if you download a trial of LabVIEW, you have 30 days to play with it. LabVIEW 2010 just came out yesterday. It is common to have multiple versions of LabVIEW on a single computer without conflict, but if you like, feel free to back it up. After the 30 days, you license will expire, but your code will still be functional if it is deployed. If you'd like to use your code in LabVIEW 8.6, make sure to back-save it so that you can open it with the earlier version of LabVIEW.
When you'd like to use the cRIO for FIRST again, you will have to re-image.
Now that just confused me even more . So I do not have access to the cRio FGPA? I won't be using LabView, and never plan to; I use C++. I guess the possibility of using an on board computer to process the images is certainly a possibility. I doubt beagle board is strong enough; a standard PC would violate the rules (BIOS Battery). Even without those, the project is a big hole in the wallet; the cameras them selves are around $80.
__________________
Do not say what can or cannot be done, but, instead, say what must be done for the task at hand must be accomplished.
  #32   Spotlight this post!  
Unread 05-08-2010, 20:10
biojae's Avatar
biojae biojae is offline
Likes Omni drives :)
AKA: Justin Stocking
FTC #5011 (BOT SQUAD) && FTC#72(Garage bots)&& FRC#0399 (Eagle Robotics)
Team Role: College Student
 
Join Date: Oct 2008
Rookie Year: 2008
Location: Lancaster
Posts: 276
biojae is a jewel in the roughbiojae is a jewel in the roughbiojae is a jewel in the rough
Re: Is the crio powerful enough?

Quote:
Originally Posted by davidthefat View Post
I was not very aware of FPGAs, so I read up on them; essentially FPGAs are processors that are highly customizable to fit specific functions? So do FPGAs need to be configured hardwarely before it can be programmed? Is the cRio a type of FPGA? If not, which FPGA is a suitable FPGA for the purpose of image processing? Also would the FPGAs be used primarily to capture the images or process the images? Regarding cameras, would they need to be directly communicating with the FPGA, like the middle man, or would the cameras be communicating with the cRio?
The cRIO has an FPGA in it. This is what produces the PWM signal on the digital sidecar, accumulates the gyro signal, and communicates with all of the modules in the RIO.
It also provides the system watchdog.

Most FPGAs are programmed over JTAG, they only need power (some need 3.3v for IO as well as 1.75v for the main processor) and a clock to be programmed.
Keep in mind that some of them are volatile, they lose their program upon power down, so those ones need an external flash memory in order to function properly each time it is powered up.

As far as capturing / processing goes, the FPGA could do both (if you use one that has enough NAND (or NOR) gates).

If to be used for capturing, then it would have to be a "middle man" between the camera and the cRIO.
This would allow all of the processing to be done without putting ANY load on the cRIO. It would appear be something like a CMUCam to the cRIO.

The CMUCam would give the RC a very limited set of data (but the data was useful). It gave the centroid's (Center of mass) coordinates, 2 coordinates (a box where the green target was found), and servo control commands to keep the target centered.

Quote:
Originally Posted by davidthefat View Post
If the cameras were to be communicating with the cRio, would a Ethernet network cable splitter suffice? Would the cameras show up as two separate cameras or would the set up just fail?
You would need a hub or switch, not just a splitter.
Each camera would have its own IP address (unless your processing FPGA is what is ultimately communicating to the cRIO, in which case no cameras would show up, the only data transferred would be in your own custom protocol and with your own data.) and thus would show up as 2 cameras.
__________________
FTC Team 72 - No site
FRC Team 399 - http://www.team399.org
2010 Rockwell Collins Innovation in Control Award - (Use of the CAN bus, among other reasons) Phoenix, Arizona!
  #33   Spotlight this post!  
Unread 05-08-2010, 20:13
davidthefat davidthefat is offline
Alumni
AKA: David Yoon
FRC #0589 (Falkons)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: California
Posts: 792
davidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud of
Re: Is the crio powerful enough?

Quote:
Originally Posted by biojae View Post
The cRIO has an FPGA in it. This is what produces the PWM signal on the digital sidecar, accumulates the gyro signal, and communicates with all of the modules in the RIO.
It also provides the system watchdog.

Most FPGAs are programmed over JTAG, they only need power (some need 3.3v for IO as well as 1.75v for the main processor) and a clock to be programmed.
Keep in mind that some of them are volatile, they lose their program upon power down, so those ones need an external flash memory in order to function properly each time it is powered up.

As far as capturing / processing goes, the FPGA could do both (if you use one that has enough NAND (or NOR) gates).

If to be used for capturing, then it would have to be a "middle man" between the camera and the cRIO.
This would allow all of the processing to be done without putting ANY load on the cRIO. It would appear be something like a CMUCam to the cRIO.

The CMUCam would give the RC a very limited set of data (but the data was useful). It gave the centroid's (Center of mass) coordinates, 2 coordinates (a box where the green target was found), and servo control commands to keep the target centered.



You would need a hub or switch, not just a splitter.
Each camera would have its own IP address (unless your processing FPGA is what is ultimately communicating to the cRIO, in which case no cameras would show up, the only data transferred would be in your own custom protocol and with your own data.) and thus would show up as 2 cameras.
Thank you for your response, always good posts. Do you have any recommendations on the processors dedicated to process images? So would the cRio would treat the processor as a digital input?
__________________
Do not say what can or cannot be done, but, instead, say what must be done for the task at hand must be accomplished.
  #34   Spotlight this post!  
Unread 05-08-2010, 21:09
gblake's Avatar
gblake gblake is offline
6th Gear Developer; Mentor
AKA: Blake Ross
no team (6th Gear)
Team Role: Mentor
 
Join Date: May 2006
Rookie Year: 2006
Location: Virginia
Posts: 1,942
gblake has a reputation beyond reputegblake has a reputation beyond reputegblake has a reputation beyond reputegblake has a reputation beyond reputegblake has a reputation beyond reputegblake has a reputation beyond reputegblake has a reputation beyond reputegblake has a reputation beyond reputegblake has a reputation beyond reputegblake has a reputation beyond reputegblake has a reputation beyond repute
Re: Is the crio powerful enough?

Quote:
Originally Posted by kamocat View Post
An FPGA is not a processor...
I agreed with everything in the quoted post except for the first sentence (above).

Many of the ways an FPGA can be used are the definition of "processing" digitized data; and the inevitable consequence of that, is that an FPGA is (among other things) a type of "processor".

FPGA's certainly are not one of the typical CISC/RISC Central Processing Units usually found at the heart of a desktop computer or of many embedded computing products; but "processor" is certainly one of the ways they can be configured and used.

Blake
__________________
Blake Ross, For emailing me, in the verizon.net domain, I am blake
VRC Team Mentor, FTC volunteer, 5th Gear Developer, Husband, Father, Triangle Fraternity Alumnus (ky 76), U Ky BSEE, Tau Beta Pi, Eta Kappa Nu, Kentucky Colonel
Words/phrases I avoid: basis, mitigate, leveraging, transitioning, impact (instead of affect/effect), facilitate, programmatic, problematic, issue (instead of problem), latency (instead of delay), dependency (instead of prerequisite), connectivity, usage & utilize (instead of use), downed, functionality, functional, power on, descore, alumni (instead of alumnus/alumna), the enterprise, methodology, nomenclature, form factor (instead of size or shape), competency, modality, provided(with), provision(ing), irregardless/irrespective, signage, colorized, pulsating, ideate
  #35   Spotlight this post!  
Unread 06-08-2010, 02:30
biojae's Avatar
biojae biojae is offline
Likes Omni drives :)
AKA: Justin Stocking
FTC #5011 (BOT SQUAD) && FTC#72(Garage bots)&& FRC#0399 (Eagle Robotics)
Team Role: College Student
 
Join Date: Oct 2008
Rookie Year: 2008
Location: Lancaster
Posts: 276
biojae is a jewel in the roughbiojae is a jewel in the roughbiojae is a jewel in the rough
Re: Is the crio powerful enough?

Quote:
Originally Posted by davidthefat View Post
Thank you for your response, always good posts. Do you have any recommendations on the processors dedicated to process images? So would the cRio would treat the processor as a digital input?
I have only dealt with one type of FPGA, the Xilinx Spartan 3e (250,000 gates).
It can go fast, the board that I have clocks it at 100mhz (and it can go faster).

Acquiring images will take up some resources on the FPGA, but if you are already making your own board (Most FPGAs are ball grid array ics) you could include an ARM (or something similar) processor to grab the image from the camera.

Programming FPGAs is different then a CPU. Everything is in parallel.
For example something simple that can provide weird results is:
Code:
    int a = 2, b = 3;
    a = b;
    b = a;
    print("A : " + a);
    print("B : " + b);
If this was executed on a CPU then the results would be as predicted:
"A : 3"
"B : 3"

However, if executed on an FPGA:
"A : 3"
"B : 2"

Since you are the one who is programming the FPGA, you could have it interface to the cRIO in any way that you want. The cRIO has ethernet, serial, SPI, I2C, analog in (this would require digital potentiometers and be slow), and digital IO.
__________________
FTC Team 72 - No site
FRC Team 399 - http://www.team399.org
2010 Rockwell Collins Innovation in Control Award - (Use of the CAN bus, among other reasons) Phoenix, Arizona!
  #36   Spotlight this post!  
Unread 06-08-2010, 11:42
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: Is the crio powerful enough?

Quote:
Originally Posted by biojae View Post
Since you are the one who is programming the FPGA, you could have it interface to the cRIO in any way that you want. The cRIO has ethernet, serial, SPI, I2C, analog in (this would require digital potentiometers and be slow), and digital IO.
This is not true. The analog inputs on the cRIO are not the same as the inputs on the old OI. They read voltage, not resistance. You can wire the output of a DAC to the analog inputs directly.
  #37   Spotlight this post!  
Unread 06-08-2010, 11:47
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: Is the crio powerful enough?

Quote:
Originally Posted by kamocat View Post
Now, as to how to get access to the FPGA: We aren't given the LabVIEW FPGA module in FRC. That's because
  1. It's believed to be too difficult for highschoolers in 6 weeks.
  2. It contains the system watchdog, and FIRST would be worried about safety hazards if it is disabled.
  3. It is a very valuble product of National Instruments, and it's a lot of what prevents loss of profit through piracy of the software we get for free. If we were to buy this software and a cRIO, it would be around $8,000 (single license).
The first 2 points are accurate. The 3rd point about piracy is not a contributing factor for it not being included in the kit. We trust that teams will be responsible with the software they are given.
  #38   Spotlight this post!  
Unread 06-08-2010, 11:49
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: Is the crio powerful enough?

Quote:
Originally Posted by kamocat View Post
Be aware that the way that you've written this test, you are including the management of (potentially) huge arrays and the loop overhead in the time you are calculating.

-Joe
  #39   Spotlight this post!  
Unread 06-08-2010, 12:01
kamocat's Avatar
kamocat kamocat is offline
Test Engineer
AKA: Marshal Horn
FRC #3213 (Thunder Tech)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 2008
Location: Tacoma
Posts: 894
kamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nice
Send a message via AIM to kamocat Send a message via MSN to kamocat
Re: Is the crio powerful enough?

Yeah, I wasn't sure how to do that in a way that would prevent it from being preprocessed by the compiler. A million elements probably does count as a huge array.
My assumption was that by generating the array beforehand the FOR loop would simply replace each element in the array as it went through, eliminating the overhead of *creating* an array.
__________________
-- Marshal Horn
  #40   Spotlight this post!  
Unread 06-08-2010, 12:12
kamocat's Avatar
kamocat kamocat is offline
Test Engineer
AKA: Marshal Horn
FRC #3213 (Thunder Tech)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 2008
Location: Tacoma
Posts: 894
kamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nice
Send a message via AIM to kamocat Send a message via MSN to kamocat
Re: Is the crio powerful enough?

Quote:
Originally Posted by biojae View Post
Since you are the one who is programming the FPGA, you could have it interface to the cRIO in any way that you want. The cRIO has ethernet, serial, SPI, I2C, analog in (this would require digital potentiometers and be slow), and digital IO.
Another note on the Analog Inputs: 800,000 samples/second for a single channel.

What do they mean by "scanning" here? Is that constantly switching between channels?
__________________
-- Marshal Horn
  #41   Spotlight this post!  
Unread 06-08-2010, 12:12
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: Is the crio powerful enough?

Quote:
Originally Posted by kamocat View Post
Yeah, I wasn't sure how to do that in a way that would prevent it from being preprocessed by the compiler. A million elements probably does count as a huge array.
My assumption was that by generating the array beforehand the FOR loop would simply replace each element in the array as it went through, eliminating the overhead of *creating* an array.
Since you are changing the value of the array, it's possible that LabVIEW's compiler would reuse that memory, but I wouldn't count on it. I'm not sure of all the optimizations that the 8.6 compiler employs or what constraints they have.

Perhaps you can run another test that computes y=sin(sin(x)) and subtract the timing results from the test you already ran. Then that will leave you with only the difference between calling sin twice compared to once for each call of the loop, and all of the loop structure and the array handling will be canceled out.

-Joe
  #42   Spotlight this post!  
Unread 06-08-2010, 12:18
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: Is the crio powerful enough?

Quote:
Originally Posted by kamocat View Post
Another note on the Analog Inputs: 800,000 samples/second for a single channel.

What do they mean by "scanning" here? Is that constantly switching between channels?
Actually, this is controlled by both the hardware in the module and the FPGA code. The way the FPGA is written, the maximum single channel rate is 500ks/s.

Scanning refers to sampling more than one channel (i.e. muxing between channels). The overall max module sample rate is unaffected by the number of channels scanned, but the rate per channel is divided by the number of channels.

This means if you can reliably distinguish 8-bits, then the data transfer rate through analog input is 500 kBytes per second. That's one of the faster options.

-Joe
  #43   Spotlight this post!  
Unread 06-08-2010, 14:58
biojae's Avatar
biojae biojae is offline
Likes Omni drives :)
AKA: Justin Stocking
FTC #5011 (BOT SQUAD) && FTC#72(Garage bots)&& FRC#0399 (Eagle Robotics)
Team Role: College Student
 
Join Date: Oct 2008
Rookie Year: 2008
Location: Lancaster
Posts: 276
biojae is a jewel in the roughbiojae is a jewel in the roughbiojae is a jewel in the rough
Re: Is the crio powerful enough?

Quote:
Originally Posted by jhersh View Post
This is not true. The analog inputs on the cRIO are not the same as the inputs on the old OI. They read voltage, not resistance. You can wire the output of a DAC to the analog inputs directly.
If you wire the digital potentiometer as a voltage divider instead of as a rheostat , then it would work properly.

It would be slower then any of the other methods of digital communication, as the FPGA (or other processor) has to communicate with the potentiometer and then the pot has to change its value which takes time. It would also only be a one way communication method.
__________________
FTC Team 72 - No site
FRC Team 399 - http://www.team399.org
2010 Rockwell Collins Innovation in Control Award - (Use of the CAN bus, among other reasons) Phoenix, Arizona!
  #44   Spotlight this post!  
Unread 06-08-2010, 15:24
davidthefat davidthefat is offline
Alumni
AKA: David Yoon
FRC #0589 (Falkons)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: California
Posts: 792
davidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud of
Re: Is the crio powerful enough?

Ok this FGPA stuff seems very complicated, I think I would get caught up on trying to figure out the FGPA it self instead of the actual problem, I think I would want to pursue an alternative. I think the shop has a CMUcam or two laying around, I think I would want to experiment with those, is there isn't pick up 2 cheap web cam and try using a PC to do it.
__________________
Do not say what can or cannot be done, but, instead, say what must be done for the task at hand must be accomplished.
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Reimaging the cRio Issues there are no cRio devices on the subnet Stuart FRC Control System 2 25-02-2009 23:41
617 IN THE LIMELIGHT (Close Enough) bsmmoney Chit-Chat 0 08-03-2008 00:01
pic: The gearbox that makes us so powerful keenanmolner Robot Showcase 6 20-02-2007 02:11
The end of mindstorms - no smiley face sad enough Eric Reed FIRST Lego League 20 15-01-2004 16:00
Enough with the bumpers! archiver 2000 2 23-06-2002 22:32


All times are GMT -5. The time now is 03:42.

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