LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PID problem (unstable)

Hi,

i have DAQ-6024E and the PID-Toolbox. I'm trying to build some PI-Controller for my DC-Motor. I set "range output" to 0-10V, my "setpoint" ist between 0 and 60W (u*i) and my "process variable" also ofcourse.

Problem: system is very unstable, sometimes to low and sometimes to high output. i have feeling that, when the PI- reach a null difference (setpoint=
process value) - then he starts again and not holding 0 - difference. K = 25 and Ti = 100 (i have tryed with 1000000, and 10, but nothing helps)

am i doing something really wrong?


thanx in advance

vedran


P.S.: Samples 100, Frequency 33Hz
0 Kudos
Message 1 of 5
(3,508 Views)
<< samples="" 100="">>

What do you mean ? is the sampling rate 33 Hz, and the average of every 100 samples is used as the readout input to the PID ? I would assume so.

I think the tuning parametersv are not set right.

Try with small values of Kc (near zero), and set TI to a small value (say 0.01), then increase the Kc slowly. the resuting control voltage will change at a small pace. Increase Kc more, and the control voltage will increase faster.
If the control voltage is swinging, then either Kc is too large, or Ti is too small.

Note, increasing the control voltage should increase the control parameters (such as Flow or Force).
If it decreases it, the Kc should be negative
0 Kudos
Message 2 of 5
(3,500 Views)
Here are three things to consider:
  1. Why do you want to build a PI instead of a PID controller? For motion control applications PI controllers tend to be unstable. Kd in general reduces the inclination for oscillations. As a rule of thumb Kd = 10 x Kp. Here is a link to a servo tuning tutorial that is specific to NI motion control boards but it should give you also good ideas about PID tuning in general.
  2. The behavior of a controller is affected almost in equal shares by the PID parameters and by the sampling time. This means that high jitter in the control loop's timing is poison to the stability. 33 Hz loop rate is not very fast but as long as you run your application under Windows you will see a considerable amount of jitter even at these low loop rates. If you have access to a LabVIEW RealTime system this would eliminate this potential problem source.
  3. Motion Control is much more than PID (think of limit switch monitoring, trajectory generation, splining, gearing, blending, contouring,...). If you need a real motion control solution please have a look at the NI motion control boards that integrate perfectly into LabVIEW and that run everything on board in a real-time environment.

Best regards,

Jochen Klier
National Instruments Germany
0 Kudos
Message 3 of 5
(3,485 Views)
Hi Jochen,

can you please tell me more something about problem and solution with real-time under point 2? yes, i have also real-time-toolbox.

thanx in advance
vedran
0 Kudos
Message 4 of 5
(3,485 Views)
Vedran,

there is always a tight correlation between control loop rates and the PID parameters. Imagine you have a well tuned control loop and you decide to double the frequency of this loop. After that you will probably see a system that is everything but well tuned. In this example you will have to decrease your Kp, Kd and Ki values approximately by the factor 2.

Now think of the non-deterministic behavior of Windows which results in varying loop cycle times making it harder or even impossible to get a stable system. This is especially true for higher your loop rates. At 33 Hz this issue might not be so immanent but basically you never can tell when Windows decides to take CPU power from your application causing gaps in your control timing up to several 10s of miliseconds. Depending on the application and the type of motor you want to control this could even result in hazardeous situations. Especially if you need reliable methods to react on potentially dangerous situations I would never trust Windows or any other desktop OS.

Here you can find more information about the way LV RT works and how you can use it either on a PXI-system, a desktop PC or other RT targets.

Jochen
0 Kudos
Message 5 of 5
(3,478 Views)