Go to Post wood is the original carbon fibre! - dtengineering [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 16-02-2012, 23:17
RickyMartan RickyMartan is offline
Registered User
no team
 
Join Date: Feb 2012
Location: Canada
Posts: 3
RickyMartan is an unknown quantity at this point
Turning the Robot(Totally New to programming)

Hi. I would like to ask a quick question.(Sorry, I dont really know how to ask proper question, first post )

I have been trying to learn Labview throughout this season and its challenging indeed. We have gotten the basic shooting, vision tracking, gyro capabilities, and everything working, but, we are unable to turn our robot in autonomous.

We have used the code that is given in the default autonomous, the turn right for 1 second one, but our robot just drives back, does not turn:S

We are using 4 jaguars and are trying to figure this out. Do we use Button Spin thing instead of arcade drive? :S Can someone post some basic code that might help us accomplish our task? Thank you very much.
Reply With Quote
  #2   Spotlight this post!  
Unread 17-02-2012, 01:14
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: Turning the Robot(Totally New to programming)

Ok, first question, can you turn in teleop? (I realize this is an obvious one, but sometime it gets overlooked.)

Second question, have you tried this with the robot on blocks so you can see what the wheels are doing without having to worry about where the robot is going? I recommend always doing this with autonomous drive code before trying it on the floor so that a mistake on polarity (is -1 forward or backward) or logic doesn't cause the robot to try to run over a nearby mentor . Make sure that the blocks (or jack stands or whatever) are under a structural part capable of supporting the weight, get all of your powered wheels off the ground, and are not touching any of the wheels.

Do you have a basic four or six wheel drivetrain with kit wheels or something more complicated? I'm going to assume a fairly basic drivetrain for the rest of this.

On the Arcade Drive VI in standard mode (which should work fine for this), the Y axis input (ranging from -1 to 1) controls your forward speed, and the X axis input (same range) controls the amount of turn. Which way forward and right are (negative or positive) depends on your motor physical position, wiring, and what you did in Begin.vi. Since your robot is moving backwards, I suspect that negative is forward and right for you, but the code commenter seems to have assumed the reverse.

The default code has x set to .25 and y set to .5 in the first 1-second while loop (iterating 20 times at 50 ms each), which should cause a gentle forward right (or backward left) turn in which the right and left wheels are all moving in the same direction, but with one side going faster than the other.

The second .5-second while loop reverses the numbers. I'd actually expect this to make the forward right turn tighter, rather than reversing it and going to the left as the comment indicates. Tank drive would produce a left turn with those values, but this is the arcade drive VI.

A good way to make it really obvious whether it's turning or not is to set Y to 0. This will make it turn in place since there is no motion requested other than the turn (expect the right side tires to go forward and the left backward for a positive value of X, and vice versa for a negative if your polarities are set that way).

You may also want to extend the number of iterations in each loop for testing so that you can get a good look before it moves on.
__________________


Reply With Quote
  #3   Spotlight this post!  
Unread 17-02-2012, 02:02
RickyMartan RickyMartan is offline
Registered User
no team
 
Join Date: Feb 2012
Location: Canada
Posts: 3
RickyMartan is an unknown quantity at this point
Re: Turning the Robot(Totally New to programming)

Yes, we tried teleop and have got it to turn.

We have tried the basic code and put the robot on block. When we try the turn code by setting the x-value to 0.5 and y-value to 0, it moves back. I assume that means that it is somehow getting the y-value set? I am not sure what the problem is. :S
Reply With Quote
  #4   Spotlight this post!  
Unread 18-02-2012, 09:27
RickyMartan RickyMartan is offline
Registered User
no team
 
Join Date: Feb 2012
Location: Canada
Posts: 3
RickyMartan is an unknown quantity at this point
Post Re: Turning the Robot(Totally New to programming)

FIXED: For other teams having similar/ same issue.

If you are using a rottery switch of some kind and specifying "buttons" to different autonomous, you might want to check if the number you choose physical matches with in the software.

Because when we put the following on the switch the software gave us these values:

Physical - Software
1 -1
2 -3
3 -0
4 -1
5 -8
6 -7
7 -6
8 -9
9 -0

That is the reason why when we tried to run number "4" we were actually running number "1" which was drive straight back Hope this helps any other team having a similar problem.
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 03:55.

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