01-16-2013 11:51 AM - edited 01-16-2013 11:53 AM
Hello!
I would like to update and do some change on an old LabView project, made like 10 years ago.
I opened it in my LabView 2012. One VI do some PID control, and it contains an obsolete PID toolkit VI. I attach the simplified VI with some notes made by me, I only left the relevant parts from the whole VI.
What I would like to do is to implement the same control but in LabView 2012, using PID advanced VI. I also would like to use absolute values for PID, so not percentage values.
I got a bit confused with this very old VI, I hope someone can clarify the situation for me.
My questions:
1., In my new LabView VI, I will automatically set the range on the Keithley, when it is necessary during control. Since I will use absolute value approach for PID, which P gain should I use?
(I guess the I and D can stay the same) Should I use P=0.03 ? Note that, I want to wire the process value directly to the PID advanced VI, not the difference of the PV and SV. Also, the PID out should be directly in Ampere, connected directly to the Keithley VIs.
2., In this old VI, what "iteration" means? I cannot see any similar parameter between my LabView 2012 PID toolkit VIs...
3., I also wonder, why the developer in the old times used dt = 20 sec., and the structure was placed in a while loop iterated in every 1 second. What does this cause actually in the control?
I am interested, since I would like to make a very similar copy of this VI, but in a new way as explained above.
Thanks very much for any note, advice and help,
Best Regards,
Solved! Go to Solution.
01-16-2013 02:22 PM
Blokk wrote:
1., In my new LabView VI, I will automatically set the range on the Keithley, when it is necessary during control. Since I will use absolute value approach for PID, which P gain should I use?
(I guess the I and D can stay the same) Should I use P=0.03 ? Note that, I want to wire the process value directly to the PID advanced VI, not the difference of the PV and SV. Also, the PID out should be directly in Ampere, connected directly to the Keithley VIs.
You can think of the P gain as a ratio of output units to process variable units, which might help you compute the correct adjustments to the gain when you change the units (from percentage to absolute units). However, I'm not clear where the percentages are here - the whole PV logic doesn't make any sense. Why does it compute the difference between setpoint and process variable, multiply it by a large number, then clamp it between -100 and +100 and use that as the process variable? That's unlikely to work well, because the setpoint and process variable should have the same units, which they do not have here. You might be better off fixing that and then retuning the controller.
Blokk wrote:
2., In this old VI, what "iteration" means? I cannot see any similar parameter between my LabView 2012 PID toolkit VIs...
The "iteration" terminal is somewhat similar to the "Reset" input. You can dig around in the VI and see what it does. Mostly it resets the integrator and disables derivative control when it's 0 (the first iteration); it also disables process variable filtering for the first 3 iterations. The idea is that you connect it directly to the iterator terminal of a while loop.
Blokk wrote:
3., I also wonder, why the developer in the old times used dt = 20 sec., and the structure was placed in a while loop iterated in every 1 second. What does this cause actually in the control?
I don't see where the dt is set to 20. The dt is purely a mathematical construct, and assuming the timing is consistent from one iteration to the next, you could adjust the I and D values to match any dt value and get the same result. A dt of 20s and an I of 20s should be the same as a dt of 1s and an I of 1s (note, though, that in the current PID toolkit, I is in minutes even though dt is in seconds) - in both cases you're saying that the integral time is a single loop cycle. Setting dt to anything other than -1 is mostly useful for simulating a controller offline, for example in simulation, when you can run the controller much faster than in realtime.
01-16-2013 02:42 PM
okey, thanks for help. Well, I guess the best will be just to retune the whole control again with a properly constructed PID structure.
I am happy to see this code not only confusing me 🙂 And I even did not show the whole original VI. It would go as a dish in any Italian restaurant. (+ crazy overusing local variables...)