Shop OBEX P1 Docs P2 Docs Learn Events
Automotive Pulse Generator reading on the Prop — Parallax Forums

Automotive Pulse Generator reading on the Prop

eagletalontimeagletalontim Posts: 1,399
edited 2013-09-12 20:11 in Propeller 1
And yet another project.... I am trying to read a pulse generator that is located on the output shaft of my transmission so I can display the MPH on the parallax 2x16 display. First things first, I am not familiar with pulse generators and will probably need lots of help on this one. The only thing I know is most automotive pulse generators output an AC signal. I know the Prop cannot handle the AC signal and probably not the voltage, so before I go hooking it to a prop, I need to do some testing. The first thing I did was build an H-Bridge using some 1N4401 diodes, fed the pulse generator output to it, and hooked the O-Scope directly to the output of the H-Bridge. Here are some pics of the readings. Sorry I could not adjust the thresholds or other stuff on the images since I was driving. The Image1 is right around 45mph. The Image2 is around 100mph, and Image3 is about 10mph. What I am needing to do is somehow convert the pulse generator signal into a readable signal for the prop and calculate it into MPH. ALL help is appreciated!

EDIT : Changed images from BMP to JPG.
400 x 240 - 48K
400 x 240 - 50K
400 x 240 - 46K

Comments

  • Hal AlbachHal Albach Posts: 747
    edited 2013-09-01 13:36
    "The first thing I did was build an H-Bridge using some 1N4401 diodes"
    Did you mean Full Wave Bridge? The images you posted do not look like a rectified ac signal.


    This is what I mean by a full wave rectified signal....
    1366560067.jpg
    Also, the voltage shown by the scope appears too low for a prop to work with. Possibly the diodes you are using are dropping a significant part. However...
    I'm not so sure that messing with the input to the vehicle odometer is a good idea. After all, the odometer becomes a legal record if and when you sell the vehicle. And how can you insure that adding another circuit to the sensor output won't affect the reliability of the speedometer and odometer and adversely affect their accuracy?
    IMHO I would leave the sensor alone and install another one somewhere on the driveline. A magnet and a pickup coil would certainly work after proper signal conditioning, such as an amplifier and a Schmidtt Trigger. That is what after market speed controls use.

    AND driving at 100 MPH and tinkering with a scope!!!!! Your angels are working overtime.....

    Hal
  • eagletalontimeagletalontim Posts: 1,399
    edited 2013-09-01 14:34
    The Pulse generators are used inside the TCU to detect vehicle speed, and to see if there is an issue between the input shaft and the output shaft. They are separate from the VSS which is actually located in the dash. The signal from it is a 5V square wave, but it is so choppy, it is pretty much unusable. I have a chip in my ECU that allows me to read all the sensors, adjust timing, fuel, etc, and the vehicle speed is read from the VSS which is always jumping all over the place. By using the output shaft pulse generator, I can display a more steady speed and also use it in another project I am tinkering with.

    I was also thinking of making some sort of NPN / PNP transistor setup that will maybe output more of a usable wave that could be processed through the jm_freqin code found in the forums.

    BTW, I was driving fast, but only had to hit 1 button to take the snap shot :) I do more than that at the drag strip!

    EDIT : Also... I have set up a bench testing unit to hopefully help me figure out how to make a clean signal into the prop. I have a DC motor with a small gear on the shaft with the pulse generator mounted very close to the teeth of the gear. I am using a torn apart drill trigger to adjust the speed of the motor. Now I don't have to drive 100 mph to get a reading!
  • pmrobertpmrobert Posts: 675
    edited 2013-09-01 14:55
    Tim, it's almost certainly a VR sensor that you're capturing the output from. Look at an LM1815 to convert it's output to nice, clean, reliable logic level pulses. TI's short description is:
    "The LM1815 is an adaptive sense amplifier and default gating circuit for motor control applications. The sense amplifier provides a one-shot pulse output whose leading edge coincides with the negative-going zero crossing of a ground referenced input signal such as from a variable reluctance magnetic pick-up coil."

    They are cheap, reliable and pretty much bulletproof in my use and misuse of them. Datasheet: http://www.ti.com/lit/ds/symlink/lm1815.pdf

    I've successfully used them as crank angle sensors in 16000 rpm engines using a 36-1 wheel so they're quite fast and accurate.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2013-09-02 07:32
    I ordered a sample from TI. It will probably be awhile till it gets here. I can't afford to buy test components all the time :( I may have already got it working with using a single diode, 2 resistors and an NPN transistor. Got more testing to do.
  • pmrobertpmrobert Posts: 675
    edited 2013-09-02 08:00
    Make sure you scope the raw input from the VR sensor. Most of the crank angle installations generate a 60-100 volt sine wave at top speed so you need fairly robust component ratings and a way to clip your output to logic level. I'm not personally familiar with the VSS installs but do know they are interpreted the same way, i.e., zero crossing detection if it's a VR style pickup. Many newer vehicles use Hall Effect sensors; they're so much easier to work with. Another thing you can calc off the VSS and RPM values is what gear you're in and, if you're of a mind to, calc gear and TC slip, ratio and/or lockup status in the case of an automatic tranny.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2013-09-02 10:16
    At 100mph, I was getting around 4V DC after the diode I have in place. At 45 mph, I was getting around 2.6V DC according to my digital meter. I have the "positive" lead of the pulse generator going to the base of an NPN which is connected to the base of a PNP. I am pulling 5V from the prop board and running it to the PNP. Everything is commonly grounded including the prop board.

    Will the LM1815 just hook directly to the pulse generator and then to the prop and it work? If there is other circuitry, I am going to need help with that as well please.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2013-09-02 11:20
    Here is my updated circuit at work. I tried using a cap to smooth the signal, but I think it actually hurt the reading more than helped. I am using jm_freqin to count the distance between pulses, but since I believe it is looking for a rising edge, the readings are all over the place as there are 2 rising edges for each pulse. If I am not mistaken, the threshold of an "on-state" for a prop pin is 1.3V? If this is the case, why are the readings soooo erratic for the output to the display? One second it is reading ~43000, then the next, it is reading ~70000. BTW, I am outputting raw numbers returned by the jm_freqin to the display for testing purposes.

    EDIT ***. This is the readings directly at the Prop Pin.
    400 x 240 - 44K
    400 x 240 - 46K
  • pmrobertpmrobert Posts: 675
    edited 2013-09-02 12:53
    Here is my updated circuit at work. I tried using a cap to smooth the signal, but I think it actually hurt the reading more than helped. I am using jm_freqin to count the distance between pulses, but since I believe it is looking for a rising edge, the readings are all over the place as there are 2 rising edges for each pulse. If I am not mistaken, the threshold of an "on-state" for a prop pin is 1.3V? If this is the case, why are the readings soooo erratic for the output to the display? One second it is reading ~43000, then the next, it is reading ~70000. BTW, I am outputting raw numbers returned by the jm_freqin to the display for testing purposes.

    EDIT ***. This is the readings directly at the Prop Pin.

    The only temporally accurate part of the raw input is the zero crossing. The voltage of a VR sensor varies with speed, #1, and #2, the sensor and teeth are almost certainly not exactly aligned with each other so the voltage each tooth generates is slightly different so your derived pulses are going to be inconsistent. If you counted pulses over, say, 500 ms or so and determined speed that way you'd be much more accurate but now you have a lag in your data. Zero crossing detection is the cure for the inconsistency you're seeing. I'll send you my notes re the 1815 circuit when I'm back at the estate later tonight. They are simple to use, the datasheet has lots of info on modes you will not use. I think it was pulling 7,9 & 14 to ground and using a 10K resistor on the input that was the simple, reliable approach I use - but I'm probably incorrect (memory read error in my head!) and will follow up shortly.If TI is going to take a long time for the sample you can get the 1815 from diyautotune.com or I can send you one gratis - they are cheap and I'm more than happy to support a fellow motor enthusiast!

    -Mike
  • eagletalontimeagletalontim Posts: 1,399
    edited 2013-09-02 15:59
    I don't know how long it takes for TI to send out samples, but the last place I requested samples from took almost 2 months. I am hoping to do more testing next weekend. Any help with the chip is appreciated! I was hoping to finish the entire project by the end of this month. Don't have much longer, but still have several more tanks of gas to waste testing it :)
  • eagletalontimeagletalontim Posts: 1,399
    edited 2013-09-05 18:12
    Wooo Hoo, I got my samples in from TI already and now I need help figuring out how to wire it up so I can get something working. Any help please? Product is an LM1815 and I am connecting them to automotive pulse generators.
  • CircuitsoftCircuitsoft Posts: 1,166
    edited 2013-09-05 18:31
    See http://www.ti.com/lit/ds/symlink/lm1815.pdf figure 17. Input goes on Pin 3. Keep the 18k resistor, dump the inductor - that's part of the sensor.
  • pmrobertpmrobert Posts: 675
    edited 2013-09-06 06:13
    Here's a thread on msextra ( http://www.msextra.com/forums/viewtopic.php?t=25641 ) discussing an LM1815 product I have used, there are schematics in there. Bringing Pin 14 to ground rather than as part of an RC circuit as in the schematic puts the chip in zero crossing mode and automatic hysteresis. This configuaration just works on everything I've used it for. If you read that thread the LM1815 use becomes pretty clear - the datasheet is quite vague in my opinion. Also, start with Pin 5 grounded (Mode 3). That usually works for any VR input I've encountered from a vehicle. You can experiment with Mode 1 or 2 if you have pulse no-sense at low speeds.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2013-09-11 17:14
    I have it all wired up like the schematic on that site, but am getting some serious random readings using the jm_freqin function. Should I try to get an average of the readings to do the calculation from? I have no idea what the ratio is from the output shaft gear, nor do I know the final drive ratio from the output gear to the axles. I can't seem to locate this information.

    EDIT *** When watching it on the O-Scope, the square waves are not spaced evenly while driving a constant speed. The spacing jumps a little.
  • jmgjmg Posts: 15,173
    edited 2013-09-11 22:01
    Can you firstly borrow a reciprocal counter ?
    A good one that allows variation of gate/update time, and you can see the effect of average over time.

    That will also give you scale values needed.

    With any sensor like this, expect significant 'pattern jitter', but long term averages will be correct.

    What update rate do you need, for your measurements ? - the longer you can tolerate, the less jitter you will get.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2013-09-11 22:06
    I need the variable to accurately update every 10 to 50ms. Faster is better as some vehicles go from 0 to 60 in roughly 3 seconds or so. Mine is currently 0 to 60 in 6.025 seconds. I need the program to accurately read the values in between as fast as possible without losing too much accuracy.
  • jmgjmg Posts: 15,173
    edited 2013-09-11 22:12
    I need the variable to accurately update every 10 to 50ms. Faster is better as some vehicles go from 0 to 60 in roughly 3 seconds or so. Mine is currently 0 to 60 in 6.025 seconds. I need the program to accurately read the values in between as fast as possible without losing too much accuracy.

    What info you you want out ? - just vehicle speed ? - and for the driver to read, or for other controls to use ?
    Does the driver react to this, (ie do something different) or is it just to 'see how you are going' ?

    If you wanted to gather more data, you could store a time-stamp of every edge, and then process that to give a fitted acceleration profile. Because you know the profile shape, that can be used to improve filtering.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2013-09-12 04:22
    The speed is a variable that will possibly control something if I can get the accuracy fair enough.
  • BeanBean Posts: 8,129
    edited 2013-09-12 04:36
    Have you thought about installing your own sensor ?

    A latching hall sensor should give nice square pulses.

    The sensor is turned on by a magnetic south pole, and off by a magnetic north pole. So you'll need to install at least two magnets on the driveshaft, but you could install 4 or 6 or 8 to get better resolution. You'll need a pulse every inch traveled to get 0.001sec resolution at 60MPH. (60MPH = 1056 inches/second).

    If you get a good clean sensor signal, I think the rest will be easy.

    This looks like it would work https://www.sparkfun.com/products/9312


    Bean
  • eagletalontimeagletalontim Posts: 1,399
    edited 2013-09-12 17:31
    I am trying to make this as simple as possible for end users and 90% of them don't have the technical or mechanical knowledge to properly install extra sensors. I am making this as simple as possible for the end user... ( white wire goes with the white wire, orange goes to the orange, etc...) If the stock components already work, why not go ahead and use them since it would be cheaper for them and me :) I think I accidentally fried my first chip... A socket rolled onto the bread board when I hit the brakes and it shorted out something. Time to resolder another one...
  • eagletalontimeagletalontim Posts: 1,399
    edited 2013-09-12 17:47
    I am trying to make this as simple as possible for end users and 90% of them don't have the technical or mechanical knowledge to properly install extra sensors. I am making this as simple as possible for the end user... ( white wire goes with the white wire, orange goes to the orange, etc...) If the stock components already work, why not go ahead and use them since it would be cheaper for them and me :) I think I accidentally fried my first chip... A socket rolled onto the bread board when I hit the brakes and it shorted out something. Time to resolder another one...
  • jmgjmg Posts: 15,173
    edited 2013-09-12 18:13
    I would work on crafting a low pass filter and schmitt.
    You can AC couple this and I would avoid the diodes. The scope plots show some high freq ripple, which should be reduced in a LPF, and then some hysteresis added to the slice point.

    You know the maximum speed, and the lowest practical speed, so can filter quite aggressively.

    Something like the MCP6544 has low power, Hyst inbuilt and is not too fast.
  • bennettdanbennettdan Posts: 614
    edited 2013-09-12 20:11
    gm-ign-module-schm.jpg

    If you are looking for a simple setup to read your VR sensor then you should look in your local junk yard for a GM 7/8 pin module from an HEI distributor. The modules are already weather tight have easy to obtain connector hookups and convert the VR signal into a Square wave signal to drive a Tach which would be great for what you need. All you need are the P and N Inputs from the sensor then R is the output to the Tach. I am not sure if you need Battery + to the + terminal and Battery Negative to the mounting hole to power the unit or not. The unit new are only like 30 dollars or so. Good luck!
    743 x 661 - 42K
Sign In or Register to comment.