Sign in

username:

password:



Not a member?

Search basicx



Search tips

Subscribe to basicx



basicx by Keywords

Accelerometer | ADC | ADXL | Adxl20 | AVR | BasicStamp | BX-35 | BX28 | BX35 | COM3 | Compiler | Downloader | EEPROM | Electromagnet | GetADC | GP2D1 | GPS | I2C | IDE | Keypad | LCD | LCD+ | MIDI | Motors | Multitasking | Netmedia | Networking | PCB | PID | PlaySound | PWM | Relays | RTC | Servo | ShiftOut | SitePlayer | SPI | Stack | Timer | USB

Ads

Discussion Groups

Discussion Groups | BasicX | Re: Re: RPM to BX24

Discussion forum for the BasicX family of microcontroller chips.

Re: RPM to BX24 - Tom Becker - Nov 21 13:29:00 2005


> What is the easiest way of reading tacho signals from a normal car?

If the vehicle is contemporary the tachometer data might already be
available: http://www.obd2crazy.com/techstd.html

Otherwise, conventionally, you can shape the ignition signal to produce
a fixed-width pulse of fixed amplitude. You can then do two things with
that, either integrate the pulses to yield an analog average voltage
that corresponds to engine speed, or digitally time and average the
period between pulses and invert that value to yield a pulse rate that
corresponds to engine speed. The former puts some burden on analog
hardware while the latter can be done in code.

A little Googling will find a number of practical implementations of
each method, or you can start with the Circuit Ideas link in the group:
http://groups.yahoo.com/group/basicx/links .

Tom





(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )


RPM to BX24 - Mikael Karstikko - Nov 21 16:15:00 2005

Hello !

What is the easiest way of reading tacho signals from a normal car ??

From the Distributor coil ??
How do I convert the signal into voltage or digital (SPI) ?




