netronio
Member
I am a student and i am doing a dissertation which condists of implementing a predictive control algorithm in the PLC.
In the laboratory we have a PLC S7-300 with CPU 313C-2DP and a PLC S7-200 with CPU 222 connected with EM 277
The main idea is to implement the algorithm first in the S7-300 and then in the S7-200 to see the differences and the response times of each controller.
The predictive control algorithms have a large amount of calculations that must be executed in each sampling period.
In general,in each sampling instant
150*(a*b*c*d) additions and
150*(a*b*c*d) multiplications
where a ranges from 0 to 88
b ranges from 0 to 86
c ranges from 0 to 21
d ranges from 0 to 23
have to be done
The algorithm gradually increanse the parameters.
What i have realised is that as the parameters increase, so the accuracy of the results differ from the expected values.
The expected values are computed in MATLAB so a slight difference is expected.But the strange thing is that the implementation with the S7-300 controller give differents results with the S7-200 controller.
I also did another experiment in order to test it.
I wrote a program in MATLAB which generates 2 arrays with size 200 of random elements following normal distribution.
I multiplied the elements and gor the result.The I did this procedure with both S7-300 and S7-200.
For doing this experiment twice with different numbers,i got the results:
MATLAB S7-300 S7-200
-19.901 -19.90173 -20.04157
-12.478 -12.47769 -12.20856
So an obvious difference in the results of S7-200 can be seen.My question is,is it possible that the S7-200 have a different accuracy(especially when they are dealing with floating point numbers) that can affect the result of a procedure?
When a lot a calculations is needed,the result will differ considerably from expected?
And,why has different results with S7-300 although they use pretty much the same technology?
thank you in advance,
Giannis Sdrolias
In the laboratory we have a PLC S7-300 with CPU 313C-2DP and a PLC S7-200 with CPU 222 connected with EM 277
The main idea is to implement the algorithm first in the S7-300 and then in the S7-200 to see the differences and the response times of each controller.
The predictive control algorithms have a large amount of calculations that must be executed in each sampling period.
In general,in each sampling instant
150*(a*b*c*d) additions and
150*(a*b*c*d) multiplications
where a ranges from 0 to 88
b ranges from 0 to 86
c ranges from 0 to 21
d ranges from 0 to 23
have to be done
The algorithm gradually increanse the parameters.
What i have realised is that as the parameters increase, so the accuracy of the results differ from the expected values.
The expected values are computed in MATLAB so a slight difference is expected.But the strange thing is that the implementation with the S7-300 controller give differents results with the S7-200 controller.
I also did another experiment in order to test it.
I wrote a program in MATLAB which generates 2 arrays with size 200 of random elements following normal distribution.
I multiplied the elements and gor the result.The I did this procedure with both S7-300 and S7-200.
For doing this experiment twice with different numbers,i got the results:
MATLAB S7-300 S7-200
-19.901 -19.90173 -20.04157
-12.478 -12.47769 -12.20856
So an obvious difference in the results of S7-200 can be seen.My question is,is it possible that the S7-200 have a different accuracy(especially when they are dealing with floating point numbers) that can affect the result of a procedure?
When a lot a calculations is needed,the result will differ considerably from expected?
And,why has different results with S7-300 although they use pretty much the same technology?
thank you in advance,
Giannis Sdrolias
Last edited: