Go to Post The best legacy of this little machine is the inspiration she provided to a whole generation of future explorers who witnessed the unveiling of a planet through the eyes of a robot. - dlavery [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 31-03-2013, 01:26
Happy Birthday! Jefferson Jefferson is offline
Registered User
AKA: Jeff Clements
FRC #0016 (Bomb Squad)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Mountain Home, AR
Posts: 258
Jefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond repute
Voltage Counts Range 0-970

Now that we have slip rings on our swerve modules, we spend some time at the roll-over point of our analog encoders (the point where it rolls from 5V to 0V). We were surprised that there was significant "chatter" around this point and chalked it up to a bug in the PIDContoller to be found latter.
In trying to debug some different weirdness observed in crab, I started looking more closely at the values reported for GetAverageValue from the modules. I was surprised to find that the encoders never report anything greater than 970, but roll over all the way to 0.
A few things we checked:
Encoders are providing a full 0-5V output range.
GetValue provides the same range.
All four wheel modules on two robots exhibit the same "chatter" in the modules.

Of course we can rescale all of our calculations to 970, but I'd like to know why we aren't getting to 1024.

Has anybody seen anything like this before? We've not used the full range of our encoders before now.

Thanks
Reply With Quote
  #2   Spotlight this post!  
Unread 31-03-2013, 09:32
Unsung FIRST Hero
Al Skierkiewicz Al Skierkiewicz is offline
Broadcast Eng/Chief Robot Inspector
AKA: Big Al WFFA 2005
FRC #0111 (WildStang)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1996
Location: Wheeling, IL
Posts: 10,792
Al Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond repute
Re: Voltage Counts Range 0-970

Jeff,
What are you using for encoders? If you are using continuous pots then they are behaving as expected. It is possible with this device to momentarily short the 5 volt and 0 volt together at the transition. While this give a lot of noise output it also arcs the rotating contact in the pot. Eventually, this device will fail.
__________________
Good Luck All. Learn something new, everyday!
Al
WB9UVJ
www.wildstang.org
________________________
Storming the Tower since 1996.
Reply With Quote
  #3   Spotlight this post!  
Unread 31-03-2013, 10:54
Happy Birthday! Jefferson Jefferson is offline
Registered User
AKA: Jeff Clements
FRC #0016 (Bomb Squad)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Mountain Home, AR
Posts: 258
Jefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond repute
Re: Voltage Counts Range 0-970

Al,
Thanks for the reply. Hardware was our first thought as well. We checked the voltage output from them and they are send as much as 4.96V to the analog module (couldn't ever get exactly 5, but I expect we weren't hitting the exact roll-over point).

We are using these guys:
http://www.usdigital.com/products/en...tary/shaft/ma3

They are magnetic encoders with 10-bit resolution, so I don't think shorting around the end is the issue.
Reply With Quote
  #4   Spotlight this post!  
Unread 31-03-2013, 13:59
Unsung FIRST Hero
Al Skierkiewicz Al Skierkiewicz is offline
Broadcast Eng/Chief Robot Inspector
AKA: Big Al WFFA 2005
FRC #0111 (WildStang)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1996
Location: Wheeling, IL
Posts: 10,792
Al Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond repute
Re: Voltage Counts Range 0-970

Jeff,
Those should be fine but be aware that the rapid move from +V to 0V might occur at too high a slew rate to be used by the analog module without some filtering. That might be what is giving you the noise. You might also want to add a cap right at the power input of the encoder, say a .47 or 1ufd just to keep the power supply clean. Are you using the ball bearing version?
__________________
Good Luck All. Learn something new, everyday!
Al
WB9UVJ
www.wildstang.org
________________________
Storming the Tower since 1996.
Reply With Quote
  #5   Spotlight this post!  
Unread 01-04-2013, 03:19
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: Voltage Counts Range 0-970

Quote:
Originally Posted by Jefferson View Post
Now that we have slip rings on our swerve modules, we spend some time at the roll-over point of our analog encoders (the point where it rolls from 5V to 0V). We were surprised that there was significant "chatter" around this point and chalked it up to a bug in the PIDContoller to be found latter.
In trying to debug some different weirdness observed in crab, I started looking more closely at the values reported for GetAverageValue from the modules. I was surprised to find that the encoders never report anything greater than 970, but roll over all the way to 0.
A few things we checked:
Encoders are providing a full 0-5V output range.
GetValue provides the same range.
Is there any reason you are not using the GetVoltage entry-point? That will take into account factory-calibrated scaling coefficients unique to every module. You will get far more accurate results using that method. At the very least, try that and see how closely it matches your DMM at that max value.

Also keep in mind that the range of the module is -10V to 10V.

Joe
Reply With Quote
  #6   Spotlight this post!  
Unread 01-04-2013, 07:43
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 989
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: Voltage Counts Range 0-970

Quote:
Originally Posted by jhersh View Post
Is there any reason you are not using the GetVoltage entry-point?
The PIDGet currently uses GetAverageValue.
Reply With Quote
  #7   Spotlight this post!  
Unread 01-04-2013, 10:10
Happy Birthday! Jefferson Jefferson is offline
Registered User
AKA: Jeff Clements
FRC #0016 (Bomb Squad)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Mountain Home, AR
Posts: 258
Jefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond repute
Re: Voltage Counts Range 0-970

Quote:
Originally Posted by Al Skierkiewicz View Post
Jeff,
Those should be fine but be aware that the rapid move from +V to 0V might occur at too high a slew rate to be used by the analog module without some filtering.
Al,
I really think my issue is in the control system hardware (see Joe's post above and my response below). But to confirm this I am going to short the 5V supply to the signal wire to see what reading we get. If it is in the 970 range, that takes the encoder out of the equation. I'll post results here.

Quote:
Originally Posted by jhersh View Post
Is there any reason you are not using the GetVoltage entry-point?
Joe,
Like RufflesRidge said, the PIDController uses values instead of volts for the source. I had considered changing it to volts (we have used volts for years prior), but decided that the counts should be the more "raw" reading. One less calculation between me and the raw reading must be a good thing... or so I thought.

Quote:
Originally Posted by jhersh View Post
That will take into account factory-calibrated scaling coefficients unique to every module. You will get far more accurate results using that method. At the very least, try that and see how closely it matches your DMM at that max value.
This is very interesting. I saw your post a little late in the night to try anything last night, but I'll give it a try tonight if we're not too busy getting ready to go to Razorback.
Are you saying that it is not unexpected to get something other than 1023 when we supply 5V to the module, and the error is corrected when converting back to the voltage? If so, that's a really good reason to go back to voltage, and the PIDController should probably be changed for future seasons.
Reply With Quote
  #8   Spotlight this post!  
Unread 01-04-2013, 19:00
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: Voltage Counts Range 0-970

Quote:
Originally Posted by Jefferson View Post
Joe,
Like RufflesRidge said, the PIDController uses values instead of volts for the source. I had considered changing it to volts (we have used volts for years prior), but decided that the counts should be the more "raw" reading. One less calculation between me and the raw reading must be a good thing... or so I thought.
That's in Java? C++? Both?

Quote:
Originally Posted by Jefferson View Post
This is very interesting. I saw your post a little late in the night to try anything last night, but I'll give it a try tonight if we're not too busy getting ready to go to Razorback.
Are you saying that it is not unexpected to get something other than 1023 when we supply 5V to the module, and the error is corrected when converting back to the voltage? If so, that's a really good reason to go back to voltage, and the PIDController should probably be changed for future seasons.
You are certainly not guaranteed a certain raw value for a specific voltage. That's an uncalibrated raw value. It will be consistent for a given module, though, so if you only need it to work on one module, you can figure out what raw values are mapped to what voltages, and you can use the raw codes reliably. If you switch modules, you need to figure out new raw codes again.

-Joe
Reply With Quote
  #9   Spotlight this post!  
Unread 01-04-2013, 19:04
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,576
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: Voltage Counts Range 0-970

Quote:
Originally Posted by jhersh View Post
That's in Java? C++? Both?
C++ only. It was reported on FIRST Forge in January http://firstforge.wpi.edu/sf/go/artf...3648572967 51
Reply With Quote
  #10   Spotlight this post!  
Unread 01-04-2013, 19:35
Happy Birthday! Jefferson Jefferson is offline
Registered User
AKA: Jeff Clements
FRC #0016 (Bomb Squad)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Mountain Home, AR
Posts: 258
Jefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond repute
Re: Voltage Counts Range 0-970

Quote:
Originally Posted by jhersh View Post
You are certainly not guaranteed a certain raw value for a specific voltage. That's an uncalibrated raw value. It will be consistent for a given module, though, so if you only need it to work on one module, you can figure out what raw values are mapped to what voltages, and you can use the raw codes reliably. If you switch modules, you need to figure out new raw codes again.

-Joe
Great info. Thanks.
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 05:28.

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