[?]: Detect failure of Encoder counts

SIMATIC S7-200/300/400, Step7, PCS7, CFC, SFC, PDM, PLCSIM,
SCL, Graph, SPS-VISU S5/S7, IBHsoftec, LOGO ...
nashama
Posts: 50
Joined: Thu Apr 21, 2011 9:37 am

[?]: Detect failure of Encoder counts

Post by nashama »

Dear All,

Code: Select all

L  PIW 256
T  DB10.DBD26
PIW 256 is the hardware address of the Encoder mounted on the travel drive of a machine.
What are the possible ways to detect if this Encoder is not generating any signals (like a warning display on the HMI that Encoder is not responding to the movement of the machine).
Can we check and compare DB10.DBD26 in OB35?
Or what are the ways, by programming, you can keep a watch on this Encoder's count PIW 256 or DB10.DBD26 and stop the machine if the encoder has stopped working during machine movement?

Regards
peterg70
Posts: 121
Joined: Tue Apr 12, 2011 1:44 pm

Re: [?]: Detect failure of Encoder counts

Post by peterg70 »

Do you have another inputs that would indicate movement.

i.e. a proximity switch or something else like a sensor.

Then check each cycle of the machine that the encoder is within a certain range that is appropriate.
i.e. when proxi on PIW is 2000 to 3000 and when other sensor is on PIW is 4000 to 4500 if one of these is wrong then machine alarm and warn PIW not changing.
Scarch
Posts: 103
Joined: Fri Aug 31, 2007 8:17 pm
Location: Europe

Re: [?]: Detect failure of Encoder counts

Post by Scarch »

Assuming that DB10.DBD30 is the speed reference (theorical reference), I compare such reference with the actual value. If the diference is higher than the threshold longer than 100 ms (filter), then I stop the machine and show speed error alarm on the OP.

Code: Select all

L PIW 256
ITD
T DB10.DBD26
L DB10.DBD30
-D
DTR
ABS
L 50.0   // TRIGGER THRESHOLD
>R
L S5T#100ms
SE T10
U T10
= M 100.0 // Alarm
nashama
Posts: 50
Joined: Thu Apr 21, 2011 9:37 am

Re: [?]: Detect failure of Encoder counts

Post by nashama »

Dear Peterg70 and Scarch,
Thanks for your time and attention.
Also, many thanks for the idea.
How about trying the following codes in OB35.

Code: Select all

      A     Q      3.2                       "MACHINE LIFTING
      FP    M      6.1
      R     M      6.0                       "ENCODER ALARM"
      JU    P1


P1:    A     Q      3.2                      "MACHINE LIFTING"
        JCN   P2

        L     "DATA B".encoder_value    "ACTUAL ENCODER VALUE"
        L     "DATA B".cyclic_check      "PREVIOUS STORED ENCODER VALUE "
        <>D   
        JC    K1
        S     M      6.0                         "ENCODER ALARM"
        BE    


K1:     L     "DATA B".encoder_value    "ACTUAL ENCODER VALUE"
         T     "DATA B".cyclic_check     "PREVIOUS STORED ENCODER VALUE "


P2:   NOP   0


Please advice if this idea is ok to compare the actual encoder counts with the value stored in OB35 100ms ago?

Regards
Scarch
Posts: 103
Joined: Fri Aug 31, 2007 8:17 pm
Location: Europe

Re: [?]: Detect failure of Encoder counts

Post by Scarch »

There will be always a difference, it is almost impossible to get the same number of pulses, that's why is better to compare and introduce a window error
nashama
Posts: 50
Joined: Thu Apr 21, 2011 9:37 am

Re: [?]: Detect failure of Encoder counts

Post by nashama »

Dear Scarch,

You are correct.

It is better to have to have a threshold value (like 50.0 as a tolerable margin) before you raise the alarm.

Regards