Jump to content

As of July 17, 2015, the LabJack forums here at forums.labjack.com are shut down. New registrations, topics, and replies are disabled. All forums are in a read-only state for archive purposes.

Please visit our current forums at labjack.com/forums to view and make new posts. To post on the current forums, use your labjack.com login account. Your old LabJack forums login credentials have been retired. There are no longer separate logins for labjack.com and LabJack forums.


Photo

Built-in CJC and Stream Mode


  • Please log in to reply
16 replies to this topic

#1 mmedas

mmedas
  • Members
  • 6 posts

Posted 16 October 2013 - 11:05 AM

I have a Labjack U6. I know that the built-in temperature sensor is not accessible when the device is being used in stream mode, having read this in the user's guide.

 

I am looking to measure the temperature and RPM of a machine.

 

I have thermocouples which I have no trouble using with the built-in temp sensor as the CJC. I know there are other options for sensors out there, but I have the materials to make my own TCs. Also, the sensors will inevitably get destroyed when I use them, so continuing to buy new parts is not an option.

 

I also have a reed switch - I know I can use this with a timer in stream mode to determine the RPM with some simple math.

 

Since stream mode locks out the built-in temp sensor (and for good reason - poor response time of the sensor), I am left scratching my head. 

 

My first guess at solving the problem would be to use a calibrated temperature sensor to measure the ambient temperature (therefore, creating my own CJ reference which can be used outside of stream mode?). I'm not sure about the response time of thermistors and those things, though. Does this sound like the most reasonable solution? Any other suggestions?

 

Thanks!

Matt



#2 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 16 October 2013 - 01:11 PM

A quick, easy, and inexpensive solution is to simply put some silicon-type sensor in some analog input.  You can put one of these right in the applicable screw-terminals, and in fact we always recommend this when connecting thermocouples to the CB37 as you want to know the temperature of the screw terminals on the CB37.  The LM34CAZ is a good option:

 

http://labjack.com/s...erature-sensors

 

Note that the LM34 can still require extra settling time than is provided automatically.  See the following forum topic:

 

https://forums.labja...?showtopic=6269

 

One thing I am unclear on is whether you actually need to use stream mode.  Is the temperature or RPM changing so fast that you need stream mode to monitor rapid changes in either?



#3 mmedas

mmedas
  • Members
  • 6 posts

Posted 16 October 2013 - 01:59 PM

(Please forgive my ignorance with a lot of this stuff -- still trying to learn)

 

The machine speed will vary from 0-5500 RPM, or a frequency of 0~100Hz.

 

My intent was to use the firmware counter, but I read that the built-in debouncing has a delay of its own and will limit the speed of the measurements. I suppose that the RPM measurement doesn't need to be too too accurate (maybe within ~100RPM?), but I'm concerned about it being less accurate than that. I've also considered adding a simple RC circuit to hardware debounce. Is this logic correct?

 

I don't expect that either of the parameters will change drastically during measurements -- temperature will be continuous, and while machine RPM will vary during use, it will be mostly constant and I do not care about the short transition period in between speeds.



#4 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 16 October 2013 - 02:26 PM

Does not sound like you want stream mode.  Sounds like you could just poll the U6 once per second to get your temperature readings and RPM reading.

 

First thing I would do is determine if you have bounce.  Connect the reed switch to FIO0 and GND, go into the test panel in LJControlPanel and enable Counter0, then turn the machine a known number of revolutions and see if you get the correct count or lots more.



#5 mmedas

mmedas
  • Members
  • 6 posts

Posted 17 October 2013 - 06:55 AM

I have confirmed that there is bounce using LJControlPanel - I get way too many readings per machine turn.



#6 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 17 October 2013 - 07:47 AM

You have a tough situation then.  You have bounce, but your max frequency of 100 Hz is too fast for a U6 timer in debounce mode 6.  Some thoughts:

 

  1.  I will look at whether the new T7 can do what you need.

 

  2. If you want to handle it in software, that is an option.  You would stream the signal into an analog or digital input at perhaps 2 kscans/second or faster, and then come up and algorithm in your software data processing to handle the bounce.

 

  3.  Try a simple RC circuit.  See Section 2.8.1.3 of the U6 User's Guide, but you would need to make the circuit faster to work at 100 Hz.

 

  4.  Use a debounce IC.  See Section 2.8.1.3 of the U6 User's Guide and the following links to Maxim:

 

http://www.maximinte...ndex.mvp/id/287

 

http://www.maximinte...tch_debouncers/

 

 

