Go to Post The way things generally work in cases like this is simple: if you know something, you can't say it. So keep in mind that if someone does say something, it usually means they don't know. - Alan Anderson [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 17-02-2009, 20:16
tomy tomy is offline
Registered User
FRC #3038 (I.C.E. Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Stacy, Minnesota
Posts: 494
tomy has a spectacular aura abouttomy has a spectacular aura about
Angry autonomous mode help please...

this is my code. i know it looks confusing the first joystick on usb 1 controls the two motors on the left side of the robot. the joystick on usb 2 controlls the two motors on the right side. the third joystick controls our manipulator. with the victorl only controls one motor on pwm 5, pwm 6 is a ghost so it will work. i have tried other programs and they do nto seem to work the way i want them to. i know that it is confusing but how do i program that in autonomous mode. i already looked at the tip jar and that did not help. i do not need to put the manipulater in there i just need to get control of all 4 motors at once. i know that i will probally not be ably to test it but i need to get it done. please help
Attached Files
File Type: vi Basic Robot Main.vi (90.4 KB, 35 views)
Reply With Quote
  #2   Spotlight this post!  
Unread 18-02-2009, 16:53
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,795
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: autonomous mode help please...

I would be simpler to use 4 motor tank drive, then your autonomous mode is also much simpler. Making three duplicates of the original drive function isn't the right way to go.

For just the top Drive section:
1) Right click on the top "Drive Open 2 Motor" and choose: Replace -> RobotDrive Pallet -> Open 4 Motor
You'll then need to add constants for the extra PWMs for your motors, but make sure to read which motor each connection is supposed to be.

2) Right click on "Drive Arcade Drive" and choose: Replace -> RobotDrive Pallet -> TankDrive

3) Take the output of your second joystick on USB 2 and connect it to the Tank Drive "Right Axis value"

4) Remove the second "Drive Open 2 Motor" and the second Arcade Drive icon.

5) Switch "TeleOp Execute" to "TeleOp Reset" and also replace the Arcade Drive there with Tank Drive.

That's all you need to have 4 motors controlled by Joysticks 1 & 2 in tank-style drive.

The attached sample of this is a direct modification of your code.

This makes Autonomous pretty simple, because you can use what's already there
In Autonomous Independent.vi replace each of the three Arcade Drive icons with TankDrive:

1) Right click on "Drive Arcade Drive" and choose: Replace -> RobotDrive Pallet -> TankDrive
Add a second constant (use -0.5 for the fist one and 0.5 for the second one) to each of the TankDrive Left axis inputs.

2) Toggle the True/False switch on the left to True, so that the autonomous is allowed to run.

P.S. I've attached a picture of what the autonomous would look like when you're done.
Attached Thumbnails
Click image for larger version

Name:	TankDriveSample.jpg
Views:	81
Size:	28.6 KB
ID:	7519  Click image for larger version

Name:	Auto_sample.jpg
Views:	86
Size:	37.7 KB
ID:	7521  
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 19-02-2009 at 09:15.
Reply With Quote
  #3   Spotlight this post!  
Unread 18-02-2009, 18:05
tomy tomy is offline
Registered User
FRC #3038 (I.C.E. Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Stacy, Minnesota
Posts: 494
tomy has a spectacular aura abouttomy has a spectacular aura about
Re: autonomous mode help please...

that is awesome but will it still give me the same control with the right pwm's like i already have it set up...?

Also, how do you check what version your driver station is and your crio i do not have the crio with me but i would like to know so when i do get to the competition i can easily check
Reply With Quote
  #4   Spotlight this post!  
Unread 18-02-2009, 18:18
tomy tomy is offline
Registered User
FRC #3038 (I.C.E. Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Stacy, Minnesota
Posts: 494
tomy has a spectacular aura abouttomy has a spectacular aura about
Re: autonomous mode help please...

one more thing sorry if it is much of a trouble but i am a buy that like pictures. can you get me a pic of the autonomous code
Reply With Quote
  #5   Spotlight this post!  
Unread 19-02-2009, 09:13
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,795
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: autonomous mode help please...

Quote:
Originally Posted by tomy View Post
Also, how do you check what version your driver station is and your crio i do not have the crio with me but i would like to know so when i do get to the competition i can easily check
The Driver Station version is desplayed at the bottom of the LCD screen.
The cRIO version can be checked using the FRC Diagnostic Tool at: http://thinktank.wpi.edu/resources/2...indow_ver2.zip
When you start that up though, the version information is off the screen to the right.

---------------
This will give you the same control that you already have.
As with all code changes though, put the robot up on blocks until you've tested it. It's too easy to reverse the PWMs by accident, or have the motors or wiring inverted.

Part of the problem with doing it the way you have is that RobotDriveDefRef is messed up so that autonomous wouldn't work.

Even your manipulator drive should at least have the RobotDriveDefRef taken off of it.

I've attached to the original post what the Autonomous described would look like.
--------------

A better way to handle your manipulator is to learn how to use a single motor.
In your case for example:

1) Go to the Pallet WPI Robotics Library -> RobotDrive ->Advanced -> Motor Control

2) Use Motor Open, Set Speed, and Close

Here's a picture of what that would look like:
Attached Thumbnails
Click image for larger version

Name:	Manipulator.jpg
Views:	58
Size:	38.7 KB
ID:	7522  
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 19-02-2009 at 09:35.
Reply With Quote
  #6   Spotlight this post!  
