Go to Post According to Clarke's third law, I believe their entire robot works by magic. - dtengineering [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 03-09-2009, 21:54
Racer26 Racer26 is offline
Registered User
no team
Team Role: Alumni
 
Join Date: Apr 2003
Rookie Year: 2003
Location: Beaverton, ON
Posts: 2,229
Racer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond repute
Encoder problem

We're having some problems coding our traction control. We have traced it back to an issue with the encoders.

Our robot has 7 encoders on it. 1 encoder on each wheel, 1 on our idler wheel, and 1 each on our front and rear steering.

The issue we're having is 4 of the encoders are all changing together when you turn a specific one of the 4.

I'm not sure if this is an issue with the Encoder class, or what

We're coding in C++ using windriver.

Is there like a 4 encoder limitation or something? I ask because it is like the 5th, 6th, and 7th encoders are actually replacing the reference to the 1st encoder, and then the 1,5,6,7 encoders are all referencing to the same place in memory, and are changing with the ports from the 7th encoder. Changing the ports associated with 1, 5, and 6 doesnt increase the count, but changing the 7th set of ports is causing the numbers on all 4 (1,5,6,7) to change.
  #2   Spotlight this post!  
Unread 04-09-2009, 03:11
AustinSchuh AustinSchuh is offline
Registered User
FRC #0971 (Spartan Robotics) #254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Feb 2005
Rookie Year: 1999
Location: Los Altos, CA
Posts: 803
AustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond repute
Re: Encoder problem

Quote:
Originally Posted by 1075guy View Post
Is there like a 4 encoder limitation or something?
Yes, there is. I'm pretty sure that this information is in the well commented source code for WPILib. It might also be in the docs too. I seem to remember that there was a work around mentioned in the WPILib source as well.
  #3   Spotlight this post!  
Unread 04-09-2009, 07:15
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,078
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: Encoder problem

The limit is because the cRIO FPGA can (currently) only allocate four, 4x encoder interfaces. The workaround is to declare your encoders as 1X or 2X (see WPILib documentation on how to do this); this forces the FPGA to implement your encoders as up/down counters, which have different FPGA implementations.

Which encoders should you keep as 4X and which should you implement as 1X or 2X? Generally, encoders that directly measure position (like your steering encoders) you should leave at 4X for the highest precision. Encoders that measure speed (your drive wheels and idler wheels) are often better off at 1X for several reasons. First, when timing the period between two edges longer amounts of time mean more accurate measurements because of the limitations of the timers. At 1X, the edge-edge time is 4 times as long as with 4X. Second, due to manufacturing and assembling tolerances, all both phases are often not exactly 90 degrees out of phase, and each phase is often not exactly at a 50% duty cycle. By only counting a certain edge (say, rising edge of phase A), you ignore these problems.
  #4   Spotlight this post!  
Unread 04-09-2009, 07:55
Gdeaver Gdeaver is offline
Registered User
FRC #1640
Team Role: Mentor
 
Join Date: Mar 2004
Rookie Year: 2001
Location: West Chester, Pa.
Posts: 1,363
Gdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond repute
Re: Encoder problem

You could also substitute a non contact absolute rotary position sensor for an encoder. Then the software just has to time an a to d. Cherry makes a 360 degree packaged unit that includes a magnet. Look at Future electronics. There is also a white paper on rotary position sensors on chief Delphi.
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with quadrature encoder Steve Compton Programming 13 14-03-2009 11:16
[FTC]: Labview Encoder Problem jlester FIRST Tech Challenge 1 08-03-2009 11:27
WPILIB Encoder SetMInRate() Problem vamfun C/C++ 1 28-02-2009 17:58
Encoder Problem DustinB_3 Programming 22 03-01-2007 20:42
Strange Encoder Problem AIBob Electrical 3 20-02-2005 22:20


All times are GMT -5. The time now is 01:09.

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