Go to Post Students and engineers should work side by side, actually inspiring each other. - Andy Baker [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 16-01-2013, 07:23
Bruno#1382's Avatar
Bruno#1382 Bruno#1382 is offline
Registered User
FRC #1382
 
Join Date: Jan 2013
Location: Brazil
Posts: 19
Bruno#1382 is an unknown quantity at this point
RPM control system

hello guys we are having some troubles with a RPM control system
we are using a inductive sensor to get pulses and convert to RPM anyone knows a another way to do this? it can be simple or not
thanks
Reply With Quote
  #2   Spotlight this post!  
Unread 16-01-2013, 11:46
BitTwiddler's Avatar
BitTwiddler BitTwiddler is offline
electronics/programming mentor
AKA: Mr Tanguay
FRC #1726 (N.E.R.D.S.)
Team Role: Mentor
 
Join Date: Oct 2008
Rookie Year: 2006
Location: Sierra Vista, AZ
Posts: 243
BitTwiddler is on a distinguished road
Re: RPM control system

The WPI Library in the Functions Palette contains some vi(s) specific to the Counter functions built-in to the Crio's FPGA. One of the outputs of the Get Counter VI is the period between input pulses. Use that output to calculate the RPM value. See some of the example code for how to use the counter.

The Crio's FPGA takes a lot of the processing load off of the on-board computer so you don't have to try to do it all in software.
Reply With Quote
  #3   Spotlight this post!  
Unread 16-01-2013, 17:30
propionate's Avatar
propionate propionate is offline
Team co-lead and LabVIEW programmer
AKA: Stephen
FRC #1732 (Hilltopper Robotics)
 
Join Date: Jan 2012
Rookie Year: 2009
Location: Milwaukee
Posts: 93
propionate is on a distinguished road
Re: RPM control system

If you have trouble with the solution above, there is a way to tweak the example code for an encoder to do what you are looking for as well.
Reply With Quote
  #4   Spotlight this post!  
Unread 17-01-2013, 05:38
Bruno#1382's Avatar
Bruno#1382 Bruno#1382 is offline
Registered User
FRC #1382
 
Join Date: Jan 2013
Location: Brazil
Posts: 19
Bruno#1382 is an unknown quantity at this point
Re: RPM control system

ok,but the encoder don't work well because when he works in high rotation he skip a lot os pulses
Reply With Quote
  #5   Spotlight this post!  
Unread 17-01-2013, 09:41
propionate's Avatar
propionate propionate is offline
Team co-lead and LabVIEW programmer
AKA: Stephen
FRC #1732 (Hilltopper Robotics)
 
Join Date: Jan 2012
Rookie Year: 2009
Location: Milwaukee
Posts: 93
propionate is on a distinguished road
Re: RPM control system

You don't have to use the encoder - just wire up the inductive sensor to a DIO input, and have LabVIEW pretend it is an encoder. The encoder VI will generate a speed for you (degrees/second), but you will likely have to scale it to get the correct RPM. Once again, this is just an alternative to using the Counter method.
Reply With Quote
  #6   Spotlight this post!  
Unread 17-01-2013, 10:38
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,034
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: RPM control system

Quote:
Originally Posted by propionate View Post
You don't have to use the encoder - just wire up the inductive sensor to a DIO input, and have LabVIEW pretend it is an encoder.
LabVIEW must be different from Java:

http://www.chiefdelphi.com/forums/sh...26&postcount=2


Reply With Quote
  #7   Spotlight this post!  
Unread 17-01-2013, 16:31
propionate's Avatar
propionate propionate is offline
Team co-lead and LabVIEW programmer
AKA: Stephen
FRC #1732 (Hilltopper Robotics)
 
Join Date: Jan 2012
Rookie Year: 2009
Location: Milwaukee
Posts: 93
propionate is on a distinguished road
Re: RPM control system

Quote:
Originally Posted by Ether View Post
LabVIEW must be different from Java:

http://www.chiefdelphi.com/forums/sh...26&postcount=2


You do need to provide a DIO number for both Channel A and Channel B, but I just entered in the same channel for both. It worked out fine.
Reply With Quote
  #8   Spotlight this post!  
Unread 17-01-2013, 18:51
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,560
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: RPM control system

Quote:
Originally Posted by Bruno#1382 View Post
ok,but the encoder don't work well because when he works in high rotation he skip a lot os pulses
Are you saying that the sensor doesn't react fast enough and misses pulses, or that the cRIO misses pulses?

I'd expect that the counter works at a higher rate then an encoder.
Reply With Quote
  #9   Spotlight this post!  
Unread 18-01-2013, 02:47
Ken Streeter's Avatar
Ken Streeter Ken Streeter is offline
Let the MAYHEM begin!
FRC #1519 (Mechanical Mayhem)
Team Role: Engineer
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Team: Milford, NH; Me: Bedford, NH
Posts: 468
Ken Streeter has a reputation beyond reputeKen Streeter has a reputation beyond reputeKen Streeter has a reputation beyond reputeKen Streeter has a reputation beyond reputeKen Streeter has a reputation beyond reputeKen Streeter has a reputation beyond reputeKen Streeter has a reputation beyond reputeKen Streeter has a reputation beyond reputeKen Streeter has a reputation beyond reputeKen Streeter has a reputation beyond reputeKen Streeter has a reputation beyond repute
Re: RPM control system

Quote:
Originally Posted by Bruno#1382 View Post
ok,but the encoder don't work well because when he works in high rotation he skip a lot os pulses
I keep hearing reports like this and always wonder whether or not I should try to stop the misinformation. Usually Ether jumps in to do so, but this time I figured I'd have a go...

The USDigital Sensors that have come in the Kit of Parts in recent years and the FPGA in the cRIO are fully capable of keeping up with very high rate encoders or counters.

The limiting factor for the maximum rate will be the lesser of the limits for the encoder and the cRIO.

First, the USDigital encoder:

There are two separate constraints for the USDigital encoder: (1) The mechanical limit for the USDigital E4P encoder is 60,000RPM. (2) The maximum count frequency is 60kHz. Accordingly, the maximum RPM due to the maximum 60kHz count frequency is 3,600,000/CPR. For the 250 count disks that were provided in the kit in recent years, this means the maximum RPM is 14,400 RPM. Even a 360 count disk will allow 10,000 RPM.

Next, the cRIO:

The cRIO is fully able to measure such high rate encoders with the use of the FPGA counter. The input sample period is 6.5usec, which is 153 kHz, giving a permissible encoder rate of up to 38.4k counts per second. For a 250-count disk, this is about 9200rpm.

OK, so rates of up to 9200rpm should be possible. But, what about practical experience?

For 1519's shooter wheels last year (Rebound Rumble 2012), we used a 250-count optical disk in the USDigital E7P encoder and had no problems with this setup being driven at over 4000rpm and measured by the cRIO using an encoder object with 1x sampling in Java.

One caveat that may lead to misinformation that teams were having problems with encoders at high RPMs is that the getRate() function will have excessive jitter at high RPMs, but this isn't due to missing counts. Instead, this jitter is due to the way the getRate() function works in WPILib. getRate() determines the rate by measuring the period of a single pulse (with 6.5usec resolution) and then taking the reciprocal to determine a rate. This isn't accurate at very high pulse frequencies, due to the discretization of the measurement of the period of a pulse. Instead, what can be done is to periodically sample the number of counts, determine how many counts have occurred since the prior sample, and then divide by the time since the prior sample, to determine a rate in counts per second.

Converting counts per second to RPM is achieved by multiplying by 60 seconds / 1 minute and dividing by 250 counts per 1 rotation (for a 250 CPR disk). We did this last year and received very stable RPM information for controlling our shooter wheel speeds via a PID control loop.
__________________
Ken Streeter - Team 1519 - Mechanical Mayhem (Milford Area Youth Homeschoolers Enriching Minds)
2015 NE District Winners with 195 & 2067, 125 & 1786, 230 & 4908, and 95 & 1307
2013 World Finalists & Archimedes Division Winners with 33 & 469
2013 & 2012 North Carolina Regional Winners with teams 435 & 4828 and 1311 & 2642
2011, 2010, 2006 Granite State Regional Winners with teams 175 & 176, 1073 & 1058, and 1276 & 133
Team 1519 Video Gallery - including Chairman's Video, and the infamous "Speed Racer!"

Last edited by Ken Streeter : 18-01-2013 at 03:01. Reason: clarification
Reply With Quote
  #10   Spotlight this post!  
Unread 18-01-2013, 08:00
Bruno#1382's Avatar
Bruno#1382 Bruno#1382 is offline
Registered User
FRC #1382
 
Join Date: Jan 2013
Location: Brazil
Posts: 19
Bruno#1382 is an unknown quantity at this point
Re: RPM control system

our encoder don't detect the pulses in high rotation ,but we solve the problem today's morning thanks for all replys guys we use a control wired direct on the motor so we can control the motor direct from the labview
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 04:15.

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