10-09-2018 07:26 PM
Hi all,
When I use the PID vi. the propotional gain(kc) can only be varied in front panel. Since I am doing the instrument control project. Is there any way to make propotional gain(Kc) dependent, which is Kc= K1+K2* current(measured). The current is measured by using DAQmx and K1, K2 is changeable in front panel, so there is no need to change Kc manually.
Solved! Go to Solution.
10-09-2018 08:15 PM
Help us to help you.
Sample code please!
Benoit
10-10-2018 01:45 AM
Hi Jayden,
Is there any way to make propotional gain(Kc) dependent, which is Kc= K1+K2* current(measured).
So you have a problem in creating a simple math expression in LabVIEW?
Really?
Suggestion: take the online training resources offered for free in the header of this LabVIEW board!
10-10-2018 06:59 AM
Hi Gerdw,
Thanks for your reply. In fact, I don't know how to make propotional gain(Kc) variable, please see attachment.
10-10-2018 07:20 AM
Hi Jayden,
Kc is an element in the PIDGains cluster. Use cluster functions to change the KC value within that cluster!
Did you notice my suggestion? When you don't know about those basic LabVIEW items you really should take those learning resources!
10-10-2018 04:10 PM
Jaydennnn you are wiring the input of the PID gain to a control which is why the only way to modify the values are through the front panel. Controls are meant to be controlled via front panel interaction.
See GerdW's post on how to calculate the Kc value you desire and then bundle the computed value into the Gain input of the PID.vi
10-10-2018 05:36 PM
Hi marcelmorin & GerdW,
It works now! Appreciate it.
10-11-2018 01:05 AM
Hi Marcel,
why do you suggest the plain Bundle function and not BundleByName?
- Bundle expects a wire at each input…
- BundleByName creates much better self-documenting code…
(The PID gains is a typedefined cluster anyway…)
10-15-2018 04:20 PM
You're correct GertW! For clarification regarding this post I've attached what the "cleaner" code looks like.
Thanks for the input on making the code cleaner and more readable.