<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Slow rate calculation in LabVIEW</title>
    <link>https://ni.lithium.com/t5/LabVIEW/Slow-rate-calculation/m-p/930308#M417802</link>
    <description>&lt;P&gt;Loop spins too fast:&lt;/P&gt;&lt;P&gt;&amp;nbsp;This is merely a placeholder for the actual code that reads the scale. You can throw a 100ms wait in there if you want, as that's how often I check the scale.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sequence structure has no purpose:&lt;/P&gt;&lt;P&gt;&amp;nbsp;Another benefit of using those shift registers instead of my locals. Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All terminals should be outside any structures:&lt;/P&gt;&lt;P&gt;&amp;nbsp;That's interesting. What about doing that makes it more efficient? It looks like just moving the terminals outside the case structure would change the behavior. How would you change the subVI?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;No stop:&lt;/P&gt;&lt;P&gt;&amp;nbsp;As with the first flaw, this is just some demo code copied from a larger program so I could get some help. The larger program has a better stop function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your version is good, but would you change it if other loops in the program needed access to Pump Mass? With it in the loop, it seems I'd have to use locals again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm always happy to hear a better algorithm. Using a timer rather than an increment each second would improve precision, but I never could get it working quite right. Actually, my algorithm is discussed on this other forum: &lt;A href="http://mathforum.org/kb/message.jspa?messageID=6698550&amp;amp;tstart=0" target="_blank"&gt;http://mathforum.org/kb/message.jspa?messageID=6698550&amp;amp;tstart=0&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I tried to implement a simple form of Hagman's first suggestion. If someone knows what he's talking about in his second suggestion, maybe that'd make a good algorithm. &lt;/P&gt;</description>
    <pubDate>Fri, 19 Jun 2009 23:09:20 GMT</pubDate>
    <dc:creator>IMSargon</dc:creator>
    <dc:date>2009-06-19T23:09:20Z</dc:date>
    <item>
      <title>Slow rate calculation</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Slow-rate-calculation/m-p/929282#M417366</link>
      <description>&lt;P&gt;The attached VI is my attempt to calculate the feed rate of a pump which pumps out of a container on a scale. The rate is very slow, on the scale of about 10Kg/h. The best way I can think of to calculate such a rate is to time how long it takes for the scale to change. I also need some ability to filter out noise (bumping the scale, tubes being hit, breezes, instability between mass changes). It works, more or less, but I feel it could use improvement. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Assume the indicator, "Pump Mass", is constantly being updated with the current scale mass (which measures pounds and converts to kilograms by using a factor of 0.45)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The intention of my code is to first check the mass once per second. If the mass does not change, it increments the timer. When it does change, and if it has been more than 5 seconds (that's my filter), it calculates the current rate and then resets the process.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Is there a better way to write my method than how I have written it?&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Is there a method that is better than my method? &lt;/P&gt;</description>
      <pubDate>Thu, 18 Jun 2009 16:35:29 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Slow-rate-calculation/m-p/929282#M417366</guid>
      <dc:creator>IMSargon</dc:creator>
      <dc:date>2009-06-18T16:35:29Z</dc:date>
    </item>
    <item>
      <title>Re: Slow rate calculation</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Slow-rate-calculation/m-p/930017#M417674</link>
      <description>&lt;P&gt;I try to avoid local variables in my programming because they have bitten me more then once by causing race conditions.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I pretty much used your program but instead of local variables I pass the data with shift registers inside the loop.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The GetSetMass.vi is in a parallel loop just as an example but it can be used somewhere else in your program to bring in the updated Pump Mass information.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jun 2009 15:47:28 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Slow-rate-calculation/m-p/930017#M417674</guid>
      <dc:creator>BrianInTheForest</dc:creator>
      <dc:date>2009-06-19T15:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: Slow rate calculation</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Slow-rate-calculation/m-p/930263#M417779</link>
      <description>&lt;P&gt;So your shift registers eliminate not only the need for the locals but also the need for the hidden indicators I was using to store data. The subVI is simply a FGV, is that correct? Is it a common practice to use many SubVIs in this way? Are there other benefits besides avoiding race conditions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your good advice. &lt;/P&gt;</description>
      <pubDate>Fri, 19 Jun 2009 21:14:50 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Slow-rate-calculation/m-p/930263#M417779</guid>
      <dc:creator>IMSargon</dc:creator>
      <dc:date>2009-06-19T21:14:50Z</dc:date>
    </item>
    <item>
      <title>Re: Slow rate calculation</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Slow-rate-calculation/m-p/930268#M417780</link>
      <description>&lt;P&gt;Hi IMSargon,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"other benefits":&lt;/P&gt;&lt;P&gt;&amp;nbsp;Locals cause data copies, hence increase memory needs (bad when using big arrays). Making data copies almost always means slower execution too... &lt;/P&gt;</description>
      <pubDate>Fri, 19 Jun 2009 21:23:00 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Slow-rate-calculation/m-p/930268#M417780</guid>
      <dc:creator>GerdW</dc:creator>
      <dc:date>2009-06-19T21:23:00Z</dc:date>
    </item>
    <item>
      <title>Re: Slow rate calculation</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Slow-rate-calculation/m-p/930283#M417787</link>
      <description>&lt;P&gt;Brians example is&amp;nbsp;somewhat flawed, so you should make a few corrections:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The loop in the lower left spins way too fast, consuming all CPU. It only needs to&amp;nbsp;spin if the value changes.&lt;/LI&gt;&lt;LI&gt;The sequence structure has no purpose.&lt;/LI&gt;&lt;LI&gt;For efficieincy, all terminals of the subVI should be outside any&amp;nbsp;structures.&lt;/LI&gt;&lt;LI&gt;There is no way to stop the program, we can only abort.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's a quick version without subVIs. It's just a dumb refactor without locals. I would still watch for a better algorithm. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by altenbach on &lt;/SPAN&gt;&lt;SPAN class="local-date"&gt; 06-19-2009&lt;/SPAN&gt;&lt;SPAN class="local-time"&gt; 02:55 PM&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 19 Jun 2009 21:55:31 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Slow-rate-calculation/m-p/930283#M417787</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2009-06-19T21:55:31Z</dc:date>
    </item>
    <item>
      <title>Re: Slow rate calculation</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Slow-rate-calculation/m-p/930308#M417802</link>
      <description>&lt;P&gt;Loop spins too fast:&lt;/P&gt;&lt;P&gt;&amp;nbsp;This is merely a placeholder for the actual code that reads the scale. You can throw a 100ms wait in there if you want, as that's how often I check the scale.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sequence structure has no purpose:&lt;/P&gt;&lt;P&gt;&amp;nbsp;Another benefit of using those shift registers instead of my locals. Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All terminals should be outside any structures:&lt;/P&gt;&lt;P&gt;&amp;nbsp;That's interesting. What about doing that makes it more efficient? It looks like just moving the terminals outside the case structure would change the behavior. How would you change the subVI?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;No stop:&lt;/P&gt;&lt;P&gt;&amp;nbsp;As with the first flaw, this is just some demo code copied from a larger program so I could get some help. The larger program has a better stop function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your version is good, but would you change it if other loops in the program needed access to Pump Mass? With it in the loop, it seems I'd have to use locals again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm always happy to hear a better algorithm. Using a timer rather than an increment each second would improve precision, but I never could get it working quite right. Actually, my algorithm is discussed on this other forum: &lt;A href="http://mathforum.org/kb/message.jspa?messageID=6698550&amp;amp;tstart=0" target="_blank"&gt;http://mathforum.org/kb/message.jspa?messageID=6698550&amp;amp;tstart=0&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I tried to implement a simple form of Hagman's first suggestion. If someone knows what he's talking about in his second suggestion, maybe that'd make a good algorithm. &lt;/P&gt;</description>
      <pubDate>Fri, 19 Jun 2009 23:09:20 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Slow-rate-calculation/m-p/930308#M417802</guid>
      <dc:creator>IMSargon</dc:creator>
      <dc:date>2009-06-19T23:09:20Z</dc:date>
    </item>
    <item>
      <title>Re: Slow rate calculation</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Slow-rate-calculation/m-p/930311#M417804</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;IMSargon wrote: &lt;BR /&gt;&lt;P&gt;So your shift registers eliminate not only the need for the locals but also the need for the hidden indicators I was using to store data. The subVI is simply a FGV, is that correct? Is it a common practice to use many SubVIs in this way? Are there other benefits besides avoiding race conditions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your good advice. &lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;Glad to help.&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE&gt;I use functional global variables(FGV) all the time... for passing many types of data&amp;nbsp; amongst VI's. &lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE&gt;I do use local variables for initializing controls.&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE&gt;&amp;nbsp;&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Fri, 19 Jun 2009 23:22:07 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Slow-rate-calculation/m-p/930311#M417804</guid>
      <dc:creator>BrianInTheForest</dc:creator>
      <dc:date>2009-06-19T23:22:07Z</dc:date>
    </item>
    <item>
      <title>Re: Slow rate calculation</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Slow-rate-calculation/m-p/930394#M417843</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;IMSargon wrote: &lt;BR /&gt;&lt;P&gt;&lt;EM&gt;&amp;gt;All terminals should be outside any structures:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;That's interesting. What about doing that makes it more efficient? It looks like just moving the terminals outside the case structure would change the behavior. How would you change the subVI?&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I was talking about the FGV subVI by Brian. For a detailed discussion, see &lt;A href="http://forums.ni.com/ni/board/message?board.id=170&amp;amp;view=by_date_ascending&amp;amp;message.id=191642#M191642" target="_blank"&gt;this post by Darren&lt;/A&gt; (read that entire thread for details).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;No, it won't change the behavior if you do it right, it could for example look like that:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="http://forums.ni.com/ni/attachments/ni/170/417843/1/TerminalsOutside.png" border="0" width="392" height="155" align="center" /&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;IMSargon wrote: &lt;BR /&gt;&lt;P&gt;Your version is good, but would you change it if other loops in the program needed access to Pump Mass? With it in the loop, it seems I'd have to use locals again.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Not necessarily. (of course&amp;nbsp;there is nothing wrong with a local here and there). Still, if you would use a queue, the loop would only spin when a new value is available. Keep track of the tick count and the code will know when the last significant change happenend.&lt;/P&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by altenbach on &lt;/SPAN&gt;&lt;SPAN class="local-date"&gt; 06-20-2009&lt;/SPAN&gt;&lt;SPAN class="local-time"&gt; 09:27 AM&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 20 Jun 2009 16:27:45 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Slow-rate-calculation/m-p/930394#M417843</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2009-06-20T16:27:45Z</dc:date>
    </item>
    <item>
      <title>Re: Slow rate calculation</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Slow-rate-calculation/m-p/930398#M417846</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;IMSargon wrote: &lt;BR /&gt;&lt;P&gt;I'm always happy to hear a better algorithm. Using a timer rather than an increment each second would improve precision, but I never could get it working quite right. Actually, my algorithm is discussed on this other forum: &lt;A href="http://mathforum.org/kb/message.jspa?messageID=6698550&amp;amp;tstart=0" target="_blank"&gt;http://mathforum.org/kb/message.jspa?messageID=6698550&amp;amp;tstart=0&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I tried to implement a simple form of Hagman's first suggestion. If someone knows what he's talking about in his second suggestion, maybe that'd make a good algorithm. &lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I would just collect raw weight data every second and place a few&amp;nbsp;hundred points (or whatever)&amp;nbsp;into a FIFO buffer, then simply do some low-pass filtering or smoothing operation&amp;nbsp;(e.g. fit to a polynomial of suitable order) to calculate the derivative at the newest edge of the data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems way too convoluted to throw away data based on changes and such.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have some typical raw data, e.g. weight reading every second for an hour or so to play with?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jun 2009 16:37:34 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Slow-rate-calculation/m-p/930398#M417846</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2009-06-20T16:37:34Z</dc:date>
    </item>
    <item>
      <title>Re: Slow rate calculation</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Slow-rate-calculation/m-p/930407#M417852</link>
      <description>&lt;P&gt;Raw data? Great idea! I've attached two files with example data. In both cases the pump is running at a constant rate. The two files are two different scales with two different pumping rates.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ideally, we would like to know the rate at which we are pumping in real time. However, the scale isn't sensitive enough to do that. So what's the next best thing? &lt;/P&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by IMSargon on &lt;/SPAN&gt;&lt;SPAN class="local-date"&gt; 06-20-2009&lt;/SPAN&gt;&lt;SPAN class="local-time"&gt; 12:48 PM&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 20 Jun 2009 17:48:52 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Slow-rate-calculation/m-p/930407#M417852</guid>
      <dc:creator>IMSargon</dc:creator>
      <dc:date>2009-06-20T17:48:52Z</dc:date>
    </item>
    <item>
      <title>Re: Slow rate calculation</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Slow-rate-calculation/m-p/930424#M417866</link>
      <description>&lt;P&gt;(OK, CSV means comma separated values, however you files are tab delimited. Be careful with extensions! :D)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think all you need to do is use the &lt;A href="http://zone.ni.com/reference/en-XX/help/371361E-01/ptbypt/linear_fit_ptbypt/" target="_blank"&gt;pt-by-pt linear fit&lt;/A&gt; of the incoming data with a reasonable buffer size (e.g. 3000 points) and things look pretty good.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(The lower FOR loop processes the data one point at a time, calculating the instantaneous slope from the historical data. In your application, it would just read the current weight at constant intervals at each iteration.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's a quick example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="http://forums.ni.com/ni/attachments/ni/170/417866/3/PtByPtSlopeDiagram.png" border="0" width="478" height="226" align="center" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG src="http://forums.ni.com/ni/attachments/ni/170/417866/2/PtByPtSlope.png" border="0" width="904" height="542" align="center" /&gt;&lt;/P&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by altenbach on &lt;/SPAN&gt;&lt;SPAN class="local-date"&gt; 06-20-2009&lt;/SPAN&gt;&lt;SPAN class="local-time"&gt; 01:40 PM&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 20 Jun 2009 20:40:56 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Slow-rate-calculation/m-p/930424#M417866</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2009-06-20T20:40:56Z</dc:date>
    </item>
    <item>
      <title>Re: Slow rate calculation</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Slow-rate-calculation/m-p/930446#M417884</link>
      <description>&lt;P&gt;@ altenbach&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(Interestingly enough, the CSV file format is tab delimited by default in OpenOffice. While technically we should be using a DSV extension for such things, CSV has become the de-facto extension for any delimiter separated value file.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;This is really great. It only takes your software about 2 minutes to give a reasonable rate, while I was having trouble beating 10. Your rate does oscillate by about 10%, though. I need to mix my chemicals with an accuracy of about 1%. That's the tradeoff, of course, between using more or fewer points for the fit. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So here are the points I'm pondering:&lt;/P&gt;&lt;P&gt;- How to display the rate such that the user does not take it for what it's not (the instantaneous rate of the pump)&lt;/P&gt;&lt;P&gt;- How to filter out noise such as that seen in the second example data file (Repeat after me: "The chemical tank is not a table!") &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'll see if I can run this live on Tuesday. It's a good deal better than what I've been using. We'll see how that goes.&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jun 2009 22:24:44 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Slow-rate-calculation/m-p/930446#M417884</guid>
      <dc:creator>IMSargon</dc:creator>
      <dc:date>2009-06-20T22:24:44Z</dc:date>
    </item>
    <item>
      <title>Re: Slow rate calculation</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Slow-rate-calculation/m-p/930456#M417892</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;IMSargon wrote: &lt;BR /&gt;&lt;P&gt;(Interestingly enough, the CSV file format is tab delimited by default in OpenOffice. While technically we should be using a DSV extension for such things, CSV has become the de-facto extension for any delimiter separated value file.)&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I think the de-facto standard is tab delimited (execel text export, LabVIEW (write/read spreadsheet file, spreadsheet string to array, etc.). If you call a tab delimited file *.csv, excel does not correctly open it because it expects commas. From a &lt;STRONG&gt;global viewpoint&lt;/STRONG&gt;, comma delimited is probably one of the worst choices, simply because some countries in Europe use the comma for the decimal point, so doing a CSV would chop the data up beyond recognition. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; So if you ever think your company will expand and sell overseas, don't do csv! &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;IMSargon wrote: &lt;BR /&gt;&lt;P&gt;&amp;nbsp;This is really great. It only takes your software about 2 minutes to give a reasonable rate, while I was having trouble beating 10. Your rate does oscillate by about 10%, though. I need to mix my chemicals with an accuracy of about 1%. That's the tradeoff, of course, between using more or fewer points for the fit. &lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I think the oscillation is real. Look at the data: There are areas that stick much longer to one value than others.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In any case, there is no way to get better info&amp;nbsp;out of your raw data. You have to work with what you have. If the slope is relatively constant between experiments, you could incoporate that knowledge somehow. Right now, there is no way to tell the slope in the early data if all&amp;nbsp;readings are the same.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If your chemical reaction blows up if you're off by 1%, you simply cannot do it this way.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe you could place a massflow controller on the drain or measure hydrostatic pressure at the bottom of the tank for more accurate data?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Instead of a single indicator, you could display it on&amp;nbsp;a chart.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To eliminate the "glitch" in the second example, you need to incorporate knowledge, e.g. ("the weight can only go down") and filter accordingly. This is tricky. What actually happened there? Did some Hippo take a swim in the tank?&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jun 2009 23:40:36 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Slow-rate-calculation/m-p/930456#M417892</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2009-06-20T23:40:36Z</dc:date>
    </item>
    <item>
      <title>Re: Slow rate calculation</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Slow-rate-calculation/m-p/930460#M417893</link>
      <description>&lt;P&gt;&amp;nbsp;To see if the noise is real, I generated some perfect data, where the mass decreases by 1 kg exactly every 112.5 seconds. The results are below. (I also multiplied the slope by -3200 to give me fed Kg/h and autoscaled Y)&lt;/P&gt;&lt;P&gt;The shape of the oscillation does closely resemble that in our previous example data, besides the different frequency. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit: I had someone take a look at it. It sounds like what I need to do is run the input data through a lowpass filter. I'll see how that works out. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With just the feed rates, you're right, there just isn't enough information. With these improvements so far though, and coupled with the other inputs from the process (mixer mass, etc) I'm getting closer to that goal than I had previously thought possible. You know, we've been trying to convince my boss to get a mass flow meter or a hydrostatic pressure guage for a year now. Oh well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;"The weight can only go down" is exactly what I'm planning on doing. No time this weekend, but maybe Monday I'll put everything together. I'm not sure exactly what caused that glitch, but maybe I should test a sample for evidence of dissolved hippo &lt;span class="lia-unicode-emoji" title=":face_with_tongue:"&gt;😛&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://ip1.i.lithium.com/b85fb7f79d1f76045469040774d66b6ab11aa0c8/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f39313469384444423945304238314344363334362f696d6167652d73697a652f6f726967696e616c3f763d6d70626c2d312670783d2d31" border="0" alt="PerfectData.PNG" title="PerfectData.PNG" align="center" /&gt;&lt;/P&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by IMSargon on &lt;/SPAN&gt;&lt;SPAN class="local-date"&gt; 06-20-2009&lt;/SPAN&gt;&lt;SPAN class="local-time"&gt; 08:21 PM&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 21 Jun 2009 01:21:25 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Slow-rate-calculation/m-p/930460#M417893</guid>
      <dc:creator>IMSargon</dc:creator>
      <dc:date>2009-06-21T01:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: Slow rate calculation</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Slow-rate-calculation/m-p/930461#M417894</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;IMSargon wrote: &lt;BR /&gt;&lt;P&gt;&amp;nbsp;To see if the noise is real, I generated some perfect data, where the mass decreases by 1 kg exactly every 112.5 seconds. The results are below. (I also multiplied the slope by -3200 to give me fed Kg/h and autoscaled Y)&lt;/P&gt;&lt;P&gt;The shape of the oscillation does closely resemble that in our previous example data, besides the different frequency. &lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This is similar to "spectral leakage", caused because the history buffer is not a multiple of the step lenght.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How is the weight measured? What kind of hardware is this? Since the problem is due to limited digital resolution, I don't think a direct&amp;nbsp;lowpass filter would help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another option&amp;nbsp;could be "&lt;A href="http://zone.ni.com/devzone/cda/tut/p/id/3016#toc5" target="_blank"&gt;dithering&lt;/A&gt;". Simply&amp;nbsp;add random noise corresponding to about the step size followed by lowpass filtering?&lt;/P&gt;</description>
      <pubDate>Sun, 21 Jun 2009 01:37:46 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Slow-rate-calculation/m-p/930461#M417894</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2009-06-21T01:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: Slow rate calculation</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Slow-rate-calculation/m-p/930464#M417895</link>
      <description>&lt;P&gt;The scale has an increment of 1lb, so I do have a bit better resolution than I have shown in my example data, but ultimately the problem is the same.&lt;/P&gt;&lt;P&gt;The value comes in as ASCII over RS-232 &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried toying with the point-by-point Butterworth filter. It was successful at high sampling frequencies, but then it took a long time to get up to the real data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt; Simply add random noise corresponding to about the step size followed by lowpass filtering&lt;/P&gt;&lt;P&gt;&amp;nbsp;Really? That would be a brilliant solution if it works. I tried a method by which 1 is added to or subtracted from each data point, at random, before passing through a butterworth filter. In my imperfection, it makes it worse. Does it work for you? &lt;/P&gt;</description>
      <pubDate>Sun, 21 Jun 2009 02:12:41 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Slow-rate-calculation/m-p/930464#M417895</guid>
      <dc:creator>IMSargon</dc:creator>
      <dc:date>2009-06-21T02:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: Slow rate calculation</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Slow-rate-calculation/m-p/930465#M417896</link>
      <description>Dithering needs to be done on the analog circuit, before the ADC. This is not something that works digitally.</description>
      <pubDate>Sun, 21 Jun 2009 02:22:28 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Slow-rate-calculation/m-p/930465#M417896</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2009-06-21T02:22:28Z</dc:date>
    </item>
  </channel>
</rss>

