I cannot see a derivative function built into RSLOGIX 5000 v16. I only see an integrator.
I wish to estimate the rate of change of a signal with respect to to time. It doesn't have to be perfect but the close the better. I have two approaches and would like to know which of the two approaches the experts here think would be best or maybe someone has a better approach altogether.
Method 1 >> Use a CPT instruction where
dS/dt = [S(current scan) - S(last scan)] / deltaT
where deltaT = period of the scheduled task
next rung would MOV S(current scan) to S(last scan)
** I'm not sure how repeatable the period of the a task and if the period is small a small error in the time could lead to a large error in the result.
Method 2 >> Use a CPT instruction where
dS/dt = [S(current scan) - S(last scan)] / [t(current scan) - t(last scan)
where t(current scan) = GSV.WALLCLOCKTIME.CURRNETVALUE
next rung would MOV S(current scan) to S(last scan)
next rung would MOV GSV.WALLCLOCK.TIME.CURRENTVALUE to t(last scan)
I hope my notation isn't confusing
I wish to estimate the rate of change of a signal with respect to to time. It doesn't have to be perfect but the close the better. I have two approaches and would like to know which of the two approaches the experts here think would be best or maybe someone has a better approach altogether.
Method 1 >> Use a CPT instruction where
dS/dt = [S(current scan) - S(last scan)] / deltaT
where deltaT = period of the scheduled task
next rung would MOV S(current scan) to S(last scan)
** I'm not sure how repeatable the period of the a task and if the period is small a small error in the time could lead to a large error in the result.
Method 2 >> Use a CPT instruction where
dS/dt = [S(current scan) - S(last scan)] / [t(current scan) - t(last scan)
where t(current scan) = GSV.WALLCLOCKTIME.CURRNETVALUE
next rung would MOV S(current scan) to S(last scan)
next rung would MOV GSV.WALLCLOCK.TIME.CURRENTVALUE to t(last scan)
I hope my notation isn't confusing