Go to Post Dean Kamen is my Shaquille O'niel (or any other generic sports star). - Daniel Brim [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 04-04-2011, 18:19
j.cole j.cole is offline
Registered User
FRC #0379
 
Join Date: Jan 2010
Location: Girard
Posts: 159
j.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud of
Would Someone mind looking over my autonomous.

I'm not sure if what I'm doing is right at all because I have no robot to test it with but here it is. Before I split every command into its own while loop the robot was giving me some weird outputs with the arm always going to where I want it to go at first and then sometimes driving the full 3 seconds and sometimes not driving till the arm stopped.
__________________

It's not normally a good idea to give a programmer a drill but rules are made to be broken.

Last edited by j.cole : 04-04-2011 at 19:28. Reason: Detached file
Reply With Quote
  #2   Spotlight this post!  
Unread 04-04-2011, 18:36
WizenedEE's Avatar
WizenedEE WizenedEE is offline
Registered User
AKA: Adam
FRC #3238 (Cyborg Ferrets)
Team Role: Leadership
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Anacortes, WA
Posts: 395
WizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to all
Re: Would Someone mind looking over my autonomous.

  • Neither the top triplet nor the bottom triplet of while loops has a delay in them
  • You may want to change those waits to the other kind of wait (wait until next multiple), becuase that's more accurate.
  • The top triplet of loops will all execute at the same time; put a wire between them or use a sequence structure
  • You may want to combine all of the stages of the top 9 loops into one, so they stay synchronized.
  • When you stop on the last loop, you probably want to just put a false constant for the while loop so that it never ends; that way, the motors kept getting written to and don't give errors
  • In the bottom loop, why do you write to a global and then immediately read it again instead of just using a wire?
  • Check to see if there's a better way to calibrate the encoders than to just add a constant, but there may not be.
  • To make it more readable, you may want to replace some of those one-input-one-output case structures with selects
  • Instead of putting a not in the wire and then having a case structure, you could just swich around the cases. Again, not that important.
  • Comments might be nice, but again not too important
  • Your code is extremely clean, I'm impressed... I just punch the built in clean up button and live with it

That's everything I could find. Good luck with it though!
Reply With Quote
  #3   Spotlight this post!  
Unread 04-04-2011, 19:27
j.cole j.cole is offline
Registered User
FRC #0379
 
Join Date: Jan 2010
Location: Girard
Posts: 159
j.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud of
Re: Would Someone mind looking over my autonomous.

  • Fixed idk how I missed that
  • Ill stick with the normal Waits for now unless I get a problem.
  • Put them in a sequence structure
  • I had problems when I did that also this way I have more customization.
  • Did that
  • That was to 1.clean it up and 2.It was done in teleop where I call those values in weird places. (I assume your talking about the Rotate Max/Min)
  • That's there to make a physical 90 deg into a virtual 90 deg
  • That's how it is in teleop I like consistency.
  • Consistency
  • I've been told and I try.
  • I'm really anal about it and I spend almost twice as much time cleaning code as I do writing it. An NI rep was checking out my code and added some things that weren't perfectly wired I was twitching till I fixed it. You should see my teleop
Attached Files
File Type: vi Autonomous Independent.vi (50.3 KB, 18 views)
__________________

It's not normally a good idea to give a programmer a drill but rules are made to be broken.

Last edited by j.cole : 04-04-2011 at 19:29. Reason: Attached file
Reply With Quote
  #4   Spotlight this post!  
Unread 04-04-2011, 19:56
vhcook's Avatar
vhcook vhcook is offline
Reader of Things
AKA: Victoria
FRC #1939 (Kuh-nig-its)
Team Role: Mentor
 
Join Date: Feb 2007
Rookie Year: 2006
Location: Kansas City, MO
Posts: 546
vhcook has a reputation beyond reputevhcook has a reputation beyond reputevhcook has a reputation beyond reputevhcook has a reputation beyond reputevhcook has a reputation beyond reputevhcook has a reputation beyond reputevhcook has a reputation beyond reputevhcook has a reputation beyond reputevhcook has a reputation beyond reputevhcook has a reputation beyond reputevhcook has a reputation beyond repute
Re: Would Someone mind looking over my autonomous.

- If you're controlling your while loop exit condition entirely by the iteration number, why not use a for loop instead?

