02-03-2012 02:16 PM
Hi,
I am a chemical engineer, and I am trying to use fuzzy logic control to control the temperature of a non-linear reaction. The variable I use in the control is the difference between the temperature ramp of the reactor and the preset temperature ramp. And my question is how to calculate the temperature change of the reactor.
I just started learning LabVIEW and only have a rough idea that I could record reactor temperature in a certain time interval and calculate the difference. However, I don't know how to record the data internally in the program so I could use the data to do the calculation while the program is still running. I wonder if anyone could help me out. It will be better if you could give me an example about it. I am using LabVIEW 7.1. Thanks a lot!
Wilson
Solved! Go to Solution.
02-06-2012 05:59 AM
Hi Wilson,
From what I have understood from your explanation, I tried one simple code.
I could not save it in 7.1, so attaching screen shot.
Let me know if this is what you were looking for.Sorry if I have not understood your problem and wrong solution( if it is)
02-06-2012 07:17 AM
@Wilson8561 wrote:
Hi,
I am a chemical engineer, and I am trying to use fuzzy logic control to control the temperature of a non-linear reaction. The variable I use in the control is the difference between the temperature ramp of the reactor and the preset temperature ramp. And my question is how to calculate the temperature change of the reactor.
I just started learning LabVIEW and only have a rough idea that I could record reactor temperature in a certain time interval and calculate the difference. However, I don't know how to record the data internally in the program so I could use the data to do the calculation while the program is still running. I wonder if anyone could help me out. It will be better if you could give me an example about it. I am using LabVIEW 7.1. Thanks a lot!
Wilson
Sounds like to perfect application of a PID controller. Have you looked into this option?
02-06-2012 01:22 PM
I tried to use PID, but it seems like it didn't work very well. The reaction I am working on is very non-linear. It generates a lot of heat during operation, and the higher the temperature goes, the more heat it will generate. So what I did is I just used PD control and didn't use the integral term, since it caused fluctuation during temperature ramp. However, the reaction is so sensitive to temperature change, that even a small temperature fluctuation (0.3 C) would cause a sharp temperature increase of the reaction. I tried to stabilize the reaction by increasing the D term, but manual control was still required sometimes to prevent the temperature shoot-up.
That's why I have been considering of using fuzzy logic control to better control the reactor. I don't plan to replace the previous PID controller, but just want to add fuzzy controller afterwards. I will use (the difference between the temperature ramp of the reactor and the preset temperature ramp) as a parameter. When the reactor starts to heat up fast and shows a sign of temperature shoot-up, fuzzy controller would have a quicker response and confine the heater output.
In order to calculate reactor temperature change, I think I should record temperature internally and compare the data I recorded at certain time interval. However, I don't know how to do it... I know we could write a small C program in the LabVIEW to realize the comparison, but I am not familiar with C language. So I just hope if anyone could help me with the temperature ramp calculation, and I would be able to deal with the rest of the parts. Also, I will really appreciate if you have better idea to control it. Thank you.
02-06-2012 04:52 PM
Thank you for you help. I tried to use your program, however, the T ramp term still shows the temperature but not the ramp. I also have some questions about your program. First I don't know why I need to round temperature reading to integer. Since the temperature ramp I am controlling is very accurate (0.000), I just output the temperature rather than rounding it to an integer. Also, when I connected the signal to a indicator, I could only connect to a array indicator but not the DBL shown in your program. I am not sure if I have made some mistakes anywhere, hope you could help me work this out. Thank you.
02-07-2012 03:05 AM
Did you try using the Ziegler–Nichols method ? I think this should help you in your problem.
02-07-2012 09:38 AM
Hi,
1. The rounding is not needed for the example to work - I think you shouldn't worry about that.
2. The indicators in the example are array indicators too. "Temp" showing the temperature values, "Ramp" showing the differences between consecutive values in "Temp".
The first value of each array will always be the same in this case because the first iteration of the loop subtracts 0 from the first random number.
regards Flo
02-07-2012 12:37 PM
Thank you for your suggestion. I haven't done that, but I don't think it would work in my experiment. Like I said, the reaction itself generates a lot of heat, and the heat generation is also very non-linear (like a chain reaction). So I have to adjust the PID output during temperature ramp, and be extra cautious when it's getting close to the final temperature. As a result, a test for Pu with large temperature fluctuation in the beginning would be very likely to ruin the whole experiment. That's why I only used PD control, and planning to add fuzzy control afterwards, so the controller would be sensitive enough to prevent the temperature shoot-up.
02-07-2012 12:46 PM
I understand this way to realize temperature ramp calculation, and I built the same block in my program. I set up a temperature ramp for test, but T ramp showed 0 every time I run it. Could you help me find out what's wrong with the program? Thank you.
02-08-2012 02:23 AM
That behavior only logical since you do not feed a ramp into your for loop. A ramp would require an array of values, then you could auto index the input like you do with the outputs of the loop.
You only feed a single value into your loop. Once that single value is stored into the shift register (every iteration except the first) the difference between the input and the shift register must always be zero.
Note that in your example "T" will contain the measured temperature ramp while "Ramp" will contain the temperature increments
Regards Florian.