easy-forum

English Support - Software => easySoft => Thema gestartet von: Marco am März 28, 2013, 12:18:21 Nachmittag

Titel: PID-Control
Beitrag von: Marco am März 28, 2013, 12:18:21 Nachmittag
Hello guys. I have a question for you.
Some years ago I installed and programmed n.4 EASY 819-DC-RCX with NET-ID system for a industrial machine.
Now, the customer asks me to improve the machine adding a display to show the value of the analog input from NET-ID 1 and also to regulate a new analog output when the analog input changes.
So, the analog input is on the NET-ID 1 and the analog outpup is on the new part (MFD-Titan + MFD-RA17) that I want add as a display called NET-ID 5.
Please, who can explain me how I do to transfer the analog input from NET-ID 1 to NET-ID 5 and how to manage di PID to control the new analog output.

Thanks a lot
Titel: Re:PID and Analog Input/Outpu manage for NED-ID system
Beitrag von: John_Ess am März 28, 2013, 16:09:18 Nachmittag
Hi Marco,

I guess a snippet of your original code might help others to understand what you're after.
I have a similar project with four 819 relays that will eventually require an external MFD-Titan display and I'm eager to learn how to do it as well.

Cheers,
John




Titel: Re:PID-Control
Beitrag von: Marco am März 28, 2013, 16:17:04 Nachmittag
Hi John,
I attach my project.
I'm sorry but some comments are in Italian.
You can find, inside of the NET-ID 5 (MFD-Titan), the part of code that I've already written.

Thanks.

Titel: Re:PID and Analog Input/Outpu manage for NED-ID system
Beitrag von: Maikky am März 28, 2013, 17:31:34 Nachmittag
Dear Marco.

As far as I understand you like to use the analogue input IA02 at NetID01.

The use of function block PT in line 39 is fully correct, but this block is sending a value only
at a change from low to high value. Therefore you should permanently trigger this function block.

The corresponding block GT in NetId05 in contrary is reading at each cycle. You do not have to
add anything there.

By adding a trigger signal in line 39 of NetID01 you should be able already to see the value at the display.

Regards
Maikky
Titel: Re:PID and Analog Input/Outpu manage for NED-ID system
Beitrag von: Maikky am März 28, 2013, 23:12:36 Nachmittag
Dear Marco.

If you need a general description of PI-control with sample programs you may check the following link.
http://easy-forum.net/index.php?topic=3825.msg21229#msg21229

Regards
Maikky
Titel: Re:PID-Control
Beitrag von: Marco am März 29, 2013, 07:26:06 Vormittag
Good morning Maikky,
if I well known, I have to inser in the line 39 of NET-ID 1 a trigger to refresh the value of IA2.
Which is the best cycle time for trigger, about your point of view?

So, in line 39 of NET-ID 1, I put the PT_T function block for reading the IA2 and in NET-ID 5, with GT_Q function block, I read the value of IA2 and write it on MD1; then in the same line I put DB_T function block where I read MD e move it on MD2 (this step is correct or the DB_T block is nonsense?).
I use the value on MD2 for showing in the MFD-Titan display and for PID.

I wait your comments.

Thanks a lto.

Have a nice day
Titel: Re:PID and Analog Input/Outpu manage for NED-ID system
Beitrag von: Maikky am März 29, 2013, 09:36:58 Vormittag
Dear Marco.

The trigger time depends on the estimated change of the signal. For example for
temperatures it will be much slower than for motion control.

To be on the safe side you may use the quickest possibility which is a toggle bit.
A new value will be sent on each second cycle.
I have added a line 39 in NetID01.

Regarding receiving the data it is not necessary to use the function DB and it
is even not necessary to store the value in MD01. The value from the net
already is stored in GT01.QV

I have modified the program and visualization in NetId05 for information.

If you like to store the value you may do that. It will work also.

Regards
Maikky
Titel: Re:PID and Analog Input/Outpu manage for NED-ID system
Beitrag von: Marco am März 29, 2013, 10:10:30 Vormittag
Hi Maikky,
now I understand.
Thanks a lot for your precious suggestions, and sorry for my bad English.

See you.

Regards
Titel: Re:PID and Analog Input/Outpu manage for NED-ID system
Beitrag von: Maikky am März 29, 2013, 10:14:59 Vormittag
Dear Marco.

Chnaging to the subject PID-control now.

In your program you are actually using the proportional and integral component,
which in most cases is sufficient. If the differential component is not used, you do
not need a screen to adjust the rate time TV.

You also have to modify the output of your DC01 block. The output of the controller
is a 12bit value. You can not direct it to the analogue output, which is using 10 bits
only. You have to change the 12 bit output into 10 bits.

I have done that in attached revision by using the arithmetic function AR01, dividing the
controller output by 4 and direct it to analogue output.

Regards
Maikky
Titel: Re:PID and Analog Input/Outpu manage for NED-ID system
Beitrag von: Maikky am März 29, 2013, 10:19:52 Vormittag
Dear Marco.

There is nothing wrong with your English,
it is definitely better than my Italian.

Regards
Maikky
Titel: Re:PID-Control
Beitrag von: Marco am März 29, 2013, 10:36:18 Vormittag
Ok,
thank you.

Have a hapy Easter.

Regards
Titel: Re:PID-Control
Beitrag von: Marco am Mai 25, 2016, 17:51:03 Nachmittag
Hello Guys,
3 years are past and finally I installed the PID-control.
It works good but I had some problems and I must to come back to the customer another time.
After this experience I have some questions for you.

