Go to Post If Amanda is 'old', I am beginning to feel like a fossil.... - Chris Fultz [more]
Home
Go Back   Chief Delphi > Technical > Motors
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 29-01-2013, 08:35
fovea1959's Avatar
fovea1959 fovea1959 is offline
Herder of programmers
AKA: Doug Wegscheid
FRC #3620 (The Average Joes)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2011
Location: St Joseph
Posts: 336
fovea1959 will become famous soon enough
Measuring motor speed

I'm struggling with a good way to measure motor speed for our shooter motors (probably Banebots, probably 10-20k rpm). I'll have a back shaft available for mounting.

Any one have any advice for something off the shelf? my priorities are available, reliable, simple to interface, easy to mount, and cheap, in that order. I'm trying to stay away from have to do any electronics design (I'd end up doing it myself, I suspect, which is not the point of this exercise!), want to use off the shelf if possible. Alternatively, something that we can put together on perfboard would be good.

If we're on our own, we're thinking either Hall Effect, or else opto (fairchild QRD1113/1114 with a black/white "plug" on the backshaft), but if someone has something simple that they know works, I'm all ears....
  #2   Spotlight this post!  
Unread 29-01-2013, 08:51
iambujo iambujo is offline
Mentor
FRC #2729 (Storm)
Team Role: Mentor
 
Join Date: Feb 2008
Rookie Year: 2008
Location: NJ
Posts: 86
iambujo is a name known to alliambujo is a name known to alliambujo is a name known to alliambujo is a name known to alliambujo is a name known to alliambujo is a name known to all
Re: Measuring motor speed

Hello - Last year with my students and I designed a PCB for a US1881 Hall Latch. It has done very well for us. To use it, we just mount some good magnets in a hub, 180 degrees out of phase and at opposing poles. Each pole swap during rotation swaps the latch, creating a square wave on the digital signal. We have tested it up to about 5000 RPM on our shooter last year and this year. I am not sure how high it can go before missing latches, our goal was <= 5000 RPM, but the US1881 data sheet probably tells you. You need to make sure those magnets in the hub are secured well, you don't want them flying out!

For the magnets we have had great luck using the larger of the 2 magnets that spark fun sells. The smaller works too, but the larger one allows the sensor to be between a 1/4 and a 1/2 inch away from the magnets/spinning hub.

We actually just shipped 3 units to another FRC team and sold a few last year. If you are interested, private message me and we can hook you up with some for $20 a piece for an assembled sensor, you supply the magnets (we did a short run on the boards so they weren't cheap).

Here is the thread from last year:
http://www.chiefdelphi.com/forums/sh...92#post1114292

Last edited by iambujo : 29-01-2013 at 08:59.
  #3   Spotlight this post!  
Unread 29-01-2013, 09:01
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,125
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: Measuring motor speed

Quote:
Originally Posted by fovea1959 View Post
I'm struggling with a good way to measure motor speed for our shooter motors (probably Banebots, probably 10-20k rpm).
At those high speeds, you can get good results with a one-pulse-per-rev device by putting one mark or one piece of reflective tape on your wheel and detecting it with an optical sensor.

Then use the GetPeriod() method in the Counter class to get the elapsed seconds between pulses, and convert that to RPM:

RPM = 60/period


  #4   Spotlight this post!  
Unread 29-01-2013, 09:10
fovea1959's Avatar
fovea1959 fovea1959 is offline
Herder of programmers
AKA: Doug Wegscheid
FRC #3620 (The Average Joes)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2011
Location: St Joseph
Posts: 336
fovea1959 will become famous soon enough
Re: Measuring motor speed

software I can handle: need a recommendation for a easy to interface opto this is fast enough.
  #5   Spotlight this post!  
Unread 29-01-2013, 09:15
Hugh Meyer's Avatar
Hugh Meyer Hugh Meyer is offline
Registered User
FRC #1741 (Red Alert Robotics)
Team Role: Mentor
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Greenwood Indiana
Posts: 158
Hugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud of
Re: Measuring motor speed

The encoders that come in the kit of parts are very good for this. Run the wires to the cRIO or to a Jaguar. Both devices will give you speed. We mount directly to the CIM motors and they have no trouble keeping up with 5K rpm. It should go on up to 20K rpm without any trouble. If you are concerned about that you could get the lowest line count encoder. They are simple to install, cheap, reliable, and directly interface to two systems we use.

-Hugh
  #6   Spotlight this post!  
Unread 29-01-2013, 09:33
fovea1959's Avatar
fovea1959 fovea1959 is offline
Herder of programmers
AKA: Doug Wegscheid
FRC #3620 (The Average Joes)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2011
Location: St Joseph
Posts: 336
fovea1959 will become famous soon enough
Re: Measuring motor speed

Hugh, thanks.

We may fall back to the USDigital, but we're trying to see if there are viable alternatives in the single pulse per rev range. Our experiments so far is that the US Digital are noisy and unreliable at these speeds (had a student plotting speed at constant power, flat with spikes of varying size above and below the line). Needed a fair amount of filtration to get something that looked decent.

If I can find something cheaper, less noisy, more robust, and sends sends fewer pulses to the poor cRIO, I want to explorer it. A 10000 rpm shaft on a 250 pulse /rev encoder is over 40000 pulses/s; depending on what numbers you believe, that's close to what the FPGA can handle.
  #7   Spotlight this post!  
Unread 29-01-2013, 10:29
Hugh Meyer's Avatar
Hugh Meyer Hugh Meyer is offline
Registered User
FRC #1741 (Red Alert Robotics)
Team Role: Mentor
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Greenwood Indiana
Posts: 158
Hugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud of
Re: Measuring motor speed

fovea1959,

Using the 100 line encoder with one channel rather than quad mode will reduce the pulses per second considerably.

If you are seeing noise you might want to check your mechanical arrangement. The signals we see are rock solid when all is properly aligned and constrained.

If you have something spinning that you could drill a hole in you could use a LED and photo transistor to sense the hole. A slot sensor is another option (HOA1405)

If you could mount a black and white sticker on the spinning shaft then a reflective sensor (OPB625) would work great.

Either of these devices can connect directly to the cRIO with only a few resistors.

Good luck. Please be sure to post your final solution. It is always interesting to see how others solve problems like this.

-Hugh
Attached Thumbnails
Click image for larger version

Name:	HOA1405.jpg
Views:	33
Size:	5.2 KB
ID:	13712  Click image for larger version

Name:	SlotSensor_OPB625.jpg
Views:	22
Size:	104.4 KB
ID:	13713  Click image for larger version

Name:	IMG_4020_LR.jpg
Views:	34
Size:	118.1 KB
ID:	13714  
  #8   Spotlight this post!  
Unread 29-01-2013, 11:15
fovea1959's Avatar
fovea1959 fovea1959 is offline
Herder of programmers
AKA: Doug Wegscheid
FRC #3620 (The Average Joes)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2011
Location: St Joseph
Posts: 336
fovea1959 will become famous soon enough
Re: Measuring motor speed

Hugh: thanks for the suggestions. Probably a mechanical alignment problem. Didn't think to just run one channel and use the encoder as a counter (though I had the encoder set up in SW as 1x), will detail student to run experiment tonight. Don't have a 100 count new encoder wheel around; not even sure if they make one small enough to go on the backshaft of a BaneBots...

is OPB625 reflective? looks transmissive to me. Was considering Optek 720s...

I'm seeing if we can find the parts to do a homebuilt Hall Effect on perf board tonight; just want to cobble something together so that programmers can get their feedback loop working, then take the time to determine what's reliable and swap it out closer to bag day. Will post what we do for interim, and what we end up with.

Programming is easy. Sensors are hard

Last edited by fovea1959 : 29-01-2013 at 11:25.
  #9   Spotlight this post!  
Unread 29-01-2013, 11:21
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,125
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: Measuring motor speed

Quote:
Originally Posted by fovea1959 View Post
A 10000 rpm shaft on a 250 pulse /rev encoder is over 40000 pulses/s; depending on what numbers you believe, that's close to what the FPGA can handle.
AIUI, the 250 CPR encoder has 500 edge transitions (rising+falling) per channel per rev. At 10,000 RPM, that would be 10,000/60*500 = 83,333 edges/sec which is acceptable because the FPGA polls each channel for edges at 153KHz.

If you do decide to use a 250 CPR encoder at 10,000 RPM to measure shooter wheel speed, you don't need both channels since you'll always be going in the same direction.

You can use the Counter class with only one channel of the encoder.

If you use the GetPeriod() method of the Counter class, you will get up to roughly 2770 RPM peak-to-peak jitter due to the 153KHz FPGA polling rate if you don't use the FPGA's built-in averaging capability.

In C++ or Java WPILib, you can make a small modification to counter.cpp (or counter.java) to tell the FPGA to return the elapsed time between the most recent N+1 rising edges (N<127), and WPILib will divide that by N, effectively averaging. If you set N to 125 for example, you'll be averaging over half a revolution and should get a nice clean signal with jitter roughly 22 RPM p-p.

Note that the 250 CPR E4P has a max speed of 14,400 RPM due to its 60kHz maximum count frequency (per page 3 of the datasheet).



Last edited by Ether : 29-01-2013 at 11:29.
  #10   Spotlight this post!  
Unread 29-01-2013, 11:27
pfreivald's Avatar
pfreivald pfreivald is offline
Registered User
AKA: Patrick Freivald
FRC #1551 (The Grapes of Wrath)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2001
Location: Naples, NY
Posts: 2,304
pfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond repute
Re: Measuring motor speed

We tried using this optical sensor yesterday with a half-black, half-white wheel, and found that it didn't seem to refresh fast enough at frisbee-shooting speeds. (This is what was reported to me -- I wasn't there).

