Go to Post Funny, I came to robotics for the robot, but find I stay for the people. - Mr. Pockets [more]
Home
Go Back   Chief Delphi > Other > FIRST Tech Challenge
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 26-11-2011, 17:12
NType3-4278 NType3-4278 is offline
Registered User
FTC #4278
 
Join Date: Nov 2011
Location: Del Mar
Posts: 3
NType3-4278 is an unknown quantity at this point
[FTC]: RobotC returns junk joystick data?

Hello:

We are having a problem where the joystick data is intermittently being transmitted as zero. We hold the joystick (joystick.joy1_y1) forward, and have the NXT display the value. The NXT alternates between 128 and 0. This produces jittery movement in the robot, intolerable for the FTC competition. This error is replicable in the sample code provided with RobotC.

As we have noted, there are several elements in the chain from the controller to the NXT. In order, we have identified: The controller, the connection to robotc, robotc itself, the connection to the NXT, the driver on the NXT, and lastly the values interpreted by the NXT. We have eliminated all of these save the connection from RobotC to the NXT, which is an inherent part of the software provided. There were also several other variables, such as the controller used, the NXT used, and the software version used.

In our debugging, we tried all possible combinations of the following: two different controllers, three different NXT bricks, and two unique versions of RobotC (3.03 and 3.04). None of the permutations solved our problem.

The controller's information is correct. The Joystick Setup dialog box demonstrates that, at least within RobotC, the program is correct. The value does not deviate from 128 and does not spontaneously switch to zero. The controller is correct. The data being transferred from RobotC to the NXT is, to my knowledge, unverifiable.

We tried several joystick drivers, including several modifications of the driver, as well as making some of our own edits to attempt to remove the junk data. The raw data received by the NXT is accurate for the output it creates, but, due to Garbage In Garbage Out, it returns incorrect data. This lead us to the conclusion that the error lies in the connection between RobotC and the NXT.

To test which side the error was on, we attempted both a connection via USB and Bluetooth. The error was replicated exactly with both connection methods. This lead us to the conclusion that RobotC is not sending the correct joystick data and/or the NXT is not correctly receiving the data from the NXT.

The error is very recent.

Our FTC competition is in 13 days. Please hurry!

Thanks!
--Noah
de.evolution 4278
Reply With Quote
  #2   Spotlight this post!  
Unread 26-11-2011, 23:54
PhilBot's Avatar
PhilBot PhilBot is offline
Get a life? This IS my life!
AKA: Phil Malone
FRC #1629 (GaCo: The Garrett Coalition)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Maryland
Posts: 747
PhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond repute
Re: [FTC]: RobotC returns junk joystick data?

Does it only happen when the joystick is fully forward (not backwards)?

If so, it sound like a signed to unsinged integer conversion problem.

Since the joystick actually puts out max negative when you push it forward, somewhere in the software is negating the number. Since there is a -128 in 8 bit signed math, but not a +128, this is sometimes converted incorrectly.

If that's what it is, you might also expect it to happen to the X axis when you move the joystick all the way to the left, but it may not since that value probably isn't reversed.

I don't use Robot C. What "type" is the joystick value (byte or integer)?

Phil.
__________________
Phil Malone
Garrett Engineering And Robotics Society (GEARS) founder.
http://www.GEARSinc.org

FRC1629 Mentor, FTC2818 Coach, FTC4240 Mentor, FLL NeXTGEN Mentor
Reply With Quote
  #3   Spotlight this post!  
Unread 27-11-2011, 02:43
NType3-4278 NType3-4278 is offline
Registered User
FTC #4278
 
Join Date: Nov 2011
Location: Del Mar
Posts: 3
NType3-4278 is an unknown quantity at this point
Re: [FTC]: RobotC returns junk joystick data?

It happens at both directions. I did consider an unsigned int conversion error.

The data type is short for the joystick data.
Reply With Quote
  #4   Spotlight this post!  
Unread 27-11-2011, 19:09
l0jec l0jec is offline
Registered User
no team
 
Join Date: Oct 2009
Rookie Year: 2004
Location: St. Louis, MO
Posts: 52
l0jec has a spectacular aura aboutl0jec has a spectacular aura about
Re: [FTC]: RobotC returns junk joystick data?

Our experience with similar issues is somewhere in the USB connection/driver on the computer with your joysticks. We had the same symptoms when using a USB hub on a particular laptop. If we removed the USB hub from the equation or moved the hub to another computer the issue would go away.
I'd suggest testing from another computer or playing around with how you're connecting the joysticks to the computer.
Reply With Quote
  #5   Spotlight this post!  
Unread 28-11-2011, 20:49
NType3-4278 NType3-4278 is offline
Registered User
FTC #4278
 
Join Date: Nov 2011
Location: Del Mar
Posts: 3
NType3-4278 is an unknown quantity at this point
Re: [FTC]: RobotC returns junk joystick data?

The issue is present on two computers.

I may have found a workaround for it, though.
Reply With Quote
  #6   Spotlight this post!  
Unread 10-12-2011, 10:50
normalmutant's Avatar
normalmutant normalmutant is offline
Registered User
AKA: Nathan
FTC #3539 (Say Watt?)
Team Role: Alumni
 
Join Date: Apr 2010
Rookie Year: 2006
Location: Edison, NJ
Posts: 126
normalmutant has a spectacular aura aboutnormalmutant has a spectacular aura about
Re: [FTC]: RobotC returns junk joystick data?

Did you try using a different joystick? If you don't have another, you could contact a team in your area.
__________________
SAY-WATT.ORG
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 13:23.

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