Shop OBEX P1 Docs P2 Docs Learn Events
Tachometer circuit problem — Parallax Forums

Tachometer circuit problem

Capt. QuirkCapt. Quirk Posts: 872
edited 2017-10-23 01:31 in Propeller 1
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.

Comments

  • 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: 872
    edited 2017-10-24 07:39
    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?

    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.
  • Capt. QuirkCapt. Quirk Posts: 872
    edited 2017-10-24 07:46
    You are referring to the Propeller Schmitt Trigger Circuit in appnote 015

    The capacitive pick-up is supplied with 3.3v, should the hysteresis band be increased
    to provide a wider gap? Perhaps V_lo closer to ~.8v and V_hi closer to ~2.3v?

    Or is that something best found through experimenting.

    Since I am using the counters, can I bypass the AN015 pasm program and change the
    counter to %01011 "POSEDGE detector w/ feedback" and use the same wiring diagram
    in the app note with the 2 resistors using the Bpin as the feedback pin, and Apin as the
    input pin?

    I have never understood what the "Feedback" on a counter was used for.
    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.

    I would like to learn more about that. Can you point me towards something I can read? I was
    planing on using the counters to control the dwell time and ignition timing on the transistor
    ignition.

    Thanks


    Moderator: Frequently my schematic in my first post does not show up, when I am
    logged in, on this page. It doesn't matter if I am using chrome, firefox, or internet explorer?
  • I use magnetic pickups to read RPM all the time as fast as 30,000 rpm. You need a signal conditioner to change the pulses to square wave and a HEF40106 to bring it down to 3.3 volts. I guess I would use a cog to read the rpm and another cog to detect the trigger pulse and fire the ignition coil. In the trigger cog I would set my dwell delays.
    I like the parallax LCD along with it's object. The Jonny Mac object is good for the cheap LCD's but a little more work to use. The Parallax LCD is very good but a little pricey.
  • Capt. QuirkCapt. Quirk Posts: 872
    edited 2017-10-25 06:03
    DigitalBob wrote: »
    I use magnetic pickups to read RPM all the time as fast as 30,000 rpm.
    You need a signal conditioner to change the pulses to square wave and a HEF40106 to bring it down to 3.3 volts.

    The HEF40106 Hex inverting Schmitt trigger isn't enough?

    Does that mean the parallax appnote an015 will most likely be insufficient?

    I bought the resistors I needed today, and will test tomorrow.

    One other question. Looking at my circuit (does it show up in your browser?)
    Does the voltage that is applied to the base (from the sensor wire), combine with the
    3.3v on the emitter side of the transistor to create a rising edge logic that is greater
    than 3.3v?


    Bill M.

    On the transistor ignition prototype, I used 2 parallax hall sensors with a magnet glued
    to the back of the sensor to read my reluctor. Many watercraft use a wasted spark system,
    but this one uses individual coils for the 2 cylinder engine.

    The 2 hall sensors are combined for each cylinder-coil; to create a greater degree resolution
    similar to a 4 stroke with a position sensor on the crank and cam. The reluctor (and truth table)
    is designed to signal which cylinder will fire, and when to start the dwell. The truth table and
    software determines when to cut the dwell and create the spark.

    The problem with this set-up is the need to count clock tics for 180' to 360 degrees to determine
    rpm.

    Currently I see calculating rpm on a single or 1/2 revolution as my greatest problem, because
    it may not be accurate enough?

    Hopefully I can just slow down the clock speed or add a fudge factor to the program :)
    BM.
  • I use the 40106 to lower the square wave from my signal conditioner to the prop. My signal conditioner uses a LF411 op that allows me to configure many sensors such as A/C, switch contact, open collector, TTL, etc.. I always use my trusty oscilloscope to look at any signals in question so I don't waist time guessing. As far as the tech notes goes I power the 40106 from the prop. with a 10K resistor on the input. Ground any unused trigger pins to low.
Sign In or Register to comment.