Go to Post Legend has it that Brandon installs the server in a bulletproof case shortly before Kickoff. That way, when the server explodes, the damage to surrounding things is minimal. ;) - Billfred [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 Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 08-05-2011, 21:23
DFZXA DFZXA is offline
Registered User
FRC #3055 (Furious George)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2007
Location: Minnesota
Posts: 60
DFZXA is infamous around these parts
Broken 360 controller needs a dead zone

I have an xbox 360 controller that keeps leaning towards the right a little. I've made a program with the 360 controller and everything has been fine except that it leans right. Is there a vi for creating a dead zone or multiplying a range of values by zero?
Reply With Quote
  #2   Spotlight this post!  
Unread 08-05-2011, 21:31
Vikesrock's Avatar
Vikesrock Vikesrock is offline
Team 2175 Founder
AKA: Kevin O'Connor
no team
Team Role: Engineer
 
Join Date: Mar 2006
Rookie Year: 2007
Location: Manchester, NH
Posts: 3,305
Vikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond repute
Send a message via AIM to Vikesrock Send a message via MSN to Vikesrock Send a message via Yahoo to Vikesrock
Re: Broken 360 controller needs a dead zone

Creating a deadzone should be fairly easy. I would use a select VI. To feed the selector I would run the input through an absolute value then a "greater than" VI. For the True part of the Select VI you would have the unaltered input value and for the False you would feed 0.

I will suggest an alternative however. Depending on the joystick behavior, you may want to trim it instead of make a deadzone. If it has a constant or near constant offset, you can add or subtract the appropriate value before using the input to correct for the drift.

EDIT: Alternative suggestion removed due to Chris' post below.
__________________


2007 Wisconsin Regional Highest Rookie Seed & Regional Finalists (Thanks 930 & 2039)
2008 MN Regional Semifinalists (Thanks 2472 & 1756)
2009 Northstar Regional Semifinalists (Thanks 171 & 525)

Last edited by Vikesrock : 08-05-2011 at 21:34.
Reply With Quote
  #3   Spotlight this post!  
Unread 08-05-2011, 21:32
Chris is me's Avatar
Chris is me Chris is me is offline
no bag, vex only, final destination
AKA: Pinecone
FRC #0228 (GUS Robotics); FRC #2170 (Titanium Tomahawks)
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2006
Location: Glastonbury, CT
Posts: 7,667
Chris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond repute
Send a message via AIM to Chris is me
Re: Broken 360 controller needs a dead zone

It's generally good practice to add dead zones to Xbox 360 controllers. They don't consistently return to any particular center point.
__________________
Mentor / Drive Coach: 228 (2016-?)
...2016 Waterbury SFs (with 3314, 3719), RIDE #2 Seed / Winners (with 1058, 6153), Carver QFs (with 503, 359, 4607)
Mentor / Consultant Person: 2170 (2017-?)
---
College Mentor: 2791 (2010-2015)
...2015 TVR Motorola Quality, FLR GM Industrial Design
...2014 FLR Motorola Quality / SFs (with 341, 4930)
...2013 BAE Motorola Quality, WPI Regional #1 Seed / Delphi Excellence in Engineering / Finalists (with 20, 3182)
...2012 BAE Imagery / Finalists (with 1519, 885), CT Xerox Creativity / SFs (with 2168, 118)
Student: 1714 (2009) - 2009 Minnesota 10,000 Lakes Regional Winners (with 2826, 2470)
2791 Build Season Photo Gallery - Look here for mechanism photos My Robotics Blog (Updated April 11 2014)
Reply With Quote
  #4   Spotlight this post!  
Unread 08-05-2011, 21:54
DFZXA DFZXA is offline
Registered User
FRC #3055 (Furious George)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2007
Location: Minnesota
Posts: 60
DFZXA is infamous around these parts
Re: Broken 360 controller needs a dead zone

Well yeah I guess it works fine with all my games except fallout 3 for some reason and minecraft on my computer. Those and my program are the only things it leans right on
Reply With Quote
  #5   Spotlight this post!  
Unread 11-05-2011, 20:43
WizenedEE's Avatar
WizenedEE WizenedEE is offline
Registered User
AKA: Adam
FRC #3238 (Cyborg Ferrets)
Team Role: Leadership
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Anacortes, WA
Posts: 395
WizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to all
Re: Broken 360 controller needs a dead zone

What I'd do is use the in range and coerce function, and then either return zero or the value with a select. Remember to do it for each axis.
Reply With Quote
  #6   Spotlight this post!  
Unread 19-05-2011, 06:42
Wamp Wamp is offline
Registered User
no team
 
Join Date: May 2011
Location: Spain
Posts: 5
Wamp is an unknown quantity at this point
Re: Broken 360 controller needs a dead zone

Quote:
Originally Posted by DFZXA View Post
Well yeah I guess it works fine with all my games except fallout 3 for some reason and minecraft on my computer. Those and my program are the only things it leans right on
Thatīs because the videogames are the ones who manage the dead zone, not the console or the PC by themselves.

Videogames like Fallout, Deadly Premonition, etc, didnīt manage the dead zone at all, so if your controller is slightly "broken"... well, s**t happens.

Itīs a very common issue with the Xbox360 controller, if you are too rough playing (but there are FEW titles which donīt manage the dead zone, so chances that you never notice your controller is broken are high).

New and well conserved controllers work fine, so if you are not able to manage the dead zone, you can always buy a new one...
Reply With Quote
  #7   Spotlight this post!  
Unread 19-05-2011, 08:18
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,077
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: Broken 360 controller needs a dead zone

I've noticed this on our 360 controllers, and for this reason I will encourage our team to use something like this as an FRC gamepad in the future.
Reply With Quote
  #8   Spotlight this post!  
Unread 19-05-2011, 18:03
Wamp Wamp is offline
Registered User
no team
 
Join Date: May 2011
Location: Spain
Posts: 5
Wamp is an unknown quantity at this point
Re: Broken 360 controller needs a dead zone

If drivers werenīt a problem, this would be nice:



So beautiful... Itīs for a "mecha (giant robot of massive destruction) simulator" for the Xbox1, Steel Battalion.

And back to the real world... if you dont like the 360īs just try Logitech gamepads, those are fine too.
Reply With Quote
  #9   Spotlight this post!  
Unread 21-05-2011, 05:19
Mr. Lim Mr. Lim is offline
Registered User
AKA: Mr. Lim
no team
Team Role: Leadership
 
Join Date: Jan 2004
Rookie Year: 1998
Location: Toronto, Ontario
Posts: 1,125
Mr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond repute
Re: Broken 360 controller needs a dead zone

360 controllers are notoriously bad when it comes to center-positions.

I've been on 3 teams the past 3 years, and with each team I've had to expend a lot of energy convincing students that XBOX controllers simply aren't as good as the Logitech Dual Action or F310 alternatives for FRC purposes. The values that XBOX controllers put out don't reliably return to center.

You could add code to increase your deadband, but it takes away your useable resolution on your joystick. Most of your joystick movement in the middle will become useless. And if you compensate for it, you will ramp up from 0 to max over a very small distance, without much resolution.

Driving an FRC robot is not like *most* video games: you don't jam your controls to full-blast in every direction if you actually expect to drive at a world class level. The difference between pushing a joystick forward 13% vs 14% is the difference between scoring/dropping a tube. Consider this when you take away all values between 0-30%, or increment by 5% because you are managing a huge deadband on your controller.

I'd highly recommend one of the Logitech controllers mentioned. They tend to give nice clean numbers, and even recalibrate/center each time you plug/unplug them (which is why you should never touch the sticks while plugging them in!)

The only drawback to the Logitech gamepads is that the stick motion has a circular profile. Great for drivers, because they feel really smooth whipping around the extents. But programmers need to compensate for the fact that they will never hit the "corners" of the XY-Cartesian plane. You may never hit full speed/power if you don't account for this.





Or you could just tell your driver to drive tank-drive. That's a pretty good 5:00am solution to a joystick that uncontrollably drifts to the right.
__________________
In life, what you give, you keep. What you fail to give, you lose forever...
Reply With Quote
  #10   Spotlight this post!  
Unread 26-05-2011, 03:49
ratdude747's Avatar
ratdude747 ratdude747 is offline
Official Scorekeeper
AKA: Larry Bolan
no team
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Madison, IN
Posts: 1,064
ratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond repute
Re: Broken 360 controller needs a dead zone

Actually, the stick profile on the logitech dual actions is square... or so the new ones are. they are very nice...

what I have tried and like is modding old original xbox controllers. they run on usb, so all one must do is chop the plug, and follow standard usb colors (ignoring the yellow wire) to add a usb plug/pigtail. FYI irt is one of the many examples of how an original xbox is really a PC with a different case.

anyway, I personally solder and tape my cable slices for this... as long as one keeps the cable length well under 16' (no more than 14') and does a good job of soldering, they are generally pretty reliable.

