LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there someone to check my PID vi????

Hi,
I've been working for some time now on a PID control vi and I am getting
some strange results...
Specifically, comparing to a Matlab simulation, the system seems to be
extremely slow ( at least 10 times slower than the simulated one ).
I want to make an exact system identification through this vi, and the
results I am getting make no sense.

I am using LV 6.02 on Windows 98 ( I know it's not real time but LV RT is
not available ) and PCI 6035E.

I am not an expert in LV ( rather a novice one ) and I would be grateful, if
someone could help me.
I would like to know if the vi I made ( actually, modified from an
example ), is working as it should be.

If someone is willing on checking my vi, it is available on
http://users.ntua.
gr/egreb/PID/ ( VoiceCoil_PID.vi & VoiceCoil_PID.llb )

Please, help me !!!!! Any comments would be highly appreciated.
M.
0 Kudos
Message 1 of 4
(5,632 Views)
I downloaded your code and I tweaked it a bit. You indicate that the code is running slow. How slow? Do you measure the difference with a stop watch or a calendar? In general remember that you are doing all your IO inside the PID loop, which will slo it down rather dramatically. Also you are accumulating an array inside the loop. This also slows things down.

In terms of the tweaks I made. The biggest change was to the simple PID subVI. The first thing I did was get rid of the unnecessary sequence structure. It did nothing for you computationally and would have a negative impact on the code's efficiency by preventing parallel operations. It's also much easier to read now and (if I didn't miss something) should do the same thing as the original one. The other c
hange I made to it was to remove the while loop wrapped around its insides. The reason for such a while loop is to store the values of shift registers. However, the way you have the code written the SRs were being reinitialized everytime the subVI was called--effectively nullifying the reason for the SRs to exist. So is the SRs aren't needed the loop isn't either.

I also bundled some of the IO going in and out of the subVI to cleanup the interface, and changed the way you were measuring time. The primative you were using is essentially the output of a 32-bit counter so it will rollover when it reaches its maximum count. This rollover will appear to your code as a huge jump in time. Which is probibly a BAD thing...

If you give me an email address I can send you the modified code (it's apparently too big to upload here--even zipped).

Mike...
mporter@arielcorp.com

BTW: One Major thing you are doing very well: Error handling. The only additional thing you need to be on the loo
kout for is that in the DAQ drivers NI doesn't consider things like acquisition timeouts as errors. Rather it flags them as warnings (error status good but with a non-zero code).

Be looking forward to hearing from you.

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 4
(5,632 Views)
"M." wrote:

> Hi,
> I've been working for some time now on a PID control vi and I am getting
> some strange results...
> Specifically, comparing to a Matlab simulation, the system seems to be
> extremely slow ( at least 10 times slower than the simulated one ).
> I want to make an exact system identification through this vi, and the
> results I am getting make no sense.
>
> I am using LV 6.02 on Windows 98 ( I know it's not real time but LV RT is
> not available ) and PCI 6035E.
>
> I am not an expert in LV ( rather a novice one ) and I would be grateful, if
> someone could help me.
> I would like to know if the vi I made ( actually, modified from an
> example ), is working as it should be.
>
> If someone is willing on checking my vi, it is available on
> http:
//users.ntua.gr/egreb/PID/ ( VoiceCoil_PID.vi & VoiceCoil_PID.llb )
>
> Please, help me !!!!! Any comments would be highly appreciated.
> M.

##############

Hi big M,
I wanted to spend some time looking at your PID vis, but my LabVIEW 6.02 can't
open them. It reports not a vi and llb not readable. I repeated the download,
without succcess, so I guess there is something wrong with the files on your web
server.

I work at PID vis myself and mine work properly. Two of them run simultaneously
together with other parametring, displaying and com-port actions- stuff on an
pentium 3, 700 MHz, with cycle times of 50ms and without any timing problems.

Bye,
Rainer
0 Kudos
Message 3 of 4
(5,632 Views)
Hi Rainer,
I retested the download from the location I specified, and everything seems
to work fine.
If you would sent me your e-mail address I could sent them directly, zipped.


Thanks for the repply,
Manos
(egreb@central.ntua.gr )
> ##############
>
> Hi big M,
> I wanted to spend some time looking at your PID vis, but my LabVIEW 6.02
can't
> open them. It reports not a vi and llb not readable. I repeated the
download,
> without succcess, so I guess there is something wrong with the files on
your web
> server.
>
> I work at PID vis myself and mine work properly. Two of them run
simultaneously
> together with other parametring, displaying and com-port actions- stuff on
an
> pentium 3, 700 MHz, with cycle times of 50ms and without any timing
problems.
>
> Bye,
>
Rainer
>
>
0 Kudos
Message 4 of 4
(5,632 Views)