PID loop implementation in siemens micro/win.

Alac

Member
Join Date
Mar 2016
Location
Gatineau
Posts
6
Hi, I'm new to this forum and have been programming plc's for about 2 years now. I have done programming and mods on different small systems and know my way around rslogix 500. I'm now working with a s7-200 CPU and a analog module em235 in siemens' micro/win app for the first time. I'm also working with PID loops for the first time. I am working off-site for now and will have some time to go on site to test/diagnostic and tune later on.

My main objective here is to control a VFD driving a pump. I have a 4-20ma pressure transducer on the suction and discharge side of the pump. This pump is acting as a booster for a domestic water system with the city pushing around 75 psi. I have to program the plc so that when high demands come, the pump will compensate the pressure drop and flow increase proportinnally with the pump speed.

From all the docs I've read on siemens' website and other sources I am starting to understand the need for a pid loop. I am also familiar with derivatives and integrals. I've been able to create a PID loop using the included wizard but I have some troubles with implementing the pid loop in the ladder.

Up to now, I've made the basic ladders for the controls. I have put the discharge transducer values as pid scaled input data with a set point at 75 psi. I'm not too sure how to use the output data from the pid loop to control the start/stop and speed of the VFD to compensate for pressure drops and increased flow. I thought of using a scale instruction to change the 0-100% VFD speed(used as values in the ladders) to integer values(6400-32000) that the output analog module can relate to but not sure how to do this while controlling the VFD start contact with the pid output.

The VFD is controlled through a single contact (high=run,low=stop) and there is also a 4-20ma analog input to control speed from 0-100%. The drive will be configured to have a minimum value of 30% to keep the pump well lubricated and cooled when running at low speed.

I hope I haven't asked to much...And that what I am explaining makes any sense. ;)

Feel free to ask me any questions to make this clear.

Thanks!
 
I never had much success with the PID wizard but can maybe give some guidance.

The microwin PID loop works with float numbers of between 0 and 1, the Set Point has to be scaled to between 0 and 1, the Current Value the same, the loop output will be between 0 and 1 and will have to be scaled to give 6400-32000, which will then have to be converted to INT.

All values for the PID loop are accessed via a block of memory (table) that you assign to the PID loop. The structure of the table is shown in the attached picture from the Siemens manual. So if you assign VB100 as the start of the table, then VD100 would be the Present Value (PV), VD104 would be the Set Point.... etc. The Gain is the P part of PID and will be positive for your application, try a low gain, say 0.4 to start with, the higher the number the larger the action. 'I' works the other way round, the smaller the number the larger the action, so maybe 20 would be a good start point. I never need the D action for my applications so it is always zero for me. The PID loop only runs when you call it, and it is best to run it at a fixed period, so generally you use a cyclic interrupt to call the PID loop. You will need to tell the PID loop the sample time via the Sample Time section of the table.

Giving smooth changes between Manual and PID operation is information for another day.

S7200 PID Loop table.jpg
 
The microwin PID loop works with float numbers of between 0 and 1, the Set Point has to be scaled to between 0 and 1, the Current Value the same, the loop output will be between 0 and 1 and will have to be scaled to give 6400-32000, which will then have to be converted to INT.

Hi, thanks for your reply.

From what I understand, I have to scale all my values to fit within those parameters. Would you have some insight as to how I could use the o to 1 loop output to control multiple elements?

I was thinking of scalling my pressure range(0-232 psi) from 0 to 1 and then adding some sort of "less than" compare instruction so that under a certain value the VFD is started through a contact. I would incorporate a cut-in and cut-out latch also. Then assign the same scalled output value of the loop to control the speed of the drive.

Does that make any sense?

Thanks!
 
Would you have some insight as to how I could use the o to 1 loop output to control multiple elements?
Not sure what you mean.

I was thinking of scaling my pressure range(0-232 psi) from 0 to 1 and then adding some sort of "less than" compare instruction
I would do all your comparing in units that are easy for a human to understand, so do any maths or calculations is PSI, then scale it for the PID loop.


I would incorporate a cut-in and cut-out latch also.
The cut-in would need to enable the PID loop cyclic interrupt and the cut-out would disable the PID loop cyclic interrupt and set the PID output to zero. Again I would do the comparison in PSI so that it is easy to understand. By using cut-in, cut-out you might need to have a different Gain for an acceleration phase or the PID loop may through a fit and overreact, because when you cut-in there may be a large difference between the Set Point (SP) and the Present Value (PV).
 

Similar Topics

Hello, I am attempting to tune a PID loop on a process. The process involves a valve with electronic actuator that has quite a high deadband...
Replies
10
Views
2,184
We have a PID loop at the plant that measures our drum outlet temp. It adjusts a damper to control the temp within the set point. We have a...
Replies
8
Views
1,418
Hello All, Has anyone on here used Soft PLC brand PLCs? I've just now started doing PLC programming and I am totally stuck on trying to make a PID...
Replies
4
Views
1,553
Hello and thanks for reading my question/problem. I am working on an a application where I have a servo controlled gate that allows product (dry)...
Replies
14
Views
2,767
Hello All, I am trying to figure out the best way to control a system I am working on. I have 2 bags of peanuts being lifted up by hoist. I am...
Replies
23
Views
4,736
Back
Top Bottom