06-24-2014 08:59 AM
Hello,
I have a VI how generate and acquire signals via a NI-USB device.
I have lighted a bit my VI because the rest of the calculation doesn't increase the time spend in the loop. (I acquire 8 signals and i do 2 PID in the real VI)
So, the VI is made for read two hall sensor of a motor and tell me in wich position is the motor (Motor is a stepper with 20step per 360°). But I think that my VI only count from 0 to 19 ..
I have tried to decrease the values of both DAQ but then the sine wave doesn't look like sine.. The loop run at 200ms/iteration
If anyone know how to run it faster it would be great 🙂
thanks
Max
06-24-2014 09:21 AM
All those express vi's need to go away to improve the performance.
Example: Replace the simulate signals with "Sine waveform .vi"
Now lets really look at that code: for every loop iteration you are creating two waveforms and writing them to the DAQ AO buffers. Why? use events to build the waveforms ONLY when one of the controls change. that gets a lot of wasted computations out of your loop since the control values change infrequently compared to the loop iteration time.
Especially look at the Producer Consumer Events and use a notifier to feed the DAQ AO
Next those DAQ express vis really do have a lot of call overhead compared to programming with the DAQmx API. the shipping examples should point you in a better direction.
06-24-2014 09:40 AM
Hi Jeff,
In fact, the buffer size of these two DAQ slow down the speed of the loop. I have a rate at 1MHz and 200kS, if I reduce them i lose in precision.
I haven't many knowledge with the DAQmx but I will try. 😉
06-24-2014 09:50 AM
Oh, eventually we'll get into processing the data outside the loop acquiring it. But I don't want to overload you yet. We might even hang this project on the Continuous Measurement and logging sample project template's framework before you get all the performance you want.
A single "do everything" loop is not going to cut it for tight PID control.
06-24-2014 10:22 AM
I'm not sure I have understand what you said.
You think that I can store the data somewhere and after the loop is completed process them ?
I upload all my work , the main is the "LabVIEW_final.vi" . Maybe it's easier for explain.
In my mind I see the system like a succession of loop for divers measures, stroring them ant after that process with some Mathscript. And at first that wasn't so bad.
But now I need to know the position and the speed of my motor is higher than my loop..
--> My_VI
06-24-2014 12:17 PM
Please just post it to the forum. Don't link to outside files.
06-24-2014 12:21 PM
And use a zip file. Many people can't open RARs.
06-24-2014 12:40 PM
Sorry for the external link.
here is my vi :
06-30-2014 09:43 AM
Hello MaxLab,
my name is Dominik and i want to know what explicit question you have on your program that i can try to help you fast and confident. I think the easiest way is that we start with a single question where you cannot go on with your programming and than we will see the other things. Please tell me where you exactly have a problem and what you think about it.
Have a nice day
Kind regards
Dominik
06-30-2014 12:41 PM
Hello Dominik,
I think that my problem is the buffer sizes of my DAQ assistant.. if I set 200kS I got 200ms for an iteration - if I set 100kS I got 100ms for an iteration.
But, for a good taste of my measure, I need theses 200kS.
Thanks you for your answer