Go to Post Robot: Gyro, please reset yourself and verify proper operation. Gyro: ... WHY IS THE EVERYTHING SPINNING SO FAST? HELP! ... Robot: Are you working yet? How about now? - EricVanWyk [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 Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 06-17-2014, 11:46 PM
Bpk9p4's Avatar
Bpk9p4 Bpk9p4 is offline
Registered User
FRC #1756
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2010
Location: Illinios
Posts: 271
Bpk9p4 is on a distinguished road
Encoder rate noise

I have been playing with some s4 encoders on are robot and am getting very large noise on the encoder rate. I was wonder if people are also seeing this problem. If so what type of filter are you using or is there another way to get a cleaner signal
Reply With Quote
  #2   Spotlight this post!  
Unread 06-17-2014, 11:59 PM
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,003
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Encoder rate noise

Quote:
Originally Posted by Bpk9p4 View Post
...getting very large noise on the encoder rate

How are you mounting and driving the encoder?

How are you decoding it?

And what speeds.


Reply With Quote
  #3   Spotlight this post!  
Unread 06-18-2014, 12:27 AM
Bpk9p4's Avatar
Bpk9p4 Bpk9p4 is offline
Registered User
FRC #1756
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2010
Location: Illinios
Posts: 271
Bpk9p4 is on a distinguished road
Re: Encoder rate noise

Quote:
Originally Posted by Ether View Post
How are you mounting and driving the encoder?

How are you decoding it?

And what speeds.



It is mounted to an idler sprocket to a gear box. So there should be no slip

I have the encoder running in a 100 ms period task. It is setup how it says in the example

I am getting around 9600 pips per second
Reply With Quote
  #4   Spotlight this post!  
Unread 06-18-2014, 09:04 AM
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,763
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: Encoder rate noise

What kind of noise are you experiencing? How fast is it spinning?
__________________
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 06-18-2014, 09:09 AM
Bpk9p4's Avatar
Bpk9p4 Bpk9p4 is offline
Registered User
FRC #1756
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2010
Location: Illinios
Posts: 271
Bpk9p4 is on a distinguished road
Re: Encoder rate noise

I am seeing about a 33% noise. I attached a picture of my code bellow. The encoder is running at about 1500 rpm

http://www.chiefdelphi.com/media/photos/40706?
http://www.chiefdelphi.com/media/photos/40707?
Reply With Quote
  #6   Spotlight this post!  
Unread 06-18-2014, 09:13 AM
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,763
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: Encoder rate noise

Quote:
Originally Posted by Bpk9p4 View Post
I am seeing about a 33% noise.
???

Are you using the S4 ball bearing version? The sleeve bearing lists 100 RPM as max shaft speed. Are you seeing noise on an oscilloscope?
__________________
Good Luck All. Learn something new, everyday!
Al
WB9UVJ
www.wildstang.org
________________________
Storming the Tower since 1996.
Reply With Quote
  #7   Spotlight this post!  
Unread 06-18-2014, 09:18 AM
Aren Siekmeier's Avatar
Aren Siekmeier Aren Siekmeier is offline
on walkabout
FRC #2175 (The Fighting Calculators)
Team Role: Mentor
 
Join Date: Apr 2008
Rookie Year: 2008
Location: 대한민국
Posts: 735
Aren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond repute
Re: Encoder rate noise

Some of the wires in your VIs are overlapping or hidden, so it's difficult to be sure where they are connected...

What happens if you switch 4x decoding to 1x? You lose direction sensitivity, but it only counts one edge of one channel, instead of both, so it may be able to keep up better.

Do you know the CPR (counts per revolution) of your S4 encoders? I believe the standard options are 100 and 360.

Can you post a plot of your encoder rate over time? Also make sure there is no load on the gearbox so it can spin freely to ensure a constant speed.

Edit: Thanks for the note, Joe, good to know. Note Joe's later post for more about 1x vs. 4x.

Last edited by Aren Siekmeier : 06-18-2014 at 03:53 PM.
Reply With Quote
  #8   Spotlight this post!  
Unread 06-18-2014, 09:20 AM
Aren Siekmeier's Avatar
Aren Siekmeier Aren Siekmeier is offline
on walkabout
FRC #2175 (The Fighting Calculators)
Team Role: Mentor
 
Join Date: Apr 2008
Rookie Year: 2008
Location: 대한민국
Posts: 735
Aren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond repute
Re: Encoder rate noise

Also, I forgot to mention. There should be a VI in the Encoder palette to set the sample interval. You can call this in Begin.vi on your encoder reference to change the duration of the rolling interval the FPGA calculates the rate over.
Reply With Quote
  #9   Spotlight this post!  
Unread 06-18-2014, 09:23 AM
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is offline
Flywheel Police
AKA: Matthew Lythgoe
FRC #2363 (Triple Helix)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Newport News, VA
Posts: 1,712
notmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond repute
Re: Encoder rate noise

Quote:
Originally Posted by compwiztobe View Post
Also, I forgot to mention. There should be a VI in the Encoder palette to set the sample interval. You can call this in Begin.vi on your encoder reference to change the duration of the rolling interval the FPGA calculates the rate over.
I really hope they make this available in C++ and Java without having to modify the source in this next year's version of the API.
Reply With Quote
  #10   Spotlight this post!  
Unread 06-18-2014, 09:30 AM
Aren Siekmeier's Avatar
Aren Siekmeier Aren Siekmeier is offline
on walkabout
FRC #2175 (The Fighting Calculators)
Team Role: Mentor
 
Join Date: Apr 2008
Rookie Year: 2008
Location: 대한민국
Posts: 735
Aren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond repute
Re: Encoder rate noise

Quote:
Originally Posted by notmattlythgoe View Post
I really hope they make this available in C++ and Java without having to modify the source in this next year's version of the API.
edu.wpi.first.wpilibj.Encoder.setSamplesToAverage?
Reply With Quote
  #11   Spotlight this post!  
Unread 06-18-2014, 09:33 AM
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is offline
Flywheel Police
AKA: Matthew Lythgoe
FRC #2363 (Triple Helix)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Newport News, VA
Posts: 1,712
notmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond repute
Re: Encoder rate noise

Quote:
Originally Posted by compwiztobe View Post
edu.wpi.first.wpilibj.Encoder.setSamplesToAverage?
Doh >.<
Reply With Quote
  #12   Spotlight this post!  
Unread 06-18-2014, 11:43 AM
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,548
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: Encoder rate noise

Quote:
Originally Posted by notmattlythgoe View Post
I really hope they make this available in C++ and Java without having to modify the source in this next year's version of the API.
Like Aren pointed out, this was added prior to the 2014 season. http://wpilib.screenstepslive.com/s/...d-known-issues
Reply With Quote
  #13   Spotlight this post!  
Unread 06-18-2014, 11:41 AM
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,548
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: Encoder rate noise

Quote:
Originally Posted by compwiztobe View Post
What happens if you switch 4x decoding to 1x? You lose direction sensitivity, but it only counts one edge of one channel, instead of both, so it may be able to keep up better.
Switching to 1x decoding does not lose direction sensitivity. It still uses the B channel for direction, but only 1 transition of the A channel.

1x decoding helps reduce noise beyond just reducing counts to within the limit of the FPGA. It also allows additional digital samples between each count, effectively acting like averaging 4 samples at 4x. It also ignores manufacturing tolerances between the different signals, like Ether mentioned. For the S4 encoder, B lags A by 90 degress +/- 60 degrees (max).
Reply With Quote
  #14   Spotlight this post!  
Unread 06-18-2014, 04:00 PM
Aren Siekmeier's Avatar
Aren Siekmeier Aren Siekmeier is offline
on walkabout
FRC #2175 (The Fighting Calculators)
Team Role: Mentor
 
Join Date: Apr 2008
Rookie Year: 2008
Location: 대한민국
Posts: 735
Aren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond repute
Re: Encoder rate noise

Quote:
Originally Posted by Joe Ross View Post
Switching to 1x decoding does not lose direction sensitivity. It still uses the B channel for direction, but only 1 transition of the A channel.

1x decoding helps reduce noise beyond just reducing counts to within the limit of the FPGA. It also allows additional digital samples between each count, effectively acting like averaging 4 samples at 4x. It also ignores manufacturing tolerances between the different signals, like Ether mentioned. For the S4 encoder, B lags A by 90 degress +/- 60 degrees (max).
Ah, thanks for that, good to know. I'm guessing 2x behaves similarly, skipping the falling edge of each channel and using it as a second sample to smooth things out relative to 4x.
Reply With Quote
  #15   Spotlight this post!  
Unread 06-18-2014, 04:26 PM
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,548
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: Encoder rate noise

Quote:
Originally Posted by compwiztobe View Post
Ah, thanks for that, good to know. I'm guessing 2x behaves similarly, skipping the falling edge of each channel and using it as a second sample to smooth things out relative to 4x.
2x uses the rising and falling pulse of channel A (since those are 180 degrees apart).

Last edited by Joe Ross : 06-18-2014 at 04:49 PM.
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 06:02 PM.

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