Does this seem like a legitimate problem for this sensor? And how would I go about determining whether or not any given sensor is suitable for these kinds of rates?

Thanks!
__________________
Patrick Freivald -- Mentor
Team 1551
"The Grapes of Wrath"
Bausch & Lomb, PTC Corporation, and Naples High School

I write books, too!
  #11   Spotlight this post!  
Unread 29-01-2013, 11:48
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,901
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: Measuring motor speed

The responses time for that photo sensor is .5ms to 1ms depending on model, so calculate how fast your wheel changes states.
and make sure to power them off the solenoid bumper running fromn the protected 24v source, otherwise normal robot power dips will make them inoperable or flakey at best.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
  #12   Spotlight this post!  
Unread 29-01-2013, 12:11
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,125
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: Measuring motor speed

Quote:
Originally Posted by pfreivald View Post
We tried using this optical sensor yesterday with a half-black, half-white wheel, and found that it didn't seem to refresh fast enough at frisbee-shooting speeds. (This is what was reported to me -- I wasn't there).

Does this seem like a legitimate problem for this sensor? And how would I go about determining whether or not any given sensor is suitable for these kinds of rates?
This should work fine if you decode the signal the right way.

There are two different methods commonly used in FRC for decoding sensor pulses into RPM. Each has advantages and disadvantages.


Method1

Divide the pulse count by the elapsed time and convert to RPM


Method2

Measure the elapsed time between pulse counts and convert to RPM.


If you are using a low pulse-per-rev sensor (like you described above), you should used Method2. If you use Method1 you'll get a very noisy signal (lots of jitter).

For example, let's say your wheel speed is 5000 RPM and you are using Method1, and you are reading speed samples at 20ms (TeleOp speed).

At 20ms (50Hz), you'll sometimes get 2 pulse counts and sometimes only 1. So sometimes you'll read 6000 RPM and sometimes you'll read 3000 RPM, when your true speed is actually 5000 RPM. That's a lot of noise.

But if you use Method2 you can get a good signal. Use the GetPeriod() method of the Counter class. This will return the elapsed time between the most recent 2 pulses. This will give you a jitter of roughly 3 RPM. Much better.


  #13   Spotlight this post!  
Unread 29-01-2013, 12:26
pfreivald's Avatar
pfreivald pfreivald is offline
Registered User
AKA: Patrick Freivald
FRC #1551 (The Grapes of Wrath)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2001
Location: Naples, NY
Posts: 2,304
pfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond repute
Re: Measuring motor speed

Excellent, thanks!
__________________
Patrick Freivald -- Mentor
Team 1551
"The Grapes of Wrath"
Bausch & Lomb, PTC Corporation, and Naples High School

I write books, too!
  #14   Spotlight this post!  
Unread 29-01-2013, 12:47
Alchemy99's Avatar
Alchemy99 Alchemy99 is offline
Registered User
AKA: Josh Cote
FRC #3141 (Team Alchemy)
Team Role: Leadership
 
Join Date: Jun 2009
Rookie Year: 2007
Location: Torrington, CT
Posts: 29
Alchemy99 is an unknown quantity at this point
Send a message via AIM to Alchemy99 Send a message via Yahoo to Alchemy99
Re: Measuring motor speed

Why not just gear the encoder down... the shooter is spinning at 20k, gear it so the encoder is spinning at 5k. 4:1 ratio.
__________________
  #15   Spotlight this post!  
Unread 29-01-2013, 12:53
protoserge's Avatar
protoserge protoserge is offline
CAD, machining, circuits, fun!
AKA: Some call me... Tim?
FRC #0365 (MOE) & former 836 Mentor)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2002
Location: Wilmington, DE
Posts: 754
protoserge has a reputation beyond reputeprotoserge has a reputation beyond reputeprotoserge has a reputation beyond reputeprotoserge has a reputation beyond reputeprotoserge has a reputation beyond reputeprotoserge has a reputation beyond reputeprotoserge has a reputation beyond reputeprotoserge has a reputation beyond reputeprotoserge has a reputation beyond reputeprotoserge has a reputation beyond reputeprotoserge has a reputation beyond repute
Re: Measuring motor speed

Here's a relevant thread that discusses the Hall Effect solution.

http://www.chiefdelphi.com/forums/sh...d.php?t=111375 (the big quote in post 2, picture in post #5)
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 15:33.

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