Tachometer circuit problem

Capt. QuirkCapt. Quirk Posts: 763
I have a capacitive pick-up circuit that was copied from a tach/egt unit.

The problem is the transistor used in the circuit. The part # is a npn,
but the symbol used is a pnp.

Another problem is the circuit itself, IMO, it is an NPN style, and the
output to the propeller should be low?

++ moderator, I may need to ask more questions related directly to
the propeller.

Thanks

Bill M.
1600 x 794 - 107K

Comments

  • 6 Comments sorted by Date Added Votes
  • Definitely a PNP circuit. You could invert everything for NPN, but I suspect its done this way round to respond
    rapidly to the -ve pulse from the lead.
  • It looks like it is pulled high (3.3v) and when triggered it would pull a propeller pin low?

    I am curious because of the 220k resistor below the transistor. Is that part of a voltage divider?
    When it is triggered, do you think the voltage will drop enough (less than ~1.7v) for the propeller
    to recognize the change?


    Bill M.


    BTW, I found an itty bitty coil inside that MSD pickup.
  • I think R1 sets the time constant on the falling edge of the output. Seems rather large though. And a
    healthy input negative going spike will simply pull the base down fast and charge the cap directly via
    the base-emitter junction.
  • The prop pin would be low because the base is biased high on the PNP. If you changed it to a NPN it still biased high but the prop pin would be high. But it's says input from spark plug wire so how Kv are coming into the circuit. Those BAT54 are 30v zener are they suppose to be back to back to clip down the peaks. Is this from the jet ski MSD
  • Capt. QuirkCapt. Quirk Posts: 763
    edited 2:20AM Vote Up0Vote Down
    Mark_T wrote: »
    I think R1 sets the time constant on the falling edge of the output. Seems rather large though. And a
    healthy input negative going spike will simply pull the base down fast and charge the cap directly via
    the base-emitter junction.
    DigitalBob wrote: »
    But it's says input from spark plug wire so how Kv are coming into the circuit. Those BAT54 are 30v zener
    are they suppose to be back to back to clip down the peaks. Is this from the jet ski MSD

    The tach is bouncing around high and low.

    I am going to try to add another 100K resistor to the end of the pick-up wire.
    A few commercial capacitive pick-ups use a resistor on the end of their pick-up
    wire.

    It also occurs to me that either the counter is doing a poor job of logging a high
    signal to the Propeller pin. Or the pick-up circuit is possibly supplying a poor
    pulse to the Propeller?

    I have a brand new oscilloscope, I could use some help to diagnose the problem.
    DigitalBob wrote: »
    Is this from the jet ski MSD

    Right now I am just trying to measure rpm on my Lawnmower. But yes, it is for a
    jetski, but not the MSD. The MSD is much easier thanks to the forum!

    This is one part of a JetSki data acquisition system that will monitor exhaust gas temp
    (EGT), cylinder head temp (CHT), rpm, acceleration, throttle position (TPS), and log it
    to a large spi eeprom.

    After I am finished with the JetSki data acquisition system, I want to create an object
    without the EGT, and TPS. CHT's under the spark plug is easy, combined with cht
    guidelines, it will make jetting much easier. EGT's, imo, are too difficult for most people
    to use.

    By the first of the year, I want to include a 18v transistor ignition.

    But since I started the tachometer project, I have discovered that my understanding
    of what the Propeller counters are capable of was incorrect. I would prefer the counters
    to add clock tics to the phsa while the propeller pin is either low or high. Not simply
    add the number of high or low pulses to the phsa.

    Bill M.
    '' =================================================================================================
    ''
    ''   File....... Tach demo v.0.3C.spin
    ''   Purpose.... 4-bit LCD tachometer
    ''   Author..... Bill M.    
    ''   Started.... 
    ''   Updated.... 
    ''
    '' =================================================================================================
     {{  Notes:
     1. Baseline code v.0.1 that displays a make-believe rpm range.
     2. Incorperate Motor Minder into tach demo v.0.2
    To_Do List:
    I need to average rpm results and refresh the rpm value at a given time
    I need to be able to change rpm average and refresh time rate in the "Con" section.
    3. tach demo v.0.3 Cnvert motor minder to read only phsa register after a 60 sec delay.
    Also add code for calculating acceleration.
    4. tach demo v.0.3B
    5. Tach demo v.0.3C Needed delays between lcd operations. They worked.
    6. The backlight is too bright
    7. The rpm bounces around too much, Need to try 100K resistor on
    the end of the sensor wire.
    8. Another possibility is the counters are doing a poor job of
    counting the short positive pulses, or they are capturing more
    than one positive pulse per revolution. 
    
    
    Future:
    Add Baseline v1.1.1 Max31856.spin and put it into it's own cog.
    Convert to 4x20 display
    Add 512 mbyte spi eeprom.
    Add ADC for TPS. 
    
    
     }}
    
    con
    
    ' _clkmode = xtal1 + pll16x
      _clkmode = xtal1 + pll8x 
    ' _xinfreq = 5_000_000                                          ' use 5MHz crystal
    ' _xinfreq = 6_250_000                                          ' use 6.25MHz crystal
      _xinfreq = 10_000_000
      
      LCD_D4 = 3
      LCD_RS = 2
      LCD_RW = 1
      LCD_E  = 0
      LCD_BL = -1                                                   ' no backlight
     
    
    
    
      LCD_COLS = 8                                                 ' lcd configuration
      LCD_ROWS = 2
    
    
      tach_pin   =  7                ' shaft encoder - Propeller pin
    
    
                   ' floating point variables for display
      
    OBJ
    
      lcd   : "jm_lcd4_ez"  
    
    PUB Main | rps, rpm, acc, rps_old
    
      lcd.start(-1, LCD_E, LCD_COLS, LCD_ROWS)                      ' bl on P16, 16x2 LCD
    
      
      lcd.move_to(1,1)                                      ' define custom characters
      lcd.str(@lable1)
      lcd.move_to(5,1)
      lcd.str(@lable2)
      lcd.move_to(1,2)                                      ' define custom characters
      lcd.str(@lable3)
    
      waitcnt(clkfreq * 2 + cnt)                            ' wait 2 seconds to check lcd display.                                                       
      
      
      dira[tach_pin]~                           ' Set as an Input.
    
      'start revolution counter in counter A
      frqa := 1     ' Determines the value added every time a pos edge occurs.
      ctra := 0     ' stop counter
      phsa := 0     ' zero counter
      ctra := (%01010 << 26 ) | (tach_pin)      ' count positive going edges in counter A
      rps_old := 1000                           ' one time only value to prevent subtracting zero.
    
      repeat
        phsa := 0
        waitcnt(clkfreq + cnt)
        rps := phsa 
       if phsa > 0                              ' Prevent lcd from displaying bad data while engine is off                         
         rpm := rps * 60
         acc := rps - rps_old 
         lcd.move_to(5,1)
         waitcnt(clkfreq / 10_000 + cnt)
         lcd.rjdec(rpm, 4, "0")
         waitcnt(clkfreq / 1000 + cnt)
         lcd.move_to(5,2)
         waitcnt(clkfreq / 10_000 + cnt) 
         lcd.rjdec(acc, 4, "0")    '' Need to determine if + or - symbols are displayed??
         rps_old := rps
                                    
    
    
    DAT
      lable1        byte    "RPM", 0 
      lable2        byte    "1250", 0 
      lable3        byte    "ACC", 0 
      lable4        byte    "Pto", 0
    
  • Unless you add hardware filtering the counters will count sub-microsecond glitches This is one area where you should just dedicate a cog to debouncing and counting pulses since it is so simple to do and simplifies any external filtering etc. A no-brainer really.

    LCD operations normally need about 37us before accepting another character except in the case of home/clear commands which require 1.5ms. Spin is slow enough that it doesn't need any extra delay for normal operations, you only need to add that delay to the home/clear. My LCD driver in Tachyon controls the brightness of the backlight through a simple PWM on the background timer cog which does something similar to the tick interrupt routine on most micros in tracking time, timers, time of day, events etc.
    Tachyon Forth - compact, fast, forthwright and interactive
    useforthlogo-s.png
    Tachyon Forth News Blog
    TACHYON DEMONSTRATOR
    Brisbane, Australia
Sign In or Register to comment.