- Regarding the top nine loops, I think what you might really want to do here is combine your left three loops into one loop, then do the same thing with the middle three and the right three. Based on what you're doing with the iteration counter and the stop button, you seem to want each vertical trio to iterate at the same speed and terminate at the same time. Combining them would reduce the amount of CPU utilization involved as you wouldn't be running multiple waits and multiple instances of the same floating point arithmetic at once. On the other hand, if you're not entirely sure that you really want the timings identical, this may be your best bet.

- Similarly, rather than doing the floating point math on your loop control constants every pass, you could do that outside the loop and pass the value inside on a wire. You could also use a single constant and explain the math it came from in a comment. This isn't going to be terribly important unless you find you're using too much CPU, but every little bit helps.
__________________


Reply With Quote
  #5   Spotlight this post!  
Unread 05-04-2011, 23:01
j.cole j.cole is offline
Registered User
FRC #0379
 
Join Date: Jan 2010
Location: Girard
Posts: 159
j.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud of
Re: Would Someone mind looking over my autonomous.

-Its just the way the tutorial says to do it and if it aint broken (to my knowledge) why fix it

-I tried that and with PiD it doesn't like to work all of the time(at least I think that's what is happening) It won't run anything else until the PiD setpoints are met.

-As in first comment
__________________

It's not normally a good idea to give a programmer a drill but rules are made to be broken.
Reply With Quote
  #6   Spotlight this post!  
Unread 06-04-2011, 13:57
mesamb1's Avatar
mesamb1 mesamb1 is offline
Registered User
AKA: Sam Bacon
FRC #1466 (Webb Robotics)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2004
Location: Knoxville
Posts: 93
mesamb1 is just really nicemesamb1 is just really nicemesamb1 is just really nicemesamb1 is just really nice
Re: Would Someone mind looking over my autonomous.

I sympathize with your clean code and the NI rep. I make all of my students clean up their code so often they complain labview is more about being organized then knowing computes(but with good comments they can fine problems right away ) .

Our team did PID controllers for giggles this season. I am a C.S. and Math person working with a professional automation engineering mentor, so nerdy enough to read the NI manual on PID. The controller actually wants a percent. It just the difference between set point, and process variables(there is more then that, but it is a little more complicated then you can explain over a forum). I dont think it will help your drive issues, but if you send the PID a percent and give it a range between 100 to -100 then divide by 100 you will get a much better motor curve.

How did you go about setting your PID gains?

Please combine those three sets of loops, there is no reason you should separate them, and your timing becomes precise, and since your not driving off of floor sensors then you need that to be right!

The variables could cause the sporadic driving. I do not think they are, but what will save you a lot of trouble is if you place the arm movement part in a subvi. then call the subvi with the the two set points that you want in the arcade drive loop(the subvi will make your telop cleaner too!!)

As a member of the smoky mountain planning committee I hope you had a great time!! thanks for coming to Knoxville!

Last edited by mesamb1 : 06-04-2011 at 13:59. Reason: misspelling
Reply With Quote
  #7   Spotlight this post!  
Unread 06-04-2011, 14:17
Travis Hoffman's Avatar Unsung FIRST Hero
Travis Hoffman Travis Hoffman is offline
O-H
FRC #0048 (Delphi E.L.I.T.E.)
Team Role: Engineer
 
Join Date: Sep 2001
Rookie Year: 2001
Location: Warren, Ohio USA
Posts: 4,047
Travis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond repute
Re: Would Someone mind looking over my autonomous.

Thanks to all so far for providing help. Jordan is the hardest-working programming student we have in these here parts, and he's learned far more about LabVIEW than I'd ever care to learn. I'm expecting him to teach me and other NEOFRA students and mentors this offseason, once he's done figuring it all out.

Until then, I shall remain comfortably in my faster compile and download C++ fantasy land! Tra la la....
__________________

Travis Hoffman, Enginerd, FRC Team 48 Delphi E.L.I.T.E.
Encouraging Learning in Technology and Engineering - www.delphielite.com
NEOFRA - Northeast Ohio FIRST Robotics Alliance - www.neofra.com
NEOFRA / Delphi E.L.I.T.E. FLL Regional Partner
Reply With Quote
  #8   Spotlight this post!  
Unread 06-04-2011, 15:41
j.cole j.cole is offline
Registered User
FRC #0379
 
