engine rev limit/shift light

Changster

New Member
Hi all,

Im building a small rev limit or shift light for my race car. I'm still trying to get my head round this programming although my electronic skills are good.

This is still work in progress but im stuck to add extra leds to the circuit in a progressive mode.

im using a 18m2 on my axe091 board.

my current code for one light:

main:
pulsin c.1,1,w1
if w1<450 then led
goto main

led:
high b.4
pause 100
low b.4
goto main


this puts the led on at around 115 hz but the lamp flickers as it comes on and i would like to add 2 or 3 extra leds to give a progressive light bar...

I cant think what other instructions i could use to perform this simple task, anyone got any ideas??
 

g6ejd

Senior Member
init:
low b.4
low b.5
low b.6

main:
pulsin c.1,1,w1 'measures time between a Rev
if w1<450 then led1 ' Light up 1st LED
if w1<400 then led2 ' Light up 2nd LED
if w1<350 then led3 ' Light up 3rd LED

if w1 > 450 then led1 ' Light off 1st LED
if w1 > 400 then led1 ' Light off 2nd LED
if w1 > 350 then led1 ' Light off 3rd LED
goto main

led1:
toggle b.4
goto main

led2:
toggle b.5
goto main

led3:
toggle b.6
goto main

If the light is flickering, then have you got some decoupling/smoothing capacitors across your power supply feed to the board and should adjacent to the PIC? Say both a 0.1uF and 100uF
 

hippy

Ex-Staff (retired)
this puts the led on at around 115 hz but the lamp flickers as it comes on
The problem there is you turn the LED on then off and it stays off while you take your next PULSIN reading. What you need is a mecahnism which turns the LED on when over 115Hz and turns it off when under 115 Hz ...

Pulsin ...
If w1 < 450 Then
High LED
Else
Low LED
End If
 

Goeytex

Senior Member
I did a Picaxe based Rev Limiter with a shift indicator lamp about 2 years ago. It works very well.

It was designed for single or twin cylinder engines and is has a programmable rev limit from 1000 rpm to 10,000 rpm with a resolution of about 50 rpm. There is also a shift / warning light output and a tachometer output compatible with inexpensive automotive type tachs.

Here are your choices.

1. Figure it out on your own as a learning experience ( 2 - 4 weeks or more)
2. I can provide schematics, & working code that you can use as is, or modify as you wish.

Let me know.

I will need to know the following

1. What kind of car ?
2 How many cylinders ?
3.What kind of ignition?
4. Fuel Injected or carburetor ?
4. Where are you reading the tach / ignition signal from ?
5. How do you plan to limit revs ?
A. Kill ignition ?
B. Limit fuel ?
C. Other ?
 
Last edited:

westaust55

Moderator
You can also consider the SELECT. . . CASE command structure as an alternative to IF . . . THEN.
See The PICAXE manual 2 (V7.7) page 203.
 

Adamey

Senior Member
SELECT CASE is what I would have used.

As Geoytex said, we really need to know the make/model of car. Depending on that, there are many options. Newer cars often have an RPM tach output from the ECU which is going to be a nice 0-5V (or similar) pulse train. If they use an external igniter, then you can use the signal the ECU sends to that as it will also be a 0-5V signal.

Otherwise you need to look at getting a signal from a coil or points and then you've got to consider how to condition the signal so you don't fry your PICAXE.
 

Changster

New Member
Thx for all your replies..

I'm using the ecu output from the ecu on a BMW compact 1.9 M44 race car so i have a nice 0-5V pulse to the original instrument cluster altho i will condition it with protection diodes and resistors etc.. it will be just used as a shift light where i will use it to indicate the top of the power curve (from dyno graph) so i can change gear at the most efficient point. The rev limit will be taken care of by the original ecu (which has been raised by one of our sponsors, Superchips) so that part is taken care of.

i would like to have 2-4 different coloured leds to indicate the rise of revs.

I will now have a tinker with the code and see what comes up so i can run several lights in a sequencial mode spaced by 250rpm up to max power..

Thx again guys for all your input! I'm picking up more and more tips to programming!

On another subject... I would like to build a programmable ignition system for my old Suzuki GT250... Ive already built a CDI unit for it (built as a college project 25 yrs ago!) but would like to advance the ignition at higher revs... I'm hoping Picaxe could help!!
 

Changster

New Member
Hi all,

this is my code so far:

low b.4,b.2,b.1



main:
pulsin c.3,1,w1
select case w1
case <400
high b.1
case <500
low b.1
high b.2
case <600
low b.2
high b.4
else
low b.4,b.2,b.1
endselect
goto main


i do have a problem though, when there's no input b.1 output stays high and i cant see how to turn it off until the frequency rises to the set point.

any ideas??
 

hippy

Ex-Staff (retired)
i do have a problem though, when there's no input b.1 output stays high and i cant see how to turn it off until the frequency rises to the set point.
When there's no input, w0 will be set to zero and this is less than 400 so it sets B.1.
 

RexLan

Senior Member
I don't think it will work as written. You are not actually calculating the RPM and even if you can find the magic numbers to correlate to the RPM the lights will jump around randomly giving you worthless information.

I would take a running average of the actual RPM, which you will need to calculate, and then turn a light on/off based on that average - not one instant reading. The average should contain a minimum of 5 samples and the lights should not update more than once per second, or 500ms as the very shortest time period. The sample count will probably overflow if you try to get more than 5-6 samples.

The average can be setup to refresh itself with each new sample (running average) which will allow you to base on/off decisions accurately.
Once you can actually calculate the RPM you can turn on a progressive LED bar easily.

I would verify that your tach signal is indeed 0-5v and not a 12v PWM signal.

The signal from the ECU requires no protection (if it is 5v) and if you start adding circuity you may load the line to the point that your original instrument does not work.
 
Top