Timing with flip flops

Discussion in 'General Electronics Chat' started by Tobias, Apr 19, 2010.

  1. Tobias

    Thread Starter Active Member

    May 19, 2008
    158
    0
    I have two 18 teeth gears on two separate motors (left motor and right motor) with a hall effect sensor on each gear. I want to know the time between pulses left to right. I rigged up a D type flip flop and have the left turn on the output and the right turn off the output. Thinking the ratio between high and low from the output of the flipflop is the dutycycleThe problem I think I am running into is the duty-cycle for each gear is 50%. If the left is still high when the right sensor goes high, the output of the flip-flop is still low.

    So is there a way to set up a flip flip so the output is turned on with a rising edge of input1 and the output is turned off with the rising edge of input2? So just the rising edge triggers the flipflop.

    I eventually need to time the motors so not only same speed but the 'dutycycle' between gear pulse left to right is 50%

    I am on a different computer than normal otherwise I would post a schematic of what I have currently
     
  2. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
  3. Tobias

    Thread Starter Active Member

    May 19, 2008
    158
    0
    I need one hall effect to turn on a signal with its rising edge and the other hall effect to turn off the signal with its rising edge. I am running into a problem with one hall effect connected to clock and the other to reset. I have data pulled high. If reset is still high when clock goes high, the output stays low. I need the output to turn hi or low regardless of state of either input. I need the output to be driven only by rising edges.

    I will try your recommendation later today. I don't have any components with me now.
     
  4. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Instead of a F/F, you might consider using a binary up/down counter. Have one input clock the count up, the other clock the count down. You'll know the motors are about the same speed if the outputs are staying relatively constant, or if you're not getting any carry/borrow outputs.
     
  5. Tobias

    Thread Starter Active Member

    May 19, 2008
    158
    0
    I am looking around for a counter that has two inputs, one to count up and one to count down. Any suggestions?
     
  6. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Might look at a 74HC193.

    The count increments or decrements on the rising edge of UP or DOWN.
    If one is toggling, the other must be high.

    I don't know what might happen if they are both low at the same time; you might have instability problems.
     
  7. rjenkins

    AAC Fanatic!

    Nov 6, 2005
    1,015
    69
    Another possibility may be a 4046 PLL IC - that has three phase comparators and comparator 2 is an edge triggered block which may have the features you need.

    Have a look at the datasheet, page 12:
    http://www.fairchildsemi.com/ds/MM/MM74HC4046.pdf
     
Loading...