rev counter

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
siliconchip
Posts: 392
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 101 times
Been thanked: 24 times
Contact:

rev counter

Post by siliconchip »

hi all is it possible to build a rev counter using a pic and lcd as a display, has anyone attempted this in the past, I would appreciate some advice and be pointed in the right direction to attempt this,

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: rev counter

Post by kersing »

Have you tried to search the forums? There are several messages concerning this subject. Search for 'rev counter' or 'rpm'...
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

brandonb
Posts: 438
Joined: Mon Aug 29, 2011 12:26 am
Location: arizona
Has thanked: 175 times
Been thanked: 173 times
Contact:

Re: rev counter

Post by brandonb »

input the amount of teeth on tone wheel at the top

Code: Select all

//------------------------------------------------------------------
// #define crank 120
// #define cam   60
tonewheel = 1 //number of teeth on tone wheel
then type in if its cam or crank driven here

Code: Select all

count = (100000 / count) * crank //tachometer calculation
cam is a constant =60
crank is a constant=120
it works by measuring the amount of time in 10u/s increments for a rotation
Attachments
TACHOMETER.fcf
(14.75 KiB) Downloaded 383 times

siliconchip
Posts: 392
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 101 times
Been thanked: 24 times
Contact:

Re: rev counter

Post by siliconchip »

hi forgot to point out that the rev counter would be for a 50cc 2 stroke

brandonb
Posts: 438
Joined: Mon Aug 29, 2011 12:26 am
Location: arizona
Has thanked: 175 times
Been thanked: 173 times
Contact:

Re: rev counter

Post by brandonb »

i rigged it up for lcd, the digits change for the position as it should be, *** i had to add variable rpm and its a float to increase resolution as it should
it doesn't matter as a two stroke because the crank is still gonna be whats measured, inthis case your gonna get a firing for each cylinder every crank rotation instead of cam rotation
is your rpm higher than 10,000? and how many pulses? how are you implimenting the circuitry?
Attachments
TACHOMETER fixed with lcd.fcf
(23.56 KiB) Downloaded 401 times

brandonb
Posts: 438
Joined: Mon Aug 29, 2011 12:26 am
Location: arizona
Has thanked: 175 times
Been thanked: 173 times
Contact:

Re: rev counter

Post by brandonb »

i was playing around with accuracy and wanted to add this one so you can play with this in the simi or on hardware with your signal generator, in this flowchart its currently set up for 8 pulse crank wheel,
on the bottom line it shows the counts of the tmr for one rotation of (cam or crank) which ever you selected
the math---> rpm = (100,000 / number it shows)*120 for crank or 60 for cam
you'll see that the resolution and update speed is very good! keep in mind that it does hog up the processing power with the 100k interrupt
TACHOMETER with counts.fcf
(24.79 KiB) Downloaded 426 times

siliconchip
Posts: 392
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 101 times
Been thanked: 24 times
Contact:

Re: rev counter

Post by siliconchip »

hi the red line is 10500 rpm, not sure how to implement it yet was thinking of trying to attatch some thing to the HT lead to trigger the circuit rather like when you connect a strobe light to check your timing

brandonb
Posts: 438
Joined: Mon Aug 29, 2011 12:26 am
Location: arizona
Has thanked: 175 times
Been thanked: 173 times
Contact:

Re: rev counter

Post by brandonb »

thinking of trying to attatch some thing to the HT lead to trigger the circuit rather like when you connect a strobe light to check your timing
no don't do that, i created a neat injector stobe light thingy about 5years ago with a ignition timing light http://www.youtube.com/watch?v=8JxgWZWyLyQ but the point is it takes minimum 66volts kickback to get the timing light to flash!!!, i would imagine this would kill the pic directly, i would try using a npn darlington transistor hooked to a pnp transistor to safely do it.... darlington will trigger off of ignition wire and pnp will flip the signal, on the pnp base you will need a 1K pull down to get a square wave coming out of it

siliconchip
Posts: 392
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 101 times
Been thanked: 24 times
Contact:

Re: rev counter

Post by siliconchip »

do you mean the single ignition wire on the primary side of the ignition coil that comes from the CDI module

brandonb
Posts: 438
Joined: Mon Aug 29, 2011 12:26 am
Location: arizona
Has thanked: 175 times
Been thanked: 173 times
Contact:

Re: rev counter

Post by brandonb »

do you mean the single ignition wire on the primary side of the ignition coil that comes from the CDI module
i thought you men't secondary, does it have electronic ignition or points, the way i designed the rpm deal is that it hooks to a hall effect sensor or can make a circuit to hook to a variable reluctance sensor, i'm sure there is someway to make it work

siliconchip
Posts: 392
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 101 times
Been thanked: 24 times
Contact:

Re: rev counter

Post by siliconchip »

hi I have electronic ignition with one wire coming from this to the primary side of the ignition coil , one idea I have is to use some sort of PIR sensor monitoring the flywheel ? if I put a reflective marker on the flywheel at say a point when the piston is top dead center this could count the revolutions but its from here im at a standstill as to get this to some sort of code in the pic :oops:

brandonb
Posts: 438
Joined: Mon Aug 29, 2011 12:26 am
Location: arizona
Has thanked: 175 times
Been thanked: 173 times
Contact:

Re: rev counter

Post by brandonb »

if I put a reflective marker on the flywheel at say a point when the piston is top dead center this could count the revolutions but its from here im at a standstill as to get this to some sort of code in the pic
no worries, the code that i posted for second flowchart can do any combo of trigger for a engine, you tell it "cam" or "crank" then tell it how many pulses you have on your tonewheel, in this case how many peices of tape and it does the rest because it works on counting the time it takes in 10u/s increments to pass the number you selected for teeth plus 1.... check it out here is the full version that you can set all parameters on http://www.youtube.com/watch?v=BAEJS0CZ5IE

siliconchip
Posts: 392
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 101 times
Been thanked: 24 times
Contact:

Re: rev counter

Post by siliconchip »

thanks brandonb much appreciated I now have something to go on many thanks

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: rev counter

Post by medelec35 »

I just had a thought:

Can a single wire be wrapped around the HT lead.
This wire can then go to an i/p of Microcontroller.
You may need to experiment with a high value pulldown resistor, and you may even require a 5V zener between the ADCi/p and GND for addition protection as I do not know what the voltage will be induced, but it use to be done this way with transistors years ago.

Not sure it it will work or not its only theory.
Martin

siliconchip
Posts: 392
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 101 times
Been thanked: 24 times
Contact:

Re: rev counter

Post by siliconchip »

hi martin on that note do you see a possible problem with PIR sensors near the fly wheel, the biggest problem I could see with this is heat on the PIRs as it does get very hot in this area, any input would be appreciated

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: rev counter

Post by kersing »

PIR as in passive infra red detector? Those work by detecting temperature changes, so reflective tape will not be detected. Also most sensors divide their view window into some sort of grid and require at least two cells next to each other to have a difference to prevent false triggers.
Using a led and a photo detector might be better. (check http://stab-iitb.org/wiki/Contactless_Tachometer for an example circuit)
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: rev counter

Post by medelec35 »

I would agree with kersing,
I don't believe PIR is way to go.

Either what I said or LED transmitter and receiver all in one like this:
http://uk.rs-online.com/web/p/photoelec ... s/6165709/
Or hall effect transistor and magnet.
You can get stick on flat magnets not much different than sticking on tape.

Martin
Martin

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: rev counter

Post by medelec35 »

Hi I have been asked to post this on behalf of Steve001 since he can't post in V5 section:
Steve001 wrote:Hi Martin,

Could you please post this for me ?

http://www.kasensors.co.uk/

They make all sorts of sensors for motorsports they list a high speed hall effect crank sensor
Don't know of the price range though

Steve
Martin

siliconchip
Posts: 392
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 101 times
Been thanked: 24 times
Contact:

Re: rev counter

Post by siliconchip »

after looking at the ignition system on the bike I have a sensor behind the flywheel which when the magnet passes over it induces a voltage that is then used to trigger the cdi (capacitor discharge ignition) any thoughts whether this signal could be used to trigger the second flow chart from brandonb on this thread ????

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 474 times
Been thanked: 458 times
Contact:

Re: rev counter

Post by dazz »

Hi Silicon chip
What bike is it??
different bikes use different types of sensing depending on age

Regards
Dazz
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

siliconchip
Posts: 392
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 101 times
Been thanked: 24 times
Contact:

Re: rev counter

Post by siliconchip »

the bike is a Honda MT50 from 1986 vintage

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 474 times
Been thanked: 458 times
Contact:

Re: rev counter

Post by dazz »

HI
Changed post as i was thinking of an earlier model, blue/yellow should be your pick up wire so try measuring the outputs with a multimeter,(high voltage ac first, don't disconnect pulse coil put meter lead into connector block, check voltage as you kick it over , if low voltage try checking whether its ac or dc, i would probably use an opto isolator and use that as a trigger to a rev counter, )as i think yours is the self generating CDI system , i used to have all the test data for bike pickups but i can't find any of it grrrrr
Regards
Dazz
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

Post Reply