Go to Post This is what happens when a couple of whackos get an idea at 2 am. - Rich Kressly [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 19-02-2013, 13:15
marccenter's Avatar
marccenter marccenter is offline
Registered User
FRC #3548 (RoboRavens2)
Team Role: Coach
 
Join Date: Sep 2004
Rookie Year: 2004
Location: Royal Oak
Posts: 406
marccenter has a spectacular aura aboutmarccenter has a spectacular aura about
Is there a speed sensor input example for Labview?

CD,
Is there a speed sensor input example for Labview?
I'm looking for one but cannot find it. I am thinking about using
one of the old honeywell optical sensors to read one pulse per
revolution as a CIM motor speed sensor (black tape on alum disk).

If there is no speed sensor input example can someone post one they
have successfully used in the past?

Thanks in advance,
__________________
Marc Center
FIRST FRC Mentor/Coach - Team 3548 Royal Oak RoboRavens#2 - on Sabbatical 2017 season
marc.center@gmail.com
Mobile: 248-255-7377
Reply With Quote
  #2   Spotlight this post!  
Unread 19-02-2013, 13:27
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,861
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Is there a speed sensor input example for Labview?

Is this what you mean?


The 5 should be a 1 in your example. If you had more than one piece of reflective tape, that would be the number of pieces of tape.
The 99 also should be a 1
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 19-02-2013 at 13:30.
Reply With Quote
  #3   Spotlight this post!  
Unread 19-02-2013, 13:52
marccenter's Avatar
marccenter marccenter is offline
Registered User
FRC #3548 (RoboRavens2)
Team Role: Coach
 
Join Date: Sep 2004
Rookie Year: 2004
Location: Royal Oak
Posts: 406
marccenter has a spectacular aura aboutmarccenter has a spectacular aura about
Smile Re: Is there a speed sensor input example for Labview?

Mark,

Yes.. great example.. Let me throw it into my code and maybe I can see motor speed this afternoon for FRC 1188 (sister team). Thanks,
__________________
Marc Center
FIRST FRC Mentor/Coach - Team 3548 Royal Oak RoboRavens#2 - on Sabbatical 2017 season
marc.center@gmail.com
Mobile: 248-255-7377
Reply With Quote
  #4   Spotlight this post!  
Unread 19-02-2013, 14:12
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,102
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
Let me throw it into my code and maybe I can see motor speed this afternoon for FRC 1188 (sister team).
Important: What is the part number of that "old Honeywell sensor", what is your wheel speed, and how wide is your piece of tape (in degrees or radians at the point where it is being sensed)?


Reply With Quote
  #5   Spotlight this post!  
Unread 21-02-2013, 14:31
marccenter's Avatar
marccenter marccenter is offline
Registered User
FRC #3548 (RoboRavens2)
Team Role: Coach
 
Join Date: Sep 2004
Rookie Year: 2004
Location: Royal Oak
Posts: 406
marccenter has a spectacular aura aboutmarccenter has a spectacular aura about
Re: Is there a speed sensor input example for Labview?

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.
__________________
Marc Center
FIRST FRC Mentor/Coach - Team 3548 Royal Oak RoboRavens#2 - on Sabbatical 2017 season
marc.center@gmail.com
Mobile: 248-255-7377

Last edited by marccenter : 21-02-2013 at 14:34. Reason: more info
Reply With Quote
  #6   Spotlight this post!  
Unread 22-02-2013, 20:00
nickcvet89 nickcvet89 is offline
Registered User
FRC #1228 (RoboTribe)
Team Role: Engineer
 
Join Date: Jan 2007
Rookie Year: 2003
Location: Rahway,NJ
Posts: 99
nickcvet89 will become famous soon enough
Send a message via AIM to nickcvet89
Re: Is there a speed sensor input example for Labview?

We used the photoelectric sensor (line follower) from the 2011 season and, used this as a tachometer and sent the information to the DS similar to marks example. I might post a video on how to do it next week.
__________________
Reply With Quote
  #7   Spotlight this post!  
Unread 24-02-2013, 20:24
marccenter's Avatar
marccenter marccenter is offline
Registered User
FRC #3548 (RoboRavens2)
Team Role: Coach
 
Join Date: Sep 2004
Rookie Year: 2004
Location: Royal Oak
Posts: 406
marccenter has a spectacular aura aboutmarccenter has a spectacular aura about
Smile Re: Is there a speed sensor input example for Labview?

Dear CD,

Mark's example worked with me with one small modification, I changed the 0.05 value going to the config Timer to 0.5 (timeout value) and I placed the Periodic Tasks inside a 100 msec loop not the 10 msec loop also available.

I am able to read the Tachometer on the Variables page but not on the smart dashboard. I have fiddled with the smart dashboard displays and they seem to have a much slower update and seem to "freeze up" after a short period of time on my bench setup at home. I wouldn't trust them too much if you are using them for control purposes... use the variables page to confirm your software is operating as expected is my 10-cent advice.

BTW, I am testing an AndyMark PG188 gearmotor at home that has a free speed of about 75 rpm. This operates at a safe
speed and I can see the Rockwell Automation sensor built in lights toggling to indicate a change of state. I have not yet configured a CIM for higher speed measurement operation.

I see the code segment below appears to be run in the 10 msec loop. Hmm... I may move the 100 msec counter logic into the 10 msec loop and see if the motor speed shows up on the smart dashboard.
__________________
Marc Center
FIRST FRC Mentor/Coach - Team 3548 Royal Oak RoboRavens#2 - on Sabbatical 2017 season
marc.center@gmail.com
Mobile: 248-255-7377

Last edited by marccenter : 25-02-2013 at 16:38. Reason: more informaiton
Reply With Quote
  #8   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,102
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
  #9   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: 531
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
  #10   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,102
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
  #11   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: 531
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
  #12   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,102
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
  #13   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: 531
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
  #14   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,102
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:	49
Size:	9.5 KB
ID:	14181  
Reply With Quote
  #15   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: 531
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
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 23:05.

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