Go to Post One of these years, the game piece will be an actual red herring. - Taylor [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 08-02-2011, 12:23
Coach#3536 Coach#3536 is offline
2015 Carver 2nd Alliance Captain
AKA: The Hemi
FRC #3536 (Electro Eagles)
Team Role: Coach
 
Join Date: Jan 2011
Rookie Year: 2007
Location: Michigan
Posts: 37
Coach#3536 is an unknown quantity at this point
turning joystick controls 90% in programming

We are a rookie team. We have been running the robot with the joystick controller turned at 90 degrees for about a week because the intitial set up from LabView is causing it to be this way.

We want to fixt the axis im programming but are unsure where. I know the axis values are 0 to 254 from reading the posts.

Where and how do I switch the locations?

Is it in the WPI_JoystickGet.vi and is it that I swap the x for y and y for x in the bundle? It appears that the x is being used for fore aft rather than front to back if I am reading the code correctly.

Can someone look at this and confirm?
  #2   Spotlight this post!  
Unread 08-02-2011, 12:34
indubitably's Avatar
indubitably indubitably is offline
Registered User
AKA: Ryan Guinn
FRC #2338 (Gear It Forward), FRC #1732 (Hilltoppers)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Oswego, IL
Posts: 172
indubitably has a reputation beyond reputeindubitably has a reputation beyond reputeindubitably has a reputation beyond reputeindubitably has a reputation beyond reputeindubitably has a reputation beyond reputeindubitably has a reputation beyond reputeindubitably has a reputation beyond reputeindubitably has a reputation beyond reputeindubitably has a reputation beyond reputeindubitably has a reputation beyond reputeindubitably has a reputation beyond repute
Re: turning joystick controls 90% in programming

EDIT: I gave it more thought and your problem can be solved by inverting either your left or right motor. Do this in the begin subvi

Disreguard:
by turning 90 degrees, I would have to assume that you have the x axis and y axis switched in your program. switching the values would do nothing except reverse the controls, they would still be off by 90 degrees.

I am assuming you are useing the base code that unbundles the axis data into x axis and y axis. those should simply be fed into their respective x and y inputs into your robot drive subvi. If they match then try mismatching them to see if that solves your problem, as it may just be a problem with the joystick you are using.

You can find this in the teleop subvi.
__________________
FRC 1732 (Hilltoppers): Mentor
FRC 2338 (Gear It Forward): Mentor/Alumnus
FRC 4096 (CTRL-Z): Mentor


Last edited by indubitably : 08-02-2011 at 12:42.
  #3   Spotlight this post!  
Unread 08-02-2011, 12:46
Coach#3536 Coach#3536 is offline
2015 Carver 2nd Alliance Captain
AKA: The Hemi
FRC #3536 (Electro Eagles)
Team Role: Coach
 
Join Date: Jan 2011
Rookie Year: 2007
Location: Michigan
Posts: 37
Coach#3536 is an unknown quantity at this point
Re: turning joystick controls 90% in programming

Thanks for the feedback.

We found the mis match on both the Joysticks in the KOP and a X-box contoller. So I am thinking the issue is in the code.

We tried to flip the inputs at the motor level and it still didnt solve the issue.

When I go to the area in the WPI_JoystickGet.vi it appears that the for/aft movement is being sent into the wrong output to the motors.
  #4   Spotlight this post!  
Unread 08-02-2011, 12:53
Coach#3536 Coach#3536 is offline
2015 Carver 2nd Alliance Captain
AKA: The Hemi
FRC #3536 (Electro Eagles)
Team Role: Coach
 
Join Date: Jan 2011
Rookie Year: 2007
Location: Michigan
Posts: 37
Coach#3536 is an unknown quantity at this point
Re: turning joystick controls 90% in programming

You are speaking to the true false statements in the motor as it sits one is true the other is false.
  #5   Spotlight this post!  
Unread 08-02-2011, 13:02
JamesBrown JamesBrown is offline
Back after 4 years off
FRC #5279
Team Role: Engineer
 
Join Date: Nov 2004
Rookie Year: 2005
Location: Lynchburg VA
Posts: 1,281
JamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond repute
Re: turning joystick controls 90% in programming

Quote:
Originally Posted by Coach#3536 View Post
You are speaking to the true false statements in the motor as it sits one is true the other is false.
You should just be able to swap the X and Y axis values, if you are using labview then just swap the wires going to axis 1 and axis2.
__________________
I'm Back


5279 (2015-Present)
3594 (2011)
3280 (2010)
1665 (2009)
1350 (2008-2009)
1493 (2007-2008)
1568 (2005-2007)
  #6   Spotlight this post!  
Unread 08-02-2011, 13:05
indubitably's Avatar
indubitably indubitably is offline
Registered User
AKA: Ryan Guinn
FRC #2338 (Gear It Forward), FRC #1732 (Hilltoppers)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Oswego, IL
Posts: 172
indubitably has a reputation beyond reputeindubitably has a reputation beyond reputeindubitably has a reputation beyond reputeindubitably has a reputation beyond reputeindubitably has a reputation beyond reputeindubitably has a reputation beyond reputeindubitably has a reputation beyond reputeindubitably has a reputation beyond reputeindubitably has a reputation beyond reputeindubitably has a reputation beyond reputeindubitably has a reputation beyond repute
Re: turning joystick controls 90% in programming

You should try different variations of true/false as I am like 90% sure that is your problem.

The reasons you see different numbers being output to your motors than the values that are sent into the subvi is because the arcadedrive vi squares your inputs to allow for a smoother control.
__________________
FRC 1732 (Hilltoppers): Mentor
FRC 2338 (Gear It Forward): Mentor/Alumnus
FRC 4096 (CTRL-Z): Mentor

  #7   Spotlight this post!  
Unread 08-02-2011, 13:17
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,113
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: turning joystick controls 90% in programming

indubitably is correct. One of your motors is running backwards. You can fix that by either swapping the wires or by changing its "invert" constant on the Open Drive in Begin.

Put the robot up on blocks. Push the joystick forward. Observe which motor is doing the wrong thing. Fix it to do the right thing.

(If you then find that the robot is turning the wrong direction when you push the joystick sideways, that would be because you have the left and right motors swapped. Fix that in the Begin vi as well, by changing the left and right motor PWM definitions.)
  #8   Spotlight this post!  
Unread 08-02-2011, 14:10
Coach#3536 Coach#3536 is offline
2015 Carver 2nd Alliance Captain
AKA: The Hemi
FRC #3536 (Electro Eagles)
Team Role: Coach
 
Join Date: Jan 2011
Rookie Year: 2007
Location: Michigan
Posts: 37
Coach#3536 is an unknown quantity at this point
Re: turning joystick controls 90% in programming

when you say swap wires you are talking on the physical robot or in the code?

When you say invert in the OPEN drive it is swapping the true false statement?

Then finally it is changing to reverse the PMW1 address to PMW2 and vise versa in the Drive.vi?

Sorry to be tedious but I want to be sure. Thanks for the assistance by the way
  #9   Spotlight this post!  
Unread 08-02-2011, 14:36
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,101
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: turning joystick controls 90% in programming

@Coach#3536:

You can physically swap the wires going to the motor which is going in the wrong direction, or

you can reverse the motor direction in software by setting the appropriate "motor inverted" input to True or False in the "Drive Open Motor" vi.

you can swap left and right (or front and rear for that matter) motors by changing the PWM channels.

see attached screenshot.



Attached Thumbnails
Click image for larger version

Name:	open motor vi.png
Views:	32
Size:	15.9 KB
ID:	10023  
  #10   Spotlight this post!  
Unread 09-02-2011, 10:09
Coach#3536 Coach#3536 is offline
2015 Carver 2nd Alliance Captain
AKA: The Hemi
FRC #3536 (Electro Eagles)
Team Role: Coach
 
Join Date: Jan 2011
Rookie Year: 2007
Location: Michigan
Posts: 37
Coach#3536 is an unknown quantity at this point
Re: turning joystick controls 90% in programming

As I stated before....."the WPI_JoystickGet.vi it appears that the for/aft movement is being sent into the wrong output to the motors."

When I switched them in this area the control issue was corrected. Thanks for the input to get me to the correct spot.
  #11   Spotlight this post!  
Unread 12-02-2011, 13:51
Gmzcarlos Gmzcarlos is offline
Registered User
FRC #3583
 
Join Date: Feb 2011
Location: Texas
Posts: 8
Gmzcarlos is an unknown quantity at this point
Re: turning joystick controls 90% in programming

We have the same problem (x and y axis inverted). How do you fix it if we are using C++ ?

thank you
  #12   Spotlight this post!  
Unread 12-02-2011, 13:52
demosthenes2k8's Avatar
demosthenes2k8 demosthenes2k8 is offline
Graduated but not gone
AKA: Matt Soucy
FRC #0166 (Chop Shop 166)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Merrimack, NH
Posts: 589
demosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to behold
Send a message via AIM to demosthenes2k8 Send a message via Yahoo to demosthenes2k8
Re: turning joystick controls 90% in programming

Gmzcarlos, you'll need to post the parts of your code that affect drive so we can help you.
__________________


GSR Dean's List Finalist 2011
  #13   Spotlight this post!  
Unread 12-02-2011, 14:12
Gmzcarlos Gmzcarlos is offline
Registered User
FRC #3583
 
Join Date: Feb 2011
Location: Texas
Posts: 8
Gmzcarlos is an unknown quantity at this point
Re: turning joystick controls 90% in programming

We are using the "SimpleRobot" template Code.

When in Autonomous, the robot just spins and in teleoperated the x and y axis are inverted.

Let me know if you need additional information.

- UPDATE -

We got it, just needed to revert the polarity of one the engines, and its now working.

Last edited by Gmzcarlos : 12-02-2011 at 14:58.
Closed Thread


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 23: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