Skip to content

Siemens SCL Tia Portal Tia-Portal Bibliothek Source Code like in OSCAT PID PI Regler

License

Notifications You must be signed in to change notification settings

sk8net/Siemens-Tia-Portal-PID-Regler

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PID controller for Siemens SCL Tia-Portal

Problem

I always had a lot to do with control technology at the Tia Portal and was simply never satisfied with the Siemens modules. I need PI controllers for pressure control and PID for temperature control. Here are a few points that bothered me:

  • Different devices among different CPUs use deferent lib.
  • Cannot be simulated.
  • Not posible to read the source and change it.
  • Far too complicated with a high level of familiarisation.
  • No portability to Codesys.
  • Too high integration in TIA.
  • Do a lot of tinkering and testing until finally something worked.
  • Cyclic OBs and Global DB were absolutely necessary. You can not integrate it in your privat functions.
  • Many thousands of pages of manuals.

Work

After a long search I did not find an alternative. But with OSCAT as an inspiration, since it is actually quite simple, I rewrote the functions. I wrote it in TIA14 and 15 for the 1200 and 1500 CPU. I still use the control in my projects Tia Portal 17. My intention was not to make everyone happy, but to give something back. I learned a lot thanks to open libs (OSCAT) and it wouldn't be right if I don't share back. Please do not argue with me about the functions. Everything works as it should. Just copy and use it. If you want, share your experience with my software with others.

Using instruction

The controller produce a outputs from 0 to 100. If used with a binary actor you shoud use the clock generator for pulse width modulation. The PI controller is disigned to run alone. Usefull for pressure regulation. The controller should alwasys stoped with the reset input is the regulation loop is disturbed. This prevents the integral to windup.

  • ir_Input = The mesuered value of pressure or themperature
  • ir_Setpoint = The demanded value of pressure or themperature
  • ir_ProportionalGain = The proportional gain, a tuning parameter
  • ir_IntegrationGain = The integral gain, a tuning parameter
  • ir_DifferentialGain = The derivative gain, a tuning parameter
  • itime_DifferezialActionTime = The length of the derivative action, a tuning parameter
  • ib_Reset = Empty the integral and sets the output to zero
  • or_Output = Output value in % from 0 to 100

Installing

Installing is quite simple. Insert the two SLC files under "External source files" and then execute the menu item "Generate blocks from source".

Porting

Note on porting to Step-7, Codesys or similar:

#PastTime := LREAL_TO_REAL(RUNTIME(#StaticCycleTime_Aux));
IF #PastTime > 0 AND #PastTime < 0.1 THEN

The first line returns the time between two calls in seconds. The resolution is accurate to the nanosecond. The second one checks the validity. With Step-7 I would pass the time as parameter, with Codesys TIME_TCK can be used. On 300 PLC it might be possible to work with "SFC64"(TIMETICK).

License

This project is released under the WTFPL LICENSE. WTFPL

About

Siemens SCL Tia Portal Tia-Portal Bibliothek Source Code like in OSCAT PID PI Regler

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published