Go to Post Don't trust everything you read on Chief Delphi. - Peter Matteson [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 27-01-2017, 17:50
flemdogmillion's Avatar
flemdogmillion flemdogmillion is online now
Programmer, Builder, Driver...
FRC #3007
 
Join Date: Nov 2016
Rookie Year: 2015
Location: Minnesota
Posts: 125
flemdogmillion will become famous soon enoughflemdogmillion will become famous soon enough
Limit on how complex Teleop.vi should be?

Hello from 3007 (again),
I have a rather crowded and complex teleop.vi, and I was wondering if there is a downside of this.
Also, can anyone tell me if I dropped a negative sign somewhere in my lateral aiming algorithm? I can't keep track of all of it.
Attached Thumbnails
Click image for larger version

Name:	TeleopVI_1-27-16.PNG
Views:	55
Size:	51.5 KB
ID:	21638  
__________________
Team 4506: 2015-2016
Team 3007: 2017

Jack of all trades except C++ & Java
Reply With Quote
  #2   Spotlight this post!  
Unread 27-01-2017, 19:23
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
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,906
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: Limit on how complex Teleop.vi should be?

Teleop needs to complete faster than 20ms.
You can check this using the Elapsed Times.vi provided under the Support Code in the project tree.

Drop it into Teleop and open the front panel of Elapsed Times to watch, then run debug from Robot Main. You'll get how long it takes Teleop to run.

Normally you should put complete, time consuming tasks somewhere other than Teleop.
Usually Periodic Tasks.vi is a good choice.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 27-01-2017 at 22:05.
Reply With Quote
  #3   Spotlight this post!  
Unread 27-01-2017, 21:59
flemdogmillion's Avatar
flemdogmillion flemdogmillion is online now
Programmer, Builder, Driver...
FRC #3007
 
Join Date: Nov 2016
Rookie Year: 2015
Location: Minnesota
Posts: 125
flemdogmillion will become famous soon enoughflemdogmillion will become famous soon enough
Quote:
Originally Posted by Mark McLeod View Post
Teleop needs to complete faster than 20ms.
You can check this using the Elapsed Times.vi provided under support in the project tree.

Drop it into Teleop and open the front panel of Elapsed Times to watch, then run debug from Robot Main. You'll get how long it takes Teleop to run.

Normally you should put complete, time consuming tasks somewhere other than Teleop.
Usually Periodic Tasks.vi is a good choice.


I'm pretty sure it completes within 20ms, but I should probably check.
__________________
Team 4506: 2015-2016
Team 3007: 2017

Jack of all trades except C++ & Java
Reply With Quote
  #4   Spotlight this post!  
Unread 28-01-2017, 08:17
Jonathan L. Jonathan L. is offline
Programmer alumnus, mentor, and CSA
FRC #1094 (Channel Cats)
 
Join Date: Jan 2013
Rookie Year: 2011
Location: St. Louis MO
Posts: 82
Jonathan L. is a jewel in the roughJonathan L. is a jewel in the roughJonathan L. is a jewel in the roughJonathan L. is a jewel in the rough
Re: Limit on how complex Teleop.vi should be?

Just by looking at it, I don't think it should be a problem for the roboRIO to handle. Using Elapsed Time.vi as Mark McLeod said would be a good idea if you really want to know for sure.

I see a Negate function just before the PID's process variable input. I don't know if that's what your looking for.



Visually, it does seam a bit messy. You can fix that by creating subVIs for each function (e.g. Drive.vi, Feeder.vi, Climber.vi, etc.). I wouldn't hesitate to copy the Joystick Get code into each of those VIs. If you end up with two actuators that are strongly related, you can still put those in the same vi. For example, in 2015 we had an elevator that used a motor and a pneumatic piston as a brake. The operator had an up button and a down button. Whenever, the up or down buttons were pressed, the brake would be off and the motor would move in the appropriate direction (assuming it was safe according to limit switches). If neither button was pressed the motor would be off and the brake would be on. That was all a subVI in TeleOp.

Additianaly, you can put most of that code inside a VI that gets reused in autonomous. See our code from last year for an example of that.

Of course there are other ways to organize code. This is just one way that you could easily use without having to learn a whole lot about communication inside a LabVIEW program.



FYI, I think you can safely remove the compressor code as the compressor will still run automatically as long as you open a solenoid.
Reply With Quote
  #5   Spotlight this post!  
Unread 28-01-2017, 09:20
flemdogmillion's Avatar
flemdogmillion flemdogmillion is online now
Programmer, Builder, Driver...
FRC #3007
 
Join Date: Nov 2016
Rookie Year: 2015
Location: Minnesota
Posts: 125
flemdogmillion will become famous soon enoughflemdogmillion will become famous soon enough
Quote:
Originally Posted by Jonathan L. View Post
Just by looking at it, I don't think it should be a problem for the roboRIO to handle. Using Elapsed Time.vi as Mark McLeod said would be a good idea if you really want to know for sure.



I see a Negate function just before the PID's process variable input. I don't know if that's what your looking for.







Visually, it does seam a bit messy. You can fix that by creating subVIs for each function (e.g. Drive.vi, Feeder.vi, Climber.vi, etc.). I wouldn't hesitate to copy the Joystick Get code into each of those VIs. If you end up with two actuators that are strongly related, you can still put those in the same vi. For example, in 2015 we had an elevator that used a motor and a pneumatic piston as a brake. The operator had an up button and a down button. Whenever, the up or down buttons were pressed, the brake would be off and the motor would move in the appropriate direction (assuming it was safe according to limit switches). If neither button was pressed the motor would be off and the brake would be on. That was all a subVI in TeleOp.



Additianaly, you can put most of that code inside a VI that gets reused in autonomous. See our code from last year for an example of that.



Of course there are other ways to organize code. This is just one way that you could easily use without having to learn a whole lot about communication inside a LabVIEW program.







FYI, I think you can safely remove the compressor code as the compressor will still run automatically as long as you open a solenoid.


The compressor code is there to turn off the compressor when the climber is enabled.
__________________
Team 4506: 2015-2016
Team 3007: 2017

Jack of all trades except C++ & Java
Reply With Quote
  #6   Spotlight this post!  
Unread 28-01-2017, 11:14
billbo911's Avatar
billbo911 billbo911 is offline
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,385
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
Re: Limit on how complex Teleop.vi should be?

Back in the day....(When we used LabView), we had a rule of thumb.
Onlu driving code was included in Teleop.vi. Everything else was run through parallel tasks (periodic task). One key is to make certain the Teleop.vi is not waiting for a parallel task to complete.
Trigger tasks from within teleop.vi if you want, but don't wait on them to complete.
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist
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 10:52.

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