Go to Post Of course even though its less than a week until kickoff, dave can still change the rules to make bearhugging me in automode a bonus - Mike Schroeder [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 01-03-2009, 10:11
professorX professorX is offline
Registered User
AKA: Xavier
FRC #1660 (The Harlem Knights)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2005
Location: New York
Posts: 62
professorX is an unknown quantity at this point
Question Automous Programming

I need help finishing programming Autonomous mode. I want the robot to move forward in increments of .2 until it reaches to 1 for 8 seconds. Then, I want the robot to turn in increments of .2 until it reaches to 1 for 7 seconds.

It is tank drive and the jaguars are not flip so 0.2 for the left value and -0.2 for the right value will make it move forward.

Can anyone help me finish this?


Last edited by professorX : 01-03-2009 at 19:14.
Reply With Quote
  #2   Spotlight this post!  
Unread 01-03-2009, 11:44
Stuart's Avatar
Stuart Stuart is offline
#include coffee.h
FRC #1745 (P51- Mustangs)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Dallas, TX
Posts: 414
Stuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond repute
Send a message via AIM to Stuart
Re: Automous Programming

ok let me ask you a question.

how fast will this code get up to 1

as fast as it can. you see your for loop has no delay and your sequence has no delay either

start looking in to time delays ( it looks like a stop watch).


PM me if you have any other questions.
__________________
Proud mentor of Team #1745 the P-51 Mustangs

If at first it doesn't work, use a hammer.
If that doesn't work, use a bigger hammer.
Reply With Quote
  #3   Spotlight this post!  
Unread 01-03-2009, 13:32
professorX professorX is offline
Registered User
AKA: Xavier
FRC #1660 (The Harlem Knights)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2005
Location: New York
Posts: 62
professorX is an unknown quantity at this point
Re: Automous Programming

I want it reach 1 in 8 seconds and then turn for 7 seconds. I was looking at time delay but I'm not sure how it would work.
Reply With Quote
  #4   Spotlight this post!  
Unread 01-03-2009, 14:32
Caroline2399 Caroline2399 is offline
Registered User
FRC #2399 (Team HB)
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Cleveland, OH
Posts: 9
Caroline2399 will become famous soon enough
Re: Automous Programming

Yeah, you will definitely want a time delay in there. The only tricky thing about using a normal one is that your watchdog will time out (I experienced some problems with that earlier this season). So, what you will want to do is insert one of those watchdog "delay and feed" VIs with the delay input set to however many seconds you want your code to run for.

It looks like in your first frame of the sequential loop you would want a constant set to 1 (or however many seconds you want it to run at each increment of .2) for the delay time, and set "N" to 7 or 8 depending on how many seconds you want it to take. Then repeat that same kind of format for the second frame.

Just as a side note, currently the last Watchdog delay and feed that you have outside of your sequential loop looks to me as if it is not going to be doing anything.

If you have any more questions feel free to PM me.
__________________
2399:

2009 Buckeye Regional: Delphi Driving Tomorrow's Technology Award winner
2009 Pittsburgh Regional: General Motors Industrial Design Award winner
2009 Pittsburgh Regional: Semi-Finalist (Thank you teams 2901 and 2614 for being absolutely AMAZING alliance partners!!!!)

Last edited by Caroline2399 : 01-03-2009 at 14:44.
Reply With Quote
  #5   Spotlight this post!  
Unread 01-03-2009, 15:11
professorX professorX is offline
Registered User
AKA: Xavier
FRC #1660 (The Harlem Knights)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2005
Location: New York
Posts: 62
professorX is an unknown quantity at this point
Re: Automous Programming

So it would be like this? But one problem that I had with this code is that the robot would try to go forward for maybe 1 second and then turn or it would try to move forward and turn at the same time.

Reply With Quote
  #6   Spotlight this post!  
Unread 01-03-2009, 15:58
Caroline2399 Caroline2399 is offline
Registered User
FRC #2399 (Team HB)
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Cleveland, OH
Posts: 9
Caroline2399 will become famous soon enough
Re: Automous Programming

I'm not sure as to why that code isn't working, but here are my suggestions for troubleshooting it.

My first suggestion for this would be to wire the error from the drive VI to the Delay and Feed VI in the same frame.

I noticed that you had the constant "N" value for the first frame defined outside of the sequential loop, I don't know why it wouldn't work where it is currently, but maybe try moving it inside there.

Also, maybe try turning the auto-indexing off for the tunnels outputting and inputting the Watchdog Reference and the Drive Ref. And, try for the second "Delay and Feed" VI taking the reference from the output of the first one. Again, I don't know why this would make a difference, but LabView can be odd like that sometimes.

I hope this is able to help, if you still have the same issues, let me know, and I'll see if I can come up with any other methods you could use to troubleshoot the code.
__________________
2399:

2009 Buckeye Regional: Delphi Driving Tomorrow's Technology Award winner
2009 Pittsburgh Regional: General Motors Industrial Design Award winner
2009 Pittsburgh Regional: Semi-Finalist (Thank you teams 2901 and 2614 for being absolutely AMAZING alliance partners!!!!)
Reply With Quote
  #7   Spotlight this post!  
Unread 01-03-2009, 18:17
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: Automous Programming

We can't tell what the polarity of your motors are or how they are mounted and geared. But your first loop is doing the same as moving one joystick forward and the other backwards. The second loop moves them both backwards. It may seem odd that pushing the joystick forward is negative numbers, but that is the way that HID devices are defined, and that was the standard chosen for the joystick library.

So my prediction is that the robot increases the spin speed for eight seconds, then sets the motors to slow backward and increases speed backwards for eight seconds.

Another thing to think about is how the robot drives using the joystick. After four seconds, your loop will effectively have the joysticks maxed out. Does that match what your human driver would do? It seems like you may want to try a smaller increment so that you wind up at the same point as the human driver.

To clean up the code a bit in readability, you can right click on the outer case and Remove the case. You can also do that to the sequence structure. You can right click on the output tunnels on the first for loop and disable the auto-indexing.

Greg McKaskle
Reply With Quote
  #8   Spotlight this post!  
Unread 01-03-2009, 18:43
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,597
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
Re: Automous Programming

I strongly recommend making your code clearer by using the Arcade Mode VI during autonomous. It is easier to understand and code for (IMHO). For me, Tank is easier to drive but Arcade is easier to code.

To do so, you will need to invert that motor. I always "force" my programmers to fix things as soon as possible. In your case, you can fix it by using a -.2, or you can fix it by inverting that bit. The bit is sooner, which means you have to worry about it less. Less worry is more better.
Reply With Quote
  #9   Spotlight this post!  
Unread 01-03-2009, 21:26
gwytheyrn gwytheyrn is offline
Registered User
AKA: David
FRC #0461 (West Side Boiler Invasion)
Team Role: Programmer
 
Join Date: Dec 2007
Rookie Year: 2004
Location: Indiana
Posts: 44
gwytheyrn is infamous around these parts
Send a message via AIM to gwytheyrn
Re: Automous Programming

Meh, I disagree, since for tank drive, you're essentially setting the motor values yourself, whereas arcade it's processed by the arcade vi (note: i say essentially).

just out of curiosity, try the attached code...It uses a different structure and does it in a smaller steps (time and motor value), but should have the same overall function. The positives and negatives might be flipped around as previously mentioned though
Attached Files
File Type: vi Autonomous Independent.vi (24.1 KB, 62 views)
Reply With Quote
  #10   Spotlight this post!  
Unread 02-03-2009, 09:07
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: Automous Programming

From the little exerience I had in DC, I think there is benefit for using the same drive version or both tele and auto. That allows the auto code to replicate driver actions. True, if you can visualize the joystick maneuver either way, then I also prefer arcade for auto, but the important thing to me is that the person writing the auto can pretend they are setting the joystick and build code to replay that.

Perhaps someone would like to build a recorder for a drive session and play that back using an array of setpoints?

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Team 1675' s AutoFlex automous Program bcieslak Programming 8 14-03-2007 20:29
Automous Code? Raikon Programming 5 29-01-2007 01:13
programming motors with programming kit BorisTheBlade FIRST Tech Challenge 4 01-11-2005 19:03
so lost we need help with automous evilhunter Programming 2 21-02-2005 13:54
2001 2002 in Automous SpaceOsc Control System 12 17-05-2004 01:52


All times are GMT -5. The time now is 21:38.

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