Timing with flip flops

Thread Starter

Tobias

Joined May 19, 2008
158
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
 

Thread Starter

Tobias

Joined May 19, 2008
158
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.
 

SgtWookie

Joined Jul 17, 2007
22,230
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.
 

Thread Starter

Tobias

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

SgtWookie

Joined Jul 17, 2007
22,230
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.
 
Top