there are 3rd party drivers to run these; linux has it by default, redcl0ud has the windows driver (XBCD), and the xbox HID project covers mac.

What i like about the old xbox controllers:
1. 2 analog triggers. good for racing games and fine control stuff
2. technically analog buttons... they are pressure sensitive from what the xbcd utility showed me.
3. cheap. my favorite one i did was a $3 used intec micro unit i found at a thrift store... it works great and really works well.

they do center properly... another reason to keep modding the old kind i guess.

I have driven robots with the modded xbox controllers... they drive nice.

For driving holomonic systems (kiwi, killough, mecanum, crap, etc.), i prefer the dual action layout.

links:
XBCD windows driver: http://www.redcl0ud.com/xbcd.html
Xbox HID for Mac: http://xhd.sourceforge.net/
__________________
Dean's List Semi-finalist 2010
1747 Harrison Boiler Robotics 2008-2010, 2783 Engineers of Tomorrow 2011, Event Volunteer 2012-current

DISCLAIMER: Any opinions/comments posted are solely my personal opinion and does not reflect the views/opinions of FIRST, IndianaFIRST, or any other organization.

Last edited by ratdude747 : 26-05-2011 at 07:12.
Reply With Quote
  #11   Spotlight this post!  
Unread 26-05-2011, 08:06
Chris is me's Avatar
Chris is me Chris is me is offline
no bag, vex only, final destination
AKA: Pinecone
FRC #0228 (GUS Robotics); FRC #2170 (Titanium Tomahawks)
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2006
Location: Glastonbury, CT
Posts: 7,667
Chris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond repute
Send a message via AIM to Chris is me
Re: Broken 360 controller needs a dead zone

