Sign in to follow this  
Followers 0
LestatSan

PID Function

10 posts in this topic

Hello I'm studiant and I have this project to do : To control an "engine with DC current" with the PID function of the CJ1M CPU22 automate. But, the function doesn't work... But I have configured the words C to C+9 as written in the documentation... I have tested the acquisition of mesure and the command of the engine, and all is ok. That's why I think the problem comes from the PID And I would like to manipulate words in my programation (with du function MOV), so I used the "W" caracter, is it the good symbol ? I saw I can change the caracteristics of this symbol (dint, int, channel....). When I send the program to my API I have the message Error which say that my data are not compatibles (dint and int for example). So I tried to change their caracteristics, but it doesn't work for some words... Do I use the best method to manipulates words ? If not, which is the best one ? If yes how can I change the caracteristics of the variables ? Thank you and excuse me for my English ^^;

Share this post


Link to post
Share on other sites
Firstly program the other bits under the PID instruction namely the P_ER etc and turn on temp outputs. This will enable you to see what type of error.... i suspect that it would be a setting error...... Secondly, you have never used the PID instruction before, can be a little tricky...post all of the values that you have set.....it would give us more insight as to where the problem might be... Thirdly...a simple test...you don't even have to connect to the outside world to test..... simply use a dummy PV word and adjust the setpoint to be say 100+ the dummy PV. You shoud see your output word go to the full scale you have set...if 12 bits then 4095...make the dummy PV a bit greater then the SV and the output should be driven to 0. etc....... Forthly....make sure that you are not using the words C+10....+48 as good practice....because a lot of these word are used as internal calc words for the PID....

Share this post


Link to post
Share on other sites
I think too ^^; I use theese symbols : W10 to W14 W100 and W101 W1 W20 is the word C f the PID instruction W102 <== Although it would be contant, it changes... My PID instructions' values : C+1 : 10 (temporary) C+2 : 9999 (temporary) C+3 : 0 (temporary) C+4 : 1 (int) C+5 : 000B (Hex) All bits are forced C+6 : +6281 (int) Bits 12,11,7,3 and 0 are forced on Bits 1 and 2 are forced to off Other bits are off but not forced C+7 : -1500 (its the minimum that the process accepts) C+8 : +1500 I've tried to change the value of SP, but it's fixed to 0, and and can't change it (as all PID values : G, Ti, Td....) But, with the SP at 0 and the mesure is at 1000 and the output of the pid instruction doesn't changes... (I tried with values under 100, and I have the same results...) When I send the program to the API, I've got those advertisings messages : * Sortie **** is duplicated * The symbol SP has a data type (int) which is not compatible with the data's operand (DINT) (This my traductions, maybe there are not good at 100%) The input and output are ok when I'm not in auto (in regulation) but maybe you'll be interested by this : I use devicenet modules. I have this configuration : output : node 01. pins 1,2,4,5, and 8 are on. Only the first channel is connected input : node 00. pins 1,2,4,5 and 8 are on. Only the first channel is connected I hope I sent you the good informations Edited by LestatSan

Share this post


Link to post
Share on other sites
You can't have negative values for the PID insctruction.....if you need the neg (of course you do) then simply scale the values to the ones the PID can use using the APR instruction (for neg values) OR using floating point implment the linear equation of y=mx + b where m = gradient dy/dx b = constant The scaled value will have to correspond to the setup of the PID ie if 12 bit then scale to 0-4095 etc.... I have attached an example using the PIDAT instruction, in this case, because i was controlling a pump my setpoint from a screen was 0-100% and to display the output from the PID this was also 0-100%. The actual PID used 0-4095 for calcl's, this should point you in the right direction...... PID_Autotune_Example.cxp

Share this post


Link to post
Share on other sites
Thank you Sleepy Wombat Omron should learn how to make a programtion guide, cause in the guide I have, it's not APR but ARP written... It shouldn't work -_- But, il fact, I forgot that the values should be between 0 and 100%... Now, I've got 2 days to finish this project, thanks for your help ^^

Share this post


Link to post
Share on other sites
It still doesn't work.... The output of the PID doesn't changes whatever be the mesure or the set point... I send you the .cpx file. Maybe someone could find the error I remplace all symbols W by symbol H. H200 and H250=&3 r_gul_moteur4.cxp

Share this post


Link to post
Share on other sites
In which values must be the PID parameter ? INT ? UINT ? DINT ?

Share this post


Link to post
Share on other sites
I am not going to detail where you have gone wrong..... I have attached a modifed program similar to yours.... Study this and you will notice a number of differences....I am sorry i will be unavailable the next week or so due to work commitments, however this should be more then enough to get you started.....good luck PID.cxp

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0