(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: RPM to BX24 - Don Kinzer - Nov 22 0:39:00 2005

--- In basicx@basi..., Mikael Karstikko <makarst@p...> wrote:
> What is the easiest way of reading tacho signals from a normal car?

Some electronic ignition distributers (e.g. GM HEI from 70s and 80s)
have a "Tach." output that is a nominal square wave at the ignition
frequency. Later vehicles that have OBDII have a tach signal
available as Tom mentioned.

When I built my diesel generator controller I added a magnetic
pickup that is positioned over the flywheel teeth. I amplify and
clip that signal to give me a square wave that is proportional to
the RPM (each tooth causes a pulse). In my controller, I did a
running average of the CountTransitions() result and computed RPM
from that.

You could add a frequency-to-voltage converter and then do an ADC on
that but I suspect that you'll get just as good a result counting
transitions over a fixed period.

Don
http://www.zbasic.net




(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: Re: RPM to BX24 - Mikael Karstikko - Nov 23 10:28:00 2005

Thanks Don !

I allready have build a rpm meter to a diesel car , using a hall sensor
to sense the gears but now I should move on to petrol cars ...
I used a F / V converter and ADC with the diesel , but Your idea with
the CountTransitions might well be easier and more cheap !

If I'm not wrong the ignitor gives GND on every spark .
If I hook up a opto isolator that outputs logic levels I should have the
CountTransitions function working ??

What do You suggest for a measuring period ??
Engines used are 4 or 5 or 6 cylinders ...
And also my program must loop 2-4 times / sec to refresh the lcd with
new values ...

I also use the RTC in my program , could I prevent it from resetting
with this code ?

Call gettime(hour, minute, second)
rpm = counttransitions(pinnumber, timetouse)
rpm = rpm \ 4 ' cylinder engine
second = second + timetouse
Call putime(hour, minute, second)

I'm I even close ?? :-)




(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: RPM to BX24 - Don Kinzer - Nov 23 12:41:00 2005

--- In basicx@basi..., Mikael Karstikko <makarst@p...> wrote:
> What do You suggest for a measuring period ??

The time for counting transitions depends on the range of RPM that
you want to measure, the number of cylinders, and whether they're
two- or four-cycle engines.

If the lowest RPM that you want to measure is, say, 600 RPM on a 4-
cylinder/4-stroke engine, you'll be measuring 600 * 4 / 2 pulses per
minute. That's 20 pulses per second.

On the other end of the spectrum, at 5000 RPM on a 6 cylinder, 4-
stroke engine you'll be seeing 250 pulses per second.

> I also use the RTC in my program, could I prevent it
> from resetting with this code ?

I assume that you're referring to the problem with the RTC losing
time with long periods for CountTransitions(). The code that you
suggested would partially correct it but there is still a chance
that you will miss a tick during the correction process.

One of the benefits of using the ZX-24 (see the link below) is that
its firmware tracks the "missed ticks" during long counting periods
and then automatically updates the RTC when it is finished. This is
done for all of the I/O functions that disable interrupts like
CountTransitions, PulseIn, PulseOut, FreqOut, PlaySound, and RCTime.

Don
http://www.zbasic.net




(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: RPM to BX24 - Don Kinzer - Nov 23 12:41:00 2005

--- In basicx@basi..., Mikael Karstikko <makarst@p...> wrote:
> What do You suggest for a measuring period ??

The time for counting transitions depends on the range of RPM that
you want to measure, the number of cylinders, and whether they\\\'re
two- or four-cycle engines.

If the lowest RPM that you want to measure is, say, 600 RPM on a 4-
cylinder/4-stroke engine, you\\\'ll be measuring 600 * 4 / 2 pulses per
minute. That\\\'s 20 pulses per second.

On the other end of the spectrum, at 5000 RPM on a 6 cylinder, 4-
stroke engine you\\\'ll be seeing 250 pulses per second.

> I also use the RTC in my program, could I prevent it
> from resetting with this code ?

I assume that you\\\'re referring to the problem with the RTC losing
time with long periods for CountTransitions(). The code that you
suggested would partially correct it but there is still a chance
that you will miss a tick during the correction process.

One of the benefits of using the ZX-24 (see the link below) is that
its firmware tracks the "missed ticks" during long counting periods
and then automatically updates the RTC when it is finished. This is
done for all of the I/O functions that disable interrupts like
CountTransitions, PulseIn, PulseOut, FreqOut, PlaySound, and RCTime.

Don
http://www.zbasic.net




(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: Re: RPM to BX24 - Mikael Karstikko - Nov 24 4:21:00 2005

Thanks again Don !

> >>The time for counting transitions depends on the range of RPM that
> >>you want to measure, the number of cylinders, and whether they're
> >>two- or four-cycle engines.
>
> >>If the lowest RPM that you want to measure is, say, 600 RPM on a 4-
> >>cylinder/4-stroke engine, you'll be measuring 600 * 4 / 2 pulses per
> >>minute. That's 20 pulses per second.
>
> >>On the other end of the spectrum, at 5000 RPM on a 6 cylinder, 4-
> >>stroke engine you'll be seeing 250 pulses per second.
>
Sorry , I ment 4 cycle , 4-6 cylinder car engines that are probably
supercharged , so they may rev up to 7000-8000 rpm ...
If I choose a sampling period of 100ms , would You concur that it would
be suffiecient to display rpm over the 500-8000rpm range with
an accuracy of say 50 or 100 rev/s ??

> >>> I also use the RTC in my program, could I prevent it
> >>> from resetting with this code ?
>
> >>I assume that you're referring to the problem with the RTC losing
> >>time with long periods for CountTransitions(). The code that you
> >>suggested would partially correct it but there is still a chance
> >>that you will miss a tick during the correction process.
>
> >>One of the benefits of using the ZX-24 (see the link below) is that
> >>its firmware tracks the "missed ticks" during long counting periods
> >>and then automatically updates the RTC when it is finished. This is
> >>done for all of the I/O functions that disable interrupts like
> >>CountTransitions, PulseIn, PulseOut, FreqOut, PlaySound, and RCTime.
>
Ok , I visited http://www.zbasic.net <http://www.zbasic.net>
It looked promising !
But how different is the programming language from BX-24's ???
Im just beginning to learn the BX-24 ,,, Could You describe the
differences in the laguage ??
And I'm running out of BX-24 - probably I must change all my BX-24 to
the newer BX-24p , Because in my project the chip will
be housen in a car , in Finland , that means temperatures down to
-40'c - I'm not shure how my old BX-24 will handle the coming winter ...
Anyway , Would You recommend these ZX-24 as a new replacment ??





(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: RPM to BX24 - Don Kinzer - Nov 24 14:14:00 2005

--- In basicx@basi..., Mikael Karstikko <makarst@p...> wrote:
>I meant 4 cycle, 4-6 cylinder car engines that are probably
> supercharged, so they may rev up to 7000-8000 rpm ...

Yes, not being normally aspirated makes a big difference.

> If I choose a sampling period of 100ms, would you concur that it
> would be sufficient to display rpm over the 500-8000 rpm range
> with an accuracy of say 50 or 100 rev/s??

I assume that you meant an accuracy of 50 to 100 rev/minute or RPM.

500 RPM on a 4 cylinder/4 cycle engine will produce 1000 pulses per
minute or 16.7 pulses per second. If you count transitions for only
100mS you'll see 3 or 4 transitions each time you count (assuming a
50% duty cycle waveform). If you employ a 10 sample moving average
the result could range from 30 to 40, yielding a calculated result
of 450 to 600 RPM.

You can do a similar analysis at the opposite end of the spectrum
where the resolution will be better.

> Could you describe the differences [between ZBasic and BasicX]?

ZBasic is a superset of BasicX. Any correct BasicX program should
compile with no errors and many programs (perhaps even most
programs) will run on the ZX-24 with no changes at all after
compiling. You can download the compiler/IDE or just the
documentation at the website.

Don




(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )