Go to Post Is it weird we think speed controllers are sexy? - vivek16 [more]
Home
Go Back   Chief Delphi > Technical > Electrical
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 26-01-2013, 17:56
coachrandall coachrandall is offline
Registered User
FRC #3588
 
Join Date: Dec 2012
Location: Renton, WA
Posts: 1
coachrandall is an unknown quantity at this point
Digital I/O sampling frequency question.

Our team is attempting to use a linear magnetic sensor to create an index pulse when passing a magnet. This pulse signal connects to the digital sidecar, digital I/O. Using Labview, we are monitoring (displaying) these pulses using the "Simple Digital input" VI. When we compare the pulses produced by the chip sensor using an O'scope with the Raw value of the Dig I/O pin in Labview, they are very different. The O'scope is perfectly consistant pulse periods and the Labview display frequently has gaps where 2, 3 or more pulses should be.

Our conclusion is that the Dig I/O is not properly sampling the I/O port and missing some pulses. Is this a good conclusion and if so, can we adjust settings in Labview or the CRIO to correct this?
  #2   Spotlight this post!  
Unread 26-01-2013, 18:03
apples000's Avatar
apples000 apples000 is offline
Registered User
no team
 
Join Date: Mar 2012
Rookie Year: 2012
Location: United States
Posts: 222
apples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant future
Re: Digital I/O sampling frequency question.

If you are trying to find the time between quick pulses, don't use a digital IO object, use a counter. You should leave the sensor connected the way it is now, and just use the period terminal on the counter vi in LV, or in c/java, use counter.getPeriod(). The counter uses the FPGA to count the signal really quickly just like an encoder and we've had success using this to measure our shooter's wheel speed.

Last edited by apples000 : 26-01-2013 at 18:09. Reason: clarification
  #3   Spotlight this post!  
Unread 26-01-2013, 18:08
JohnGilb JohnGilb is offline
Programming Mentor, Drive Mentor
FRC #0488
 
Join Date: Mar 2011
Rookie Year: 2003
Location: Redmond, WA
Posts: 116
JohnGilb has a spectacular aura aboutJohnGilb has a spectacular aura aboutJohnGilb has a spectacular aura about
Re: Digital I/O sampling frequency question.

http://www.sal.wisc.edu/PFIS/docs/rs...403-manual.pdf

So you need to understand the difference between the cRIO Module & FPGA and the software layer on top of it.

The cRIO module can detect changes about every 1 microsecond, so unless you're getting one million pulses per second, you're probably not saturating the hardware.

What I expect you're doing is just reading the "current" value of the I/O pin in software, which is probably running every few milliseconds. In that case, if you're getting >100 or >1000 pulses per second (hard to say for sure without knowing the execution speed of your program) you may miss some transitions.

What you could do is set one of the cRIO's hardware counters to read off an I/O pin. I can't remember how to set this up yourself, but the encoder class does this automatically. Essentially, the FPGA counts things in hardware, and the software layer comes along every once in a while and asks "how many pulses have you recorded?" The hardware delivers the number and then resets the counter.
Closed Thread


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 20:18.

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