Go to Post The world isn't changed by people playing it safe. - Andrew Y. [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 Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 15-04-2011, 04:47
cabbagekid2 cabbagekid2 is offline
Registered User
#0368 (Kika Mana)
 
Join Date: Jun 2001
Rookie Year: 2000
Location: Honolulu, HI
Posts: 85
cabbagekid2 has a spectacular aura aboutcabbagekid2 has a spectacular aura aboutcabbagekid2 has a spectacular aura about
Periodic Task (vi) - Thoughts?

Hi, I was wondering what peoples thoughts were with what code should be put in periodic task. I believe with the old IFI control system you couldn't read driver station values in periodic task (it was just meant for on board sensors, internal calcs, etc). Everything that dealt with driver station input was in teleop.

With the new Crio though since the teleop while loop cycle doesn't finish until the last thing executes, it leads me to think that we should either move the slowest items in teleop to periodic task or the fastest items (so the slow items don't slow down the faster items).

As an example, our lift uses pid and a bunch of other limit checks to keep the driver from killing the lift. However, this is probably the slowest thing in teleop (we used the elapse vi and usually things are under 100ms however there are times when it goes over).

So, what we did was move our minibot deployment code (just a switch from the driver station controlling solenoids) to periodic task since it leads me to believe that if telop does run over 100ms that minibot deployment can be delayed by up to 90ms or so. We also plan to move a bunch of other things that can run faster into periodic task from teleop. Does this seem right? Putting teleop code in periodic tasks seems a little weird to me. Where do you differentiate what should go where?

Any comments would be good. If you could give your own examples of what you put in teleop vs periodic task that would be good. THanks!
Reply With Quote
  #2   Spotlight this post!  
Unread 15-04-2011, 06:57
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
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: Periodic Task (vi) - Thoughts?

Periodic tasks is really just a template showing that code can run in parallel with the telelop VI.

The camera code runs independently and publishes results. This is especially good since cameras are somewhat slow sensors. You wouldn't want the camera to limit when the teleop finished, right?

Similarly, any periodic tasks, especially slow ones should be considered for this approach. If you have a PID loop, especially if the teleop loop rate isn't the ideal loop rate for the PID, move the PID into periodic. Update the setpoints from within teleop, but let the sensor reads, the calculations, and the value updates happen within periodic.

By moving things out, and running control loops at the rate they need, rather than the rate of the joysticks, hopefully you can have your teleop running at 20ms instead of 100.

Doug Norman and I will be giving a presentation in St Louis which covers this in a bit more detail. I'm assuming the slides will be available afterwards.

Greg McKaskle
Reply With Quote
  #3   Spotlight this post!  
Unread 15-04-2011, 17:49
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,100
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: Periodic Task (vi) - Thoughts?

Quote:
Originally Posted by Greg McKaskle View Post
Doug Norman and I will be giving a presentation in St Louis which covers this in a bit more detail. I'm assuming the slides will be available afterwards.
Thank you Greg. I think there's a real need for this information, especially for teams with no mentors who have experience with realtime control.


Reply With Quote
  #4   Spotlight this post!  
Unread 16-04-2011, 02:35
cabbagekid2 cabbagekid2 is offline
Registered User
#0368 (Kika Mana)
 
Join Date: Jun 2001
Rookie Year: 2000
Location: Honolulu, HI
Posts: 85
cabbagekid2 has a spectacular aura aboutcabbagekid2 has a spectacular aura aboutcabbagekid2 has a spectacular aura about
Re: Periodic Task (vi) - Thoughts?

Thanks Greg. I look forward to your presentation. Do you know what the topic of the other tbd NI presentation is?
Reply With Quote
  #5   Spotlight this post!  
Unread 16-04-2011, 08:34
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
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: Periodic Task (vi) - Thoughts?

The title is something like -- Making the Most of LabVIEW for FRC : Performance, Debugging, and Architecture.

The performance section covers the performance goals of the different VIs, shows different measurements you can make to determine if you meet those goals, and if not, why not.

Debugging covers understanding errors, determining where they come from, why they are being reported, and what to try to get them to stop.

Architecture covers determining where to put different code elements, and how to coordinate them.

And of course, if you ask other questions, we'll try to answer them. Doug and I will also be in the NI booth in some form of Genius Bar. We'll have computers and robot, so you can drop by and we'll do our best to answer whatever questions you may have.

Greg McKaskle
Reply With Quote
  #6   Spotlight this post!  
Unread 21-04-2011, 08:10
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: Periodic Task (vi) - Thoughts?

Greg - Does this apply to Autonomous as well? Should a while loop in autonomous (say, iterating while waiting for a drive encoder to reach a certain distance) - be moved to periodic tasks? Is there any difference in a loop running within periodic tasks and one running in autonomous?

We're getting performance issues (drive motors stop intermittently) while running this autonomous and the concurrent vision processing loop. We have a 50 ms delay in the autonomous loop and 20 ms delay in the vision loop.
Reply With Quote
  #7   Spotlight this post!  
Unread 21-04-2011, 22:18
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
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: Periodic Task (vi) - Thoughts?

The only thing special about the autonomous VI is that it is dynamically launched and aborted after the autonomous is over. If you would like to distribute some of the processing into other loops, that is fine. The parallel loops can be in periodic.vi or even in the autonomous.

Another thing to consider is whether you would like to use the exact same periodic loop code for a mechanism. Use it during tele and during auto. This should allow for more consistent control.

Greg McKaskle
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:46.

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