LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

phase delay in PID controlled vi

Solved!
Go to solution

Hello,

 

I have a question regarding PID controllers.

 

I use a PID controller in Labview (Windows, no access to real-time) within a timed-loop to have as much deterministic execution as possible (loop period 3 ms). 

I am trying to impose a current to a voice coil motor in order to control its motion in a sinusoidal fashion. 

 

As you can see in the figure (ignore the green curve), the actual position of the motor (red curve) is phase shifted with respect to the desired sinusoid position (white curve). 

 

What can I do to correct for that? 

 

Thanks in advance,

Nikos

 

0 Kudos
Message 1 of 5
(256 Views)

I don't do a lot of closed-loop control, but as I recall the phase delay is kinda in the nature of using PID control to follow a dynamically changing setpoint.  The more generic term I've heard for it is "tracking error".

 

I don't recall all the detailed math, just that it takes an additional integration term in the controller to reduce/eliminate it.  It's analogous to the way that pure P control leaves you with an offset relative to a constant setpoint.  I've thought of this extra term as feed-forward, though that may not be technically accurate.  Hopefully someone else who does a lot of closed-loop control will chime in with better info.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy coming to an end (finally!). Permanent license pricing remains WIP. Tread carefully.
0 Kudos
Message 2 of 5
(233 Views)

Hi Nikos, 

 

From your picture, I would say the tracking is actually pretty good!  😁  Of course, tuning PID parameters is more of an art than a science.  Have you tried to increase your P parameter?  That might make it track better, but too much P may introduce some jitter.

 

I'm sure you've seen many PID tuning tutorials on the web.  I like this one from WPI, easy to follow and understand:

https://docs.wpilib.org/en/2020/docs/software/advanced-control/introduction/tuning-pid-controller.ht...

 

BR

John

Add motion to LabVIEW in 30min or less - TENET EMotion
Finding it hard to source legacy NI hardware? Try Extend Test

0 Kudos
Message 3 of 5
(214 Views)
Solution
Accepted by nikoskal95

Dear John,

 

Thanks a lot for your reply! 

 

Increasing the P makes the controller unstable. 

I guess the only way is with feed-forward method or model-predictive control.

Any suggestions?

 

Best,

Nikos

0 Kudos
Message 4 of 5
(196 Views)

Are all of these data points one cycle of the PID controller?

 

Try increasing your I coefficient. This will essentially increase the bandwidth of your controller..

 

We use PI controllers regularly. If your P coefficient is close to instability, try increasing your I coefficient instead.

0 Kudos
Message 5 of 5
(154 Views)