JordyR96
Posts: 11
Joined: Thu May 01, 2014 12:28 pm

realy need help with RPM counter

Thu May 01, 2014 1:46 pm

hi,

i'm a student, i builde a radiale air engine as project. but i have a raspberry pi, so i want to use the raspberry as rpm counter.

can someone program a rpm counter for me on idle? or something else.


pls i realy need help
Last edited by JordyR96 on Fri May 02, 2014 12:02 pm, edited 1 time in total.

User avatar
joan
Posts: 14838
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: realy need help with RPM counter

Thu May 01, 2014 2:19 pm

The software will be trivial.

Do you have a method for measuring the RPM at the moment, e.g. can you send an electrical pulse for every revolution?

JordyR96
Posts: 11
Joined: Thu May 01, 2014 12:28 pm

Re: realy need help with RPM counter

Thu May 01, 2014 4:08 pm

i tought about a infra-red censor that detects my flywheel of my compresed air engine.

so if the raspberry detect pulses and count them on timeperiods. it would be posible to calculate the speed in km/h

thats my theorie what is yours. i can buy stuf like that in local stores.

thanx for helping me anyway

User avatar
joan
Posts: 14838
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: realy need help with RPM counter

Thu May 01, 2014 4:34 pm

Another method I've seen is a Hall effect sensor at a fixed position triggered by a magnet rotating on a shaft.

How many RPM do you expect?

Can the Raspberry Pi be located close to the motor?

Is the environment hostile?

Tarcas
Posts: 741
Joined: Thu Jan 09, 2014 5:38 am
Location: USA

Re: realy need help with RPM counter

Thu May 01, 2014 7:37 pm

The Hall Effect Sensor that Joan mentioned was my first thought.
My second thought is an optical sensor. Either a slotted sensor or a reflective sensor could work, depending on your setup.

To use the slotted, you'd pass something that blocks the light between the two sides, and count the number of times the beam is blocked in a given time period.
To use the reflective, you'd pass a dark or light spot in front of it, and count the number of times that the reflectivity changes in a given time period.
The hall effect sensor works the same way in effect, but with the south pole of a magnet moving past it instead of a beam of light being reflected or interrupted.

JordyR96
Posts: 11
Joined: Thu May 01, 2014 12:28 pm

Re: realy need help with RPM counter

Thu May 01, 2014 7:43 pm

i don't have the brains for it.

i"m making this air engine: https://www.youtube.com/watch?v=vcaFWg-FvbQ

i think it goes at least 400 rpm

I HOPE SOMEONE CAN GIVE ME AN SOLUTION: IS IT POSIBLE TO SEND AN LITLE PROGRAM AND A WAY TO DO THE SECUIRD BORD FOR THE SENCOR?

THAT WOULD BE GREAT :)

Tarcas
Posts: 741
Joined: Thu Jan 09, 2014 5:38 am
Location: USA

Re: realy need help with RPM counter

Thu May 01, 2014 11:30 pm

i don't have the brains for it.
No, you just haven't learned yet. If you set your mind to it and understand that it's not a 1-day project, you can comprehend. Break it down into little parts. Start by reading a button instead of a complex sensor if you haven't already done that. Go find a tutorial on GPIO first, and get up to speed with that.
Helpful, and interesting. There would be several ways to measure the speed of that. Probably the reflective optical sensor that I mentioned earlier would be best. Paint half the wheel black and the other half white or silver (test both colors with the sensor first) and count how many times it changes.
i think it goes at least 400 rpm
400 RPM = 6.67 rotations per second. I'm pretty certain that the Pi can be fast enough to read the GPIO fast enough to make sense of that, as long as you're doing it in C or Python and not a shell script. Does anyone have a benchmark on GPIO reads per second?
I HOPE SOMEONE CAN GIVE ME AN SOLUTION:
We can help. We might even be able to do that with enough information and help from you. However, we're not your personal problem solving team and if you keep typing at us in all caps, you're likely to get ignored by most people on here.
IS IT POSIBLE TO SEND AN LITLE PROGRAM
A program can be written, but it needs the hardware to interface with in order to read the speed of the wheel. Without the hardware to read it, no program will give you a meaningful output. Let's get that solved first.
A WAY TO DO THE SECUIRD BORD FOR THE SENCOR?
I have no idea what this means. Try again, and use mostly lowercase letters, please. ;)

User avatar
FLYFISH TECHNOLOGIES
Posts: 1750
Joined: Thu Oct 03, 2013 7:48 am
Location: Ljubljana, Slovenia
Contact: Website

Re: realy need help with RPM counter

Thu May 01, 2014 11:47 pm

Hi,
JordyR96 wrote:i"m making this air engine
I'd also vote as light reflexion measuring method. The sensor (take it as a first approximation) could be something like this http://uk.farnell.com/jsp/search/browse ... allpartial

After watching the video, my first thought was that RasPi is a bit overpowered if displaying RPMs is its one and only task...