The process is composed by a pneumatic valve with positioner and a pressure transmitter.
I write the pressure set-point on MFD and the PID control has to regulate the valve.

1) I would like that PID-control of the valve worked from 70% and 100%, how I can do it?

2) in this case I had a problem with the pressure transmitter because has an only positive range (0-100mbar) and the pipe, where the valve is installed, is vacuum
    (-25mbar/0mbar).
    The PID-control works very good only when the pressure is positive (0-100mbar) but when the pressure is below to 0mbar MFD shows only ____! and the PID-control doesn't
    work.
    Is it possible to set that if the pressure is below to 0mbar MFD will show 0mbar?

Thanks a lot
   
Titel: Re:PID-Control
Beitrag von: werner_1 am Mai 26, 2016, 20:11:57 Nachmittag
Yes, both is possible. Please excuse my bad English.
First you put in the output of the PID-Controller a "VC". There you can set the parameter to 70% and 100%.
Second you can put a "VC" in the pressure input and set the Low value to 0,1% for excample.
Titel: Re:PID-Control
Beitrag von: Marco am Mai 27, 2016, 11:39:27 Vormittag
Hi wener_1,
your English is good.
I understand that you wrote me.
I attached my program and you can see the part of the PID-controller on the NET-ID5.
Please, can you send me an example for that application?

Thank you very much.
Titel: Re:PID-Control
Beitrag von: werner_1 am Mai 27, 2016, 20:47:16 Nachmittag
A few questions: Wy do you the Controller output divide by '1'?
I have add a VC in the Controller output, so that the value will be between 70 and 100%.

Wy do you subtract '200' from the IA01? I have set the value to '0', so that the controller see only positive values.
Titel: Re:PID-Control
Beitrag von: Marco am Mai 30, 2016, 08:15:24 Vormittag
Good Morning wener_1,
thanks a lot for your example.
About your questions:

- the right divider was 4, but during the testing I tried to use also 1 as value.
- I subracted 200 beacuse the sensor is 4-20mA (0-100mbar), trasformed 2-10V (200mV-1000mV)

Thanks
Titel: Re:PID-Control
Beitrag von: Marco am Mai 30, 2016, 14:23:31 Nachmittag
Good Afternoon wene_1,
if I well understood, with VC (I1= DC QV, SH=1023, SL=716), I could regulating the valve from 70% to 100%.
So, I've just given the enable (EV) at the valve, it takes up itself at 70%.

Is it correct?


Thanks a lot.


Have a nice day

Regards
Titel: Re:PID-Control
Beitrag von: werner_1 am Mai 30, 2016, 14:59:03 Nachmittag
What is "EV"?

I think, its correct.

At the transmitter you have 2...10V. Thats internaly 205 to 1023. If you now subract 200, you will have 5 to 823 for 0 to 100mbar. If you want to have 0 to 1000, you have to subract 205 and after them to multiplicate with 1,24.
Titel: Re:PID-Control
Beitrag von: Marco am Mai 30, 2016, 15:09:24 Nachmittag
Sorry.
(EN) not (EV).

Everything is clear.

Thanks.

Regards.
Titel: Re:PID-Control
Beitrag von: Marco am Juni 01, 2016, 07:19:29 Vormittag
Good Morning,
I'm sorry to distub you again, but I would like to have more information about the right mode for calculating the PID components (KP, TN, TV, TC, MV).
Because, I want to know how to increase or decrease the answer's speed of the valve when the pressure changes.

Thanks.

Have a nice day.


Regards
Titel: Re:PID-Control
Beitrag von: werner_1 am Juni 01, 2016, 11:07:58 Vormittag
Hi,
please see here:

https://de.wikipedia.org/wiki/Faustformelverfahren_%28Automatisierungstechnik%29
Titel: Re:PID-Control
Beitrag von: Marco am Juni 01, 2016, 16:27:26 Nachmittag
Hi werner_1,
thanks a lot for your quick answer.

In my application KP is set in MW80, TN is set in MW81 directly from MFD-Titan display, TV is none and TC = 1.
If I supposed, at the beginnig, TN = 0, which is the first value for KP (0-65535)? 1, 10, 100?

Sorry for my very little knowing about PID.


Thanks.


Best regards


Titel: Re:PID-Control
Beitrag von: werner_1 am Juni 01, 2016, 22:45:25 Nachmittag
Hi,

I'm not shure what's your question.  :-\

For Kp=1 you have set KP to 100. But I think that is not your question.

Best regards
werner
Titel: Re:PID-Control
Beitrag von: Marco am Juni 02, 2016, 07:26:56 Vormittag
Good Morning werner_1,
if I followed the Ziegler-Nichols as you linked I would have to set Kp=0.5Ku.
How can I find the value for Kp and Ku?
I should have to proceed step by step, I think.

For the DC function block, I should start with KP=50 (Kp=0.5 if I well understood) anf then with:

KP=100 (Kp=1)
KP=150 (Kp=1.5)
KP=200 (Kp=2)
......

Is the correct way to follow about your experience?


Thanks.

Have a nice day.

Titel: Re:PID-Control
Beitrag von: Marco am Juni 23, 2016, 12:08:11 Nachmittag
Hello werner_1,
I'm sorry to disturb again bt would like to know if the data written are correct [KP=100 (Kp=1), KP=150 (Kp=1.5), KP=200 (Kp=2)].

Thanks.

Have a nice day