Go to Post Sometimes an aggravating season is the most educational. - Al Skierkiewicz [more]
Home
Go Back   Chief Delphi > Technical > Control System
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 12-02-2011, 15:33
MathMaven MathMaven is offline
Registered User
AKA: Elisha Sword
FRC #3175 (Knight Vision)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Michigan
Posts: 50
MathMaven is on a distinguished road
Xbox 360 Controller Triggers

We (team 3175) have been testing the use of an Xbox 360 controller to control our arm and have found issues with the trigger buttons. When using the trigger buttons to control a window motor, we find that our program is reading axis z-axis values that do not correspond to how we are pressing the trigger buttons.

In one case, we let go of the trigger buttons and the value sent to the TeleOp.vi was 1. However, when looking at the controller through the control panel while running the program, it shows that the z-axis is in a neutral position.

Why is this happening? Is this a fault of the controller's hardware, the programming (which I have attached to this thread), or something else? We'd really appreciate some answers.
Attached Thumbnails
Click image for larger version

Name:	problem.png
Views:	127
Size:	6.5 KB
ID:	10076  
__________________
—Elisha Sword

2010–13: FRC Team 3175 (Knight Vision), student, lead programmer
2012–13: FRC Team 3175 (Knight Vision), lead website designer
2014: FRC Team 3175 (Knight Vision), programming mentor

“Who has not been amazed to learn that the function y = e^x, like a phoenix rising from its own ashes, is its own derivative?”
—Francois le Lionnais
Reply With Quote
  #2   Spotlight this post!  
Unread 13-02-2011, 07:02
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,756
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: Xbox 360 Controller Triggers

You don't show what is in the other case frame, so I can't be sure whether you stop the motor or leave it running.

You also don't really describe what the buttons are supposed to do to the motor.

What I'd suggest is to put some joystick code into your disabled routine. If using LV, just drop the Joystick get into disabled and you can open it to see the values at runtime. Otherwise add some printfs or use some debugging features of the IDE to observe the joystick values while disabled.

Once you can run the robot, leave it disabled, and see what the XBox controller is sending. If that looks correct, the issue is with the code or possibly the HW.

With a programming buddy, think through what commands are being sent to the motor with different inputs. For example. If the last command told the motor to spin, and releasing the button is supposed to make it stop, show them the code that sets the speed to zero. If you can't find the code, you have found a problem.

Greg McKaksle
Reply With Quote
  #3   Spotlight this post!  
Unread 13-02-2011, 14:36
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: Xbox 360 Controller Triggers

Quote:
Originally Posted by MathMaven View Post
We (team 3175) have been testing the use of an Xbox 360 controller to control our arm and have found issues with the trigger buttons. When using the trigger buttons to control a window motor, we find that our program is reading axis z-axis values that do not correspond to how we are pressing the trigger buttons.
I have no specific experience with the Xbox controller, but I wouldn't expect buttons to have any affect on the joystick axis values. They normally appear on the joystick button values.
Reply With Quote
  #4   Spotlight this post!  
Unread 16-02-2011, 12:46
mck1117 mck1117 is offline
Registered User
AKA: Matthew Kennedy
FRC #1294 (Top Gun)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Sammamish, WA
Posts: 6
mck1117 is an unknown quantity at this point
Re: Xbox 360 Controller Triggers

As far as I know, the XNA driver for the Xbox 360 controller (the one that Windows uses) has the two controllers input as one axis. The Xbox controller outputs five axes, two for each stick and one that is the combined triggers. i believe that it returns 0 for neither trigger pulled and each trigger adds or subtracts one from this value when pulled (i.e. you pull both triggers and the value is still 0).
Reply With Quote
  #5   Spotlight this post!  
Unread 16-02-2011, 12:58
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,600
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Xbox 360 Controller Triggers

Quote:
Originally Posted by Alan Anderson View Post
I have no specific experience with the Xbox controller, but I wouldn't expect buttons to have any affect on the joystick axis values. They normally appear on the joystick button values.
The xbox controller has two analog "buttons" or "triggers".
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 11:50.

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