Best wishes, Ivan Zilic.

[EDITED URL LINK]
Last edited by FLYFISH TECHNOLOGIES on Fri May 02, 2014 1:46 am, edited 1 time in total.
Running out of GPIO pins and/or need to read analog values?
Solution: http://www.flyfish-tech.com/FF32

User avatar
joan
Posts: 14838
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: realy need help with RPM counter

Fri May 02, 2014 12:25 am

Tarcas wrote: ...
400 RPM = 6.67 rotations per second. I'm pretty certain that the Pi can be fast enough to read the GPIO fast enough to make sense of that, as long as you're doing it in C or Python and not a shell script. Does anyone have a benchmark on GPIO reads per second?
...
I did some tests with the pigpio Python module and got circa 9000 state changes per second with Python running locally and circa 100K state changes per second if Python was running over a network to the Pi.

End of http://www.raspberrypi.org/forums/viewt ... 36#p486959

Tarcas
Posts: 741
Joined: Thu Jan 09, 2014 5:38 am
Location: USA

Re: realy need help with RPM counter

Fri May 02, 2014 1:04 am

FLYFISH TECHNOLOGIES wrote:Hi,
JordyR96 wrote:i"m making this air engine
I'd also vote as light reflexion measuring method. The sensor (take it as a first approximation) could be something like this http://si.farnell.com/optek-technology/ ... lective/dp

After watching the video, my first thought was that RasPi is a bit overpowered if displaying RPMs is its one and only task...


Best wishes, Ivan Zilic.
FYI: Your link is broken.
I posted one up above to an Ebay auction for one, just as a reference. (I won't recommend it or any other in particular, as I haven't used this type of sensor and therefore have no firsthand experience.)

User avatar
FLYFISH TECHNOLOGIES
Posts: 1750
Joined: Thu Oct 03, 2013 7:48 am
Location: Ljubljana, Slovenia
Contact: Website

Re: realy need help with RPM counter

Fri May 02, 2014 1:50 am

Hi,
Tarcas wrote:FYI: Your link is broken.
Thanks, updated... hopefully, that one works and is not glued to the session.


Best wishes, Ivan Zilic.
Running out of GPIO pins and/or need to read analog values?
Solution: http://www.flyfish-tech.com/FF32

Tarcas
Posts: 741
Joined: Thu Jan 09, 2014 5:38 am
Location: USA

Re: realy need help with RPM counter

Fri May 02, 2014 4:41 am

FLYFISH TECHNOLOGIES wrote:Hi,
Tarcas wrote:FYI: Your link is broken.
Thanks, updated... hopefully, that one works and is not glued to the session.


Best wishes, Ivan Zilic.
The link works now, but it's to search results. If you meant to point him to a particular one, you might have to name it.

JordyR96
Posts: 11
Joined: Thu May 01, 2014 12:28 pm

Re: realy need help with RPM counter

Fri May 02, 2014 12:02 pm

Tarcas,

at the moment am i capabele to do some little programing.
i tryed to make this program : https://www.youtube.com/watch?v=ZpkI2JGdtAA

i would use that pushbuton as my "pulse" to try it out. i understand how the GPIO works, but to count my pulses and recalculate them to rpm is a mystery for me.

User avatar
FLYFISH TECHNOLOGIES
Posts: 1750
Joined: Thu Oct 03, 2013 7:48 am
Location: Ljubljana, Slovenia
Contact: Website

Re: realy need help with RPM counter

Fri May 02, 2014 1:38 pm

Hi,
Tarcas wrote:
FLYFISH TECHNOLOGIES wrote:Hi,
Tarcas wrote:FYI: Your link is broken.
Thanks, updated... hopefully, that one works and is not glued to the session.
The link works now, but it's to search results. If you meant to point him to a particular one, you might have to name it.
The number of results is minor... therefore, (hopefully), this will force JordyR96 to browse through them, to compare their properties, etc.
I'm aware that he is currently searching for "tell me exactly what steps do I need to follow", but (sooner or later) he will find out that "one size fits all" solution does not exist in his case.


Best wishes, Ivan Zilic.
Running out of GPIO pins and/or need to read analog values?
Solution: http://www.flyfish-tech.com/FF32

User avatar
JRV
Posts: 270
Joined: Mon Apr 02, 2012 1:39 pm
Location: Minneapolis, MN

Re: realy need help with RPM counter

Fri May 02, 2014 4:25 pm


JordyR96
Posts: 11
Joined: Thu May 01, 2014 12:28 pm

Re: realy need help with RPM counter

Fri May 02, 2014 4:44 pm

JRV,

you use c++ but i don't have that on my raspberry

so i think it won't work because of the lange diffrence

Tarcas
Posts: 741
Joined: Thu Jan 09, 2014 5:38 am
Location: USA

Re: realy need help with RPM counter

Fri May 02, 2014 4:55 pm

