Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Roy19

Member

05-03-2021 02:51 AM

Options

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hi,

I would like to ask how can I convert the dynamic data from DAQ to a numeric type with specific precision?

The reason I want to do this is because that I want to eliminate the noise from the data I acquired from LVDT (maxium range 0-10V and has about 0.01V noise (error)). So if I limit the significant figure of the acquired data to 2 then I can get a data without oscillation and input it into the PID VI.

Any suggestions is much appreciated!

Roy

Solved! Go to Solution.

Solution

Accepted by topic author Roy19

GerdW

Knight of NI

05-03-2021 03:08 AM - edited 05-03-2021 03:09 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hi Roy,

@Roy19 wrote:

I would like to ask how can I convert the dynamic data from DAQ to a numeric type with specific precision?

The reason I want to do this is because that I want to eliminate the noise from the data I acquired from LVDT (maxium range 0-10V and has about 0.01V noise (error)). So if I limit the significant figure of the acquired data to 2 then I can get a data without oscillation and input it into the PID VI.

Any suggestions is much appreciated!

Why is there a DDT wire at all? Why not use "simple" datatypes right from the beginning???

To reduce noise on a signal you usually apply a filter. Simplest filters are low-pass filters, aka RunningAverage. LabVIEW comes with such a function, it's called PtByPt-Mean…

You can only convert your DDT wire into datatypes using "ordinary" float values, you cannot apply rounding right here. When you really want to "limit the significant digits" of your values you should apply a rounding function after the conversion from DDT. (Be aware of limitations of floating point datatypes, especially regarding rounding to multiples of 10.)

Does your PID really react heavily on fluctuation in the 3rd decimal after decimal separator? Maybe chaning the PID gains may help here, too!

Best regards,

GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO

GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO

05-03-2021 10:19 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hi GerdW,

Thank you so much for your reply.

1. Cause I am using DAQ Assistant so the output signal is automatically DDT. May be I should use DAQmax instead so that I can have DBL data?

2. The round function only derives integer, the only way I can think of is that times the data with 100 and do the rounding and divides 100 again, so that I can get 3 significant digits, is there any more convinient function to get a specific decimal?

Roy

billko

Proven Zealot

05-03-2021 10:37 AM - edited 05-03-2021 10:38 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

@Roy19 wrote:

Hi GerdW,

Thank you so much for your reply.

1. Cause I am using DAQ Assistant so the output signal is automatically DDT. May be I should use DAQmax instead so that I can have DBL data?

2. The round function only derives integer, the only way I can think of is that times the data with 100 and do the rounding and divides 100 again, so that I can get 3 significant digits, is there any more convinient function to get a specific decimal?

Roy

I think that's actually how to do it. More generally multiply your number by 10^x, where x is the number of desired decimal places, then divide by 10^x. (BTW, this even works for rounding to digits to the *left* of the decimal place - e.g., using 10^0 will round your number to the nearest ones column; 10^-1 will round to the nearest 10's, etc. Convenient if you want to round to, let's say, the nearest MHz.)

Bill

(Mid-Level minion.)

My support system ensures that I don't look totally incompetent.

Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

Humble author of the CLAD Nugget.

(Mid-Level minion.)

My support system ensures that I don't look totally incompetent.

Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

Humble author of the CLAD Nugget.

05-03-2021 10:41 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hi Bill,

Really appreciated your help!

Roy

billko

Proven Zealot

05-03-2021 10:48 AM - edited 05-03-2021 10:50 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

This is actually how you would compare numbers to a certain decimal place. Multiply both numbers by 10^x, round, then do the compare! (You don't need to divide again before compare; that just gives you FP errors.)

Bill

(Mid-Level minion.)

My support system ensures that I don't look totally incompetent.

Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

Humble author of the CLAD Nugget.

(Mid-Level minion.)

My support system ensures that I don't look totally incompetent.

Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

Humble author of the CLAD Nugget.