Bibby Posted April 4, 2007 Report Posted April 4, 2007 Hi, I am using a Fx2n-4ad-TC with aFx1N. I need to control butter temp between 30c & 40c + - 1c via a HMI set point. Thermocouple reads fine. I will be using a solid state relay to turn a water heater on & off. Does anyone have code that i could just cut & past in. The book as usual is little help! Thanks in advance. Quote
Crossbow Posted April 4, 2007 Report Posted April 4, 2007 The FX Programming Manual (JY992D88101) has a programming example in the back of the book for basic PID control. Quote
waynes Posted April 5, 2007 Report Posted April 5, 2007 Bibby, It is impossible to copy and paste code from another, and hope that it works! What about the parameters: kp, ti, td, sample time, etc...... I have found this post. http://forums.mrplc.com/index.php?showtopic=9188&hl= The search facility does work really nice. Regards, WayneS Quote
Bibby Posted April 16, 2007 Author Report Posted April 16, 2007 Hi, thanks for your replies, but being very new to this kind of stuff, half a partial program does not help me at all.How in the example is an output controlled? Bibby. Quote
Crossbow Posted April 17, 2007 Report Posted April 17, 2007 Typically what's happening is the PID loop is creating a numeric output value which would be transferred to an analog output. That analog signal would for example control a pump or heater to modify the input signal to the PID (current temp, pump flow, whatever.) Quote
Colin Carpenter Posted April 17, 2007 Report Posted April 17, 2007 Do you have to do it with a PID controller. I've used the PID function in the FX2N many times, but always with an analogue control valve to precisely adjust the amount of steam or the amount of flow. I've never used a PID block with a digital output, and I'm not sure how you would do it. How you would convert an analogue MV value into digital switching would require some thought, or maybe some more hardware. Could you not just programme it as a simple thermostat. ..... when temp less than low setpoint, turn on heater, when greater than high setpoint, turn off heater? Quote
michael G Posted April 17, 2007 Report Posted April 17, 2007 Converting the PID output for a digital output you adjust the mark space ratio of a square wave PID output 0 to 100% one timer simply output on when timer "current value" <= PID output /100 * Timer Preset Timer Preset value is chosen to suit the control loop ( I use a value equal to the execution time of the PID) enhancements to basic control IF PID < 3% ( or PID output/100 * Timer Preset < minimum usefull on time) Don't bother turning ON output IF PID > 97% ( or (100 - PID output)/100 * Timer Preset < minimum usefull on time) Don't bother turning OFF output Reasoning for enhancements are 1) minimum switching times of the Digital device 2) minimum usefull time for process eg Turning on heater for 100 ms when the preset time is 10 seconds and the item being heated has a large thermal mass has no real effect on heating. Quote
waynes Posted April 17, 2007 Report Posted April 17, 2007 Maybe Peter Nachtwey has some valuable input? He knows this stuff very well. Quote
Bibby Posted April 17, 2007 Author Report Posted April 17, 2007 Hi, I only went down the PID route after the rep from mitsubushi recomended it. I would be more than happy with any help in controlling water within 1deg c. If any one has a working example I would welcome it. Thanks, Bibby. Quote
Sleepy Wombat Posted April 17, 2007 Report Posted April 17, 2007 Whats wrong with michael G example... it explains quite well how to turn the out put on/off through the use of a timer... this is baciscally what a temperature controller is doing with a relay out put... He was also nice enough to point out that you will need a contol output timer limitation (espsecially helpful for relay outputs). I would also suggest that you do some reading of PID... learn... cut and paste just aint gonna cut it... Quote
Bibby Posted April 19, 2007 Author Report Posted April 19, 2007 (edited) Thanks for all your helpful replies. I managed to obtain an example that I could just "cut and paste" in to my code & it works just fine! Cut and past.. It is the future. BIBBY. Edited April 19, 2007 by Bibby Quote
waynes Posted April 20, 2007 Report Posted April 20, 2007 (edited) If you don't mind Bibby, post it here? I would be interested to see how this was done in the example you got. Edited April 20, 2007 by waynes Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.