Go to Post Isn't that the connector used on the F.L.U.X. Capacitor? - Ed Sparks [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
  #1   Spotlight this post!  
Unread 09-04-2010, 19:52
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,101
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
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   Spotlight this post!  
Unread 09-04-2010, 20:11
BigJ BigJ is offline
Registered User
AKA: Josh P.
FRC #1675 (Ultimate Protection Squad)
Team Role: Engineer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Milwaukee, WI
Posts: 947
BigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond repute
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   Spotlight this post!  
Unread 09-04-2010, 20:14
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: 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?)
__________________
-- Marshal Horn
  #4   Spotlight this post!  
Unread 09-04-2010, 20:37
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,101
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: runtime data collection

Quote:
Originally Posted by kamocat View Post
It's possible that it had to do with the string processing functions I was using
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   Spotlight this post!  
Unread 09-04-2010, 20:41
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: 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.
__________________
-- Marshal Horn
  #6   Spotlight this post!  
Unread 09-04-2010, 20:47
gvarndell's Avatar
gvarndell gvarndell is offline
Software Engineer
AKA: Addi's and Georgie's Dad
FRC #1629 (GaCo)
Team Role: Parent
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Grantsville, Maryland
Posts: 350
gvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond repute
Re: runtime data collection

Quote:
Originally Posted by Ether View Post
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?
~
Wind River already has it, now if we can just figure out a way to get them to include it for the FRC teams.
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/
__________________
Robots never, ever, ever, ever break -- The Robot Repairman (Backyardigans)
  #7   Spotlight this post!  
Unread 09-04-2010, 20:52
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,101
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: runtime data collection

Quote:
Originally Posted by gvarndell View Post
Wind River already has it, now if we can just figure out a way to get them to include it for the FRC teams.
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/
This is exactly what I want. And no, I'd rather not re-invent it.

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   Spotlight this post!  
Unread 09-04-2010, 20:58
BigJ BigJ is offline
Registered User
AKA: Josh P.
FRC #1675 (Ultimate Protection Squad)
Team Role: Engineer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Milwaukee, WI
Posts: 947
BigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond repute
Re: runtime data collection

Quote:
Originally Posted by gvarndell View Post
Wind River already has it, now if we can just figure out a way to get them to include it for the FRC teams.
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/
Ooh. Yeah, forget about what I said for this stuff.
  #9   Spotlight this post!  
Unread 09-04-2010, 21:17
rrossbach rrossbach is offline
Registered User
AKA: Ron R
FRC #2607 (RoboVikings)
Team Role: Mentor
 
Join Date: Nov 2008
Rookie Year: 2008
Location: Warrington PA
Posts: 90
rrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to behold
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:
...but I have a feeling that the cRIO has slow memory writes. (Why else would it take several minutes to transfer your code?)
The several-minute transfer/deploy times seem unique to LabView. Deploying Java for example is usually < 1 minute. One of the many reasons our team switched from using LabView last year to using Java this (and future) years.

- Ron
Team #2607 controls mentor
  #10   Spotlight this post!  
Unread 09-04-2010, 21:26
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,535
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
Re: runtime data collection

Quote:
Originally Posted by rrossbach View Post
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.



The several-minute transfer/deploy times seem unique to LabView. Deploying Java for example is usually < 1 minute. One of the many reasons our team switched from using LabView last year to using Java this (and future) years.

- Ron
Team #2607 controls mentor
Our code in labview transfers in less than 1 minute. Now, building that code on the programming laptop may take up to 3 minutes in bad cases.
  #11   Spotlight this post!  
Unread 09-04-2010, 22:03
gvarndell's Avatar
gvarndell gvarndell is offline
Software Engineer
AKA: Addi's and Georgie's Dad
FRC #1629 (GaCo)
Team Role: Parent
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Grantsville, Maryland
Posts: 350
gvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond repute
Re: runtime data collection

Quote:
Originally Posted by kamocat View Post
If you do this, make sure to do it in Periodic Tasks.
Yes, with an easily configurable sample rate.
You wouldn't want to sample data at 100Hz if the data only changes at 1Hz.

Quote:
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.)
You were logging the data to a file no doubt.
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:
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?)
When you transfer code, it's going to the flash file system.
Writing to flash memory is always SLOW.
__________________
Robots never, ever, ever, ever break -- The Robot Repairman (Backyardigans)
  #12   Spotlight this post!  
Unread 09-04-2010, 22:21
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: 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.
__________________
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
  #13   Spotlight this post!  
Unread 09-04-2010, 23:03
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,101
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: 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   Spotlight this post!  
Unread 09-04-2010, 23:30
ayeckley's Avatar
ayeckley ayeckley is offline
Registered User
AKA: Alex Yeckley
FRC #2252 (Mavericks)
Team Role: Mentor
 
Join Date: Apr 2007
Rookie Year: 2007
Location: Sandusky, OH
Posts: 268
ayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond repute
Re: runtime data collection

Quote:
Originally Posted by BigJ View Post
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.
2252 has that capability now using plain-old LabVIEW (the basis for our Innovation in Control award at Buckeye). We're taking snapshots of the control inputs and writing a record to the the cRio filesystem vis-a-vis an .xls file every 50ms with no appreciable impact to the balance of the control system. There's a little bit of jitter reflected in the timestamps associated with each record (a couple of ms typically), but the error is non-cumulative. Playback offers no particular challenges since we load the file data into arrays during Disabled mode instead of in real-time. I plan to write a whitepaper about it in the offseason if anyone is interested. We hope to do a useful demonstration on the Curie field as well
__________________


Last edited by ayeckley : 09-04-2010 at 23:36. Reason: Clarified our programming environment.
  #15   Spotlight this post!  
Unread 09-04-2010, 23:37
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,101
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: runtime data collection

Quote:
Originally Posted by ayeckley View Post
I plan to write a whitepaper about it in the offseason if anyone is interested.
I'm interested.

~
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
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


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

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