Join Date: Jan 2010
Location: Girard
Posts: 159
j.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud of
Re: Would Someone mind looking over my autonomous.

Yeah she helped me a lot and I appreciate all her work it was just kinda throwing me off. She spent a lot of time over with us lookin at the code.

I never thought of leaving it at 100 & -100 but that's a good idea. I haven't had any problems with accuracy but if I do I'll keep that in mind.

I made a graph on the front panel of the teleop with the setpoint and the process variable. Then we had a mentor there that could look at the graph and figure out what needed to change in our gains also we left out a I because it's dangerous and unnecessary. So basically its a visual tune.

As of now I'd rather not recombine them because I wanna see if it works first.

That's what I'm thinking for why I'd rather not recombine them.

Knoxville was a lot of fun and I think all of the teams were surprised at how smoothly everything was going I think all of our other students said they liked it too. I'd like to go back in the future but it probably won't happen while I'm a student.
__________________

It's not normally a good idea to give a programmer a drill but rules are made to be broken.
Reply With Quote
  #9   Spotlight this post!  
Unread 06-04-2011, 16:06
mesamb1's Avatar
mesamb1 mesamb1 is offline
Registered User
AKA: Sam Bacon
FRC #1466 (Webb Robotics)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2004
Location: Knoxville
Posts: 93
mesamb1 is just really nicemesamb1 is just really nicemesamb1 is just really nicemesamb1 is just really nice
Re: Would Someone mind looking over my autonomous.

Well thank you so much for joining us for our rookie regional. Glad to hear you guys liked it!!

I, personally, had expected multiple field failures, but the nice thing about being week 5 is that the field techs have all of that stuff under control.

[Travis Hoffman, you have a great student! it is really done well and is particularly ambitious with out a labview mentor, but I shake my fist at your c++ compiler]

I would argue about the I variable(if it was giving dangerous results, you could be seeing some round off errors there), but that is as good as anyway to tune it.

If you have the time tonight(you may be swamped). In a very separate folder from your normal code(careful not to get a dependency error in your main code) just recreate your autonomous code in a subvi(just download the file you uploaded with a new name, and create a global variable file in the folder). then get rid of all of the motor references, and just set the arm to always be where it is desired. Then graph the drive output. It is not slick but it will give you a timing idea of how long things are being run. If your code is waiting for a variable, not running at the same time, ect. that will show up in the graphs. Far from the way you SHOULD test it, but it is a sans-robot way you CAN test it
Reply With Quote
  #10   Spotlight this post!  
Unread 06-04-2011, 17:33
Travis Hoffman's Avatar Unsung FIRST Hero
Travis Hoffman Travis Hoffman is offline
O-H
FRC #0048 (Delphi E.L.I.T.E.)
Team Role: Engineer
 
Join Date: Sep 2001
Rookie Year: 2001
Location: Warren, Ohio USA
Posts: 4,047
Travis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond repute
Re: Would Someone mind looking over my autonomous.

Quote:
Originally Posted by mesamb1 View Post

[Travis Hoffman, you have a great student! it is really done well and is particularly ambitious with out a labview mentor, but I shake my fist at your c++ compiler]
Jordan is on Team 379. I just hang out at their shop and harass them from time to time.

You were right about the "great student" part, however.
__________________

Travis Hoffman, Enginerd, FRC Team 48 Delphi E.L.I.T.E.
Encouraging Learning in Technology and Engineering - www.delphielite.com
NEOFRA - Northeast Ohio FIRST Robotics Alliance - www.neofra.com
NEOFRA / Delphi E.L.I.T.E. FLL Regional Partner
Reply With Quote
  #11   Spotlight this post!  
Unread 12-04-2011, 15:36
j.cole j.cole is offline
Registered User
FRC #0379
 
Join Date: Jan 2010
Location: Girard
Posts: 159
j.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud of
Re: Would Someone mind looking over my autonomous.

Thanks for all the help guys i prolly shouldave listened to you guys in the first place about combining the while loops because I was having trouble on thursday and the NI Rep (i never got his name cool dude, are all NI reps awesome?) told me to combine them and it worked. Aside from that it works as it should (it likes to veer right but that's a physical problem)
Attached Files
File Type: vi Autonomous Independent.vi (43.5 KB, 10 views)
__________________

It's not normally a good idea to give a programmer a drill but rules are made to be broken.
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 09:25.

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