Jump to content

Recommended Posts

Posted
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.
Posted
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
Posted
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.
Posted
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.)
Posted
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?
Posted
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.
Posted
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.
Posted
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...
Posted (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 by Bibby
Posted (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 by waynes

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...