Quote:
Originally Posted by ratdude747 View Post
What i like about the old xbox controllers:
1. 2 analog triggers. good for racing games and fine control stuff
The 360 controllers still have analog triggers.

Quote:
2. technically analog buttons... they are pressure sensitive from what the xbcd utility showed me.
I can't really see when this would be useful in FRC. Wouldn't it just make it harder to run something at full power?
__________________
Mentor / Drive Coach: 228 (2016-?)
...2016 Waterbury SFs (with 3314, 3719), RIDE #2 Seed / Winners (with 1058, 6153), Carver QFs (with 503, 359, 4607)
Mentor / Consultant Person: 2170 (2017-?)
---
College Mentor: 2791 (2010-2015)
...2015 TVR Motorola Quality, FLR GM Industrial Design
...2014 FLR Motorola Quality / SFs (with 341, 4930)
...2013 BAE Motorola Quality, WPI Regional #1 Seed / Delphi Excellence in Engineering / Finalists (with 20, 3182)
...2012 BAE Imagery / Finalists (with 1519, 885), CT Xerox Creativity / SFs (with 2168, 118)
Student: 1714 (2009) - 2009 Minnesota 10,000 Lakes Regional Winners (with 2826, 2470)
2791 Build Season Photo Gallery - Look here for mechanism photos My Robotics Blog (Updated April 11 2014)
Reply With Quote
  #12   Spotlight this post!  
Unread 26-05-2011, 15:34
ratdude747's Avatar
ratdude747 ratdude747 is offline
Official Scorekeeper
AKA: Larry Bolan
no team
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Madison, IN
Posts: 1,064
ratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond repute
Re: Broken 360 controller needs a dead zone

i was comparing the old xbox controllers to the logitech controllers as a way to get both auto center of the logitech and the button features of the 360.

the analog buttons are used to adjust sensitivity... they are read in windows as boolean buttons but xbcd can adjust the sesitivity.
__________________
Dean's List Semi-finalist 2010
1747 Harrison Boiler Robotics 2008-2010, 2783 Engineers of Tomorrow 2011, Event Volunteer 2012-current

DISCLAIMER: Any opinions/comments posted are solely my personal opinion and does not reflect the views/opinions of FIRST, IndianaFIRST, or any other organization.
Reply With Quote
  #13   Spotlight this post!  
Unread 04-09-2011, 15:57
baronep's Avatar
baronep baronep is offline
Student President
FRC #2848 (Jesuit All-Sparks)
Team Role: Leadership
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Dallas TX
Posts: 167
baronep is on a distinguished road
Re: Broken 360 controller needs a dead zone

I have also noticed that the xbox controllers that we used (knockoffs from best buy), auto-center themselves when initialized. We experienced this at competition when we turned turned on the driver station with the controller wire wrapped around the controller, holding one of the sticks off center. Then when tele-op started, the robot drove in a perpetual circle, really irritating as it turns out. I don't know if this solves any problems, but just some extra information.
Reply With Quote
  #14   Spotlight this post!  
Unread 04-09-2011, 21:08
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: Broken 360 controller needs a dead zone

As far as I can tell, HID joysticks in general, tend to use an initial value as the "zero" offset. Initial value is defined as when the HID device is opened. In the future, if there is time, you should unplug and replug the joystick with the correct center. If the match has already started, it may also be useful to hit F1, as this will force a joystick enumeration even though the robot is enabled.

Greg McKaskle
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 09:37.

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