|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
runtime data collection
As an off-season programming project, I've been thinking about asking some programmers to figure out a way to write 50Hz runtime data (like motor commands, motor current, and wheel speeds) during each match to a memory buffer in cRIO that could be downloaded from the cRIO to a laptop for analysis after the match (or even at the end of each day).
Has anyone tried this? If so, was it fruitful? ~ |
|
#2
|
|||
|
|||
|
Re: runtime data collection
Team 1675 is working on a new version of Autoflex that kind of does this, or could be extended to do this. Autoflex was a program designed by a former mentor for the IFI control system that recorded 15 seconds of certain inputs into the controller's EEPROM and played them back as a 15 second autonomous mode.
We record inputs, but it could be easily changed to record returns from any function or method, I think, and be extended to any time period. We are using the file system on the cRIO and I think that's where they are running into problems at the moment. It's not really done yet (psh, who wants to build and program a robot anyway). We dead-reckoned our autonomous this year. I'm not totally up to speed on the progress on our new version (in C++ anyway) so I'll see if i can convince one of our other programming mentors to make a post. Last edited by BigJ : 09-04-2010 at 20:14. |
|
#3
|
||||
|
||||
|
Re: runtime data collection
If you do this, make sure to do it in Periodic Tasks.
I tried logging the status of the robot (for field diagnostics during matches), but found it slowed the code down to 150 to 230 ms per iteration. (That's a lot of lag for a driver.) It's possible that it had to do with the string processing functions I was using, but I have a feeling that the cRIO has slow memory writes. (Why else would it take several minutes to transfer your code?) |
|
#4
|
||||
|
||||
|
Re: runtime data collection
I wouldn't use string processing functions for what I had in mind. I would just write the data in its native format to the buffer. Less memory usage, less processing.
|
|
#5
|
||||
|
||||
|
Re: runtime data collection
That's an interesting idea.
I think that would be the "temporary data directory" you're referring to. In the Functions palette, look under Programming > File IO > File Constants. |
|
#6
|
||||
|
||||
|
Re: runtime data collection
Quote:
It's called data monitor (used to be called StethoScope). Very easy to set and enable/disable monitor points, configure the sample frequency, set the buffer size, upload to host and (are you ready for this?) graph the data in Workbench. This is exactly the kind of thing one hates to see programmers reinventing. But if Wind River won't let you use it, and you need it, then you probably will end up doing it. Yes, it will be fruitful/ |
|
#7
|
||||
|
||||
|
Re: runtime data collection
Quote:
Teams with "overheating CIMs" could gain great insight using a tool like this, I would think, especially if they glued a small temperature sensor to each CIM. (Or if they were capturing motor current and voltage and speed, they could calculate winding resistance whenever the motors were stalled). ~ Last edited by Ether : 09-04-2010 at 20:55. |
|
#8
|
|||
|
|||
|
Re: runtime data collection
Quote:
|
|
#9
|
|||
|
|||
|
Re: runtime data collection
This very easy to do using ordinary file I/O in Java or C/C++, several teams already use this for runtime feedback. Just write your data to a CSV file, grab it with ftp and open with Excel for whatever analysis you want to do. Just be careful not to exhaust available cRIO memory.
Quote:
- Ron Team #2607 controls mentor |
|
#10
|
||||
|
||||
|
Re: runtime data collection
Quote:
|
|
#11
|
||||
|
||||
|
Re: runtime data collection
Yes, with an easily configurable sample rate.
You wouldn't want to sample data at 100Hz if the data only changes at 1Hz. Quote:
If so, you were writing to flash file system and there's your SLOW. Ideally, you would want to log raw binary data -- not formatted strings -- and you'd want to store into a RAM buffer. The Wind River data monitor does exactly that. The size of the buffer, whether it's a wrap-around buffer, and the upload-to-host threshold is configurable from Workbench. If you must log to a file (because the buffer management/access functions are more work than you want to do) then look into creating a RAM disk just for the logging. Quote:
Writing to flash memory is always SLOW. |
|
#12
|
|||||
|
|||||
|
Re: runtime data collection
If you want to see the progression of a variable during testing, LabVIEW has a nice graph control.
I had to save some data during a match once, so I bundled the data into the Dashboard packet and saved it on that end. Since I bundled a Teleop Elapsed Seconds and Robot Mode in there, I can stamp everything based on that, so the lag dosen't matter. I saved the camera images at crucial autonomous steps too, so I can review them later and tell the drive team how to adjust the position for the next match. |
|
#13
|
||||
|
||||
|
Re: runtime data collection
If I log 10 single-precision floats at 50Hz for 2.5 minutes that's less than a third of a MB. The cRIO has 64MB RAM.
|
|
#14
|
||||
|
||||
|
Re: runtime data collection
Quote:
![]() Last edited by ayeckley : 09-04-2010 at 23:36. Reason: Clarified our programming environment. |
|
#15
|
||||
|
||||
|
Re: runtime data collection
Quote:
~ |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to avoid error 1920 service net runtime optimization service v2 0.50215 _x86 | Linda_Ol | Lego Mindstorm Discussion | 3 | 28-07-2009 11:11 |
| Blinking RC and Runtime Errors | jamie_1930 | General Forum | 4 | 23-04-2009 09:53 |
| VEX Battery Pack Runtime? | TennBikeBerk | FIRST Tech Challenge | 4 | 04-08-2005 18:12 |