Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Is the crio powerful enough? (http://www.chiefdelphi.com/forums/showthread.php?t=86470)

davidthefat 03-08-2010 20:01

Is the crio powerful enough?
 
:confused: Its been a long time I have posted, nothing got accomplished for my fully autonomous robot idea, just whole bunch of notes and drawing in a notebook. My ideas involve heavy use of trig functions (due to the fact that I took trig in the summer, it inspired me). Now trig functions do take lots of power considering the fact that I might be using at least a dozen of them every cycle, while processing images (mass blob detection), and the locomotion and all that good stuff. Since there is no direct way to monitor memory and processor usage on the crio (or am I just unaware) how can I find out how much it is using? Am I good to go with the Math functions or do I have to make a "Trig chart" or have a onboard processor helping the crio?

If you want to know what I am doing:

I am thinking of using 2 60fps cameras as a stereo vision system and its not very complex on paper either. I think it is the perfect system to use


http://www.cellularfactory.com/lapto...108185&eng=fro
Does that look legit to you guys? Seem pretty "shady" as in Made In China status, do you really think its 60FPS? its pretty cheap though

biojae 03-08-2010 20:51

Re: Is the crio powerful enough?
 
If you are using too much trig processing, then you could always use a lookup table.

You would only need one table for both Sin and Cos because of the identity "sin((PI/2.0) - X) == cos(x)"

You could also cache the results of your equations.

What are you using the trig for?

davidthefat 03-08-2010 21:02

Re: Is the crio powerful enough?
 
Quote:

Originally Posted by biojae (Post 970814)
If you are using too much trig processing, then you could always use a lookup table.

You would only need one table for both Sin and Cos because of the identity "sin((PI/2.0) - X) == cos(x)"

You could also cache the results of your equations.

What are you using the trig for?

The distance of an object purely based on cameras, if you think about it, you will get it very easily, I need diagrams to explain it and might take long time to actually explain though. One phrase: Isosceles triangle with a known base

Ether 03-08-2010 21:15

Re: Is the crio powerful enough?
 
Quote:

If you are using too much trig processing, then you could always use a lookup table.
Or you could use a polynomial approximation.

You can get a very good approximation to the sine curve from zero to pi/2 (which is all you need to construct the entire curve) with only three multiplies and three adds:

sin(x) ~ -.0017 + x*(1.027 - x*(.0729 + x*(.1116)))


~

Hawiian Cadder 03-08-2010 21:15

Re: Is the crio powerful enough?
 
if the trig is too much you could attach a TI-83 to the crio, but i doubt the trig will be where the problem is, but in the image processing.

kamocat 03-08-2010 21:50

Re: Is the crio powerful enough?
 
I actually think that doing the trig functions would be faster than doing a lookup table. How long does it take to graph a sine wave on an iBook G4?
Now, what will take a while is the processing of images, ESPECIALLY with disparity maps. You'll probably require an FPGA to get the performance you're looking for. Too bad sbRIOs are in OEM quantities only.

JewishDan18 03-08-2010 22:08

Re: Is the crio powerful enough?
 
The Taylor approximation stated above is both extremely accurate and extremely fast. If it is not accurate enough, just add another term. However, I am pretty sure this is how it is done behind the scenes. It doesn't really make that much of a difference. This year, my team did crab drive w/ gyro and I used a ton of trig functions every cycle. The image processing is much much much more processing intense.

davidthefat 03-08-2010 22:11

Re: Is the crio powerful enough?
 
So all of you are saying that I should use extra help to process the images, but I doubt there is a legit way to do this though...

gblake 03-08-2010 22:21

Re: Is the crio powerful enough?
 
Quote:

Originally Posted by davidthefat (Post 970818)
The distance of an object purely based on cameras, if you think about it, you will get it very easily, I need diagrams to explain it and might take long time to actually explain though. One phrase: Isosceles triangle with a known base

Before you invest too much in this project, assume a reasonable error in the angles you are able to measure after you try to get both cameras to lock onto a single small point on the object. Additionally assume the object is not perfectly "broadside" to your two cameras. Then compute the range of distance errors that will arise as a consequence of those angular errors.

If you are thinking of using an FRC bot for the base of your triangle, and you are trying get the distances to objects that are scattered around an FRC field, You might be disappointed by the probable size of the distance errors

Or you might be perfectly happy. Just don't overlook the extreme precision required for accurate distance measurements across a reasonably wide field of view.

Blake

davidthefat 03-08-2010 22:28

Re: Is the crio powerful enough?
 
Quote:

Originally Posted by gblake (Post 970836)
Before you invest too much in this project, assume a reasonable error in the angles you are able to measure after you try to get both cameras to lock onto a single small point on the object. Additionally assume the object is not perfectly "broadside" to your two cameras. Then compute the range of distance errors that will arise as a consequence of those angular errors.

If you are thinking of using an FRC bot for the base of your triangle, and you are trying get the distances to objects that are scattered around an FRC field, You might be disappointed by the probable size of the distance errors

Or you might be perfectly happy. Just don't overlook the extreme precision required for accurate distance measurements across a reasonably wide field of view.

Blake

I am perfectly fine with "that object is close" "that object is farther" type of thing, I am not making the next mars rover or anything:eek: I don't need to be that exact, may be off by a foot or 2 is fine

gblake 03-08-2010 22:38

Re: Is the crio powerful enough?
 
Quote:

Originally Posted by davidthefat (Post 970837)
... off by a foot or 2 is fine

How about a foot or 50? ... There are important non-linearities in the calculations that magnify small measurement errors dramatically.

davidthefat 03-08-2010 22:42

Re: Is the crio powerful enough?
 
Quote:

Originally Posted by gblake (Post 970838)
How about a foot or 50? ... There are important non-linearities in the calculations that magnify small measurement errors dramatically.

I have no idea what that means, but... Its like the IR Range finders, the voltage output is a curve, gradually evening out and becoming very inaccurate; is this an example of your explanation?

PAR_WIG1350 03-08-2010 23:12

Re: Is the crio powerful enough?
 
I love trig:D

team 1350 used binocular vision in 2006 somewhat successfully, I wasn't there to get the specifics, but it used 2 CMUcams and trig, and that was with the old IFI rc, assuming there is a target that can be easily picked up at a low resolution, and the servos controlling the cameras are accurate enough (the closer the object, the less acurate they need to be), it should be *relatively simple. Streamlining the rest of the code to free up memory should also help.

Hint, research "boids", it could help with programing how to react to other robots.

kamocat 04-08-2010 00:27

Re: Is the crio powerful enough?
 
Quote:

Originally Posted by davidthefat (Post 970839)
I have no idea what that means, but... Its like the IR Range finders, the voltage output is a curve, gradually evening out and becoming very inaccurate; is this an example of your explanation?

It's an secant function where x is your angle and y is your distance.
You can see that after about 60 degrees it gets very inaccurate.
The IR sensor, on the other hand, is exponential decay, which makes a slightly friendlier curve. (Your error at 75% maximum distance is only +-25% of the total range of the IR sensor)

rahilm 04-08-2010 04:29

Re: Is the crio powerful enough?
 
Quote:

Originally Posted by davidthefat (Post 970818)
The distance of an object purely based on cameras, if you think about it, you will get it very easily, I need diagrams to explain it and might take long time to actually explain though. One phrase: Isosceles triangle with a known base

If this is the only extent you are using this for, I think the simplest method is using an approximating equation based on just one camera.

We've tried this in the past and our greatest error was about 2inches (at a distance of 52 feet). Basically, all you have to do is take a bunch of values of the width or length of the blob versus the the actual measured distance from the camera to the object. Since sight is logarithmic, take a calculator, plug in the datapoints, generate a logarithmic regression and you're good to go.

Edit: Of course, I am speaking in terms of the last 2 games, for which 2 inches would have been a small enough tolerance.

JamesBrown 04-08-2010 08:29

Re: Is the crio powerful enough?
 
Quote:

Originally Posted by PAR_WIG1350 (Post 970842)
I love trig:D

team 1350 used binocular vision in 2006 somewhat successfully, I wasn't there to get the specifics, but it used 2 CMUcams and trig, and that was with the old IFI rc, assuming there is a target that can be easily picked up at a low resolution, and the servos controlling the cameras are accurate enough (the closer the object, the less acurate they need to be), it should be *relatively simple. Streamlining the rest of the code to free up memory should also help.

Hint, research "boids", it could help with programing how to react to other robots.

If memory serves, you guys also used a Gumstix as a Co-Processor to handle the stereo vision. I dont think the old controller could handle two CMU cams very well.

Nadav Zingerman 04-08-2010 10:44

Re: Is the crio powerful enough?
 
The cRIO is powerful enough so that a few trig functions make absolutely no difference. We used a couple dozen of them for our drive routine with no noticeable slow-down at all. Using them in the vision routine should be no different. The main thing that will be slow is image processing, which is mostly affected by the camera resolution.

In addition, I imagine that the existing trig functions are already highly optimized for real-time applications, as that's what the cRIO is for. The cRIO has a floating point processor, so that should work pretty well.

Also, in my experience, one camera is good enough for range finding, provided you know the physical dimensions of the target, which has been the case in the last few games.

EricVanWyk 04-08-2010 12:37

Re: Is the crio powerful enough?
 
This conversation is focusing way too much on the cost of the trig functions, compared to the cost of the vision functions. Trig is a lot more expensive than addition and subtraction, but trivial compared to vision.

kamocat 04-08-2010 15:47

Re: Is the crio powerful enough?
 
In summary:
Yes, the cRIO is powerful enough for trig functions.
No, the cRIO is not powerful enough for stereo image processing at 60hz, without reprogramming the FPGA.

Ether 04-08-2010 19:51

Re: Is the crio powerful enough?
 
On a 3.4GHz Pentium D, the sin() function is about 3 times slower than a 3rd degree polynomial approximation.

But since we're only talking 0.3 microseconds for the sin() function, it's not to worry. Anybody have numbers for the cRIO, just curious?

biojae 04-08-2010 20:07

Re: Is the crio powerful enough?
 
Which vision target are you designing for?
Green light (2005 - 2007) / Pink and green (2009)
Concentric ellipses

If it is the first one then the cRio might be able to process it.
The thresholding operations take much less processing power.

Are you trying to use stereoscopic vision techniques, or just triangulation?

EricVanWyk 04-08-2010 20:14

Re: Is the crio powerful enough?
 
Quote:

Originally Posted by Ether (Post 970905)
On a 3.4GHz Pentium D, the sin() function is about 3 times slower than a 3rd degree polynomial approximation.

But since we're only talking 0.3 microseconds for the sin() function, it's not to worry. Anybody have numbers for the cRIO, just curious?

Ether -

How did you measure 0.3 microseconds?

I recently wrote a sin function that runs in ~0.7 microseconds on an 80MHz Arm Cortex-M3, with comparable accuracy.

davidthefat 04-08-2010 20:20

Re: Is the crio powerful enough?
 
Quote:

Originally Posted by biojae (Post 970906)
Which vision target are you designing for?
Green light (2005 - 2007) / Pink and green (2009)
Concentric ellipses

If it is the first one then the cRio might be able to process it.
The thresholding operations take much less processing power.

Are you trying to use stereoscopic vision techniques, or just triangulation?

The target is any target really, its not specific targets, but just an object that has similar colors. I will go further and do object identification, but I am not thinking that far ahead, Its just alot easier to use an IR Rangefinder and probably more accurate, but I want it to be actually useful. Also 3d mapping is one idea I have in my head

PAR_WIG1350 05-08-2010 00:22

Re: Is the crio powerful enough?
 
Quote:

Originally Posted by EricVanWyk (Post 970907)
Ether -
How did you measure 0.3 microseconds?

you don't, you just perform the same operation a few million times and divide.:)

kamocat 05-08-2010 01:31

Re: Is the crio powerful enough?
 
Quote:

Originally Posted by PAR_WIG1350 (Post 970922)
you don't, you just perform the same operation a few million times and divide.:)

I don't suppose there's any reason to perform it with changing input values, is there? Computers take just as long to multiply 0x0 as they do 57x291, correct?

Just in case, I used a random-number generator. (This prevents LabVIEW from compiling the results as constants in the program)


It took about 0.000492ms per iteration of the sine function, measured over a million iterations. To put it on the same scale as Ether's measurement, that's 0.5 microseconds.

biojae 05-08-2010 02:05

Re: Is the crio powerful enough?
 
Like what was said previously, the trig is not going to be a problem instead its the vision proc.

The triangulation tracking won't take much more processing then 2 *(current load for 1 camera + pointing).

However, a 3d disparity map for stereo optics will take the load of the previous as well as the load of the calculations to make the map and then find a target and distance.

Here is a whitepaper on stereo optics
http://www.cse.unr.edu/~bebis/CS791E...ereoCamera.pdf

EricVanWyk 05-08-2010 08:54

Re: Is the crio powerful enough?
 
Quote:

Originally Posted by kamocat (Post 970926)
I don't suppose there's any reason to perform it with changing input values, is there? Computers take just as long to multiply 0x0 as they do 57x291, correct?

Actually, that isn't always true. For example, the Cortex-M3 multiply timing follows:
32 bits x 32 bits = 32 bits is always one cycle
32b x 32b = 64b takes 3 cycles if the result is small
32b x 32b = 64b takes 5 cycles if the result is big

Also, it is relatively common for functions to bail early for special values, such as 0. For example, my sine function bails in less than half of the usual execution time if the input is a multiple of 45 degrees.

Quote:

Originally Posted by kamocat (Post 970926)

Just in case, I used a random-number generator. (This prevents LabVIEW from compiling the results as constants in the program)


It took about 0.000492ms per iteration of the sine function, measured over a million iterations. To put it on the same scale as Ether's measurement, that's 0.5 microseconds.

Thanks!

davidthefat 05-08-2010 18:55

Re: Is the crio powerful enough?
 
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? 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?

kamocat 05-08-2010 19:59

Re: Is the crio powerful enough?
 
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.

Ether 05-08-2010 20:02

Re: Is the crio powerful enough?
 
Quote:

Originally Posted by EricVanWyk (Post 970907)
Ether -
How did you measure 0.3 microseconds?

First thing I did was to make a FreeDOS boot disk and boot that so I could access the hardware directly. Then I programmed the 8254 PIT to time 100 calcs of each (plus an empty loop so I could subtract out overhead).

~

davidthefat 05-08-2010 20:08

Re: Is the crio powerful enough?
 
Quote:

Originally Posted by kamocat (Post 970984)
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:confused: . 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.

biojae 05-08-2010 20:10

Re: Is the crio powerful enough?
 
Quote:

Originally Posted by davidthefat (Post 970978)
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 (Post 970978)
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.

davidthefat 05-08-2010 20:13

Re: Is the crio powerful enough?
 
Quote:

Originally Posted by biojae (Post 970988)
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?

gblake 05-08-2010 21:09

Re: Is the crio powerful enough?
 
Quote:

Originally Posted by kamocat (Post 970984)
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

biojae 06-08-2010 02:30

Re: Is the crio powerful enough?
 
Quote:

Originally Posted by davidthefat (Post 970989)
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.

jhersh 06-08-2010 11:42

Re: Is the crio powerful enough?
 
Quote:

Originally Posted by biojae (Post 971009)
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.

jhersh 06-08-2010 11:47

Re: Is the crio powerful enough?
 
Quote:

Originally Posted by kamocat (Post 970984)
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.

jhersh 06-08-2010 11:49

Re: Is the crio powerful enough?
 
Quote:

Originally Posted by kamocat (Post 970926)

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

kamocat 06-08-2010 12:01

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.

kamocat 06-08-2010 12:12

Re: Is the crio powerful enough?
 
Quote:

Originally Posted by biojae (Post 971009)
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?

jhersh 06-08-2010 12:12

Re: Is the crio powerful enough?
 
Quote:

Originally Posted by kamocat (Post 971035)
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

jhersh 06-08-2010 12:18

Re: Is the crio powerful enough?
 
Quote:

Originally Posted by kamocat (Post 971037)
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

biojae 06-08-2010 14:58

Re: Is the crio powerful enough?
 
Quote:

Originally Posted by jhersh (Post 971032)
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.

davidthefat 06-08-2010 15:24

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.


All times are GMT -5. The time now is 23:12.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi