Hector Bermudez Posted July 30, 2005 Report Posted July 30, 2005 How's the best way to program to PID code for mitsubishi PLC A2ASCPU Quote
Colin Carpenter Posted July 30, 2005 Report Posted July 30, 2005 What software are you using to programme it with? How many PID loops are there in the application? I have ASCII files that can be imported into IEC developer to set up Global Variables and PID Function Blocks for any number of PID loops up to 10, I believe. Tested and working now, but will only work with IEC developer. Quote
maccxim Posted August 5, 2005 Report Posted August 5, 2005 I send an example of PID for AnAS using PIDINIT and PIDCONT dedicated instructions. For GX developer bye Max PID.zip Quote
thomas1000 Posted August 13, 2005 Report Posted August 13, 2005 Hi, would anyone have a manual for PID Programming of the AnS Series PLC. Is it similar to programming the QnA PID Programme. Thanks Quote
Colin Carpenter Posted August 13, 2005 Report Posted August 13, 2005 It's the very same as far as I can make out. I bought the paper manual for the AnA series and downloaded the QnA manual thinking it might be different, but I couldn't find any differences at all. Incidentally, the QnA CPUs are much more efficient at compiling the code when using IEC developer. I had a programme running 6 PID loops and lots of floating point maths, on an A2AS it was using about 12K steps, which was giving me a headache as it was getting close to maximum. Changed the CPU to a Q2AS, recompiled and the resulting programme used in the region of 4K steps. Massive reduction indicates more power in the CPU. Quote
thomas1000 Posted August 13, 2005 Report Posted August 13, 2005 Hi Colin, You sound quite proficient in using PID control on both the AnS and QnA CPU's. I used a QnA CPu recently to control 5 PID Loops, which provided good control results, unfortunately I could not get rid of a CPU error which came from the PID ladder program. All of the parameters being entered were within the specified range. Any ideas. I tried using the PIDRUN and STOP functions but had to remove them as the program would not work.Have you had similar problems? Is there an easy way of setting up the PID values to provide process control or is it down to trial and error. How do you use real values in both types of CPU? Thanks Quote
Colin Carpenter Posted August 14, 2005 Report Posted August 14, 2005 I've had that error light problem as well .... means that the CPU runs OK but you get a constant red light on the CPU. After a lot of head scratching and looking at error flags, I came to the conclusion that it was a "divide by zero error" which happened if the PID software was immediately run before variables had been set to proper numbers. Holding off the PID software for a while so that it was not operational on the first cycle seemed to cure the problem. Having said that, the error light never caused a problem, so I tended to ignore it. Have to re-programme one of my olf CPUs soon, so will look into it a bit more. Real numbers are very easy in IEC Developer .... just use INT_to_REAL to convert to real numbers, then do all your maths using system variables to store the interim results, then REAL_to_INT to convert back to Integer values. Obviously use DINT if you are using 32 bit numbers. A tip when working with integers is to work with values 100 times greater if you want a couple of decimal places accuracy. eg, 32.89 would be 3289 etc. I tend to use double integers all the time when doing calculations and then use DINT_to_INT right at the end if I'm sure that the value will be less than 32767. The QnAs are really good at it, the A2A can do it, but not sure about anything lower eg the A1S. There are "experts" who can tell you ways to tune PID loops, but I don't pretend to understand them. I find that every application I've done (mostly flow control) I use 0 as the Differential constant, and 300 to 400 for both Proportional and Integral Constants. Gives a relaxed, fairly lazy response, but that always seems to work in most cases. I hate neurotic people and neurotic control systems .....:) Quote
thomas1000 Posted August 14, 2005 Report Posted August 14, 2005 Colin, Thanks for the reply. Unfortunately I have only got the ladder version. I dont know whether the IEC version is on the same software. If it is let me know. The GX IEC version sounds very similar to the siemens software and the real to integer and vice versa conversions are available in block form. The sample program attatched in one of the previous comments utilises the LEDB and LEDC functions for PID control. What these are for I dont know, however I am guessing that the LEDR function is used to reset the error LED on the CPU on the next scan. I will be trying this function in my next project to see if it works. If you have experience of the above functions let me know. Thanks Quote
Colin Carpenter Posted August 14, 2005 Report Posted August 14, 2005 The manual for the QnA series says that the LED, LEDC and LEDR commands are used for: "Displays the ACII data (16 characters) ....etc..... at the LED display at the front of the CPU". Haven't a clue what this is about as it seems to indicate there is an LED display on the front of the CPU which can display characters 0-9, A-Z and various other special symbols. Never seen one of those to my knowledge. It doesn't mention the LEDB command, and nor does the PID manual. Totally baffled on that one, sorry. Quote
Goody Posted August 22, 2005 Report Posted August 22, 2005 These LED instructions seem to ring a distant bell (gonna try look em up after posting this) I seem to think that they are a sort of index register that changes the number of the inputs and outputs (number as in X1 changes to X8 ) so that you can use one peice of code (say for one PID) and then use this to change the inputs etc so that you dont have to repeat the code for each loop. Came across them a long time ago and I remember it took me a long while to understand the code I was looking at Quote
andybr Posted August 23, 2005 Report Posted August 23, 2005 The LED instructions were originally used for writing to the LED display on the A3 processors. When the AnA processors were developed Mitsubishi used these instructions to give access to a whole range of new instructions which were not available on the original A series (PID, Floating point maths etc.). You will need the programming manual for the AnA Dedicated Instructions to get details for most of these but the PID instructions had their own seperate manual. The same instructions were also used with the AnU processors. 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.