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

Having a lot of variance (Signal Noise) with HRXL-MaxSonar-WR


  • Please log in to reply
4 replies to this topic

#1 alberto

alberto
  • Members
  • 11 posts

Posted 18 November 2012 - 10:28 PM

Hello, I have just bought your Labjack U3-HV and I'm loving it. I have already managed to read from your sensor temps and send signals to SSR. At this time I'm trying to read the analogue signal from a HRXL-MaxSonar-WR (MB7360) to get the level of water in a tank. The only thing is that I'm getting a lot of variance. In millimeters I'm having around 10 mm. My sonar is connected in this way: Pin 7 (GND): To the ground of the FIO5 and FIO4 block Pin 6 (V+): To the Vs of the FIO5 and FIO4 block Pin 3 (Analogue Voltaje O): To FIO4 I configured the FIO5 and FIO4 pin as an analogue input using LJControlPanel, because I dont know how to do it directly using LabView. I have read in the sonar datasheet that if I connect the sensor using analogue output I get a 5mm resolution but if I connect it using pulse with (pin 2) or serial (pin 5) I can get 1 mm resolution. Im looking for 1 mm resolution but I dont know how to connect this pins to the labjack. Does any body knows how to do it? Also, I want to put some sort of filter to get rid of the noise in the signal, I have been trying to use the Filter VI in labjack but without succes, I would really appreciate if some one could help me out. Thank you

#2 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 19 November 2012 - 10:10 AM

Looks like 10mm of variance is about 10mV. That is more than the inherent noise of a low-voltage analog input on the U3, which you can see by connecting a known good signal such as an AA battery.

I would ask MaxBotix the expected noise of the analog output of the sensor. If it has a resolution of 5mm (which makes sense for a 10-bit DAC output), then 10mm of noise would just be +/-1 count, which is good.

Section 4.3.2 describes how to configure an FIO as analog:

http://labjack.com/s...ers-guide/4.3.2

... but in LabVIEW there is a handy utility VI you can use instead. Look at an example such as "U3 Single AIN Example.vi", or just use eAIN (see "U3 eAIN Example.vi") as the easy function automatically configures the line as analog for you.

To measure pulse-width, I would use a timer in duty-cycle measurement mode:

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

Looks like pin 2 gives you a 7.5Hz (133333us) signal with a high-time of 300us to 5000us. I would not worry about measuring the low time properly, but would instead set the timer clock to give good results for the high-time. I suggest you start with the 12Mhz/Div base clock with a divisor of 12, which gives you a 1MHz timer clock. That means each timer tick is 1us, which is simple to start with. Once you see that work, you could change the divisor to 1 to get higher time resolution, although the sensor resolution is only 1mm anyway.

Try it in the test panel in LJControlPanel first, then try LabVIEW by starting with an applicable example.

#3 alberto

alberto
  • Members
  • 11 posts

Posted 19 November 2012 - 11:25 AM

Ok, Im truing to configure the timer on LJ Test Panel. I've got my signal in FIO5 and im configuring my timer with the following parameters: # of timers enabled: 1 Mode, Timer 0: SYSTIMERHIGH (I'm not pretty sure about this variable) Timer Clock Base: 12Mhz/Divisor Timer Clock Divisor:12 Pin Offset: 5 I have already played with the Mode option without getting any result, I was looking for the "Scaled" value to be a number representing a distance in mm but I just received very large numbers or very small numbers and with SYSTIMERHIGH I didn't receive any number. Is the first time I'm dealling with this type of signals and using timers so I actually dont have idea of what I'm doing. Thank in advance.

#4 alberto

alberto
  • Members
  • 11 posts

Posted 19 November 2012 - 12:08 PM

I have just figure it out using the example U3 PWM16 and Duty Cycle.vi that is under LabVIEW_LJUD\Examples\U3\TimerCounter. I connected the Pin 2 (Pulse Width) of my MaxSonar to FIO5 of my LabJack U3-HV. I leave the timer clock base at LJ_tc48MHZ_DIV, which I think is 48 Mhz/div and a divisor of 18. With this settings actually worked great, the signal followed the 1 us/mm (1 microsecond per mm). When I changed the time base and divisor to 12 Mhz and 12, the output did not match the 1 us/mm, the high time(s) was too little. Does any body knows why?

#5 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 21 November 2012 - 12:49 PM

In the example are you changing the hardcoded timer clock value of 48,000,000 value to 12,000,000 for the correct "Timer Clock Frequency"? This value is used to calculate the high/low time in seconds, so make sure to change this along with the "Timer Clock Base" to LJ_tc12MHZ_DIV and "Timer Clock Divisor" to 12.

Also, in LJControlPanel you want to use the DUTYCYCLE mode. SYSTIMERHIGH mode reads the upper 32 bits of the system timer, which is an internal timer.


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users