Go to Post The mediocre do the minimum, then exclaim how easy it is. The exceptional never stop to gloat... they're too busy figuring out new ways to make it even better... - Mr. Lim [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 13-02-2013, 21:16
bvisness's Avatar
bvisness bvisness is offline
Programming Mentor, Former Driver
FRC #2175 (The Fighting Calculators)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Woodbury, MN
Posts: 181
bvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of light
VI - Get Encoder Rate in Engineering Units

I can't be the only one who's missing this functionality from the standard Encoder blocks. This VI takes an encoder reference, gets the ticks/second, and multiplies it by the configured DistancePerCount property to get the rate of the encoder in feet/second, or inches/second, or whatever else you configured it with.

Honestly, I'm surprised this functionality isn't included already...
Attached Files
File Type: vi Get Encoder Rate (Engineering Units).vi (22.2 KB, 12 views)
Reply With Quote
  #2   Spotlight this post!  
Unread 13-02-2013, 22:20
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,579
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: VI - Get Encoder Rate in Engineering Units

While the documentation says that the encoder get returns hz, if you look inside, it gets multiplied by the DistancePerPulse. I think that makes your VI unnecessary, although I haven't tried it.
Reply With Quote
  #3   Spotlight this post!  
Unread 13-02-2013, 22:45
bvisness's Avatar
bvisness bvisness is offline
Programming Mentor, Former Driver
FRC #2175 (The Fighting Calculators)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Woodbury, MN
Posts: 181
bvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of light
Re: VI - Get Encoder Rate in Engineering Units

Hmm, that's interesting. My experience has shown that the Rate output of the Get VI does in fact output Hz and not engineering units. At least, it certainly seems to always output integer values, not the decimal values I would expect from a measurement in inches or feet per second.

But looking at the code, it certainly does seem to be multiplying by DistancePerCount...I'm confused.
Reply With Quote
  #4   Spotlight this post!  
Unread 14-02-2013, 10:31
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: VI - Get Encoder Rate in Engineering Units

I can verify both that it returns "distance" per second as computed from the specified distance per count, and that it always seems to be an integer value. Our "distance" is scaled to represent 60 times 1/250th of a revolution, so we get RPM directly from the rate output, and being an integer has never been an issue.
Reply With Quote
  #5   Spotlight this post!  
Unread 14-02-2013, 21:17
bvisness's Avatar
bvisness bvisness is offline
Programming Mentor, Former Driver
FRC #2175 (The Fighting Calculators)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Woodbury, MN
Posts: 181
bvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of light
Re: VI - Get Encoder Rate in Engineering Units

So is the documentation faulty? It would seem that the rate output is not measured in Hz as the documentation states.
Reply With Quote
  #6   Spotlight this post!  
Unread 15-02-2013, 10:48
Phalanx's Avatar
Phalanx Phalanx is offline
Formerly Team 1089 (Mercury)
AKA: Michael Reffler
FRC #5431 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jun 2005
Rookie Year: 1999
Location: Lewisville, TX (previously NJ)
Posts: 384
Phalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond repute
Re: VI - Get Encoder Rate in Engineering Units

We set the DistancePerCount property value to 1. That gave us the rate in Hz.

We only used it to measure the RPM of our shooter, so it works if you don't actually need the distance.

Quote:
Originally Posted by Alan Anderson View Post
Our "distance" is scaled to represent 60 times 1/250th of a revolution, so we get RPM directly from the rate output, and being an integer has never been an issue.
I actually like Alan's method better. Let the FPGA do the calculation.
For a 250 pulse encoder 1/250 * 60 = distanceperpusle.
GetRate will then yield RPM's direclly.
__________________
Don't just ask the experts, become one!
Leadership is not about ability. It's about responsibility!
Diagonally Parked in a Parallel Universe. It's okay we do Quantum Physics



Last edited by Phalanx : 15-02-2013 at 21:48.
Reply With Quote
  #7   Spotlight this post!  
Unread 15-02-2013, 20:52
bvisness's Avatar
bvisness bvisness is offline
Programming Mentor, Former Driver
FRC #2175 (The Fighting Calculators)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Woodbury, MN
Posts: 181
bvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of light
Re: VI - Get Encoder Rate in Engineering Units

Quote:
Originally Posted by Phalanx View Post
We set the DistancePerCount property value to 1. That gave us the rate in Hz.

We only used it to measure the RPM of our shooter, so it works if you don't actually need the distance.
That's a good idea, I think we will probably do that with our shooter encoder.
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 22:56.

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