Autor Thema: PID-Control  (Gelesen 31707 mal)

Offline Marco

  • Jr. Member
  • **
  • Beiträge: 20
PID-Control
« 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
« Letzte Änderung: Mai 25, 2016, 17:23:43 Nachmittag von Marco »

Offline John_Ess

  • Jr. Member
  • **
  • Beiträge: 80
  • I love easy-Forum.net!
Re:PID and Analog Input/Outpu manage for NED-ID system
« Antwort #1 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





Offline Marco

  • Jr. Member
  • **
  • Beiträge: 20
Re:PID-Control
« Antwort #2 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.

« Letzte Änderung: Mai 25, 2016, 17:24:38 Nachmittag von Marco »

Offline Maikky

  • Sr. Member
  • ****
  • Beiträge: 531
Re:PID and Analog Input/Outpu manage for NED-ID system
« Antwort #3 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

Offline Maikky

  • Sr. Member
  • ****
  • Beiträge: 531
Re:PID and Analog Input/Outpu manage for NED-ID system
« Antwort #4 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

Offline Marco

  • Jr. Member
  • **
  • Beiträge: 20
Re:PID-Control
« Antwort #5 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
« Letzte Änderung: Mai 25, 2016, 17:25:10 Nachmittag von Marco »

Offline Maikky

  • Sr. Member
  • ****
  • Beiträge: 531
Re:PID and Analog Input/Outpu manage for NED-ID system
« Antwort #6 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

Offline Marco

  • Jr. Member
  • **
  • Beiträge: 20
Re:PID and Analog Input/Outpu manage for NED-ID system
« Antwort #7 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

Offline Maikky

  • Sr. Member
  • ****
  • Beiträge: 531
Re:PID and Analog Input/Outpu manage for NED-ID system
« Antwort #8 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

Offline Maikky

  • Sr. Member
  • ****
  • Beiträge: 531
Re:PID and Analog Input/Outpu manage for NED-ID system
« Antwort #9 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

Offline Marco

  • Jr. Member
  • **
  • Beiträge: 20
Re:PID-Control
« Antwort #10 am: März 29, 2013, 10:36:18 Vormittag »
Ok,
thank you.

Have a hapy Easter.

Regards
« Letzte Änderung: Mai 25, 2016, 17:25:24 Nachmittag von Marco »

Offline Marco

  • Jr. Member
  • **
  • Beiträge: 20
Re:PID-Control
« Antwort #11 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
   

Offline werner_1

  • Jr. Member
  • **
  • Beiträge: 98
Re:PID-Control
« Antwort #12 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.

Offline Marco

  • Jr. Member
  • **
  • Beiträge: 20
Re:PID-Control
« Antwort #13 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.

Offline werner_1

  • Jr. Member
  • **
  • Beiträge: 98
Re:PID-Control
« Antwort #14 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.