Go to Post We are all on a big team named FIRST - Al Skierkiewicz [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 21-06-2014, 23:00
jojoguy10's Avatar
jojoguy10 jojoguy10 is offline
Programming/Controls Mentor
AKA: Joe Kelly
FRC #0997 (Spartan Robotics) and FRC #2990 (Hotwire Robotics)
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2010
Location: Corvallis, OR
Posts: 294
jojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant future
Help with Datalogging

Hi there!

I was wondering if anyone has had experience with datalogging sensors.

Our team wants to be able to watch graphs of motor speed, voltage, and amperage as well as accelerometer data and encoder data.

I tried to give it a go (code attached), but nothing was working. I tried moving the motors using that "set" button, but they wouldn't move. I have never programed with graphs before. Should I put everything in one loop? Should I keep the separated? Any help would be appreciated!

Thanks!
__________________

2013 and 2014 - Student (FRC#2990), Programmer (LabVIEW)
2015 and 2016 - Mentor (FRC#2990), Programming (LabVIEW)
2017-Current - Mentor (FRC#997), Controls/Programming (Java)
2015-Current - A/V Volunteer at Oregon events

Last edited by jojoguy10 : 15-02-2015 at 00:38.
Reply With Quote
  #2   Spotlight this post!  
Unread 22-06-2014, 13:29
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,833
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Help with Datalogging

The posted code is missing the Driver Station Start COM.
While running on the cRIO the project will need to have a Driver Station app to Enable the cRIO before the Jags will be allowed to react.

You can find an example of this call under the Support Examples for I2C/ADXL345
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 22-06-2014 at 18:30.
Reply With Quote
  #3   Spotlight this post!  
Unread 22-06-2014, 18:01
jojoguy10's Avatar
jojoguy10 jojoguy10 is offline
Programming/Controls Mentor
AKA: Joe Kelly
FRC #0997 (Spartan Robotics) and FRC #2990 (Hotwire Robotics)
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2010
Location: Corvallis, OR
Posts: 294
jojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant future
Re: Help with Datalogging

Quote:
Originally Posted by Mark McLeod View Post
The posted code is missing the Driver Station Start COM.
While running on the cRIO the project will need to have a Driver Station app to Enable the cRIO befoe the Jags will be allowed to react.

You can find an exaple of this call under the Support Examples for I2C/ADXL345
Ahhh....it always seems to be the simple answer. I'll try that next time I get out to our shop.
__________________

2013 and 2014 - Student (FRC#2990), Programmer (LabVIEW)
2015 and 2016 - Mentor (FRC#2990), Programming (LabVIEW)
2017-Current - Mentor (FRC#997), Controls/Programming (Java)
2015-Current - A/V Volunteer at Oregon events
Reply With Quote
  #4   Spotlight this post!  
Unread 24-06-2014, 10:43
adciv adciv is offline
One Eyed Man
FRC #0836 (RoboBees)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2010
Location: Southern Maryland
Posts: 478
adciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to all
Re: Help with Datalogging

I'll try to take a look at your code when I get home.

We use TDMS to log to the RIO and review afterwards. The logging loop runs in Periodic Tasks and stores data to a buffer. Once per second the buffer is flushed to storage.

You can see how we did this in 2013 here: http://www.chiefdelphi.com/media/papers/2876?
__________________
Quote:
Originally Posted by texarkana View Post
I would not want the task of devising a system that 50,000 very smart people try to outwit.
Reply With Quote
  #5   Spotlight this post!  
Unread 24-06-2014, 16:22
jojoguy10's Avatar
jojoguy10 jojoguy10 is offline
Programming/Controls Mentor
AKA: Joe Kelly
FRC #0997 (Spartan Robotics) and FRC #2990 (Hotwire Robotics)
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2010
Location: Corvallis, OR
Posts: 294
jojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant future
Re: Help with Datalogging

Quote:
Originally Posted by adciv View Post
I'll try to take a look at your code when I get home.

We use TDMS to log to the RIO and review afterwards. The logging loop runs in Periodic Tasks and stores data to a buffer. Once per second the buffer is flushed to storage.

You can see how we did this in 2013 here: http://www.chiefdelphi.com/media/papers/2876?
Where did you guys learn how to use TDMS? I'm trying to follow the code, but it's a little challenging. Did you guys find a website or Youtube video explaining it?

Thanks for the reply!
__________________

2013 and 2014 - Student (FRC#2990), Programmer (LabVIEW)
2015 and 2016 - Mentor (FRC#2990), Programming (LabVIEW)
2017-Current - Mentor (FRC#997), Controls/Programming (Java)
2015-Current - A/V Volunteer at Oregon events
Reply With Quote
  #6   Spotlight this post!  
Unread 25-06-2014, 21:29
Richard100 Richard100 is offline
Registered User
FRC #0836 (RoboBees)
Team Role: Mentor
 
Join Date: Nov 2009
Rookie Year: 2008
Location: Southern Maryland
Posts: 79
Richard100 is a splendid one to beholdRichard100 is a splendid one to beholdRichard100 is a splendid one to beholdRichard100 is a splendid one to beholdRichard100 is a splendid one to beholdRichard100 is a splendid one to behold
Re: Help with Datalogging

Hi Joe - We picked up on TDMS when researching practical ways to store data using the National Instruments online documentation on LabVIEW. Practical for robotics means collecting data quickly without affecting the operation of the rest of your code.

Check out http://www.ni.com/white-paper/3727/en/ for a general discussion on TDMS ( Technical Data Management Streaming ). I ended up trying many different approaches before discovering that the TDMS capability was designed for high speed and high density storage. The other features like compatibility with Excel (for post match analysis) are a nice bonus.

When accomplishing this kind of data logging, it's important to understand software design requirements for what's called a 'real-time' system - which essentially means to ensure that your code operations reliably occur on schedule. There are some nasty things like 'priority inversions' that will impact how your code runs and creates unplanned results. To review these concepts see http://www.ni.com/white-paper/3938/en/ and http://www.ni.com/white-paper/3898/en/. There are other papers on the web that you can locate with Google (also try LabVIEW determinism).

Also study the Consumer / Producer design pattern, see http://www.ni.com/white-paper/3023/en/. This enables one to communicate effectively between loops, i.e. producing data in one loop and then sending the data to another loop that is responsible for moving it into storage (consuming). Separating these functions allow them to operate without one slowing down the other.

Once the concepts were understood, learning TDMS was kind of like how the Wright Brothers learned aeronautics ... experiments! (lots of them). You can do this yourself without a robot by just setting up a blank LV Project and trying out the VI's on the TDMS pallet. You can also study how we designed our logging algorithm in the published code - it is a stable / proven approach.

As 'adciv' said above, the logging loop should run within Periodic Tasks and be buffered via a Real Time FIFO, where a separate loop or process manages storing the data. Using a 'burst transmission' approach makes it time-efficient ... like waiting until a commercial plane is full of people before flying to the destination.

All this may sound complicated but with a bit of research it will come together. Experimenting really helps the learning process.

I can walk you through the code when you're ready with specific questions.

Richard / The RoboBees FRC Team 836
Reply With Quote
  #7   Spotlight this post!  
Unread 26-06-2014, 10:18
jojoguy10's Avatar
jojoguy10 jojoguy10 is offline
Programming/Controls Mentor
AKA: Joe Kelly
FRC #0997 (Spartan Robotics) and FRC #2990 (Hotwire Robotics)
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2010
Location: Corvallis, OR
Posts: 294
jojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant future
Re: Help with Datalogging

Thanks so much Richard! I will definitely look into TDMS! While I was waiting for more replies, I did some more research and found the "Datalog Blocks". They are in File I/O>Advanced File Functions>Datalog. Basically, it receives an array of data that it can output through a *.dat file. It seems to be easier to setup, but I haven't confirmed that yet.

We're having a drive train meeting today, and I need to figure something out for this datalogging pretty soon, so I will keep this thread updated.

Thanks again!
__________________

2013 and 2014 - Student (FRC#2990), Programmer (LabVIEW)
2015 and 2016 - Mentor (FRC#2990), Programming (LabVIEW)
2017-Current - Mentor (FRC#997), Controls/Programming (Java)
2015-Current - A/V Volunteer at Oregon events
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 20:10.

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