If you use hardware option 3 or 4 to do hardware debounce, then you can just connect the debounced signal to a counter that you read once per second, or to a period measurement timer that you read once per second:

 

https://forums.labja...?showtopic=1105



#7 mmedas

mmedas
  • Members
  • 6 posts

Posted 17 October 2013 - 08:16 AM

I may have figured out a workaround that seems accurate enough for my needs.

 

 

I enabled a timer with the firmware debounce option (with a value of 0) and used the base timer clock 4Mhz with divisor. I believe I set the divisor to "2"

 

I also connected a digital counter to the reed switch. I'm assuming that the counter has some hardware debouncing of its own, as it is rated up to 25KHz input.

 

With the settings above, I revved the motor several times and counted ~3600 turns -- the labjack reading was a mere 10 counts off.

 

This should be accurate enough for my needs. However (and again please forgive my ignorance), I want to make sure - am I missing anything about this, fundamentally?



#8 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 17 October 2013 - 09:54 AM

I don't understand.  Are you saying you have the same reed switch signal connected to 2 timer inputs.  One configured as Firmware Counter (mode 5) and the other configured as Firmware Counter with Debounce (mode 6):

 

http://labjack.com/s...s-guide/2.9.1.5

 

http://labjack.com/s...s-guide/2.9.1.6

 

Note that the timer clock has nothing to do with either of those modes.

 

Are they both reading the same?

 

The Firmware Counter (timer mode 5) is slower than the Hardware Counter you tested with earlier, so will not get as many bounce counts.  It is not the mode 5 has any debounce by design, it is simply slower and thus does notice the bounce as much.



#9 mmedas

mmedas
  • Members
  • 6 posts

Posted 17 October 2013 - 10:15 AM

Sorry for the confusion:

 

I have one timer configured on the labjack which is using mode 6. I also have  Fargo 8905D digital totalizing counter http://www.fargocont...Fargo_8900D.pdf which I can connect to the same reed switch -- and from there I can compare the labjack count with the 8905D count.



#10 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 17 October 2013 - 10:25 AM

OK.  So if you are passing in a config timer Value of 0 (which is the default), you are counting falling edges and the debounce (ignore) time is from there.  With Value = 0, the debounce time is somewhere between 0-16 ms.

 

    - If the debounce time is 16 ms, then 62 Hz would be the max frequency you could count, so you would miss some counts at 100 Hz.

 

    - If the debounce time is 0 ms, then you will get minimal debounce and likely get extra counts.

 

    - If the debounce time is say 2-9 ms, then it will work pretty well, except that at lower speeds the debounce will not be hiding any bounce that occurs on the rising edge, so bounces there might cause extra counts.



#11 mmedas

mmedas
  • Members
  • 6 posts

Posted 17 October 2013 - 10:44 AM

Got it -- one more question: What determines the actual value of the 0-16 ms variable debounce time? Is this based on processing time//system resources?



#12 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 19 October 2013 - 11:09 PM

The denounce window is controlled by an internal system clock that is always running. An edge can come in anywhere during that 0-16 ms. If it is towards the end the debounce time is almost zero.



#13 novi

novi
  • Members
  • 3 posts

Posted 26 January 2014 - 07:34 PM

hai. I just use Labjack, especially Labjack u6. I still do not understand how to measure temperature using Labjack. I'm doing a project for reading thermocouple temperature and shows it with labview software programs. help me how to connect Labjack u6 with thermocouples so that the temperature can be performed on labview program.

 

novi
thank you.



#14 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 27 January 2014 - 02:27 PM

Start with the U6 thermocouple tutorial here:

 

http://labjack.com/s...s/thermocouples

 

 

For general help getting started with the U6 in LabVIEW go through steps 1-6 here:

 

http://labjack.com/s...xamples/labview

 

 

Then look at "U6 Thermocouple Example.vi" that is included in the LabVIEW_LJUD archive.



#15 novi

novi
  • Members
  • 3 posts

Posted 27 January 2014 - 07:01 PM

OK.. i try it

thank you.



#16 novi

novi
  • Members
  • 3 posts

Posted 27 January 2014 - 07:16 PM

I've tried to follow the tutorial in http://labjack.com/s...s/thermocouples but I was confused when opening files LJLogUD. when opened it, there was a window to take a labview program, but when I want to enter a program example thermocouple, Thermocouple U6 Example.vi it does not work.

please help.



#17 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 28 January 2014 - 12:00 PM

What problem did you have with the tutorial?  Sounds like perhaps you had trouble getting LJLogUD to run?  LJLogUD.exe is an executable file.  You will find a shortcut to start it in the start menu ... same place you find LJControlPanel.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users