Pages: [1] 2   Go Down
Author Topic: Messure RPM width interrupt problem  (Read 2671 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 35
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi First post here
Must say arduino is great for special thing in a car. :-)
But got a problem messuring RPM, i need to messure absolutly perfectly. at the messuring is used to control an injectingpump.

i use attachInterrupt(2, rpm_fun, RISING); have also tryed high low falling. non seams to work great.

i messure almost 10 times as many pulses as i should. and the PRM is flagging from 200 RPM 1000 RPM when is is actually running 700 RPM.

I think the problem is in the signal i get from the car. as i have messured RPM perfectly from other cars, width no problem.

https://picasaweb.google.com/olefejer/0206201102?authkey=Gv1sRgCI2f_eSGiJbm5gE#5613583854903019506

Any idea what to do width this signal before it goes in the board ? maby some extra components is needet ?

Any help GREATLY appriciatet.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 35
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


No shure the the link was working here it is.
https://picasaweb.google.com/lh/photo/SeeYqUijRaG8CxZJ5l1EG13DH6Dyo3hd6XAMSyrO5G8?feat=directlink
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 170
Posts: 12483
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Hi,

It seems there is noise on the line, you need a scope to confirm that.

You can adapt the code of the IRQ to handle noise to certain extend. If you know that #pulse per second is e.g. max 50 you can use the following trick. Check if the last IRQ is at least 20 millis ago. SOmething like this:

Code:
volatile uint32_t last;

void IRQ()
{
  if( millis() - last > 20)
  {
    last = millis();
    // do your IRQ things here
  }
}
Rob
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

0
Offline Offline
Newbie
*
Karma: 0
Posts: 35
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Rob
thanks for a suggestion. its a good idea, but the problem is that when the engine is running full speed its almost the same as the noise when idle, 700 RPM idle 6000 RPM max. you see the problem,
I think i need some hardware before the signal goes in to the interrupt pin on the arduino. but no idea what to use, any help from you hardware guys :-) 
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 240
Posts: 24449
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
but no idea what to use
First off, I'd use an oscilloscope.
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

0
Offline Offline
Newbie
*
Karma: 0
Posts: 35
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have used an oscilloscope, here is the signal i need to detect.

https://picasaweb.google.com/lh/photo/SeeYqUijRaG8CxZJ5l1EG13DH6Dyo3hd6XAMSyrO5G8?feat=directlink

it gives me almost 10 times to many signal. and i have a common ground, on the board and the car.
Logged

Sweden
Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

shouldnt two (one ?)diodes in series take care of that ???
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 35
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes it did, the voltage drop takes the lover part away. Thanks. But got a new problem when i drive my mosfett i have interference, on the interrupt same frequence as my pwm. I run the board from usb power, and the mosfet from car. The arduino board and mosfett has common ground?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey

Are u taking the signal directly from the crank sensor on the car, or the output for RPM which is given by the engine control module??
If you are taking the output from a sensor, what sensor is it? Hall-effect or variable reluctance??


Nishad
Logged

0
Offline Offline
Shannon Member
****
Karma: 162
Posts: 10496
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The problem may the very slow rise/fall times of that signal (very slow means more than about 1us for logic purposes!!!)

If there is high frequency noise on the signal it will cause multiple triggering.  The 328 chip has a small amount of hysterysis on its inputs but I am guessing this is not enough.  A schmidt-trigger logic gate is needed to 'clean up' the signal and prevent multiple triggers.  A 74HC14 hex-inverter chip for instance - this will be resistant to noise of several volts magnitude and the output switches fast and cleanly whatever the input does.

Another problem might be signal reflections from the leads and EMI pickup - this can be reduced by using an RC low-pass filter in the input before the schmidt trigger gate - say 10k in series with the input to 1nF to ground.
Logged

[ I won't respond to messages, use the forum please ]

0
Offline Offline
Newbie
*
Karma: 0
Posts: 35
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

To Nishad :
The sensor is an inductive type a coil width a magnet in the middle, and metal running by, and i want to be able to read this signal, as i dont have this computer in the car where the engine goes,

To MarkT :
Thanks alot for hopfully some great info, Just ordert some 74HC14 hex-inverter chip, this sounds just like what i need, lets hope. and i will try out the RC low-pass filter. to see if this helps.

I get back width info when i have tried it out.  THANKS
Logged

UK
Offline Offline
Sr. Member
****
Karma: 0
Posts: 308
Arduino - very interesting !
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

you may bre able to get a cleaner signal from an injector wire, or from the wire that triggers the ignition coils

ht leads are noisy by nature and you may need to use something other than an inductive pickup

you may need to halve the signal on a 4 cylinder car if it is running wasted spark
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 35
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There is no ignitions wires as it is a diesel, the only thing i got is the RPM sensor.
The Diesel injection pump controlling the amount of diesel injectet by a PWM signal.
It is a 3,0 L mercedes turbo Diesel engine witch can give 400 HP, width the rigth turbo and amount of diesel.
Thats why i am focused on getting a clean signal,

I got the 74HC14 hex-inverter chip today and now ready to some test on the car. get a totally square signal now from a PC blower i used to test it

By the way i have many ways of killing the engine, as we dont want a 400 HP runaway engine.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 35
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you are interested you can see the previous test here
http://www.youtube.com/user/olefejer?feature=mhee
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 77
You played your cards but you couldn't win....ED-I-SON'S MEDICINE
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

To Nishad :
The sensor is an inductive type a coil width a magnet in the middle, and metal running by, and i want to be able to read this signal, as i dont have this computer in the car where the engine goes,

I just went through this same thing reading RPM off my car from the crank signal, which is also a reluctance sensor.  Since this signal is AC and, at least on my car, has an output range from <1v to over >40v) you may need something like the LM1815 chip to convert its signal to something an Arduino input can reliably read.

« Last Edit: June 12, 2011, 06:13:40 am by GlitchBoy » Logged

Pages: [1] 2   Go Up
Jump to: