Tacho!

For general Flowcode discussion that does not belong in the other sections.
jgu1
Posts: 813
http://meble-kuchenne.info.pl
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 696 times
Been thanked: 183 times

Flowcode v10 Tacho!

Post by jgu1 »

Hi all!

I am trying to make a tachometer. one pulse per revolution.

I manage to get it work. I am using pin Interrrupt to count the puls, and at timer interrupt to reset the counter. I have to multiply with 60 to get the readout pr/min. But of course then I get the step in 60 :(

Is there a better, correct way to make a tachometer or the calculation on. maybe using some of the timecounter or?

Help will be very grateful without to many C progamming instruction :lol: , please

Thank´s in advance

Br Jorgen
Attachments
Tacho_test.fcfx
(17.94 KiB) Downloaded 322 times

medelec35
Matrix Staff
Posts: 2086
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 644 times
Been thanked: 702 times

Re: Tacho!

Post by medelec35 »

Hi Jorgen.
What about using the timer component to time how long it takes from one pulse to the next, then calculate RPM from the time duration?

The other way is to start a timer, count pulses for say 10 seconds then x 6?
Martin

jgu1
Posts: 813
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 696 times
Been thanked: 183 times

Re: Tacho!

Post by jgu1 »

Hi Martin!

Thank you!

"What about using the timer component to time how long it takes from one pulse to the next, then calculate RPM from the time duration?!

I've thought about it Martin, but I can't really figure out how to do it, maybe you could give an example? ;)

"The other way is to start a timer, count pulses for say 10 seconds then x 6?" Yes, but then it will take 10 second before readout.

Jorgen

jgu1
Posts: 813
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 696 times
Been thanked: 183 times

Re: Tacho!

Post by jgu1 »

Now I found the rigth timer component and I see your idea, I try to make a new program using the timercomponent. Do you recommend to use pin Interrupt and measure the time in the macro for interrupt?

Hope you will help if I get "stock" :D

You hear

Jorgen

jgu1
Posts: 813
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 696 times
Been thanked: 183 times

Re: Tacho!

Post by jgu1 »

Hi again!

I try to create a tacho with the timercomponent. The timer work fine. I am measuring the ON time of the puls, so that mean the longer the puls is (the higher the rpm is) the counter count longer for longer time, the measured time should be inverted. :D

50hZ = Rpm 3000 Wondering is it because I use a frequency generator?
How is the calculation for the rpm?

Please Martin, what am I doing wrong :)

Thank´s in advance

Jorgen
Attachments
Rpm counter.fcfx
(16.81 KiB) Downloaded 331 times

medelec35
Matrix Staff
Posts: 2086
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 644 times
Been thanked: 702 times

Re: Tacho!

Post by medelec35 »

Hi Jorgen.
There are 60000 ms to 1 minute
Therefore, I believe RPM = 60000/time(ms) for 1 revolution.
That is assuming there is only 1 magnet triggering the hall sensor.
Martin

jgu1
Posts: 813
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 696 times
Been thanked: 183 times

Re: Tacho!

Post by jgu1 »

Hi again!

Again many thank´s. it work with your calculation Martin, but now the step in Rpm is 157 :roll:

If you are busy, don´t spend more time on this, then I have to use my own examble it has only step in 60.

Br Jorgen
Attachments
Rpm counter.fcfx
(16.78 KiB) Downloaded 312 times

chipfryer27
Valued Contributor
Posts: 1685
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 374 times
Been thanked: 583 times

Re: Tacho!

Post by chipfryer27 »

Hi Jorgen

How are you actually detecting when a revolution starts and ends? Are you using optical or magnetic sensors? From your chart you count at the start of a revolution stopping once complete with your sensor "high" for the duration. Interested to know your methodolology.

When simulating, looking at your timer component it seems to be totalling pulses. In my test my first pulse (pushing and holding button) was 300mS in length which gives a result of 200 RPM. All good. My next pulse was 150mS in length which gave a RPM of 133 (incorrect) as this 150 was being added to the existing 300mS giving a total of 450mS. A 450mS pulse would equate to a RPM of 133.

Maybe I am missing something?

Regards

jgu1
Posts: 813
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 696 times
Been thanked: 183 times

Re: Tacho!

Post by jgu1 »

Hi Chipfreyer!

Thank´s for your interest ;)

First, in the beginnig I use my Signal generator, I know 50hZ * 60 = Rpm 3000, I also test with a optocoubler.

In my experiment my intention is that as long as input = 0 do nothing. When the input is high, start the millisecond counter and stop counter again when the input = 0. So measure the time while the puls is high. The value from the timer counter use this including Martin´s advice calculation RPM = 60000/counttime. Reset the display and write the new value.
It work, but changing 1 - 2 hz the, Rpm step with 157. And I think it is the calculation.
Hope it make sense :D **and any help or advice is very welcome.**
Edit. Just test again and now it has a strange behavior.

Glad if you can help

Br Jorgen
Attachments
Rpm counter.fcfx
(17.19 KiB) Downloaded 298 times

jgu1
Posts: 813
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 696 times
Been thanked: 183 times

Re: Tacho!

Post by jgu1 »

Hi again -chipfreyer!

Hereby the first attemp I mad. Here I using intterupt and it work perfekt apart from the step in Rpm is with 60. The calulation I use, multply with 60 så the step can go lower, maybe to 1. :)

Do you have any way to make calculation on, please.

Br Jorgen
Attachments
Tacho_test.fcfx
(17.95 KiB) Downloaded 312 times

Post Reply