Unread 19-02-2009, 17:59
tomy tomy is offline
Registered User
FRC #3038 (I.C.E. Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Stacy, Minnesota
Posts: 494
tomy has a spectacular aura abouttomy has a spectacular aura about
Re: autonomous mode help please...

thank you but can i have a pic of the autonomous mode
Reply With Quote
  #7   Spotlight this post!  
Unread 19-02-2009, 19:15
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: autonomous mode help please...

Quote:
Originally Posted by tomy View Post
thank you but can i have a pic of the autonomous mode
You have one.

Quote:
Originally Posted by Mark McLeod View Post
I've attached to the original post what the Autonomous described would look like.
Reply With Quote
  #8   Spotlight this post!  
Unread 19-02-2009, 21:20
tomy tomy is offline
Registered User
FRC #3038 (I.C.E. Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Stacy, Minnesota
Posts: 494
tomy has a spectacular aura abouttomy has a spectacular aura about
Re: autonomous mode help please...

okay i am just hopping that you guys are right and that this will drive just like when i had it before
Reply With Quote
  #9   Spotlight this post!  
Unread 19-02-2009, 21:22
tomy tomy is offline
Registered User
FRC #3038 (I.C.E. Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Stacy, Minnesota
Posts: 494
tomy has a spectacular aura abouttomy has a spectacular aura about
Re: autonomous mode help please...

also can you explain autonomous mode a little better like how do i make i go further or longer
Reply With Quote
  #10   Spotlight this post!  
Unread 19-02-2009, 21:42
tomy tomy is offline
Registered User
FRC #3038 (I.C.E. Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Stacy, Minnesota
Posts: 494
tomy has a spectacular aura abouttomy has a spectacular aura about
Re: autonomous mode help please...

sorry for all the questions but on the motor control for my manipulator shouldn't i have a joystick close...?
Reply With Quote
  #11   Spotlight this post!  
Unread 20-02-2009, 08: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,751
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: autonomous mode help please...

The sample autonomous code sets the motor speeds to some value, then waits while they run at that speed, then changes the speed, then waits, ...

I think what you are asking is how to get the robot to drive further or longer. They are related. Distance is velocity x time. The joystick input to the drive block is pretty much velocity of your wheels. So one approach would be to make all the motor commands go faster -- you may want to think about that one this year. Another approach is to leave the motors running for longer. That would be the same as sending a larger number to the wait block.

Finally, if some part of your path that you map out is cyclical, you may want to use a loop to repeat a pattern until auto is up.

Now it is your turn to take these simple things and come up with your own autonomous path program.

Greg McKaskle
Reply With Quote
  #12   Spotlight this post!  
Unread 20-02-2009, 17:41
tomy tomy is offline
Registered User
FRC #3038 (I.C.E. Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Stacy, Minnesota
Posts: 494
tomy has a spectacular aura abouttomy has a spectacular aura about
Re: autonomous mode help please...

no what i mean is what do each of the constants mean how do i make all 4 of my motors go at once. all i want if 4 it to drive forward for a while
Reply With Quote
  #13   Spotlight this post!  
Unread 20-02-2009, 18:25
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: autonomous mode help please...

Quote:
Originally Posted by tomy View Post
no what i mean is what do each of the constants mean how do i make all 4 of my motors go at once. all i want if 4 it to drive forward for a while
Are you talking about your drive motors? The Tank Drive VI controls all of the motors that were defined to the Four Motor Drive Open VI.
Reply With Quote
  #14   Spotlight this post!  
Unread 20-02-2009, 19:05
tomy tomy is offline
Registered User
FRC #3038 (I.C.E. Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Stacy, Minnesota
Posts: 494
tomy has a spectacular aura abouttomy has a spectacular aura about
Re: autonomous mode help please...

okay i am talking about autonomous mode how do i make it go further and what are the constantace for.
Reply With Quote
  #15   Spotlight this post!  
Unread 20-02-2009, 20:55
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,795
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: autonomous mode help please...

Using the image I posted earlier and starting from the left:

(4) -- runs what's inside the loop box four times. You use this to repeat the same actions over and over again.

(-0.5) into Tank Drive -- runs the motors forward at half speed (-1.0 would be full speed and 0.0 is stopped)

(1) into Delay & FEED -- Keeps the tank drive settings it just made going for 1 second

(0.5) into Tank Drive -- runs the motors backward at half speed (1.0 would be full speed)

(0.25) into Delay & FEED -- keeps the tank drive settings it just made going for .25 seconds

(0) into the final Tank Drive -- stopps the motors as the last thing done in autonomous

So what this code does is to:
-- drive forward for 1 sec.
-- drive backwards for 1/4 sec.
-- repeat these two drive commands four times
-- then stop

To go further you can increase the amount of time into the Delay & FEED's.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
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
Autonomous mode help Drake Hunter NI LabVIEW 3 12-02-2009 01:52
Help needed in autonomous programming for hybrid mode Team_STORM Programming 3 21-01-2008 19:11
Autonomous Mode HELP! jesusescobar Programming 4 12-02-2007 12:02
Help - Making the autonomous mode razer Programming 5 31-01-2007 16:25
Simulating autonomous mode - i need help!! :( itay_ms Programming 5 21-01-2007 11:28


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

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