LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

first points problem

Solved!
Go to solution

Hi there,

 

I have a DAQ device that is responsible for driving an electromagnet. When starting the VI, it seems that there are three or more points of my

measurement data are not accurate as they have been taken before that field reaching its maximum and then sweeping up and down. In other words, I

supply 2V with 0.1 increment to the electromagent and the gauss meter is taking the measurement. The problem is that it takes the values somewhere

between zero and the maximum value which is about 50 mT. While it should read 50 mT for the first point, it takes 10 mT for the first, 35 mT for the second until it getting on with the DAQ output.

 

 

DAQ output (V): 2, 1.9, 1.8, 1.7, 1.6, 1.5, ...............

 

supposed field reading (mT): 50, 47, 43, 41, 39, 37,................

 

actual field reading: 10, 29, 43, 41, 37,.................

 

 

My question is how I can say to the measrement device to wait until the field reaching the desired value (max) and then start recording the data.

 

Any help in doing this will be really appreciated.

 

Many thanks

 

Islam means peace
0 Kudos
Message 1 of 13
(3,343 Views)

Well, current in coils behave like a inertial mass 😉 so you need some delay between changing the output voltage and reading the input voltage.

Take a closer look to the step response :

while capturing the both voltages with a high sampling rate (or a scope) apply a voltage step. Now measure the tau of your system ( coarse the time between the output step and the 67% end value of the input value. Use a timedelay > 5 times that tau ...

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 2 of 13
(3,316 Views)

Thank you very much Henrik for the points you made. Yes it is similar to an inertial mass. As an elementary user of labview, I'd like to ask you if you could show me your suggestion (to put a time delay between the output voltage and reading the input voltage.) in a simple VI. Also, I'm afraid I'm not

familiar with sampling rate but I assume my code is working with the default sampling rate.

 

Greetings from the UK.

Islam means peace
0 Kudos
Message 3 of 13
(3,306 Views)

three or more points of my measurement data are not accurate  

 

What leads you to think those numbers are not accurate?

 

Remember the basic rules of electronics: Magnetic field is proportional to the current thru the coil.  Current thru a coil (voltage across a capacitor) cannot change instantaneously. It's not just a good idea, it's the law.

 

If you step the voltage from 0 to 2 volts, The current will not change immediately.Therefore the field will not change immediately. Depending on the inductance, and the current supply characteristics, your field will build up over time.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 4 of 13
(3,300 Views)

Yes you are right that there is some physics behind. It might take time until the field stabilises but I don't want this to be shown in my data as it looks something funny. The intitial measured values are not desirable for this reason and would like my code to wait until the field reaching its maximum and then the measuement devices start recording.

 

Many thanks

Islam means peace
0 Kudos
Message 5 of 13
(3,293 Views)

Take a look at the example codes provided (help-find examples- ...)

 

Build a simple state machine ( there is a tutorial for that, and a starting template too)

1-Init and setup devices

2-set output

3-wait

4-read value

5-get new value to set or leave

6-close device

 

instead of waiting a defined time you can read values and look for the difference (or standard dev, or ...)  and define an acceplable threshold (and a timeout, so you don't wait forever if there is n too much noise 😉 )

 

Sorry, no time to help out  (and no DAQmx device, only PXI-scope and PXI AWGs 😉 )

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 6 of 13
(3,289 Views)

Thank you Henrik for your suggestions. I may try using the state machine but I'm still hoping that there is a simpler apporoach.

 

Many thanks indeed!

Islam means peace
0 Kudos
Message 7 of 13
(3,283 Views)

You haven't posted any code, so I don't know what you are doing.

Here's a thought:

Start the AO task (set +2 V)

Wait X mSec

Start the AI task (measurement)

 

Here's another thought:

Start the AO task and AI task, sampling at X Hz. (If timing accuracy is utmost, use a common trigger to start them both).

Read N samples

Delete first M samples from array read.

 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 8 of 13
(3,281 Views)

Many thanks CoastalMaine for your help. I attached my code and I'd really appreciate if you could try the points you mentioned with it.

 

 

 

 

Islam means peace
0 Kudos
Message 9 of 13
(3,270 Views)

I'd really appreciate if you could try the points you mentioned with it.

 

 

Sorry, I have neither the hardware nor the time to try and run your code.

 

I gave you two options - did you try either one?

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 10 of 13
(3,268 Views)