Go to Post Mentor to Student: "It's OK, if you mess it up you just get to do it again." - EStokely [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 Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 24-02-2013, 20:39
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,086
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: Is there a speed sensor input example for Labview?

Quote:
Originally Posted by marccenter View Post
Ether,

I am planning on using one of the three Rockwell Automation light sensors provided in the 2011 FRC KOP, PN 42EF-D1MNAK-2.
The shooter wheel is either a six or eight inch direct driven by a CIM (1000 to 5000 rpm, 2000-3000 rpm typical).
I was planning on using a piece of reflective tape, like one inch square, my goal being about double the size of the sense eye. My goal was to place the reflective tape near the edge of the wheel on one of the spokes.
Because of the rather high speed I believe only one signal per rev is sufficient for crude speed measurement and control. There is no plan for position based control.
Sorry, I just now saw your post.

8" diameter wheel at 5000 rpm with 1" wide tape puts the tape under the sensor for only ≈ 0.6ms. If things start to get flaky at high speeds, that might be why.


Reply With Quote
  #2   Spotlight this post!  
Unread 24-02-2013, 21:15
tr6scott's Avatar
tr6scott tr6scott is offline
Um, I smell Motor!
AKA: Scott McBride
FRC #2137 (TORC)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2005
Location: Oxford, MI
Posts: 518
tr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond repute
Re: Is there a speed sensor input example for Labview?

We are using a banner sensor, (very similar to AB, just smaller packaging, and polarized) two pieces of reflector tape, on a vex hub. We have sized the tape so it is 90 degrees on, 90 degrees off.

We are using the same code that was posted, and but averaging over two samples to balance any, not quite 90 cuts, on the reflectors.

This is giving solid RPM measurement. We are controlling with "take back half" controller, posted by 123 last year.

Our target speed is 3700, and max speed of 4400 on the wheel. We have confirmed the speed with a handheld optical tachometer. We come to speed in about 2.8 seconds, and can hold a +- 3% to shoot.

We tried bang bang, but the counter resolution was fighting with the motor update cycle. I realize now the problem was the RPM calculation, with the low resolution "encoder" we could really only calculate RPM's in steps of 300 RPM's. TBH is working, so we are working on things that aren't but when I get time we will go back and try bang-bang with rpm calculated as period in lieu of counter, to see the real comparison.
__________________
The sooner we get behind schedule, the more time we have to catch up.


Last edited by tr6scott : 24-02-2013 at 21:22.
Reply With Quote
  #3   Spotlight this post!  
Unread 24-02-2013, 21:37
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,086
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: Is there a speed sensor input example for Labview?

Quote:
Originally Posted by tr6scott View Post
We are using a banner sensor, (very similar to AB, just smaller packaging, and polarized) two pieces of reflector tape, on a vex hub. We have sized the tape so it is 90 degrees on, 90 degrees off.
Could you please post a photo or a sketch? Or if not, explain in a bit more detail what you mean by "sizing the (2 pieces of) tape so it is 90 degrees on, 90 degrees off" ?


Reply With Quote
  #4   Spotlight this post!  
Unread 24-02-2013, 22:54
tr6scott's Avatar
tr6scott tr6scott is offline
Um, I smell Motor!
AKA: Scott McBride
FRC #2137 (TORC)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2005
Location: Oxford, MI
Posts: 518
tr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond repute
Re: Is there a speed sensor input example for Labview?

See my cad pic, Yellow indicating where the reflector tape is mounted.

90 degrees on, 90 degrees off, 90 degrees on, 90 degrees off, as it spins.

With the low resolution counter method in bang-bang, the difference between (I am going from memory from a couple of weeks ago) in a 10 ms loop, it was 9, 10, or 11 counts, which equated to 3000rpm, 3300rpm, 3600rpm. We realized that if the tape did not start at 180 degrees apart, this was an issue and an error. As we increased the loop time to get more counts, we were reducing the motor output changes which increased the error.

We are using the "gear tooth" mode, and a timer avg over two counts, which is one revolution. This really reduced the error in not placing the reflector tape exactly 180 degrees apart.

Does that make more sense?

Edit, Banner part number DS18VN6LP
Attached Thumbnails
Click image for larger version

Name:	217-2592-950x950.jpg
Views:	49
Size:	91.4 KB
ID:	14173  
__________________
The sooner we get behind schedule, the more time we have to catch up.


Last edited by tr6scott : 24-02-2013 at 23:08. Reason: added banner part number. DS18VN6LP
Reply With Quote
  #5   Spotlight this post!  
Unread 25-02-2013, 00:03
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,086
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: Is there a speed sensor input example for Labview?

Quote:
Originally Posted by tr6scott View Post
See my cad pic, Yellow indicating where the reflector tape is mounted.
90 degrees on, 90 degrees off, 90 degrees on, 90 degrees off, as it spins.
Yes, that's clear, thank you. Are you counting only rising edges, or both rising and falling?

Quote:
Originally Posted by tr6scott View Post
We are using the same code that was posted
Are you referring to the code Mark posted? What you are describing is not what he posted. The code he posted is equivalent to the getPeriod() method in the WPILib, which uses the 153KHz sampling and 1μs timer in the FPGA to measure the elapsed time between counts. If you use the code Mark posted, and if you are counting rising and falling edges, and if you have the FPGA sample averaging ring buffer set to 4 samples, you should be getting rock-steady accurate rpm readings.


Attached Thumbnails
Click image for larger version

Name:	3000rpm 4CPR 4N 10ms.png
Views:	46
Size:	9.4 KB
ID:	14177  

Last edited by Ether : 25-02-2013 at 00:41.
Reply With Quote
  #6   Spotlight this post!  
Unread 25-02-2013, 06:18
tr6scott's Avatar
tr6scott tr6scott is offline
Um, I smell Motor!
AKA: Scott McBride
FRC #2137 (TORC)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2005
Location: Oxford, MI
Posts: 518
tr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond repute
Re: Is there a speed sensor input example for Labview?

Attached are screen shots of actual code. We are using the "Gear Tooth sensor" mode of the counter, which based on our results, must only be counting the rising edges, and not the falling edges.

The questionmark in the timed task is the TBH control. (Not sure where my son put that one

Scott.
Attached Thumbnails
Click image for larger version

Name:	begin.JPG
Views:	92
Size:	19.2 KB
ID:	14179  Click image for larger version

Name:	timed tasks.JPG
Views:	75
Size:	32.0 KB
ID:	14180  
__________________
The sooner we get behind schedule, the more time we have to catch up.

Reply With Quote
  #7   Spotlight this post!  
Unread 25-02-2013, 10:19
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,086
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: Is there a speed sensor input example for Labview?

Quote:
Originally Posted by tr6scott View Post
based on our results, must only be counting the rising edges, and not the falling edges.
3000rpm at 2 counts/rev with FPGA sampling set to 2 should also give you very accurate and jitter-free rpm reading.

This was the portion of your previous post which I must have misinterpreted:
Quote:
Originally Posted by tr6scott View Post
With the low resolution counter method in bang-bang, the difference between (I am going from memory from a couple of weeks ago) in a 10 ms loop, it was 9, 10, or 11 counts, which equated to 3000rpm, 3300rpm, 3600rpm.
In retrospect, I see you were describing what you were doing, not what you currently are doing.

If you use your present method, I can't see why bang-bang shouldn't work.


Attached Thumbnails
Click image for larger version

Name:	3000rpm 2CPR 2N 10ms.png
Views:	48
Size:	9.5 KB
ID:	14181  
Reply With Quote
  #8   Spotlight this post!  
Unread 25-02-2013, 10:27
tr6scott's Avatar
tr6scott tr6scott is offline
Um, I smell Motor!
AKA: Scott McBride
FRC #2137 (TORC)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2005
Location: Oxford, MI
Posts: 518
tr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond repute
Re: Is there a speed sensor input example for Labview?

I agree, the lower performance of the bang-bang method was in the RPM calculation, and not in the control method.

We have moved on, but I have two students that understand that the difference in the performance between the two, was not control algorithm, but the RPM calculation. I would like to go back, and implement bang-bang with the same RPM calculation, and compare bang-bang to TBH for control methods.

Thanks for all your great posts, I learn so much, and in turn, and some of my students do too.
__________________
The sooner we get behind schedule, the more time we have to catch up.

Reply With Quote
  #9   Spotlight this post!  
Unread 27-02-2013, 04:56
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: Is there a speed sensor input example for Labview?

Quote:
Originally Posted by tr6scott View Post
Attached are screen shots of actual code. We are using the "Gear Tooth sensor" mode of the counter, which based on our results, must only be counting the rising edges, and not the falling edges.

The questionmark in the timed task is the TBH control. (Not sure where my son put that one

Scott.
While it probably has no impact on the system as you are using it, the "Gear Tooth Sensor" mode is not likely what you want. Read the context help on that mode. It is meant to allow bi-directional counting based on the length of the pulse. This behavior was available from gear-tooth sensors provided in the kit years ago. If you happen to be near the magic number for your pulse length, you could generate glitches in your speed measurement as you "reverse directions". You would be best served selecting Up/Down counter mode and only configuring and connecting the "Up" channel.

Cheers,
-Joe
Reply With Quote
  #10   Spotlight this post!  
Unread 27-02-2013, 09:07
tr6scott's Avatar
tr6scott tr6scott is offline
Um, I smell Motor!
AKA: Scott McBride
FRC #2137 (TORC)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2005
Location: Oxford, MI
Posts: 518
tr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond repute
Re: Is there a speed sensor input example for Labview?

Thanks for the info Joe, we will change it up to the up/down mode, don't need any anomalies to pop up in competition.

I noticed I did not link to the TBH code posted by 123 last year, here is the link in case someone is searching this out later.

http://www.chiefdelphi.com/media/papers/2674
__________________
The sooner we get behind schedule, the more time we have to catch up.

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

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