Industry Online Support

Technical Forum

Navigation

Rating (0)

Thanks 0

- Actions
- New post

7/24/2013 7:55 PM | |

Posts: 113 Rating: (21) |
I know that Pegaia programmed PID Lean but I have a couple of problems. He programmed using Ladder, not his fault, it was all that was available at the time. The Database structure is completely different to the Siemens PID Compact, so you can't just unhook the Siemens version and plug in PID Lean. And finally some of the input data types are different to the Siemens version, so you have to add Conversions. So I decided to have a go myself. Attached is PID More Compact. It is written in SCL which makes the formulas a lot easier to follow, I have also given references to the source material. Wherever possible the database members that it needs are a subset of PID Compact. The Input/Output use the same data types as PID Compact with the I value in the same range. I have added a simple Deadband, it seems to be simpler than others that I have seen but still seems to work OK. From my point of view the most important difference between PID Compact and PID More Compact is that you can change Gain etc whilst the controller is active. It isn't fully tested but I have been using it without problems for a couple of weeks in a speed control application. If you spot errors or have bright ideas for improvements then please post here and I will add them to the original. ## AttachmentPID More Compact.zip (280 Downloads) |

7/24/2013 8:17 PM | |

Posts: 5 Rating: (1) |
Yeah I needed DeadBand too, and I decided to write my version too :) heh. My ver is more more compact, heh. I have only P-I-D formula, but it is good for me (HVAC). |

8/9/2013 4:04 PM | |

Posts: 113 Rating: (21) |
Sorry about the delay getting back to, my Dad died unexpectedly and things have been a bit chaotic. Can you show me how you did your Deadband so that I can see if I am anywhere close ro right. This is my effort, I divide the Deadband entered by 2 so that I can get a plus and minus range. Convert the current error to ABS so that it is always positive. Then compare the ABS error against the deadband divided by 2. Currently the deadband is referenced to output value, so if there you are using an analog output 0-27648 you could enter a band of say 200. [code]// Apply the Deadband // Divide the Deadband by 2 #DeadBandDiv2:= #Deadband_scaled / 2; // Get the absolute value for the current error #ErrorABS:= ABS(#sPIDCalc."Error(n)"); // IF #ErrorABS < #DeadBandDiv2 THEN #sPIDCalc."Error(n)":=0.0; #sPIDCalc."Error(n-1)":=0.0; END_IF;[/code] |

8/21/2014 9:50 AM | |

Joined: 9/1/2005 Last visit: 8/2/2021 Posts: 3972 Rating: (187) |
new question published by Sarfraz Bhattiis split to a seperate thread with the subjectexample of Heater Circuit PID control with PWM output for SSR. Best regards CS Moderator |

## Follow us on