4/19/2019 7:51 AM  
Joined: 4/17/2019 Last visit: 9/11/2019 Posts: 22 Rating: (0) 
Hi Guys I had design a filter in Matlab which contains too many matrix operation. How can I implement the same in Ladder logic ? Thank you. 
4/19/2019 8:52 AM  
Joined: 9/23/2005 Last visit: 9/23/2019 Posts: 2249 Rating: (333) 
Writing "matrix operation" did you have the linear algebra in your mind? If so, then there's no matrix concept in the TIA. Nor the linear algebra. You will need to define such operations by yourself. But the LAD is not best suited to code them. And in case of S7300/400, the LAD alone is not enough for this task. 
Regards, 

This contribution was helpful to1 thankful Users 
4/19/2019 9:02 AM  
Joined: 4/17/2019 Last visit: 9/11/2019 Posts: 22 Rating: (0) 
Thanks I gone through a paper where it is mentioned that Predictive control implementation (Linear dynamic model) is possible to code in PLC but in STL language not in Ladder. They didn't mentioned the STL code. I need a help regarding it since we are working on S7300. 
4/19/2019 9:03 AM  
Joined: 9/8/2009 Last visit: 9/20/2019 Posts: 1321 Rating: (126) 
Why ladder, why not SCL. There is also a package PLC Coder from Mathoworks. EDIT: Model predictive control is high resource demanding. It is almost impossible to execute in the PLC, since you will run out of memory. It is doable on PC controllers, there is also a package for MPC controller  same as Matlab's MPC on Simatic PC controllers  but I woldn't ask for price. 
Last edited by: Marko Bursic at: 4/19/2019 9:08:30 AM 

4/19/2019 9:16 AM  
Joined: 12/16/2012 Last visit: 9/23/2019 Posts: 601 Rating: (107) 
Hi, You could check out the OSCAT library: http://www.oscat.de/images/OSCATBasic/oscat_basic333_en.pdf 
Last edited by: Kahl at: 4/19/2019 9:17:31 AM 

4/19/2019 9:19 AM  
Joined: 4/17/2019 Last visit: 9/11/2019 Posts: 22 Rating: (0) 
But Is it using PLC coder or OPC servers will create latency in real time operations ? 
4/22/2019 2:59 PM  
Joined: 7/7/2010 Last visit: 9/23/2019 Posts: 8121 Rating: (1356)

I agree Ladder is the _wrong_ language for implementing filters and highly involved math operations to calculate real time control values. How often are you required to update the process in order to remain in control and produce acceptable (qualitywise) results? You need to start with some control theory engineering if you have not already done this so you know what level PLC is required for the task. Do you need s71518, or can a s71512 perform the task? If precise updates are only required every 100ms, you can distribute large calculations over 100 OB calls that run every 1 ms. However, if large numbers of calculations are required every 0.250ms, you will not likely find any single PLC that can solve the problem. There are PLC/PC hybrid solutions available using TIA Portal and Visual Studio on the PC to perform the hard calculations in real time. Until you know what is required to produce proper results, you will have a difficult time knowing what is required to solve the problem. Also, there are approximation methods that can calculate solutions "close enough" available that solve many real world problems where knowing the _exact_ answer is not required so long as it is very close to the right answer. An example of this is the use of FFTs for realtime frequency analysis. Knowing the _exact_ frequency values takes a long time. Getting a frequency value very close to the exact value however is done in real time with significantly fewer calculations. Maybe there are similar algorithms for the control functions you need to implement that produce the required quality. It starts with knowing what accuracy in the process control is required, especially if you already know what hardware is being controlled. For example, if the hardware is controlled by ±10VDC and you intend on using standard PLC outputs, you know the smallest change you can make to the control output. That's the accuracy you need to aim calculation results towards. If a formula can be simplified knowing the smallest change a process control can make and what that represents on the hardware device, you know something about the required accuracy of the calculations, and can perhaps stop calculating after a few terms in a series expansion of a solution.

Helpful? Rate it. 

This contribution was helpful to2 thankful Users 