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

noise reduction for a weight scale


  • Please log in to reply
6 replies to this topic

#1 healthograph

healthograph
  • Members
  • 4 posts

Posted 23 June 2010 - 12:14 PM

Labjack support, I am using Labjack U3-HV and LJTick-InAmp to read the signal of regular bathroom scale strain gauge. The strain gauge is excited by 5 volt dc from labjack U3 and the signal from strain gauge is connected to LJTick-InAmp to get gain of 201 with Output offset of +1.25 volts then connected to AIN3 of Labjack U3. I am having trouble getting steady signal from labjack. My voltage reading fluctuate (+ -) 0.01 volts and thus my weight reading is about (+- 4-5 lbs). I trying to reduce the noise on the strain gauge signal. Will taking less samples help and how would I do that ? or Should I time-average (low pass filter) the readings ? Thanks for your help

#2 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 23 June 2010 - 12:35 PM

The first thing to try is using Vref from the LJTIA to excite your bridge, rather than VS from the U3. Another easy thing is to oversample and average.

#3 healthograph

healthograph
  • Members
  • 4 posts

Posted 23 June 2010 - 12:49 PM

How Do I control the sampling rate ?

#4 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 23 June 2010 - 12:52 PM

What are you using for software?

#5 healthograph

healthograph
  • Members
  • 4 posts

Posted 23 June 2010 - 01:01 PM

I am using following labjack code where AI3 is the return of the function UpdateReadings. Then I apply linear constant and offset factor to compute the weight. where can I control the sampling rate in UpdateReadings function ? thanks private double UpdateReadings() { // local variables used double AI3 = 0.0; // Grab value from the number control and assign it to a double double DAC0 = excitation_v; // Changed from 2.5 for wider scale // , also changed eqn in buttonAddWeightClick() InitLabJack(); try { if (lj_init == true) { //Start by using the pin_configuration_reset IOType so that all //pin assignments are in the factory default condition. LJUD.ePut(lj_u3.ljhandle, U3.IO.PIN_CONFIGURATION_RESET, 0, 0, 0); //First some configuration commands. These will be done with the ePut //function which combines the add/go/get into a single call. //Configure FIO2 and FIO3 as analog, all else as digital. That means we //will start from channel 0 and update all 16 flexible bits. We will //pass a value of b0000000000001100 or d12. LJUD.ePut(lj_u3.ljhandle, U3.IO.PUT_ANALOG_ENABLE_PORT, 0, 12, 16); //Set the timer/counter pin offset to 7, which will put the first //timer/counter on FIO7. LJUD.ePut(lj_u3.ljhandle, U3.IO.PUT_CONFIG, U3.CHANNEL.TIMER_COUNTER_PIN_OFFSET, 7, 0); //Enable Counter1 (FIO7). LJUD.ePut(lj_u3.ljhandle, U3.IO.PUT_COUNTER_ENABLE, (U3.CHANNEL)1, 1, 0); lj_init = false; } //The following commands will use the add-go-get method to group //multiple requests into a single low-level function. //Request AIN2 and AIN3. // LJUD.AddRequest(lj_u3.ljhandle, U3.IO.GET_AIN, 2, 0, 0, 0); LJUD.AddRequest(lj_u3.ljhandle, U3.IO.GET_AIN, 3, 0, 0, 0); //Set DAC0 to excitation_v volts. LJUD.AddRequest(lj_u3.ljhandle, U3.IO.PUT_DAC, 0, DAC0, 0, 0); //Request the value of Counter1. //LJUD.AddRequest(lj_u3.ljhandle, U3.IO.GET_COUNTER, 1, 0, 0, 0); // Execute them LJUD.GoOne(lj_u3.ljhandle); // Get results // LJUD.GetResult(lj_u3.ljhandle, U3.IO.GET_AIN, (U3.CHANNEL)2, ref AI2); LJUD.GetResult(lj_u3.ljhandle, U3.IO.GET_AIN, (U3.CHANNEL)3, ref AI3); //LJUD.GetResult(lj_u3.ljhandle, U3.IO.GET_COUNTER, (U3.CHANNEL)1, ref Counter1); } catch (LabJackUDException e) { // If error occured print a message box showing which // MessageBox.Show(this, e.ToString(), "LabjackUD Error #" + (int)e.LJUDError); lj_hadError = true; } return AI3; } // Initializes LabJack public void InitLabJack() { // InitializeComponent(); try { lj_u3 = new U3(LJUD.CONNECTION.USB, "0", true); lj_u3.u3Config(); } catch (LabJackUDException e) { // If an error occurs print a message box with error // APP STUFF // MessageBox.Show(this, e.ToString(), "LabjackUD Error #" + (int)e.LJUDError); // Set flag to show error has happened and prevent further communication lj_hadError = true; // Set UE9 object values to defaults so we don't have any null values being referenced lj_u3 = new U3(); } }

#6 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 23 June 2010 - 02:46 PM

Do you need all that stuff in UpdateReadings? If all you want is 1 analog input reading, just make a call to eAIN.

http://labjack.com/s...rs-guide/4.2.17

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

Either way, you are using command/response mode, so the timing is controlled by you in software. For example, say you want a reading once every 3 seconds, where each reading is the average of 100 readings. I am not a C# programmer, but the general pseudocode would look like:

While (run):

	AvgReading = 0.0

	For (100 iterations):
		eAIN(lngHandle, 3, 31, &dblVoltage, 0, 0, 0, 0, 0, 0)
		AvgReading = AvgReading + (0.01 * dblVoltage)

	Display AvgReading

	Wait (3000 milliseconds)


#7 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 23 June 2010 - 02:48 PM

And again, the first thing to do is use Vref rather than VS, as Vref is much quieter, much more accurate, and much more stable.


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users