JordyR96 wrote:Tarcas,

at the moment am i capabele to do some little programing.
i tryed to make this program : https://www.youtube.com/watch?v=ZpkI2JGdtAA

i would use that pushbuton as my "pulse" to try it out. i understand how the GPIO works, but to count my pulses and recalculate them to rpm is a mystery for me.
What you'll be doing is one of two things:
1) Count the number of pulses for one second. This is your rotations per second. Multiply that number by 60 to convert to rotations per minute.
2) Alternately, you can time one rotation and take the inverse of that to convert minutes/rotation to rotations/minute.

Make sense?

JordyR96
Posts: 11
Joined: Thu May 01, 2014 12:28 pm

Re: realy need help with RPM counter

Fri May 02, 2014 5:41 pm

option one wil work fine.
how would my program look like?



import RPi.GPIO as gpio

gpio.setmode(gpio.BCM)

#i need only one input

gpio.setup(17, gpio.IN)

while True:

gpio.counter(17)*60???????????????????????????????????
????????????????????????????????????

User avatar
FLYFISH TECHNOLOGIES
Posts: 1750
Joined: Thu Oct 03, 2013 7:48 am
Location: Ljubljana, Slovenia
Contact: Website

Re: realy need help with RPM counter

Fri May 02, 2014 7:13 pm

Hi,
JordyR96 wrote:how would my program look like?
You need to stay in the loop for 1 second (**see below) and during this time you count number of input signal changes.
The number of revolutions per second equals to count/2.

There is no need to count exactly 1 second. If you don't have stable RPMs, your time period could be shorter and you get also additional dynamic data. However, if your rotation speeds are very unstable, then it is better to frequently measure time of one rotation instead.
On the other hand, counting revolutions on system with 400RPMs can be more reliable if your counting period is longer than 1 second.


P.S. Since your project contains also hardware, you should not expect that the forum will be able to give you all answers also when various specific issues pop up. This might sound very pessimistic statement, but I'd expect that chances that you make this done with your current approach are far below 50%. The reason is that you're not asking questions to understand the subject, but to make something done (what you cannot even define in details).


Best wishes, Ivan Zilic.
Running out of GPIO pins and/or need to read analog values?
Solution: http://www.flyfish-tech.com/FF32

JordyR96
Posts: 11
Joined: Thu May 01, 2014 12:28 pm

Re: realy need help with RPM counter

Fri May 02, 2014 7:26 pm

but what for cammands do i need to type?

while True:

?? i don't know the commands to count in one loop per second

User avatar
FLYFISH TECHNOLOGIES
Posts: 1750
Joined: Thu Oct 03, 2013 7:48 am
Location: Ljubljana, Slovenia
Contact: Website

Re: realy need help with RPM counter

Fri May 02, 2014 7:36 pm

Hi,
JordyR96 wrote:but what for cammands do i need to type?
https://www.google.com/search?q=python%20loop%20timeout


Best wishes, Ivan Zilic.
Running out of GPIO pins and/or need to read analog values?
Solution: http://www.flyfish-tech.com/FF32

JordyR96
Posts: 11
Joined: Thu May 01, 2014 12:28 pm

Re: realy need help with RPM counter

Fri May 02, 2014 10:44 pm

that link looks promesing

i wil try to make a counter and show it to all of you. maybe i need to change it

JordyR96
Posts: 11
Joined: Thu May 01, 2014 12:28 pm

Re: realy need help with RPM counter

Fri May 02, 2014 10:57 pm

i got a question?

on the link they show me timers that can stop and restart OK

but how can i count pulses? and how can i bring does 2 things in one working program?

User avatar
FLYFISH TECHNOLOGIES
Posts: 1750
Joined: Thu Oct 03, 2013 7:48 am
Location: Ljubljana, Slovenia
Contact: Website

Re: realy need help with RPM counter

Fri May 02, 2014 11:19 pm

Hi,
JordyR96 wrote:but how can i count pulses?
Try to think:
- if the loop takes some time, and
- you would like to perform counting within this time interval,
... then... you perform counting activity inside this loop.

Counting is implemented by incrementing a value when the event occurs... so, you need to check first if the event has occurred - if yes, a condition to increment the value is met.

What you need also to do is to:
- initialize the counter value to 0 before entering the loop (good practice & the code is more readable)
- save/display/recalculate/... the value after exiting the loop.


Best wishes, Ivan Zilic.
Running out of GPIO pins and/or need to read analog values?
Solution: http://www.flyfish-tech.com/FF32

JordyR96
Posts: 11
Joined: Thu May 01, 2014 12:28 pm

Re: realy need help with RPM counter

Sun May 04, 2014 2:02 pm

i think it's imposible for me to program a RPM counter for now.

i like the raspberry pi, but i'm not able to understand it in 1 week time.
i tried to make a simple button that light's up a single led, but it failed.

i thought it would be easier to make i little program. :(

Return to “Advanced users”