<?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: FPGA DAQ and triggered motion control in LabVIEW</title>
    <link>https://ni.lithium.com/t5/LabVIEW/FPGA-DAQ-and-triggered-motion-control/m-p/782763#M357828</link>
    <description>&lt;P&gt;Hi Andrew,&lt;/P&gt;&lt;P&gt;1) Yes, it is cyclical.&lt;/P&gt;&lt;P&gt;2) I will implement the FIFO's as you recommend.&lt;/P&gt;&lt;P&gt;Thanks for the help.&amp;nbsp; I will try out your suggestions.&lt;/P&gt;&lt;P&gt;Andre &lt;/P&gt;</description>
    <pubDate>Thu, 25 Sep 2008 13:21:33 GMT</pubDate>
    <dc:creator>ajfaul</dc:creator>
    <dc:date>2008-09-25T13:21:33Z</dc:date>
    <item>
      <title>FPGA DAQ and triggered motion control</title>
      <link>https://ni.lithium.com/t5/LabVIEW/FPGA-DAQ-and-triggered-motion-control/m-p/779344#M356412</link>
      <description>&lt;P&gt;I currently have a setup using Labview 8.5 on a host PC and using a PC as RT target with an NI 7830R FPGA module for DAQ and a NI7350 motion control module.&amp;nbsp; I am reading three analog inputs (call them AoP, AoF and LvP) in the FPGA and setting a trigger based on a threshold level associated with the (LvP) input.&amp;nbsp; Once the trigger is detected, AoP and AoF data must be collected for a user defined time (1), averaged and used in a PI controller to calculate the cw position of the motor.&amp;nbsp; When the next trigger is detected, the motor must move cw for a user defined time (2) to the position calculated and the PI controller must calculate the next position.&amp;nbsp; After the user defined time (2), the motor must move ccw for a user defined (3) time and then repeat the cw and ccw motions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt; I completed the FPGA and host vi's, but I have some problems finalizing the project and will appreciate any help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. The trigger is detected and the motor motion occurs as required, but it is not always synchronized with the triggers.&amp;nbsp; How can I fix that?&lt;/P&gt;&lt;P&gt;2. Do I need to use a FIFO to get the data from the FPGA to the host, since the FPGA is running faster than the host?&lt;/P&gt;&lt;P&gt;3. Am I calculating the averages for the two inputs correctly?&lt;/P&gt;&lt;P&gt;4. I am not sure how to implement the user defined time (1).&amp;nbsp; I have tried to use a case structure and flat sequence, but that did not work.&lt;/P&gt;&lt;P&gt;5. Is there a way to make the host vi run faster?&amp;nbsp; At the moment it seems that it takes about 390ms to complete.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The FPGA and host vi's are attached.&amp;nbsp; I will appreciate any and all suggestions, comments and help.&lt;/P&gt;&lt;P&gt;Andre&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Sep 2008 15:38:45 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/FPGA-DAQ-and-triggered-motion-control/m-p/779344#M356412</guid>
      <dc:creator>ajfaul</dc:creator>
      <dc:date>2008-09-18T15:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: FPGA DAQ and triggered motion control</title>
      <link>https://ni.lithium.com/t5/LabVIEW/FPGA-DAQ-and-triggered-motion-control/m-p/780249#M356764</link>
      <description>&lt;P&gt;Hi ajfaul,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am going to answer the easiest one first. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) Yes, you should use a FIFO &lt;/P&gt;&lt;P&gt;1) Could you clarify what you mean by "not always synchronized with&amp;nbsp; the triggers"? Your trigger is on your host, on your pc, so it would not be Real-Time, plus it appears to be "user defined" &lt;/P&gt;&lt;P&gt;3) Could you also clarify "calculating the averages correctly", i am assuming its just not&amp;nbsp;Sum of Samples / # of Samples Taken&amp;nbsp;but something else?&lt;/P&gt;&lt;P&gt;4) for user defined time(1) , is that millisecond to wait before eject, AI Loop time, or Millisecond multiple? Or have you not implemented it yet. It seems like you would use a wait function, with a user control input. Count how many ticks you have been aquiring data, compare that to the user defined time, and use local variables to stop the data aquisitiion.&lt;/P&gt;&lt;P&gt;5) The host vi is software timing, so the only way to "make it faster" would be to reduce the time you were set the wait functions in your loop. &lt;/P&gt;</description>
      <pubDate>Fri, 19 Sep 2008 22:36:51 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/FPGA-DAQ-and-triggered-motion-control/m-p/780249#M356764</guid>
      <dc:creator>Andrew_E</dc:creator>
      <dc:date>2008-09-19T22:36:51Z</dc:date>
    </item>
    <item>
      <title>Re: FPGA DAQ and triggered motion control</title>
      <link>https://ni.lithium.com/t5/LabVIEW/FPGA-DAQ-and-triggered-motion-control/m-p/780745#M356973</link>
      <description>&lt;P&gt;Hi Andrew,&lt;/P&gt;&lt;P&gt;Thanks for the feedback.&lt;/P&gt;&lt;P&gt;1) My trigger is provided by the "over threshold" output from the SCTL in my FPGA vi.&amp;nbsp; My host vi and FPGA vi are part of a RT project that runs on the RT target PC, so setting the threshold level and reading the "over threshold" output from the FPGA should then occur in RT, or am I missing something?&amp;nbsp; Setting the threshold level is user defined in the host vi, but detection of threshold level crossing occurs in the FPGA vi.&amp;nbsp; What I am seeing when I run the host vi, is that the trigger is detected and correct cw and ccw motion occurs for about four cycles, after which the motion pauses for a couple of seconds and then continues as before.&lt;/P&gt;&lt;P&gt;3) In my host vi, I use the "mean ptbypt.vi" to calculate the averages of AoP and AoF during the time that the threshold is exceeded and use this as process variable input for the PID controller.&amp;nbsp; I am not sure if this is the best way of calculating the averages of these signals.&lt;/P&gt;&lt;P&gt;4)&amp;nbsp; The user defined time(1) has not been implemented yet. I will try to use your recommendations.&lt;/P&gt;&lt;P&gt;5)&amp;nbsp; Even when I set the "fill time" and "eject time" to 200ms and the "ms to wait before eject" to 1ms, the loop takes 390ms to complete, so it seems that there is timing overhead that can be reduced, but I am not sure where that is.&lt;/P&gt;&lt;P&gt;2)&amp;nbsp; I have tried to transfer the data from the FPGA to the host using a FIFO, but I am having a bit of a problem reading the data on the host.&amp;nbsp; All the examples that I could find put all the data into one array for display on a graph.&amp;nbsp; I need to read each AI individually and I have to make sure that I am just reading that AI and not some data from another AI.&amp;nbsp; Can you point me to any examples or inlcude a sample vi to show me how to do that?&lt;/P&gt;&lt;P&gt;Thanks again for taking time to respond to my problem.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Andre &lt;/P&gt;</description>
      <pubDate>Mon, 22 Sep 2008 13:47:57 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/FPGA-DAQ-and-triggered-motion-control/m-p/780745#M356973</guid>
      <dc:creator>ajfaul</dc:creator>
      <dc:date>2008-09-22T13:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: FPGA DAQ and triggered motion control</title>
      <link>https://ni.lithium.com/t5/LabVIEW/FPGA-DAQ-and-triggered-motion-control/m-p/781748#M357384</link>
      <description>&lt;P&gt;Hi Ajfaul,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) Could you refine what you mean by "continues as before", is this start for 4 cycles and stop for a few seconds, cyclical? It could be that your system is working correctly, and that the code is telling it to wait for that given period of time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3) I looked at the mean ptbypt.vi and that seems to work for your application. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) I would suggest you use DMA FIFO to allocate memory in both your host PC and in your FPGA to do the task that you wish to be done. &lt;A href="http://zone.ni.com/devzone/cda/tut/p/id/4534" target="_blank"&gt;Here&lt;/A&gt;&amp;nbsp;is a link that talks about DMA FIFO's and how to implement them. I would suggest walking through the implementation and putting that into both your fpga and host vi's. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Tue, 23 Sep 2008 23:17:53 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/FPGA-DAQ-and-triggered-motion-control/m-p/781748#M357384</guid>
      <dc:creator>Andrew_E</dc:creator>
      <dc:date>2008-09-23T23:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: FPGA DAQ and triggered motion control</title>
      <link>https://ni.lithium.com/t5/LabVIEW/FPGA-DAQ-and-triggered-motion-control/m-p/782763#M357828</link>
      <description>&lt;P&gt;Hi Andrew,&lt;/P&gt;&lt;P&gt;1) Yes, it is cyclical.&lt;/P&gt;&lt;P&gt;2) I will implement the FIFO's as you recommend.&lt;/P&gt;&lt;P&gt;Thanks for the help.&amp;nbsp; I will try out your suggestions.&lt;/P&gt;&lt;P&gt;Andre &lt;/P&gt;</description>
      <pubDate>Thu, 25 Sep 2008 13:21:33 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/FPGA-DAQ-and-triggered-motion-control/m-p/782763#M357828</guid>
      <dc:creator>ajfaul</dc:creator>
      <dc:date>2008-09-25T13:21:33Z</dc:date>
    </item>
    <item>
      <title>Re: FPGA DAQ and triggered motion control</title>
      <link>https://ni.lithium.com/t5/LabVIEW/FPGA-DAQ-and-triggered-motion-control/m-p/786199#M359267</link>
      <description>&lt;P&gt;Andrew,&lt;/P&gt;&lt;P&gt;I have implemented the FIFO as you suggested, as shown in the attached pictures, but still have problems reading the data.&amp;nbsp; I will appreciate your comments on the following:&lt;/P&gt;&lt;P&gt;1)&amp;nbsp; I have set the depth of the FIFO on the FPGA to 4095, but I still get the timeout going active when running the FPGA at 100us, the host vi at 30ms and setting the number of elements to read to 10000.&lt;/P&gt;&lt;P&gt;2)&amp;nbsp; How do I determine the optimum setting for the number of elements to read?&lt;/P&gt;&lt;P&gt;3) When I set the host vi loop rate lower to say 10ms, it still takes more than 200ms to complete the loop.&amp;nbsp; Why is this?&lt;/P&gt;&lt;P&gt;I will appreciate your help.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Andre &lt;/P&gt;</description>
      <pubDate>Thu, 02 Oct 2008 17:44:08 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/FPGA-DAQ-and-triggered-motion-control/m-p/786199#M359267</guid>
      <dc:creator>ajfaul</dc:creator>
      <dc:date>2008-10-02T17:44:08Z</dc:date>
    </item>
    <item>
      <title>Re: FPGA DAQ and triggered motion control</title>
      <link>https://ni.lithium.com/t5/LabVIEW/FPGA-DAQ-and-triggered-motion-control/m-p/787171#M359654</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I assume you are getting the timeout on the host side, correct? If this is the case, there are several ways you can fix this. The timeout means that you are trying to read elements when the FIFO is empty for a time longer than your timeout setting. To fix this, you can either decrease the samples to read, decrease the speed of the Reading loop (on the host), or increase the speed of the FPGA VI (FIFO writes) to make more samples available.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is no optimal way to determine all these settings, they all depend on your application and on the nature of your code. &lt;/P&gt;</description>
      <pubDate>Mon, 06 Oct 2008 05:28:05 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/FPGA-DAQ-and-triggered-motion-control/m-p/787171#M359654</guid>
      <dc:creator>Eli_S</dc:creator>
      <dc:date>2008-10-06T05:28:05Z</dc:date>
    </item>
    <item>
      <title>Re: FPGA DAQ and triggered motion control</title>
      <link>https://ni.lithium.com/t5/LabVIEW/FPGA-DAQ-and-triggered-motion-control/m-p/788378#M360133</link>
      <description>&lt;P&gt;Eli,&lt;/P&gt;&lt;P&gt;Thanks for the response.&amp;nbsp; No, I am&amp;nbsp;reading the timeout on the FPGA side, which as I understand it, means that the FIFO gets filled up and that I am not reading the data fast enough.&amp;nbsp; As I mentioned before, even when I set the loop on the host to run at 30ms, it takes between 200 and 300ms to complete.&amp;nbsp; I cannot understand why it takes so long.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Andre&lt;/P&gt;</description>
      <pubDate>Tue, 07 Oct 2008 18:14:05 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/FPGA-DAQ-and-triggered-motion-control/m-p/788378#M360133</guid>
      <dc:creator>ajfaul</dc:creator>
      <dc:date>2008-10-07T18:14:05Z</dc:date>
    </item>
    <item>
      <title>Re: FPGA DAQ and triggered motion control</title>
      <link>https://ni.lithium.com/t5/LabVIEW/FPGA-DAQ-and-triggered-motion-control/m-p/789153#M360451</link>
      <description>&lt;P&gt;Hi Andre,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You should create the FIFO in a seperate loop from your main code, and communicate the data to it via a queue. That way your data output won't be slowed by the main body of your code. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Oct 2008 17:58:23 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/FPGA-DAQ-and-triggered-motion-control/m-p/789153#M360451</guid>
      <dc:creator>Andrew_E</dc:creator>
      <dc:date>2008-10-08T17:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: FPGA DAQ and triggered motion control</title>
      <link>https://ni.lithium.com/t5/LabVIEW/FPGA-DAQ-and-triggered-motion-control/m-p/789223#M360478</link>
      <description>&lt;P&gt;Hi Andrew,&lt;/P&gt;&lt;P&gt;It makes sense putting the FIFO in a separate loop, I will try that.&amp;nbsp; I do not quite understand what you mean with "communicate the data to it via a queue".&amp;nbsp; Can you please explain that a bit more? &lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Andre &lt;/P&gt;</description>
      <pubDate>Wed, 08 Oct 2008 20:13:44 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/FPGA-DAQ-and-triggered-motion-control/m-p/789223#M360478</guid>
      <dc:creator>ajfaul</dc:creator>
      <dc:date>2008-10-08T20:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: FPGA DAQ and triggered motion control</title>
      <link>https://ni.lithium.com/t5/LabVIEW/FPGA-DAQ-and-triggered-motion-control/m-p/789735#M360682</link>
      <description>&lt;P&gt;Hi Andre,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The best way to learn about queues is to open&amp;nbsp;up the shipping example and go through the example "Queue basics". Notice how the system enqueues data in one loop and dequeues it in another. I would also suggest that you open up the "FIFO Communication between Loops" project. This could give you more insight how the fifo's should possibly be working in your system. These examples will hopefully give you alot more insight on how to work in fifos for your sytem. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Thu, 09 Oct 2008 15:40:47 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/FPGA-DAQ-and-triggered-motion-control/m-p/789735#M360682</guid>
      <dc:creator>Andrew_E</dc:creator>
      <dc:date>2008-10-09T15:40:47Z</dc:date>
    </item>
  </channel>
</rss>

