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

JLuna

Member

10-06-2016 10:34 AM

Options

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

I have the datasheet from a NTC (Negative Thermistor Coefficient) and I want to calculate the most approximate equation

that describes it's behaviour. The table has temperature and resistance values. So the resistance of the NTC varies depending on the temperature it detects. I've already tried the next:

- Excel: polynomial fitting

- Maple: polynomial fitting

- LabVIEW: Polynomial Fit.vi

I've been getting equations with a not very good approximate parameteres. I'm suspecting that this method "polynomial FIT" it's not the best method for this type of data/equation (being a nonlinear equation).

So has someone used the Nonlinear Fit.vi to approximate the behaviour of a dataset? If so, can you explain me how this VI works... I would really appreciate it.

Thanks in advance and I'll wait for your answer.

Solved! Go to Solution.

johnsold

Knight of NI

10-06-2016 10:41 AM

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

I have not looked at your VI.

Any fitting process needs to start with an appropriate function. To get that you need to look at the physics of your system - in this case a thremistor. A simple search will show that the resistance-temperature relationship is not at all a polynomial. Specifically, the Steinhart-Hart equation is often used.

You may be able to fit the 3 parameters of that equation to your data table using Lev-Mar or something similar.

Lynn

GerdW

Knight of NI

10-06-2016 12:04 PM - edited 10-06-2016 12:06 PM

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

Hi JLuna,

could you convert your VI to LV2014 and attach this version too? (This would allow me and others to actully examine your VI.)

Another approach, most often very easy with good results:

Put the resistance-temperature pairs into an array of points. Then use Interpolate1DArray to get the temperature from resistance reading:

(Replace my dummy data with you real data!)

One more approach: with NTC thermistors you usually get R0 and B values from datasheet. Then apply the formulas described at Wikipedia!

Best regards,

GerdW

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

GerdW

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

10-06-2016 12:07 PM

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

i've just read about this equation. I didn't have notion of it's existance. Apparently it has 3 coefficients that can be

calculated. In your post you mention:

"You may be able to fil 3 parameters of that equation to your data table using Lev-Mar or something similar".

And by "3 parameters" you mean, the coefficients that are needed to be calculated. If I'm interpretating this right, there

is a Nonlinear vi, that uses the method Lev-Mar. In this VI, it has an input called "initial parameters": Is this input referring to this parameters?

**I've never used this type of VI's so I'm having lots of questions...

Thanks for your answer!!

10-06-2016 12:28 PM

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

Here is the 2014 version. I'll try that interpolating also... I'm a bit skeptical, because the "Interpolate 1D array"mentions to linearize the "y"values from your "x" values. But I'll give that a try also.

I just want to calculate en equation with a very low error. I dunno maybe at most, 2% error.

Thanks for your answer.

altenbach

Knight of NI

10-06-2016 01:14 PM

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

A higher order polynomial is a nonlinear fit. If you use more normal fit option (just delete these misquided "bisquare" and "SVD for rank defficient ..." inputs!) and things look much better!

altenbach

Knight of NI

10-06-2016 01:20 PM - edited 10-06-2016 01:25 PM

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

@altenbach wrote:A higher order polynomial is a nonlinear fit. If you use more normal fit option (just delete these misquided "bisquare" and "SVD for rank defficient ..." inputs!) and things look much better!

Here is a 6th order polynomial fit to the two datasets leaving the optional inputs disconnected. Seems good enough.

altenbach

Knight of NI

10-06-2016 01:22 PM

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

But yes, if there is a suitable mathematical model with fewer paramters, you should use nonlinear fit.

10-06-2016 01:27 PM

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

Can you display the six order equation for those two graphics.

I generated several equations using "Polynomial Fit" and using the calculated equations I substitute a new value of my choice, for

example 23.2. And watched how this equation delivered a similar value to the graphic. So, can you display the equations please?

altenbach

Knight of NI

10-06-2016 01:33 PM

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

The equations are polynomials and the coefficients I found were:

32080.3

-1484.52

48.3516

-1.35193

0.0224839

-0.000180263

5.39565E-7

and for the lower set:

32080.3

-1484.52

48.3516

-1.35193

0.0224839

-0.000180263

5.39565E-7

Just put them into a DBL array and use polynomial evaluation to calculate the value for any desired x or array of x's.