Tachometer Using Open Collector Square Wave


Recommended Posts

Morning,

Apologies if cross posting or missed something obvious but very new labjack and DAQFactory.  Any pointers to existing files, posts, and comments warmly received

 

I have just picked a half completed test rig that I have been asked to finish within the next 48hrs so as to allow some testing that will affect the use of some equipment on a big sporting event.

Are there any examples of a tachometer using open collector square wave?

 

I need to get the RPM of a shaft, the problem is that the hardware gives 360 counts per rev, believe it’s really meant for angle measurement not tacho.  With a shaft of up to 125 rpm that’s 750 pulses per second.  An update of the rpm once a second would be fine, but don’t know if I can count fast enough.  I’m very very new to labjack and when I did something similar before it was with NI kit and think did it in hardware.    Maybe I’m over simplifying it but count how many pulses in a second, do the math then send results to DAQFactory.

 

Apologies if cross posted but desperate to get this working or at least find out if possible and work out a plan B

Kind regards

 

Martin 

Link to comment
Share on other sites

Many thanks for help.

 

I tried the basic counter example last night and hope it is as simple as that but so far been unable to get it to work.  It show channelss: raw data as Labjack,  With hertz and counts set as test, is this correct.

 

Will this work ok with digital in and open collector signal.

 

Using U6-pro and basiccounter shows no 'red crosses'

 

Hope it is easy as getting this to work, any further tips will be great help

 

kind regards

 

Martin

Link to comment
Share on other sites

See the following about collecting open-collector signals to a digital input:

 

http://labjack.com/support/u6/users-guide/2.8.1.2

 

Most likely you can simply connect your signal to FIO0 and your common/ground to GND.

 

 

Start with this topic from the LabJack forum about frequency measurement:

 

http://forums.labjack.com/index.php?showtopic=1105

 

With your U6, I suggest you use a timer in the Period32 mode #2:

 

http://labjack.com/support/u6/users-guide/2.9.1.3

 

Start by closing all other software and try using the timer in the test panel in LJControlPanel.  Click "Config" in the "Timers and Counters" box, set #Timers=1, set Timer0 Mode = RISINGEDGES32, and leave all other settings as-is.  That will put Timer0 on FIO0 in period measurement mode with a 48 MHz clock.  Click "OK" to return to the main test panel and in the Timer0 row you should see a read of the raw click ticks and also a scaled value of the period in seconds.

 

If that works, I suggest you make that timer configuration the power-up default, and then in DAQFactory you simply need to read the value of Timer0 whenever you want.  Go to "Config Defaults" in LJControlPanel, set #Timers=1 and Timer0Mode=RISINGEDGES32, then click "Write Values".  Exit all the way out of LJCP, power cycle the U3, then go back to "Config Defaults" in LJCP and when it first opens you should see that it saved your timer configuration.

 

Now you can close out of LJCP and go to DAQFactory.  In a new blank CTL, simply add a channel with I/O Type = Timer and Chn# = 0, and it will read the timer value.  The timer value will return the number of clock ticks from the most recent cycle of your waveform:

 

period = ticks/48M

frequency = 48M/ticks

Link to comment
Share on other sites

Brilliant, worked a treat.  Thanks for the newbie step by step, just what I needed with a deadline.  Unfortunately/fortunately I have a little time as we have the incorrect transducer for the test.  Just need to get my head round the simple math to convert the 360 pulse per rev to rpm.

 

One last question:  The torque transducer and tacho are on the same instrument.  If I use this timer technique for the rpm and the AtoD for the torque do I need to worry that the two different measurements will not be at the same point in time.  Am worrying over nothing?  Its just the result I'm interested in is watts, a function of rpm and torque so the data collection needs to be as physically possible to the same time so as not to cast doubt on the results.

 

Thanks again for the brilliant help, looking forward to learning the kit in the near future

Link to comment
Share on other sites

  • 2 weeks later...

Thanks again for the help:  did the math, made the interface, logged the data.  Unfortunately I have had to change the hardware and now the encoder part of the torque transducer is TTL and not 'open collector' as above which worked a treat.

 

I was hoping that the TTL would just work the same as the open collector, but whilst it detects rotation the times reported in LJControlPanel seem random.  My electronics is pretty limited, but using the 5v from labjack for excitation of the encoder with a external 12v sharing a common ground for the transducer.  

 

Any helpful hints would be really appreciated: is my problem with the electronics or the way i'm timing?

 

Kind regards

 

Martin

Link to comment
Share on other sites

Evening,

 

Still really struggling with this and I need further results for use in the Tour de France cycle race so would appreciate any help.  Ive now tried the input with streaming and the good news is that it looks like i have wave the right amount of waveforms but I really would like to get it as simple as the above digital solution, after all it is still the same number of counts.  So hoping something really simple.  Ive attached a snap shot of the stream, dont really get what the  y-axis is.  I suppose the good news is that at least the hardware seems ok in analogue.

 

Thanks for help in advance

 

Link to comment
Share on other sites

The chart you attached is very strange.  It seems to show a signal varying by 1 binary count.  I suggest you attach a full screenshot (Alt+PrtScn) from LJStreamUD so we can see all the settings and everything else.

 

 

Sounds like you now have a tachometer with TTL output.  If it is TTL you should be able to follow the same instructions from post #4 above.

 

In order to count or time the tach signal, the signal needs to create falling and rising edges.  A rising edge is when the voltage from FIO0 to GND changes from low (-0.3 - 0.8V) to high (2.0 - 5.8V).  A falling edge is the opposite.  Perhaps measure the voltage from FIO0 to GND using a DMM, while you turn the tach very slow, and confirm that you see the correct voltages for a low and high.

 

http://labjack.com/support/u6/users-guide/appendix-a

Link to comment
Share on other sites

Thanks for the reply, re-tested and seems to make more sense with the stream seeming to be between 0.5-5v.  Even when going its slowest the DMM gives about 2.6v which I guess is it not reacting quick enough so reading like PWM  (360counts per rpm)

 

I've attached one image of the two tacho outputs 90 degrees apart and it look like it is 90 degrees ok and another image of just one of the tacho inputs.  I would imagine that the trace would have been cleaner with there being a lot of spurious spikes in these traces: is this normal or is it these that are giving my odd counts.  When not turning outputs go high (+5v)

 

Any ideas

 

2 inputs 90 degrees

1 input

 

Thanks again

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.