Reading a wheel speed sensor.
sccoupe
Posts: 118
I'm working on reading a wheel speed sensor on a car. I have tested a couple of different ways to read this and tested with a frequency generator(because this is easier until it needs tested on the car) but I get results that bounce around a lot. I havent tested the pulsin function yet because the object warns of cog lockups(not sure why, but i cannot have this). Why is this? Is this supposed to work as well as the BS2 pulsin command? I have used a BS2 and its pulsin command to read a crank angle sensor to accurately read rpm, but never really checked to see what happens if there is no signal. Will I have problems when the car is stopped and there is no signal? I'd like to be able to read the time between pulses to very quickly calculate speed and distance from this. Will the Prop pulsin work, or should I use a bs2 to read the signal and send the results to the prop serially for the TV output? Thoughts on the issue?
Thanks
·
Thanks
·
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
·
One is to count the pulse changes over a period of time and calculate the speed and over a long period of time and moderate speeds·it works pretty good. But at low speed and at shorter reporting periods it will bounce around a lot like you are seeing.
·
Another way is to simply count the time between each pulse. This will remove the bouncing your seeing but will give slower updates at very slow speeds it will take a lot of time for updates.
·
The approach I have taken is to have a counter watch for sensor changing from high to low or low to high and advance the counter. Then I read the counter and use that to know how many rotations I have had. This will make your code much easier because you don't have to dedicate a cog or even worry how fast you scan code works, because the counter is way faster than any speed sensor is. The other side effect is you get the odometer reading because no pulses are missed.
·
I've also used the counters to measure fuel injector pulses to determine fuel usage.
·
·
I may have some sample code, let me know if you would like to see it.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jim Fouch
FOUCH SOFTWARE
The problem with the frequency counters and misc is that you cannot control them and they are so fast that any noise is a problem. I actually coded the above in assembly but found that it worked better in spin because of the nature of the signal.
I haven't done much with the projects that read the Speed Sensor or Fuel Injector Pulses. But, back when I did they seemed pretty accurate. I don't know what you mean by fuel curve. I simply figured that if the fuel rail pressure stays constant, then the only variable is time. Flow should remain constant with pressure.
On the one motorcycle that I was interfacing to had a two stage fuel injection system. The second injector would only activate when RPM was over 7500 or so. In this system I monitored both injectors. I only did this on one cylinder (there were 4). My basic idea was that the stock ECM would not allow the cylinders to be unbalanced in the amount of fuel supplied.
I may have an oversimplified view of fuel injection, but I was simply looking to create a approximation of remaining fuel. Most motorcycles don't have ANY gauge and some only have an idiot light that comes on when you have .9 gallons of fuel left.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jim Fouch
FOUCH SOFTWARE
If you have that code around still I would love to see it Jim. I am looking to do a similar setup on my beemer htat you have previously done but I am doing to be interfacing it out to some slightly modified standard gauges and a 7 inch vga display.
Would this method would be fast enough for crotch rocket rpm counters as well? 19k rpm?
Thanks,
Jimmy