11-05-2017 01:20 PM
Hi everyone,
I'm facing a hard time to maintain a tide control of a heating element using labview pid vi. My project requires maintaining precise control over a range of temperatures (180 - 360 degC). I have tried tuning using ZN and Tyreus-Luyben methods in addition to using the PID autotuning wizard vi yet none of them gave me good results. For the set up I'm using a SSR with the following vi.
I would appreciate your help as my knowledge with labview is quite lacking
Cheers
Moha
Solved! Go to Solution.
11-06-2017 06:04 PM
Hello Moha,
Looking over your post, I am wondering what are your necessary application needs. What does precise control over 180C to 360C mean to you? Does it mean that steady state error has to be very small? If so, what is very small? Also, what is the characteristic of the SP over time? Is SP going to change drastically or constantly? Of course if we could have our PV match up exactly with SP that would be nice, but since that is unlikely, it is important to know how good is good enough.
Looking at your screenshots, I am wondering what are the other cases in your case structure. I am guessing you may just have threshold for on/off of the heating element, but purely on/off may not be good enough if you are trying to keep tight track of the temperature. You may want to look at using pwm and change your percent on/off based on the output value of the PID function.
Another thing that stands out a lot is the big variation in your PID output. It is much more dynamic than I would expect out of a PID control with a SP that is static. I would suggest potentially just doing PI (even as a starting point), as derivative is sensitive to noise in measurement. It might even be worth getting a reading of your sensor when the heating element is off, or if you can read something that you know is at a steady temperature, so that you know how much you can trust your sensor.
All of that said, you might also look at fuzzy logic and bang-bang control as that might meet your needs and could be easier to implement.
11-06-2017 08:47 PM
Hi Kelle,
thank you for your reply. what I mean by precise control is the steady-state error has to be with +/- 1 C. and for my application there will be no change in SP during one run (i.e. every experimental trial will be done at SP).
here is a clearer description of my vi with pictures:
so the first two photos show whether the element is on or off. In the third photo, the PID generates the "output 3" single ranges between 0 - 100 which I assume this works as PWM if I'm not mistaking? and for the sensor, I'm using a K-type thermocouple and I made sure it's accurate.
Another point, does change the cycle time will have a major influence on the control I'm using 1 sec?
11-07-2017
09:44 AM
- last edited on
10-09-2025
09:25 AM
by
Content Cleaner
In the code pictured, the heating element remains off, until the PID output reaches 100. To achieve PWM control of the heating element, you should be writing the PID output value to the Duty Cycle control of a pulse train output.
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000x1P0CAI&l=en-US
11-07-2017 02:16 PM
Stewart brings up a good point based on your pictures. If you implement as Stewart suggested, the output of the PID VI will go to setting your PWM and you will not need the case structure you are currently using. It would probably make sense to have a subVI that controls the PWM. In the current state, this is probably causing more issues for you than the actual PID tuning.
In regards to your question about cycle timing, for control systems, generally you want shorter cycles times to keep your PV closer to the SP. A way to think about it might be to imagine if you were driving and could only see the road through a camera. Your view of the road is only updated each time a new frame is captured. In this case, the faster the frames come in and are updated (fps, frames per second), the more up-to-date your mental model of the road, and the better you can stay in your lane/on the road. If your images come in very slowly, you may not be able to keep to the road as well. This is an oversimplification of control systems and not a perfect analogy, but I think it gets the point across about your cycle times.
I would suggest going with a shorter cycle time, as quickly as it makes sense for your thermocouple's response time. You might reference your thermocouple's spec sheet or some other website like http://www.capgo.com/Resources/Temperature/Thermocouple/Thermocouple.html#Mount for a feel about your TC. Faster cycle times will take up more processing power, but this probably shouldn't be an issue for your computer and you can test out different cycle times to see what is good enough for you.
Are we only controlling the heating element for sake of controlling the heating element or is the heating element heating up some fluid that needs to maintain a given temperature? Because, if the heating element is not the end goal, you may want to make sure that a constant temperature heating element is actually what you need.
11-10-2017 04:04 AM
Thank you guys for the help 🙂