Crank Sensor Simulator Circuit??

Discussion in 'The Projects Forum' started by Scott!, Nov 18, 2009.

  1. Scott!

    Thread Starter New Member

    Nov 18, 2009
    3
    0
    I would like to build a circuit that will produce a square wave emulating a crank sensor signal. I know how to build a circuit to produce a square wave with a 555 timer and use a variable resistor to change the frequency. The problem is most engine controllers look for and extra wide tooth on the wheel, like a 60 -2 wheel. How do I produce a pulse with 1/2 the frequency every 58 oscillations???

    Thanks,

    Scott
     
  2. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Hello Scott.

    Would this once-every-58 double-width pulse be constant, or would you need to change it for different engines?

    One possibility that comes to mind is to use a divide-by-64 counter wired to trip every 58th clock pulse. When that pulse occurs, the timing capacitor could be deeply discharged (or even charged to a negative value) which would cause an additional delay for that clock cycle.
     
  3. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    This is one of the times where it can be done in 74xx Logic, but a uC (PIC/AVR Based) solution might work better. It would allow an LCD Display, and buttons to enter the parameters for different engines, without altering the circuit at all. The parts count also goes down dramatically.

    Something on the lines of a PicAxe or Arduino could give this output in an easy to program/set up fashion. Add a little more for the display/menu and input buttons, and you are set. You could also have the ability to give the uC "hints" by using other known pulses directly related to the CPS.
     
  4. Duane P Wetick

    Active Member

    Apr 23, 2009
    408
    19
    I think a 64 bit shift register would work here, with outputs taken at 2,8,16 & 32 and gated together and sent to a 555, which would give you the wide? pulse every 58 counts.

    Cheers, DPW
     
  5. Scott!

    Thread Starter New Member

    Nov 18, 2009
    3
    0
    Awesome advice! I am looking into all of these solutions. Really never expected such great responses so quickly. I just registered today. Looks like one or more of you may be military, this is actually for development on a military engine controls ECU. Saves tons of money and is more fun building simulators myself. Thanks for all the help!

    Scott
     
  6. Scott!

    Thread Starter New Member

    Nov 18, 2009
    3
    0
    Sgt. Wookie,

    To answer your question about the double wide pulse, the 60-2 wheel is used on many engine applications. Although, it is completely dependent on the manufacturer and criticality of the injection timing resolution. But for now, I'm just trying to focusing on getting something running for this particular control system and the pulse will remain cyclical on 58 counts.

    Regards,

    Scott
     
  7. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    OK, here's basically what I was thinking. See the attached.

    As shown, the values are set for an engine running at about 660 RPM. With this kludgy design, it won't be easy to change the speed.

    C1 and C3 could actually be replaced by a single 0.1uF (100nF) capacitor. I used a split capacitance trick on the 555 timer so that the 1st pulse would be the same width as all the others.

    The 4040 (CD4040B, HEF4040B, MC14040B etc) is a 12-stage binary counter. When 58 clocks have occurred, the 4082 4-input AND gate outputs a 1.

    This turns on Q1, which temporarily keeps the voltage on C1/C3 from increasing (the timing capacitors).
    R5/C2 cause a delay before the 4040 12-stage counter is reset. The actual threshold where this will occur is ambiguous, because the reset input MR is not a Schmitt trigger. A pair of 4093 NAND gates with their inputs wired together, connected in series, would provide a relatively stable threshold level.

    When the voltage on C2 rises high enough, the counter is reset, the output of the 4-input AND gate drops, Q2 turns off, and the 555 resumes clocking.

    Don't expect any kind of flexibility or real accuracy from this thing. You'd get better results if you found a gear with 60 teeth on it, put a mandrel on it, chucked the thing in a variable speed electric drill and used a Hall-effect sensor to detect the teeth - which is basically what the sensor on the motor is anyway.

    A microcontroller would be a heck of a lot more compact, far more accurate, and more features could be added as required.

    This is just a quick & dirty & nasty schematic, just to show that the concept can work.
     
  8. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    Will this work? The wide pulse is one and a half clocks wide every 60 clocks.
     
  9. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Thanks for the whack on the head, MikeML ;)

    Your post reminded me I didn't have to fool around with the analog timing stuff.

    My initial approach was sort of interesting, but goofy.

    So, I got out the big electronic wrecking ball and did some remodeling.

    The 4-input AND gate has been replaced with three 3-input AND gates.

    The timing hack on the 555 circuit has been removed, but now the "RPM" can be adjusted over a wide range. Values of C1 & C3 (total 10nF) have been reduced. R1 and R2's values simulate about 600 RPM to 6,000 RPM or so; probably plenty of range. If more range is desired, drop R1 to about 6.8k; if still more desired increase R2 to a 200k pot.

    C2 has been added to the Control pin; this keeps the trigger/threshold levels more stable for more reliable clocking.

    R3 and C4 exist to minimize/remove a timing glitch that occurs due to the propagation delays inherent in U1 and U3. Some of this glitch might be reduced by using a couple of the three remaining OR gates of U4 in series from the output of the 555 timer to the input of U4A; they shouldn't be left "floating" anyway, or problems WILL occur.

    However, if you add too much propagation delay between the clock input of the 4040 and the output AND gate, you'll cause an early reset of the 4040.
     
    Last edited: Nov 19, 2009
  10. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Incorporated the proposed change of using a couple of the left-over OR gates to add some propagation delay between the 555 and U3C/U4A.

    The last leftover gate was used as a high input impedance buffer for the output; this will keep the output more consistent than if it were taken from the RC network.
     
  11. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Yet another revision. :rolleyes:

    S1 and S2 have been added for selectable propagation delay; either straight-thru clock from the 555 timer, 1-gate prop. delay from U4B, or 2-gate prop. delay from U4B & U4C. It turned out in the simulation that two gates was too much of a prop delay, causing early resetting of the 4040 timer. Your mileage may vary with "real" parts; that's why the provisions for adjusting the prop. delay.

    S1 and S2 could simply be jumpers on a row of header pins.

    Note that I haven't shown bypass capacitors (0.1uF) on the logic gates or the 555 timer, nor the required 220uF cap across the 555 to suppress the glitch that occurs when the 555's output toggles states (this happens with any 555 timer).
     
  12. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    MikeML,

    Hope you don't mind; I decided I'd experiment with your circuit a bit. Your circuit has an advantage in that it would be much easier to convert for multiple gear teeth count selections using rotary switches or the like.

    There are also fewer propagation delay issues to deal with than in my circuit.

    I changed the 4011 NAND gate to the 4093 Schmitt-trigger quad NAND gate; the Schmitt-trigger allows simplification of the clock circuit along with making it impossible to "stall", and enables more reliable suppression of the "glitch" in the output due to the propagation delay issues both of our circuits have. It also enables dispensing with the 4049 inverters altogether.

    As shown, the oscillator output has a range of about 418Hz to 6.3KHz, directly corresponding to an RPM range of 418 to 6,300.

    So, one of the Schmitt-trigger NANDS is used for the clock, two as you had used the 4011's, and the last NAND is used to ensure the output is squared up from the filter. Since the output from the last NAND is inverted, it was necessary to use an NPN transistor to correct the output polarity of the signal.

    However, this is likely very desirable; I suspect the sensor used in the vehicle is an open-collector output Hall-effect sensor. If that is indeed the case, resistor R5 would not be necessary, as the pull-up resistor would be inside the ECU.
     
  13. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    As long as you are having fun :D
     
  14. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Continuing on with the selectable teeth count idea... a little juggling of both of the 4017s' output lines made that easy to do by just adding a couple of 20-pin IDC headers.

    One jumper per header allows selection of any number of gear teeth you could get by multiplying two numbers in the range of 1 through 10.

    Currently, a jumper must be present somewhere on each header to prevent the reset input from floating, but a 10k pull-down resistor on the reset pin would alleviate that necessity.
     
Loading...