Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   autonomous mode help please... (http://www.chiefdelphi.com/forums/showthread.php?t=74848)

tomy 17-02-2009 20:16

autonomous mode help please...
 
1 Attachment(s)
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

Mark McLeod 18-02-2009 16:53

Re: autonomous mode help please...
 
2 Attachment(s)
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.

tomy 18-02-2009 18:05

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

tomy 18-02-2009 18:18

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

Mark McLeod 19-02-2009 09:13

Re: autonomous mode help please...
 
1 Attachment(s)
Quote:

Originally Posted by tomy (Post 824258)
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:

tomy 19-02-2009 17:59

Re: autonomous mode help please...
 
thank you but can i have a pic of the autonomous mode

Alan Anderson 19-02-2009 19:15

Re: autonomous mode help please...
 
Quote:

Originally Posted by tomy (Post 825023)
thank you but can i have a pic of the autonomous mode

You have one.

Quote:

Originally Posted by Mark McLeod (Post 824634)
I've attached to the original post what the Autonomous described would look like.


tomy 19-02-2009 21:20

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

tomy 19-02-2009 21:22

Re: autonomous mode help please...
 
also can you explain autonomous mode a little better like how do i make i go further or longer

tomy 19-02-2009 21:42

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...?

Greg McKaskle 20-02-2009 08:07

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

tomy 20-02-2009 17:41

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

Alan Anderson 20-02-2009 18:25

Re: autonomous mode help please...
 
Quote:

Originally Posted by tomy (Post 825654)
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.

tomy 20-02-2009 19:05

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.

Mark McLeod 20-02-2009 20:55

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.


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

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi