Go to Post That Billfred guy is going to pay for this one. - Bcahn836 [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Events   CD-Media   CD-Spy   FRC-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 02-15-2010, 09:47 PM
Ziaholic's Avatar
Ziaholic Ziaholic is offline
Elec/SW Mentor
AKA: Marc
FRC #1164 (Project NEO)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2002
Location: Las Cruces, NM
Posts: 194
Ziaholic is a jewel in the roughZiaholic is a jewel in the roughZiaholic is a jewel in the roughZiaholic is a jewel in the rough
Intra-Loop Timing Advice

I haven't had the time to play around with some of my timing ideas ... this being the final week and all.

I'd like to ask some of the more advanced Labview developers and cRIO gurus for some advice and/or rules-of-thumb regarding the elapsed time for some common tasks.

Our team's software has most of it's "decision making" in the teleop/auton enabled VI's, running at the frequency of the DS packets ... 20 msec/cycle.

Underneath all that "main-while-loop" stuff, we've got our other primaryVI's ...
One reads a command global and sets the drive-motor speeds.
One reads all the nav sensors (accel's, gyro, encoders) and writes to a global.
One reads a command global and sets the camera-gimbal servos
One is for Vision
In the teleop/auton modes, we look at the Nav data and the joystick inputs, and set the commands to the motor-globals.

In each of my free-running VI's (other than vision), I have a WAIT = 10 msec so that they'll run at most twice for each DS-cycle. But I'd like to adjust that arbitrary number with one that is based on the expected response times for these sorts of actions.

I wish I had the time during our recent build-sessions to play around with some timers and find out for myself, but alas, today my hands were on power tools much more than the keyboard

Do y'all put these WAIT's into your standard parallel VI's? or do you let them free-run as fast as they can? If/when you let them free-run, what sorts of elapsed times would you expect from them?

Thanks!
__________________
----
There are 10 types of people. Those who understand binary, and those that do not.
Team #1164 - Project NEO Robotics

Last edited by Ziaholic : 02-15-2010 at 09:56 PM.
Reply With Quote
  #2   Spotlight this post!  
Unread 02-16-2010, 06:47 AM
Greg McKaskle Greg McKaskle is online now
Registered User
no team (Team NI)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 3,914
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Intra-Loop Timing Advice

Free running literally means take all available resources, pretty much maxing out the CPU. This won't necessarily do harm unless you have some lower priority tasks which may now become starved. It will also add lag to other tasks since at any given point in time, the CPU will have to finish the excess loops before it gets to the task that waited in line.

Moral: Almost always delay your loops in some way. The ideal way is to make them run when new data arrives or is needed. In some cases this is more easily done using a time schedule, but that has its own set of tradeoffs.

At this point, I wouldn't recommend it unless you have an issue. But when you have time, read up on the notification mechanisms, and especially the FIFO.

Greg McKaskle
Reply With Quote
  #3   Spotlight this post!  
Unread 02-16-2010, 03:17 PM
Merle Merle is offline
FRC Mentor, FLL Coach
FRC #3146 (GRUNTS)
Team Role: Engineer
 
Join Date: Jan 2003
Rookie Year: 2002
Location: Granby, CT
Posts: 42
Merle has a spectacular aura aboutMerle has a spectacular aura aboutMerle has a spectacular aura about
Re: Intra-Loop Timing Advice

Quote:
Originally Posted by Greg McKaskle View Post
But when you have time, read up on the notification mechanisms, and especially the FIFO.

Greg McKaskle

Where would one read up on these topics?
Reply With Quote
  #4   Spotlight this post!  
Unread 02-16-2010, 07:26 PM
Luke Pike's Avatar
Luke Pike Luke Pike is offline
Programmer
FRC #1501 (THRUST)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2008
Location: Huntington
Posts: 114
Luke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to all
Send a message via Skype™ to Luke Pike
Re: Intra-Loop Timing Advice

The LabVIEW Forums are a good place.

I like using Queues to control my sub-loops. Queues are FIFO arrays; I enqueue a command from teleop or autonomous and dequeue from the loop that handles the commands. If you don't specify a timeout, the dequeue vi will wait until a command gets enqueued, effectively pausing the loop until it's needed. As a bonus, if the loop takes a long time to finish an iteration, other commands will still be added to the queue and processed in the order they were added.
__________________
Twitter Profile
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Timing functions grosh NI LabVIEW 6 02-15-2010 01:20 PM
Timing belts kajeevan General Forum 6 08-13-2008 12:59 PM
timing of re-contact Gary Dillard Rules/Strategy 16 01-19-2008 01:09 PM
Timing Codes Ryan Cumings Programming 11 01-29-2004 09:26 PM


All times are GMT -5. The time now is 06:10 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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