LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Does any experts out there have the LABVIEW source code of the PID controller?

I am currently doing a PID controller program to control a motor.

the program is supposed to acquire and output data from either a pci-mio-16e-4 or daq card 1200.

it has 3 main parts:
1.the input will be either the function generator VI or just a normal setpoint.Then the card will acquire data as feedback(this is connected to a tacho).the difference will be the error.
2.then the signal will go thru a P,I,D process and the variables are changeable.
3.then the process signal will output through the card and give voltage to the motor.

at the same time there will be a graph and the process goes on and on until stop

the problem is the the integral and derivative part doesnt work
and the program has some bugs that i cannot figure out.

please help!
urgent!

regards,
grays
0 Kudos
Message 1 of 3
(2,760 Views)
np wrote:

> I am currently doing a PID controller program to control a motor.
>
> the program is supposed to acquire and output data from either a
> pci-mio-16e-4 or daq card 1200.
>
> it has 3 main parts:
> 1.the input will be either the function generator VI or just a normal
> setpoint.Then the card will acquire data as feedback(this is connected
> to a tacho).the difference will be the error.
> 2.then the signal will go thru a P,I,D process and the variables are
> changeable.
> 3.then the process signal will output through the card and give
> voltage to the motor.
>
> at the same time there will be a graph and the process goes on and on
> until stop
>
> the problem is the the integral and derivative part doesnt work and
> the program has some bugs that i canno
t figure out.
>
> please help!
> urgent!
>
> regards,
> grays
>
> ------------------------------------------------------------------------

Hi grays,
didn't have to much time, studying your VI. But there are 2 main things you may think about.
Fist, your shift Register isn't initialized, that means the initial condition is not set. If you have a
high power motor and your VI would work mainly, this could be very harmful.
Second, look for PID in help or the examples. There are some different ones, the work and the use basic
funktions. I allready used them successfully.

Rainer
0 Kudos
Message 2 of 3
(2,760 Views)
np wrote:

> I am currently doing a PID controller program to control a motor.
>
> the program is supposed to acquire and output data from either a
> pci-mio-16e-4 or daq card 1200.
> ------------------------------------------------------------------------

Hi Grays,
I just saw your way to handle limiting.
This can't work, because if there is an error (devitation between Setpoint and input) while limiting is
active, the I- controller runs into "saturation", at least the reallife I-controllers do this. In your
case, the I- controller keeps controlling and controlling while limiting is active. If in anycase the
limiters aren't active anymore, the I- controller needs the same time to come back to useful outputs,
it spent while limiters were active.
Limit the I-con
troller input to prevent this.
But never mind, I made the same mistake in the past. :-))

Rainer
0 Kudos
Message 3 of 3
(2,760 Views)