View Single Post
  #13   Spotlight this post!  
Unread 13-04-2010, 18:27
Bigcheese Bigcheese is offline
C++0x FTW!
AKA: Michael Spencer
FRC #1771
Team Role: Mentor
 
Join Date: Feb 2008
Rookie Year: 2008
Location: GA
Posts: 36
Bigcheese is a jewel in the roughBigcheese is a jewel in the roughBigcheese is a jewel in the roughBigcheese is a jewel in the rough
Re: Unexpected results from Encoder::GetRate()

Quote:
Originally Posted by vamfun View Post
Question: What encoders did you use on left and right and what are the corresponding distances per pulse? The right encoder has a little less noise than the left.
They are both the standard ones from andymark. 0.0054105234681583 feet per pulse. I have no idea why one is a lot noisier than the other.

Quote:
Originally Posted by vamfun View Post
If you still have the same set up and a little extra time, I'd love to see the 2x and 4x cases with the get rate averaged over 2 and 4 pulses respectively rather than the default single pulse. Please use the corresponding JAG speeds as in the original data sets. In case you aren't familiar with this:

The 2x is set in the counter.cpp InitCounter() line :
m_counter->writeTimerConfig_AverageSize(1, &status);
by changing to
m_counter->writeTimerConfig_AverageSize(2, &status);

Similarly, the 4x is set in the encoder.cpp InitEncoder() line:
m_encoder->writeTimerConfig_AverageSize(1, &status);
by changing to
m_encoder->writeTimerConfig_AverageSize(4, &status);

This would help mitigate the rate noise if people insist on using 2x and 4x encoder modes. I would like this to be the default configurations. If you run the cases Ill add it to the statistical analysis and post it also. It would be a nice reference for future First teams making this decision.
Thanks for the info I didn't know about that. We just packed up everything for Atlanta, so I won't be able to test it until after.

Quote:
Originally Posted by vamfun View Post
By the way, last year Joe H and I had a thread on moving average : http://forums.usfirst.org/showthread...8143#post28143. Our team added a function to the Encoder.cpp that allows you to do this in your robot init code similar to SetDistancePerPulse(). Eventually, I hope the WPI guys incorporate this capability.
Code:
void SetMovingAveragePulseCount(int max_count)
{ //check if 1=<max_count<=127 TODO: should throw an error flag here with message if max_count invalid
if (max_count<1) max_count = 1;
else if (max_count>127) max_count = 127;
if(m_counter)
m_counter->m_counter->writeTimerConfig_AverageSize(max_count, &status); // Counter object within Encoder -> tCounter within Counter
else
m_encoder->writeTimerConfig_AverageSize(max_count, &status);
}
Do the WPI people know about it? I would hope they add it. Also they need to apply that patch I posted. I need to figure out who to send it to...
Reply With Quote