LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Look up table or a formula node?

Solved!
Go to solution
Solution
Accepted by topic author tingxuejh

altenbach wrote:

For the reverse you could use the explicit formula as e.g. given here or simply do some a quick newton-raphson on the forward eqaution.


Yes, I posted that link already at 06:26!

So I can be faster than Altenbach Smiley Very Happy

 

 

Back on topic.......

 

Can we be realistic on some figures please.
I don't know your process but I think that reading a temperature every 300us is irrealistic.
Also tree digits after decimal point? Are you sure about the significance of the last digit. Is it real temperature or is it noise?

And further, you may have 16 bits resolution but how many bits represents the noise.

So to get ride of the noise you have to average the data from the µcontroller.

How many samples will you average?

Let say 100, that will result in a calculation every 30ms. No problem with the code provided by Altenbach!

Just some thoughts 🙂

 

Forget the look up table 🙂

Message 11 of 17
(1,762 Views)

Alain S wrote:

Yes, I posted that link already at 06:26!

So I can be faster than Altenbach Smiley Very Happy


If you look in detail, I posted the link to the reverse equation, so it's not quite the same. 😉

 

Anyway, my second formula takes about 100nanoseconds (the first formula with the poly eval is about 10x slower), so you are well within specs. 🙂

Message 12 of 17
(1,758 Views)
Also both algorithms would work on arrays of resistances without any change in code, making them even faster.
Message Edited by altenbach on 07-26-2009 10:27 AM
Message 13 of 17
(1,754 Views)

Hi, altenbach,

 

Thank you for your help. It's really useful. But how did you test the speed of the program by the way, you said the calculation takes 100ns, how did you see that? Sorry, I'm really new to labview.

0 Kudos
Message 14 of 17
(1,734 Views)

Hi, Alain,

 

Actually I have a multi-channel temperature measurement system, and they are measured one by one. Each of the measurement takes around 300us,so as a result, the meaurement interval is about 2ms.  I think it is possible.

 

I think the last digit is still temperature, since I have low pass filters in front of the ADC, and the simulation result shows that the noise level is below this value by about 5-10times.

 

What is more, apart from measuring the temperature, the system will also apply control based on the measured temperature. And the control scheme is a simple ON/OFF control. That is, when the temperature is higher than the set-point, switch on the heater. WHen the temperature is lower, swich off the heater. Therefore, in order to make sure the temperature ripples caused by the ON/OFF control is small enough, I hope the time between two measurements as short as possible, that's why I only assigned 300us to each of the channel. Do you think it is realistic?

 

If you have any comments or suggetions, please let me know. THank you .

0 Kudos
Message 15 of 17
(1,731 Views)

Reliable benchmarking can be difficult, but here's the typical approach:

  1. Use a three-frame flat sequence.
  2. Place the code of intererst in the midle frame. 
  3. take a tick in the first and last frame, the difference is the elapsed time in milliseconds.
  4. Generate an array of random numbers with N points
  5. Measure the ms time, divide by N and convert to seconds (factor of 1000).
  6. As you can see, 2M interations take about 125ms.

The details are tricky. You need to use an array of inputs, you cannot simply use a scalar resistance and wire the number of iterations to N and expect the same results. Because of constant folding by the compiler, the contents of the loop would be calculated only once, making it look much faster than it really is (~8ns in this case). Make sure the iteration count it high enough so the time is at least 100-1000ms, else you get unreliable results. You might also want to disable debugging.

 

Note, as I said, you can delete the FOR loop here and the result will be the same. The FOR loop seems very slightly faster, but it's not worth bothering.

 

 

 

 

Message Edited by altenbach on 07-26-2009 12:49 PM
0 Kudos
Message 16 of 17
(1,726 Views)

tingxuejh wrote:

Hi, Alain,

 

Actually I have a multi-channel temperature measurement system, and they are measured one by one. Each of the measurement takes around 300us,so as a result, the meaurement interval is about 2ms.  I think it is possible.


You mean you measure each channel every 2ms? What temperature change do you expect in those 2ms? 

I mean, temperature changes are generally slow processes, so unless you have a very specific process to control, I think measuring every 2ms is overkill.

 

 


tingxuejh wrote: 
And the control scheme is a simple ON/OFF control. That is, when the temperature is higher than the set-point, switch on the heater. WHen the temperature is lower, swich off the heater. Therefore, in order to make sure the temperature ripples caused by the ON/OFF control is small enough, I hope the time between two measurements as short as possible, that's why I only assigned 300us to each of the channel. Do you think it is realistic?


Be sure to foresee a hysteresis or your heater (resistors with relay or SSR?) will switch On/Off every 2ms when your process is at setpoint.

This is also a reason to measure at slower rate 🙂

Message 17 of 17
(1,683 Views)