Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

AndrewIons01

Member

05-03-2021 10:43 AM

Options

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hi All

I am working with a PID controller and am having some difficulty with working it.

How does one go about tuning the PID to find its best operational values and how do I know when I have these values?

Best wishes

Andrew

Solved! Go to Solution.

xipxid

Member

05-03-2021 11:27 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

you can start to google search about Matlab simulation... on this you can try on this link link

altenbach

Knight of NI

05-03-2021 12:04 PM - edited 05-03-2021 12:07 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Since you posted in the LabVIEW forum, I assume this is not a matlab question. I am not even sure if it has anything to do with programming.

Is this a black-box PID controller? As a first thing, read the manual. Many have an auto-tune feature to find the best PID settings. What are you trying to control? Systems can differ by many orders of magnitude in the way the respond to input changes. (compare a temperature controller for a jacuzzi to a controller that keeps a maglev train at the correct height!).

You have the correct values of it responds quickly, smoothly and accurately to new settings (no oscillations, no significant overshoot, not excessively slow, no final offset, etc.)

05-03-2021 12:17 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hi altenbach

Thank you so much for the reply.

Yes this not a Matlab problem.

I am working on a beam pointing Stabilisation project and am using the PID to calculate a manipulated variable which is rhen fed into some picomotors to correct the beams position.

I don't think that this is a black box PID controller, is is built into the labview code.

From memory thus one does not have an auto tune feature.

Thank you for the advice on getting the correct settings. When I next get to my PC I will keep trying.

Are there any LabVIEW PID controllers that have this autotune feature?

altenbach

Knight of NI

05-03-2021 12:26 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

LabVIEW has auto-tuning as part of the PID tools (example).

05-03-2021 12:44 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hi Altenbach

Wow thank you so much I will try this as soon as possible.

I apologise if this is a silly question but will this work with a 1D array input too?

Solution

Accepted by AndrewIons01

BowenM

Active Participant

05-03-2021 01:09 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

As altenbach mentioned, auto-tuning PIDs are an option. There are some drawbacks to these and sometimes you need to manually tune. So, here is (in a very generic sense) the process I personally go through for tuning a PID.

- Set the integrator and derivative terms to 0 so you're working strictly with proportional.
- Adjust proportional term until it generally gets you in the ballpark. If your model is linear, you can probably just do a calculation to get you in the range. If not, use several different setpoints to find a proportional value that is closest on average.
- Once proportional gets you in the general vicinity, start increasing your integrator. The main goal here is to try and find the balance between response speed (hitting your setpoint faster) and overshoot/ringing. If you command a new value and it takes too long to get to the setpoint (approaching it asymptotically), you need to bump up your integrator term. If you command a new value and it starts to ring (decreasing amplitude sine wave), your integrator is too aggressive and you need to decrease it.
- Once your P/I terms are tuned, work on the derivative term...
**if you need it**. I very rarely use the derivative in test systems (perhaps a failing of mine, but there it is) because it is easy to overtune it and cause instability in your PID controller. As a general rule you will want to make very small and incremental changes to your derivative.

xipxid

Member

05-03-2021 04:39 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

I'm sorry about misunderstanding, I don't say that here in a LabVIEW forum are a Matlab question, I say that the man need to be open mind and and read / look / search all that is connected with "PID Tuning". as I know from here, it have an 100 years of history. well from what I know until now NOBODY IN THIS WORLD can do a perfect tuning for a PID. from what I know most of successful story are "manual tuned". the "automatic" manner of PID tuning are a good approach but not the best.

with my advise I try to "open mind" at a person with "visual examples", same person that are incredible satisfier to discover... this... https://zone.ni.com/reference/en-XX/help/371361R-01/lvpid/pid_with_autotuning/

let's be serious... we try to help here... on this forum ? or... only make homework's ?!

05-04-2021 06:19 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hi

Ok i will try manual tuning of my PID controller. I unfortunately have come across another problem.

I am trying yo pass data through a state machine (IMAQdx session) but unfortunately it passes through once, when when it is sent back to the previous state I get the following:

**Error -1074360311 occurred at IMAQdx Open Camera.vi**

**Possible reason(s):**

**Camera not found**

I have been using the camera for the rest of the code, this only occurs in one section.

rolfk

Proven Zealot

05-04-2021 06:36 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator