# How to make an RPM sensor..



## Tesseract (Sep 27, 2008)

skooler said:


> ....
> I have purchased a KFPS branded proximity sensor. Specsheet below.
> 
> http://ftp01.kfpssensor.com/DC3/TLX18P05E1.pdf


Firstly, the datasheet does not indicate if this prox is an inductive type (highly preferred) or a Hall effect type (much less preferred) or even a capacitive type (probably ok, but I've never tried it myself...). If it's an inductive prox then I would use a disc with two notches cut into it for targets.

Secondly, the schematic at the bottom of the datasheet shows an NPN output, but it's labeled as a PNP... So, you might have to try wiring the load resistor both ways. Wire up the sensor to the SJr and try a pullup resistor first - ie, a 1k resistor from TACH to S12V - then pass a piece of ferrous metal in front of the sensor while monitoring the voltage between TACH and SGND. If it does have an NPN output then the voltage will go to ~0V when the sensor sees the ferrous metal. If the voltage doesn't change then try moving the end of the resistor going to S12V over to SGND (ie - a pulldown). NB - to determine if the prox is an inductive or Hall effect type, use a piece of non-ferrous metal as the target after you have confirmed it works with ferrous metal. An inductive prox will sense the non-ferrous metal, a Hall effect prox won't.

Thirdly, note that this sensor has a maximum frequency response of 0.6kHz (600Hz). This shouldn't pose a problem as long as you use 4 targets or less.

Finally, the Soliton controllers need the pulses from the tach sensor to be at least 200us wide (whether starting from ~12V and dropping to 0V when the target approaches or vice versa) or the hardware filter/squaring circuit will ignore them. In other words, the sensor targets need to be a certain minimum width relative to the circumference of the circle they scribe as they rotate. For example, let's say you want to read up to 7200 rpm so you can effectively limit the motor to 6000 rpm (the controller needs to be able to read a higher rpm than the desired limit). If you make a disc out of aluminum and cut two notches in it for an inductive prox to sense, the notches need to be at least 1cm wide if the disc is 12cm in diameter. 

The math behind this is straightforward: the linear velocity on the surface of the disc is pi*d then multiply by RPM, divide by 60 to get the surface speed in cm (or inches) per second. Divide the width of the sensing target in cm (or inches) by the surface speed and the distance component cancels out, leaving you with the pulse width in seconds. Multiply that number by 10^3 to convert to milliseconds, or by 10^6 to convert to microseconds. The resulting pulse width must be comfortably larger than 200us at the highest RPM to be read.


----------



## skooler (Mar 26, 2011)

Tesseract said:


> Firstly, the datasheet does not indicate if this prox is an inductive type (highly preferred) or a Hall effect type (much less preferred) or even a capacitive type (probably ok, but I've never tried it myself...). If it's an inductive prox then I would use a disc with two notches cut into it for targets.
> 
> Secondly, the schematic at the bottom of the datasheet shows an NPN output, but it's labeled as a PNP... So, you might have to try wiring the load resistor both ways. Wire up the sensor to the SJr and try a pullup resistor first - ie, a 1k resistor from TACH to S12V - then pass a piece of ferrous metal in front of the sensor while monitoring the voltage between TACH and SGND. If it does have an NPN output then the voltage will go to ~0V when the sensor sees the ferrous metal. If the voltage doesn't change then try moving the end of the resistor going to S12V over to SGND (ie - a pulldown). NB - to determine if the prox is an inductive or Hall effect type, use a piece of non-ferrous metal as the target after you have confirmed it works with ferrous metal. An inductive prox will sense the non-ferrous metal, a Hall effect prox won't.
> 
> ...


WOW!!! that is the best reply I could have hoped for! Thanks Jeffrey

I made a start before reading you post. I have used bolts instead of notches but the princple is the same (I think!) I can always change it if needed.

It is an inductive sensor, well thats what I ordered! If its not then it will be going back!

I will also check he math when I'm with the part again, seems well above 200us in my head!

*Progress*

I was on the lookout for a non ferrous disc, I found an old gas regulator valve for an old welder, pulled it apart and found a perfect brass disc with 6 holes positioned around the outside.

As mentioned earlier my motor doesnt have a tailshaft but does have a threaded hole in the motor shaft.

To mount the disc I simply found a bolt which matched the motor thread, added a washer, inserted it through thhe brass piece, added a brass spacer, added another washer, put on some threadlock on and then a nut.





































I then cleaned up the shaft so everything was smooth.










Finally I added two bolts through the existing holes.



















EDIT:

and a picture of the pickup on the motor










I'll add pictures and a writup of the mounting for the proximity sensor tomorrow when I make it up in aluminium instead of cardboard!

Cheers,

Mike


----------



## piotrsko (Dec 9, 2007)

you may need to increase pulse width but that will be easy: either carriage bolts or washers under the head of the bolts.

Nice scrounge.


----------



## DIYguy (Sep 18, 2008)

Should work fine. A couple thoughts.... If the flange itself it not threaded (through-holes), then you may want to add lock washers to the sense bolts. If threaded, the nut is a secondary lock. . so, no need. 
Another thought, if you turned the sense bolts around to they pointed back towards the motor, you could tuck the prox closer to the motor so it doesn't stick out so far.


----------



## skooler (Mar 26, 2011)

Right.... update time...

I spent a couple of hours today making up a bracket to hold the sensor.

I originally planned in making it from aluminium but as soon as I bent it, it snapped (twice!). even with heating it. pictures below tell the story!




























Plan b was to use some steel strip bent to suit. I used 24x1mm strip.

This simply bolts to the existing holes in the motor.

I had access to a tool for bending strip metal, it has dies for various different angles and different radius curves.



















I then measured the that the target sticks out fro the motor, added a bit on for the sensor and bent the strip steel into shape.




























I then drilled a hole to cater for the sensor.










Stupidly, I forget to take a picture of it all on the motor!

I diddnt get chance to test what type it is. I'll have a look tomorrow.



Tesseract said:


> The math behind this is straightforward: the *linear velocity* on the surface of the disc is pi*d then multiply by RPM, divide by 60 to get the surface speed in cm (or inches) per second. Divide the width of the sensing target in cm (or inches) by the surface speed and the distance component cancels out, leaving you with the pulse width in seconds. Multiply that number by 10^3 to convert to milliseconds, or by 10^6 to convert to microseconds. The resulting pulse width must be comfortably larger than 200us at the highest RPM to be read.


Maths time...

Thanks Jeffrey, I'm a bit rusty with my maths so bear with me...

When you say linear velocity do you men the diameter between the targets, multiplying by PI to get the circumference?

It seems as though you are calculating the linear velocity in the first few steps..

Linear velocity being the distance a single point of an object would move at a certain speed (rotations) over a set amount of time (a minute). I Always remeber this as thinking how far a wheel would have rolled if it travelled for 1 minute at a certain RPM...

Anyway...


Distance between centre of targets is 58mm
Targets themselves are 6mm bolts so 6mm
Max speed is 7,200RPM
58mm * PI is 182.212mm

182.212mm * 7,200RPM = 1311926.4mm (~1.3KM travelled by the targets each minute)

1311926.4mm / 60 (seconds) is 21865.44mm (~21M travelled by the targets each second)

21865.44mm / 6mm (width of target) = 3644.24mm

I make that a 364 uS pulse width at 7,200 RPM, way above the 200 

Does somebody mind checking the math? (its great fun... I promise!)

piotrsko,

That was the idea of keeping it simple, a bigger nut on the thread makes for a bigger target!

DIYguy,

It's not threaded, I used threadlocker rather than lockwashers, I dont see there being any real load on the bolts so it should be more than adequate.

Unfortunately the sensor is quite long so it wouldnt really help. the space at the end of the motor wont be used for anything anyway as a crossmember sits just in front.


I'll post pictures and results up when I get chance to test everything.

Thanks for all the help.

Cheers,

Mike


----------



## Tesseract (Sep 27, 2008)

skooler said:


> ...
> Linear velocity being the distance a single point of an object would move at a certain speed (rotations) over a set amount of time (a minute). I Always remeber this as thinking how far a wheel would have rolled if it travelled for 1 minute at a certain RPM...


Correct, except remember has two m's and traveled has one l... 



skooler said:


> Anyway...
> 
> 
> Distance between centre of targets is 58mm
> ...


Oops... Nope. Here's the way I do it as it makes more sense to my electrically-oriented worldview:

Find circumference (mm): 58mm * 3.14 = 182mm
Find rotational frequency (Hz): 7200rpm / 60 = 120rps (same as Hz)
Find pulse width (seconds): 6mm / (182mm * 120Hz) = 0.000275s

Finally, I multiply pulse width by 10^6 to get the same result in microseconds: 275us

That's acceptable, though a bit too close to 200us for my preference. However, 7200 rpm also seems a bit high for the limiting RPM. Not sure how big your motor is, but 5500-6000 rpm is usually tops for a 9" diameter motor.


----------



## skooler (Mar 26, 2011)

Tesseract said:


> Correct, except remember has two m's and traveled has one l...
> 
> 
> 
> ...


Thanks again, 

Your mathematics of looks right to me, mine is wrong!

It makes a lot more sense to me starting in hertz / rotations per second than it does just dividing by 60!

I used 7200rpm from your earlier post as it needs to be able to read over the motor limit. I will set this limit to 4,500RPM for my 9” in the controllers configuration.

Once I receive my controller I'll see how it has worked, I assume logger will show me the rpm?

Cheers,

Mike


P.s. Apologies for the typos, using a tablet and I HATE touch screen keyboards!


----------



## piotrsko (Dec 9, 2007)

And some people wonder how _I_ broke 5 brackets.

yup logger gives you a real time window on your laptop with RPM.

BTW don't forget to disable the controller , AND calibrate the throttle before playing. A first time motor test of only 24 volts wouldn't hurt either.


----------



## gaminde (Sep 18, 2011)

some thoughts this is going to through the balance of the motor off there will be vibrations from it. Your pulses are going to be short using this type of sensor, a latching hall effect sensor could give better results, the pulse width could be equal time on and off.


----------



## gaminde (Sep 18, 2011)

also it senses iron 18mm x 18mm x 1mm
this is .708" x .708" x .039" 

this is about 3/4 of an inch square ??


----------



## gaminde (Sep 18, 2011)

Tesseract said:


> Firstly, the datasheet does not indicate if this prox is an inductive type (highly preferred) or a Hall effect type (much less preferred) or even a capacitive type (probably ok, but I've never tried it myself...). If it's an inductive prox then I would use a disc with two notches cut into it for targets.
> 
> Secondly, the schematic at the bottom of the datasheet shows an NPN output, but it's labeled as a PNP... So, you might have to try wiring the load resistor both ways. Wire up the sensor to the SJr and try a pullup resistor first - ie, a 1k resistor from TACH to S12V - then pass a piece of ferrous metal in front of the sensor while monitoring the voltage between TACH and SGND. If it does have an NPN output then the voltage will go to ~0V when the sensor sees the ferrous metal. If the voltage doesn't change then try moving the end of the resistor going to S12V over to SGND (ie - a pulldown). NB - to determine if the prox is an inductive or Hall effect type, use a piece of non-ferrous metal as the target after you have confirmed it works with ferrous metal. An inductive prox will sense the non-ferrous metal, a Hall effect prox won't.
> 
> ...


Im not exactly sure whats being said here but aluminum is not iron. and hall effect devices are used for most automotive applications.

look here for speed sensors http://gaminde.net


----------



## piotrsko (Dec 9, 2007)

FWIW, I found that when Tesseract says something about his controller, it is wise not to argue with him.


----------



## mk4gti (May 6, 2011)

Did you get a chance to test it?


----------



## skooler (Mar 26, 2011)

mk4gti said:


> Did you get a chance to test it?


Controller arrived yesterday so I've not had chance yet.

I'll post as soon as I've had a chance... Maybe tonight if not then tomorrow.

Cheers,

Mike


----------



## skooler (Mar 26, 2011)

Hi all,

It works perfectly!

I've been delayed by some pedal/tach issues but managed to get it all fired up and working today.

Simply wired it into the Soliton with a 1K (pullup) resistor between Signal and Positive. Fired it up and worked first time!

It shows 500 RPM on my 9" motor at full throttle with my test setup (a 12v starter battery!) logger showed 7v or 9v (cant remember) and ~40A. That seems about right to me 

The picture below shows the simplicity in wiring it up. The other end of this lead plugs directly into the sensor (see earlier pictures).

Nice and simple... thankyou evnetics!

Worth mentioning that the wiring below still needs to be tidied up!










Thanks everyone. If theres any questions or info I've missed then fire it at me!

Cheers

Mike


----------

