# Patent

## Title
Device for generating a time signal, and system comprising such a device

## Abstract

A device comprises a first time generator for generating an internal time signal, a unit for receiving an external time signal at discrete synchronization times and a generator unit for producing a generated time signal, which generator unit is designed to calculate on the basis of an algorithm the generated time signal at a determination time between two synchronization times from a value of the external time signal at a previous synchronization time and from a value of the internal time signal at the determination time. Said algorithm includes an assumption of a proportionality between an advance in the internal time signal and an advance in the external time signal.

## Background
CROSS REFERENCE TO RELATED APPLICATION
This application claims priority to German Patent Application No. DE 10 2013 227 177.8, filed Dec. 27, 2013, entitled VORRICHTUNG ZUM GENERIEREN EINES ZEITSIGNALS MIT SOLCHER VORRICHTUNG.
FIELD
The present invention relates to a device and a system.
BACKGROUND
In the prior art, many technical devices need a time signal to perform their intended functions. The time signal may be used for monitoring delays, for instance during communication or processing of data, for calculating time differences or for defining points in time.
It is known that in safety-related technical devices, a time signal used by the device must be safeguarded. In this context, the term safety means in particular a robustness to the occurrence of random unintentional faults rather than protection against targeted attacks in the sense of security. To achieve this, it may be necessary, for instance, for a time-signal generator integrated in the device to have a redundant design, which is associated with high costs.
The document by Stephan Schmidt, “Zeitsynchronisation” (Time Synchronization), Main Seminar on Communications Standards in Medical Engineering, Institute for Telematics, University of Lübeck (2010), describes a range of known protocols and standards for time synchronization.
SUMMARY
It is an object of the present invention to provide an improved device. It is also an object of the present invention to provide an improved system comprising a device.
In an embodiment, a device comprises a first time generator for generating an internal time signal, a unit for receiving an external time signal at discrete synchronization times and a generator unit for producing a generated time signal, which generator unit is designed to calculate on the basis of an algorithm the generated time signal at a determination time between two synchronization times from a value of the external time signal at a previous synchronization time and from a value of the internal time signal at the determination time, wherein the algorithm includes an assumption of a proportionality between an advance in the internal time signal and an advance in the external time signal.
In an embodiment, a system comprises a first device of the aforementioned type and a second device comprising a second time generator. In this system, the second device is designed to transmit as the external time signal a time signal produced by the second time generator to the first device.



BRIEF DESCRIPTION OF THE DRAWINGS
The invention is explained in more detail below with reference to drawings which each show a schematic diagram and in which:
FIG. 1 is a system having a first device and a second device, which are connected to one another via a communications link;
FIG. 2 is a first time-generator diagram; and
FIG. 3 is a second time-generator diagram.



DETAILED DESCRIPTION
FIG. 1 shows a block diagram of a system 10. The system 10 may be, for instance, part of an industrial plant, part of an automation system or part of a computer network. The system 10 may be part of a safety-related or safety-critical environment. For instance, the system 10 may be used to perform and to monitor safety-critical or safety-related functions and processes. It may be necessary for the system 10 to meet specified safety requirements and safety conditions, so for example to have a robustness to an occurrence of random unintentional faults.
The system 10 comprises a first device 100. The first device 100 may be a computer or a control device, for example. The first device 100 can be provided to perform and/or monitor safety-critical and/or safety-related processes, operations and functions. The first device 100 can be used to control and/or monitor further equipment and systems not shown in FIG. 1.
The functions, operations and processes performed by the first device 100 can have a time reference. This can mean that functions performed by the first device 100 must be performed at specific times, after specific time periods have elapsed or for specific time lengths.
In order to perform these time-referenced functions, the first device needs a reliable time signal. The first device 100, however, does not have a dedicated time generator designed to produce a sufficiently reliable and safe time signal. This means that the first device 100 can have a simple and low-cost design.
The system 10 comprises a second device 200 in addition to the first device 100. The second device 200 has a second time generator 210, which is designed to produce a reliable and safe time signal. The second time generator 210 of the second device 200 can comply with standards for safety-critical or safety-related applications. The second time generator 210 can have, for example, a redundant design and be equipped with at least two hardware timing circuits.
The second device 200 of the system 10 can transmit a time signal produced by the second time generator 210 of the second device 200 to the first device 100 of the system 10. For this purpose, the first device 100 and the second device 200 of the system 10 are connected to one another via a communications link 300. The communications link 300 may be, for example, a wired or wireless communications link. The communications link 300 can be designed such that safety-related requirements are met. For instance, the communications link 300 can have a redundant design and/or include a use of checksums.
The second device 200 can be connected via further communications links to further devices of the system 10 in order to transmit the time signal produced by the second time generator 210 of the second device 200 also to the further devices.
The first device 100 comprises a unit 120 for receiving an external time signal. The unit 120 is intended to receive as the external time signal TE the time signal produced by the second time generator 210 of the second device 200 and transmitted by the second device 200 via the communications link 300.
The first device 100 also comprises a first time generator 110. The first time generator 110 is designed to produce an internal time signal TI. The first time generator 110 can have a less stringent design in terms of safety-related requirements than the second time generator 210 of the second device 200. The internal time signal TI produced by the first time generator 110 can have a lower accuracy and a lower stability than the external time signal TE.
The unit 120 for receiving the external time signal TE receives the external time signal TE solely at discrete synchronization times tn. These synchronization times tn can occur equidistantly, i.e. each occur at the same time interval apart. The synchronization times tn, however, can also occur at varying time intervals.
In order to perform its functions, the device 100 of the system 10 may need a time signal also at times that lie between two synchronization times tn. The first time generator 110 of the first device 100 can provide the internal time signal TI at short intervals also between the synchronization times tn. The accuracy of the internal time signal TI, however, may not be sufficient for the functions performed by the first device 100. Therefore the first device 100 comprises a generator unit 130, which is designed to generate a generated time signal TG, which approximates the external time signal TE between the synchronization times tn.
The approximation of the external time signal TE by the time signal TG generated by the generator unit 130 is based on the assumption that an advance in the internal time signal TI produced by the first time generator 110 of the first device 100 is proportional to an advance of the external time signal TE at least over limited time periods. In particular, the approximation is based on the assumption that this proportionality lasts over a period of three consecutive synchronization times tn.
FIG. 2 shows a first time-generator diagram 400. An advancing time 410 is shown on a horizontal axis of the first time-generator diagram 400. Time signal values 420 are plotted on a vertical axis of the first time-generator diagram 400. A first graph shows the advance in the external time signal TE over time. A second graph shows the advance in the internal time signal TI over time.
The external time signal TE advances in a linear manner. The increase in the external time signal TE is constantly proportional to the time that has actually elapsed. The gradient of the graphs of the external time signal TE in the first time-generator diagram 400 is constant. In particular, the advance in the external time signal TE in a time period between the last synchronization time tn and a determination time tm, which lies between the last synchronization time tn and a next synchronization time tn+1, equals the advance in the external time signal TE in a previous time interval between a next-to-last synchronization time tn−1 and the last synchronization time tn. The following relationship thus applies:




  
    
      
        
          
            
              
                T
                E
              
              ⁡
              
                (
                
                  t
                  m
                
                )
              
            
            -
            
              
                T
                E
              
              ⁡
              
                (
                
                  t
                  n
                
                )
              
            
          
          
            
              t
              m
            
            -
            
              t
              n
            
          
        
        =
        
          
            
              
                
                  T
                  E
                
                ⁡
                
                  (
                  
                    t
                    n
                  
                  )
                
              
              -
              
                
                  T
                  E
                
                ⁡
                
                  (
                  
                    t
                    
                      n
                      -
                      1
                    
                  
                  )
                
              
            
            
              
                t
                n
              
              -
              
                t
                
                  n
                  -
                  1
                
              
            
          
          .
        
      
    
    
      
        (
        1
        )
      
    
  




The value TE(tm) of the external time signal TE at the determination time tm is not available to the first device 100. It is therefore meant to be approximated by the generated time signal TG.
It can be assumed for the internal time signal TI that the advance in the internal time signal TI over time progressed from the last synchronization time tn until the present determination time tm at the same gradient as the advance in the internal time signal TI in the previous time interval between the next-to-last synchronization time tn−1 and the last synchronization time tn:




  
    
      
        
          
            
              
                T
                I
              
              ⁡
              
                (
                
                  t
                  m
                
                )
              
            
            -
            
              
                T
                I
              
              ⁡
              
                (
                
                  t
                  n
                
                )
              
            
          
          
            
              t
              m
            
            -
            
              t
              n
            
          
        
        =
        
          
            
              
                
                  T
                  I
                
                ⁡
                
                  (
                  
                    t
                    n
                  
                  )
                
              
              -
              
                
                  T
                  I
                
                ⁡
                
                  (
                  
                    t
                    
                      n
                      -
                      1
                    
                  
                  )
                
              
            
            
              
                t
                n
              
              -
              
                t
                
                  
                    n
                    -
                    1
                  
                  ⁢
                  
                    
                  
                
              
            
          
          .
        
      
    
    
      
        (
        2
        )
      
    
  




If the conditions (1) and (2) are satisfied then the value of the external time signal TE at the determination time tm can expressed as




  
    
      
        
          
            T
            E
          
          ⁡
          
            (
            
              t
              m
            
            )
          
        
        =
        
          
            
              T
              E
            
            ⁡
            
              (
              
                t
                n
              
              )
            
          
          +
          
            
              
                
                  
                    T
                    I
                  
                  ⁡
                  
                    (
                    
                      t
                      m
                    
                    )
                  
                
                -
                
                  
                    T
                    I
                  
                  ⁡
                  
                    (
                    
                      t
                      n
                    
                    )
                  
                
              
              
                
                  
                    T
                    I
                  
                  ⁡
                  
                    (
                    
                      t
                      n
                    
                    )
                  
                
                -
                
                  
                    T
                    I
                  
                  ⁡
                  
                    (
                    
                      t
                      
                        n
                        -
                        1
                      
                    
                    )
                  
                
              
            
            ⁢
            
              
                (
                
                  
                    
                      T
                      E
                    
                    ⁡
                    
                      (
                      
                        t
                        n
                      
                      )
                    
                  
                  -
                  
                    
                      T
                      E
                    
                    ⁡
                    
                      (
                      
                        t
                        -
                        
                          n
                          
                            n
                            -
                            1
                          
                        
                      
                      )
                    
                  
                
                )
              
              .
            
          
        
      
    
    
      
        (
        3
        )
      
    
  




This relationship enables the value of the external time signal TE at the determination time tm to be approximated from the values known to the first device 100 of the external time signal TE at previous synchronization times tn−1, tn and from the values known anyway to the first device 100 of the internal time signal TI at the determination time tm and at the previous synchronization times tn−1, tn.
At the synchronization times tn, the value of the external time signal TE is known anyway. Hence the generator unit 130 of the first device 100 can produce the generated time signal TG as follows:




  
    
      
        
          
            T
            G
          
          ⁡
          
            (
            
              t
              m
            
            )
          
        
        =
        
          {
          
            
              
                
                  
                    
                      
                        
                          
                            T
                            E
                          
                          ⁡
                          
                            (
                            
                              t
                              m
                            
                            )
                          
                        
                        ⁢
                        
                          
                        
                        ⁢
                        for
                        ⁢
                        
                          
                        
                        ⁢
                        
                          t
                          m
                        
                      
                      =
                      ...
                    
                    ⁢
                    
                      
                    
                    ,
                    
                      t
                      
                        n
                        -
                        1
                      
                    
                    ,
                    
                      t
                      n
                    
                    ,
                    
                      t
                      
                        n
                        +
                        1
                      
                    
                    ,
                    ...
                  
                
              
              
                
                  
                    
                      
                        T
                        E
                      
                      ⁡
                      
                        (
                        
                          t
                          n
                        
                        )
                      
                    
                    +
                    
                      
                        
                          
                            
                              T
                              E
                            
                            ⁡
                            
                              (
                              
                                t
                                n
                              
                              )
                            
                          
                          -
                          
                            
                              T
                              E
                            
                            ⁡
                            
                              (
                              
                                t
                                
                                  n
                                  -
                                  1
                                
                              
                              )
                            
                          
                        
                        
                          
                            
                              T
                              I
                            
                            ⁡
                            
                              (
                              
                                t
                                n
                              
                              )
                            
                          
                          -
                          
                            
                              T
                              I
                            
                            ⁡
                            
                              (
                              
                                t
                                
                                  n
                                  -
                                  1
                                
                              
                              )
                            
                          
                        
                      
                      ⁢
                      
                        (
                        
                          
                            
                              T
                              I
                            
                            ⁡
                            
                              (
                              
                                t
                                m
                              
                              )
                            
                          
                          -
                          
                            
                              T
                              I
                            
                            ⁡
                            
                              (
                              
                                t
                                n
                              
                              )
                            
                          
                        
                        )
                      
                      ⁢
                      
                        
                      
                      ⁢
                      else
                    
                  
                
              
            
            .
          
        
      
    
    
      
        (
        4
        )
      
    
  




At the synchronization times tn, the generated time signal TG is set equal to the external time signal TE. At all other determination times tm, the generated time signal TG approximates the external time signal TE.
FIG. 3 shows a second time-generator diagram 500. The advancing time 410 is shown on a horizontal axis of the second time-generator diagram 500. The time signal values 420 of the internal time signal TI, of the external time signal TE and of the generated time signal TG are plotted on a vertical axis of the second time-generator diagram 500.
In the example shown for the time-generator diagram 500, the progress of the internal time signal TI produced by the first time generator 110 of the first device 100 is not entirely constant over a long period of time. Approximately at the synchronization time tn, the progress of the internal time signal TI slows down slightly compared with the curve which is shown dashed and which would have been expected according to the rate of advance of the internal time signal TI during the intervals preceding the synchronization time tn.
Owing to the slower progress of the internal time signal TI since the last synchronization time tn, the approximation of the external time signal TE by the generated time signal TG according to equation (4) at determination time tm between the last synchronization time tn and the next synchronization time tn+1 delivers a value that differs from the value of the external time signal TE. This error increases between the last synchronization time tn and the next synchronization time tn+1.
At the next synchronization time tn+1, the generated time signal TG is set equal to the external time signal TE as given by equation (4), with the result that the generated time signal TG experiences a step correction 131.
From the next synchronization time tn+1 onwards, the approximation of the external time signal TE by the generated time signal TG in accordance with equation (4) uses the now correct gradient of the internal time signal TI between the last synchronization time tn and the next synchronization time tn+1, with the result that the approximation of the external time signal TE by the generated time signal TG again delivers very accurate values from the next synchronization time tn+1 onwards.
An advantage of the approximation of the external time signal TE by the generated time signal TG in accordance with equation (4) is hence that long-term changes in the rate of progress of the internal time signal TI do not have long-term effects on the quality of the approximation.
A first quality value G1 can be calculated at the synchronization time tn+1 from the size of the error between the value of the generated time signal TG approximating the external time signal TE and the value of the external time signal TE:




  
    
      
        
          
            
              
                
                  G
                  1
                
                ⁡
                
                  (
                  
                    t
                    
                      n
                      +
                      1
                    
                  
                  )
                
              
              =
              
              ⁢
              
                
                  
                    T
                    G
                  
                  ⁡
                  
                    (
                    
                      t
                      
                        n
                        +
                        1
                      
                    
                    )
                  
                
                -
                
                  
                    T
                    E
                  
                  ⁡
                  
                    (
                    
                      t
                      
                        n
                        +
                        1
                      
                    
                    )
                  
                
              
            
          
        
        
          
            
              =
              
              ⁢
              
                
                  
                    
                      
                        
                          T
                          I
                        
                        ⁡
                        
                          (
                          
                            t
                            
                              n
                              +
                              1
                            
                          
                          )
                        
                      
                      -
                      
                        
                          T
                          I
                        
                        ⁡
                        
                          (
                          
                            t
                            n
                          
                          )
                        
                      
                    
                    
                      
                        
                          T
                          I
                        
                        ⁡
                        
                          (
                          
                            t
                            n
                          
                          )
                        
                      
                      -
                      
                        
                          T
                          I
                        
                        ⁡
                        
                          (
                          
                            t
                            
                              n
                              -
                              1
                            
                          
                          )
                        
                      
                    
                  
                  ⁢
                  
                    (
                    
                      
                        
                          T
                          E
                        
                        ⁡
                        
                          (
                          
                            t
                            n
                          
                          )
                        
                      
                      -
                      
                        
                          T
                          E
                        
                        ⁡
                        
                          (
                          
                            t
                            
                              n
                              -
                              1
                            
                          
                          )
                        
                      
                    
                    )
                  
                
                -
              
            
          
        
        
          
            
              
              ⁢
              
                
                  (
                  
                    
                      
                        T
                        E
                      
                      ⁡
                      
                        (
                        
                          t
                          
                            n
                            +
                            1
                          
                        
                        )
                      
                    
                    -
                    
                      
                        T
                        E
                      
                      ⁡
                      
                        (
                        
                          t
                          n
                        
                        )
                      
                    
                  
                  )
                
                .
              
            
          
        
      
    
    
      
        (
        5
        )
      
    
  




The first quality value G1 ideally has a value close to 0. If the magnitude of the first quality value G1 exceeds a specified first threshold value S1 then the quality and accuracy of the generated time signal TG may in some circumstances no longer be sufficient for the purposes of the first device 100 of the system 10. In this case, the first device 100 can produce a control signal, which can be used, for example, to take equipment and systems connected to the first device 100 of the system 10 into a safe state. Taking the equipment and systems into a safe state can involve shutting down the equipment and systems or involve an alternative way of taking the equipment and systems into an unproductive state. The control signal produced by the first device 100 can also be used to produce a fault message or for another response.
In addition, a second quality value G2 can be calculated from the values of the generated time signal TG and of the external time signal TE at the synchronization times tn−1, tn, tn+1:




  
    
      
        
          
            G
            2
          
          ⁡
          
            (
            
              t
              
                n
                +
                1
              
            
            )
          
        
        =
        
          
            
              
                
                  T
                  I
                
                ⁡
                
                  (
                  
                    t
                    
                      n
                      +
                      1
                    
                  
                  )
                
              
              -
              
                
                  T
                  I
                
                ⁡
                
                  (
                  
                    t
                    n
                  
                  )
                
              
            
            
              
                
                  T
                  I
                
                ⁡
                
                  (
                  
                    t
                    n
                  
                  )
                
              
              -
              
                
                  T
                  I
                
                ⁡
                
                  (
                  
                    t
                    
                      n
                      -
                      1
                    
                  
                  )
                
              
            
          
          ·
          
            
              
                
                  
                    T
                    E
                  
                  ⁡
                  
                    (
                    
                      t
                      n
                    
                    )
                  
                
                -
                
                  
                    T
                    E
                  
                  ⁡
                  
                    (
                    
                      t
                      
                        n
                        -
                        1
                      
                    
                    )
                  
                
              
              
                
                  
                    T
                    E
                  
                  ⁡
                  
                    (
                    
                      t
                      
                        n
                        +
                        1
                      
                    
                    )
                  
                
                -
                
                  
                    T
                    E
                  
                  ⁡
                  
                    (
                    
                      t
                      n
                    
                    )
                  
                
              
            
            .
          
        
      
    
    
      
        (
        6
        )
      
    
  




The second quality value G2 gives a measure of the proportionality between the internal time signal TI and the external time signal TE and should have a value as close as possible to 1. The first device 100 can compare the second quality value G2 at the synchronization times tn with the value 1. If the second quality value G2 differs from the value 1 by more than a specified second threshold value S2 then the first device 100 can produce a control signal, which can be used in a similar way to the control signal produced on the basis of the first quality value G1 to initiate a safe response.
Between the synchronization times tn, the generator unit 130 of the first device 100 of the system 10 can check the plausibility of the values of the generated time signal TG. At each determination time tm, the value of the generated time signal TG should be greater than or at least equal to the value of the generated time signal TG at a previous determination time tm−1. It is clear from equation (4) that this requirement is equivalent to the requirement that the value of the internal time signal TI at every determination time tm is greater than or equal to the value of the internal time signal TI at the previous determination time tm−1. This can be used to define a third quality value G3:

G3(tm)=TI(tm)TI(tm−1).  (7)

The third quality value G3 is meant to have a value greater than or equal to 0 at every determination time tm. If the third quality value G3 has a value less than 0 then the first device 100 of the system 10 can conclude that there is a fault and can produce a control signal, which can be used, for example, to initiate a safe response.
Calculation of the first quality value G1 and of the second quality value G2 is simplified if the synchronization times tn occur equidistantly, i.e. each occur at the same time interval apart. In this case, the following is true:

tn+1−tn=tn−tn−1.  (8)

If moreover the external time signal TE progresses at a constant rate, then the following is also true:

TE(tn+1)TE(tn)=TE(tn)−TE(tn−1).  (9)

Calculation of the first quality value G1 is then simplified in accordance with equations (5), (8) and (9) to




  
    
      
        
          
            G
            1
          
          ⁡
          
            (
            
              t
              
                n
                +
                1
              
            
            )
          
        
        =
        
          
            (
            
              
                
                  
                    
                      T
                      
                        I
                        ⁢
                        
                          
                        
                      
                    
                    ⁡
                    
                      (
                      
                        t
                        
                          n
                          +
                          1
                        
                      
                      )
                    
                  
                  -
                  
                    
                      T
                      I
                    
                    ⁡
                    
                      (
                      
                        t
                        n
                      
                      )
                    
                  
                
                
                  
                    
                      T
                      I
                    
                    ⁡
                    
                      (
                      
                        t
                        n
                      
                      )
                    
                  
                  -
                  
                    
                      T
                      I
                    
                    ⁡
                    
                      (
                      
                        t
                        
                          n
                          -
                          1
                        
                      
                      )
                    
                  
                
              
              -
              1
            
            )
          
          ⁢
          
            
              (
              
                
                  
                    T
                    E
                  
                  ⁡
                  
                    (
                    
                      t
                      
                        n
                        +
                        1
                      
                    
                    )
                  
                
                -
                
                  
                    T
                    E
                  
                  ⁡
                  
                    (
                    
                      t
                      n
                    
                    )
                  
                
              
              )
            
            .
          
        
      
    
    
      
        (
        
          5
          ′
        
        )
      
    
  




Calculation of the second quality value G2 is then simplified in accordance with equations (6), (8) and (9) to




  
    
      
        
          
            G
            2
          
          ⁡
          
            (
            
              t
              
                n
                +
                1
              
            
            )
          
        
        =
        
          
            
              
                
                  T
                  I
                
                ⁡
                
                  (
                  
                    t
                    
                      n
                      +
                      1
                    
                  
                  )
                
              
              -
              
                
                  T
                  I
                
                ⁡
                
                  (
                  
                    t
                    n
                  
                  )
                
              
            
            
              
                
                  T
                  I
                
                ⁡
                
                  (
                  
                    t
                    n
                  
                  )
                
              
              -
              
                
                  T
                  I
                
                ⁡
                
                  (
                  
                    t
                    
                      n
                      +
                      1
                    
                  
                  )
                
              
            
          
          .
        
      
    
    
      
        (
        
          6
          ′
        
        )
      
    
  




The first time generator 110 of the first device 100 of the system 10 and/or the second time generator 210 of the second device 200 of the system 10 can be designed as binary counters of finite bit length. In this case, the values of the internal time signal TI and of the external time signal TE can overrun. The internal time signal TI produced by the first time generator 110 of the first device 100 can have a bit length of lI. The external time signal TE produced by the second time generator 210 of the second device 200 can have a bit length of lE. In order to take into account potential overruns of the internal time signal TI and of the external time signal TE, the calculation of the generated time signal TG, of the first quality value G1, of the second quality value G2 and of the third quality value G3 in accordance with equations (4), (5), (6) and (7) can be modified as follows:




  
    
      
        
          
        
        ⁢
        
          
            
              T
              G
            
            ⁡
            
              (
              
                t
                m
              
              )
            
          
          =
          
            {
            
              
                
                  
                    
                      
                        
                          
                            
                              T
                              E
                            
                            ⁡
                            
                              (
                              
                                t
                                m
                              
                              )
                            
                          
                          ⁢
                          
                            
                          
                          ⁢
                          for
                          ⁢
                          
                            
                          
                          ⁢
                          
                            t
                            m
                          
                        
                        =
                        ...
                      
                      ⁢
                      
                        
                      
                      ,
                      
                        t
                        
                          n
                          -
                          1
                        
                      
                      ,
                      
                        t
                        
                          n
                          ⁢
                          
                            
                          
                        
                      
                      ,
                      
                        t
                        
                          n
                          +
                          1
                        
                      
                      ,
                      ...
                    
                  
                
                
                  
                    
                      
                        
                          
                            
                              
                                T
                                E
                              
                              ⁡
                              
                                (
                                
                                  t
                                  n
                                
                                )
                              
                            
                            +
                            
                              
                                
                                  (
                                  
                                    
                                      
                                        T
                                        E
                                      
                                      ⁡
                                      
                                        (
                                        
                                          t
                                          n
                                        
                                        )
                                      
                                    
                                    -
                                    
                                      
                                        T
                                        E
                                      
                                      ⁡
                                      
                                        (
                                        
                                          t
                                          
                                            n
                                            -
                                            1
                                          
                                        
                                        )
                                      
                                    
                                    +
                                    
                                      2
                                      
                                        l
                                        I
                                      
                                    
                                  
                                  )
                                
                                ⁢
                                mod
                                ⁢
                                
                                  
                                
                                ⁢
                                
                                  2
                                  
                                    l
                                    I
                                  
                                
                              
                              
                                
                                  (
                                  
                                    
                                      
                                        T
                                        I
                                      
                                      ⁡
                                      
                                        (
                                        
                                          t
                                          n
                                        
                                        )
                                      
                                    
                                    -
                                    
                                      
                                        T
                                        I
                                      
                                      ⁡
                                      
                                        (
                                        
                                          t
                                          
                                            n
                                            -
                                            1
                                          
                                        
                                        )
                                      
                                    
                                    +
                                    
                                      2
                                      
                                        l
                                        I
                                      
                                    
                                  
                                  )
                                
                                ⁢
                                mod
                                ⁢
                                
                                  
                                
                                ⁢
                                
                                  2
                                  
                                    l
                                    I
                                  
                                
                              
                            
                          
                        
                      
                      
                        
                          
                            
                              (
                              
                                
                                  
                                    T
                                    I
                                  
                                  ⁢
                                  
                                    (
                                    
                                      t
                                      m
                                    
                                    )
                                  
                                
                                -
                                
                                  
                                    T
                                    I
                                  
                                  ⁡
                                  
                                    (
                                    
                                      t
                                      n
                                    
                                    )
                                  
                                
                                +
                                
                                  2
                                  
                                    l
                                    E
                                  
                                
                              
                              )
                            
                            ⁢
                            mod
                            ⁢
                            
                              
                            
                            ⁢
                            
                              2
                              
                                l
                                E
                              
                            
                            ⁢
                            
                              
                            
                            ⁢
                            else
                          
                        
                      
                    
                  
                
              
              ;
            
          
        
      
    
    
      
        (
        
          4
          ′
        
        ⁢
        
          
        
        )
      
    
  
  
    
      
        
          
            
              G
              1
            
            ⁡
            
              (
              
                t
                
                  n
                  +
                  1
                
              
              )
            
          
          =
          
            
              
                
                  
                    (
                    
                      
                        
                          T
                          I
                        
                        ⁡
                        
                          (
                          
                            t
                            
                              n
                              +
                              1
                            
                          
                          )
                        
                      
                      -
                      
                        
                          T
                          I
                        
                        ⁡
                        
                          (
                          
                            t
                            n
                          
                          )
                        
                      
                      +
                      
                        2
                        
                          l
                          I
                        
                      
                    
                    )
                  
                  ⁢
                  mod
                  ⁢
                  
                    
                  
                  ⁢
                  
                    2
                    
                      l
                      I
                    
                  
                
                
                  
                    (
                    
                      
                        
                          T
                          I
                        
                        ⁡
                        
                          (
                          
                            t
                            n
                          
                          )
                        
                      
                      -
                      
                        
                          T
                          I
                        
                        ⁡
                        
                          (
                          
                            t
                            
                              n
                              -
                              1
                            
                          
                          )
                        
                      
                      +
                      
                        2
                        
                          l
                          I
                        
                      
                    
                    )
                  
                  ⁢
                  mod
                  ⁢
                  
                    
                  
                  ⁢
                  
                    2
                    
                      l
                      I
                    
                  
                
              
              ⁢
              
                (
                
                  
                    
                      T
                      E
                    
                    ⁡
                    
                      (
                      
                        t
                        n
                      
                      )
                    
                  
                  -
                  
                    
                      T
                      E
                    
                    ⁡
                    
                      (
                      
                        t
                        
                          n
                          -
                          1
                        
                      
                      )
                    
                  
                  +
                  
                    2
                    
                      l
                      E
                    
                  
                
                )
              
              ⁢
              mod
              ⁢
              
                
              
              ⁢
              
                2
                
                  l
                  E
                
              
            
            -
            
              
                (
                
                  
                    
                      T
                      E
                    
                    ⁡
                    
                      (
                      
                        t
                        
                          n
                          +
                          1
                        
                      
                      )
                    
                  
                  -
                  
                    
                      T
                      E
                    
                    ⁡
                    
                      (
                      
                        t
                        n
                      
                      )
                    
                  
                  +
                  
                    2
                    
                      l
                      E
                    
                  
                
                )
              
              ⁢
              mod
              ⁢
              
                
              
              ⁢
              
                2
                
                  l
                  E
                
              
            
          
        
        ;
      
    
    
      
        (
        
          5
          ′′
        
        )
      
    
  
  
    
      
        
          
            
              G
              2
            
            ⁡
            
              (
              
                t
                
                  n
                  +
                  1
                
              
              )
            
          
          =
          
            
              
                
                  (
                  
                    
                      
                        T
                        I
                      
                      ⁡
                      
                        (
                        
                          t
                          
                            n
                            +
                            1
                          
                        
                        )
                      
                    
                    -
                    
                      
                        T
                        I
                      
                      ⁡
                      
                        (
                        
                          t
                          n
                        
                        )
                      
                    
                    +
                    
                      2
                      
                        l
                        I
                      
                    
                  
                  )
                
                ⁢
                mod
                ⁢
                
                  
                
                ⁢
                
                  2
                  
                    l
                    I
                  
                
              
              
                
                  (
                  
                    
                      
                        T
                        I
                      
                      ⁡
                      
                        (
                        
                          t
                          n
                        
                        )
                      
                    
                    -
                    
                      
                        T
                        I
                      
                      ⁡
                      
                        (
                        
                          t
                          
                            n
                            -
                            1
                          
                        
                        )
                      
                    
                    +
                    
                      2
                      
                        l
                        I
                      
                    
                  
                  )
                
                ⁢
                mod
                ⁢
                
                  
                
                ⁢
                
                  2
                  
                    l
                    
                      I
                      ⁢
                      
                        
                      
                    
                  
                
              
            
            ·
            
              
                
                  (
                  
                    
                      
                        T
                        E
                      
                      ⁡
                      
                        (
                        
                          t
                          n
                        
                        )
                      
                    
                    -
                    
                      
                        T
                        E
                      
                      ⁡
                      
                        (
                        
                          t
                          
                            n
                            -
                            1
                          
                        
                        )
                      
                    
                    +
                    
                      2
                      
                        l
                        E
                      
                    
                  
                  )
                
                ⁢
                mod
                ⁢
                
                  
                
                ⁢
                
                  2
                  
                    l
                    E
                  
                
              
              
                
                  (
                  
                    
                      
                        T
                        E
                      
                      ⁡
                      
                        (
                        
                          t
                          
                            n
                            +
                            1
                          
                        
                        )
                      
                    
                    -
                    
                      
                        T
                        E
                      
                      ⁡
                      
                        (
                        
                          t
                          n
                        
                        )
                      
                    
                    +
                    
                      2
                      
                        l
                        E
                      
                    
                  
                  )
                
                ⁢
                mod
                ⁢
                
                  
                
                ⁢
                
                  2
                  
                    l
                    E
                  
                
              
            
          
        
        ;
      
    
    
      
        (
        
          6
          ′′
        
        )
      
    
  
  
    
      
        
          
        
        ⁢
        
          
            
              G
              3
            
            ⁡
            
              (
              
                t
                m
              
              )
            
          
          =
          
            
              (
              
                
                  
                    T
                    I
                  
                  ⁡
                  
                    (
                    
                      t
                      m
                    
                    )
                  
                
                -
                
                  
                    T
                    I
                  
                  ⁡
                  
                    (
                    
                      t
                      
                        m
                        -
                        1
                      
                    
                    )
                  
                
                +
                
                  2
                  
                    l
                    I
                  
                
              
              )
            
            ⁢
            mod
            ⁢
            
              
            
            ⁢
            
              2
              
                l
                I
              
            
          
        
      
    
    
      
        (
        
          7
          ′
        
        )
      
    
  




where mod denotes the modulo operator.

In an embodiment, a device comprises a first time generator for generating an internal time signal, a unit for receiving an external time signal at discrete synchronization times and a generator unit for producing a generated time signal, which generator unit is designed to calculate on the basis of an algorithm the generated time signal at a determination time between two synchronization times from a value of the external time signal at a previous synchronization time and from a value of the internal time signal at the determination time, wherein the algorithm includes an assumption of a proportionality between an advance in the internal time signal and an advance in the external time signal. The time signal generated by the generator unit of this device can advantageously approximate the external time signal sufficiently reliably for the time signal generated by the generator unit to be used to perform time-dependent safety-related functions. Moreover, the first time generator of the device advantageously does not need to meet high safety and reliability requirements. This means that the device can advantageously have a simple and low-cost design.
In an embodiment of the device, the generator unit is designed to set the generated time signal equal to the external time signal at the synchronization times. This advantageously corrects any error arising between the synchronization times that exists between the time signal generated by the generator unit of the device and the external time signal at the synchronization times. This advantageously ensures that the time signal generated by the generator unit does not depart too far from the external time signal even over long time periods.
In an embodiment of the device, the algorithm includes the assumption that a ratio of advances in the external time signal and in the internal time signal between the last synchronization time and the determination time equals a ratio of advances in the external time signal and in the internal time signal between the next-to-last synchronization time and the last synchronization time. If this assumption is valid, it is advantageously possible to extrapolate the advance in the external time signal from the advance in the internal time signal. An advantage of the algorithm used by the generator unit is that it is based solely on the time interval between the next-to-last synchronization time and the last synchronization time. This means that longer-term variations in the uniformity of the advance in the internal time signal do not reduce the quality of the approximation of the external time signal by the time signal generated by the generator unit.
In an embodiment, the algorithm is designed to calculate the generated time signal at the determination time as the sum of a value of the external time signal at the last synchronization time and of a product formed by multiplying the advance in the internal time signal between the last synchronization time and the determination time with the ratio of the advance in the external time signal between the next-to-last synchronization time and the last synchronization time to the advance in the internal time signal between the next-to-last synchronization time and the last synchronization time. The generator unit of the device thereby advantageously enables a reliable approximation of the external time signal by the time signal generated by the generator unit if the internal time signal of the first time generator of the device advances sufficiently constantly over at least a time period of three synchronization times.
In an embodiment of the device, the generator unit is designed to take into account an overrun of the value of the external time signal and/or of the value of the internal time signal. The internal time generator and/or an external time generator producing the external time signal can then advantageously be designed as counters of finite bit length.
In an embodiment of the device, the generator unit is designed to calculate a first quality value at a synchronization time. The first quality value is here calculated as the difference of the value of the generated time signal, which value is calculated for the synchronization time on the basis of the algorithm, and the value of the external time signal at the synchronization time. The first quality value advantageously provides information about an error between the time signal generated by the generator unit and the external time signal at the synchronization time. The first quality value thereby allows an assessment of the quality of the approximation of the external time signal by the time signal generated by the generator unit.
In an embodiment of the device, the device is designed to produce a control signal if the first quality value differs from the value zero by more than a specified first threshold value. This advantageously enables the device to initiate a response if the quality of the approximation of the external time signal by the time signal generated by the generator unit does not exhibit a desired quality quantified by the first threshold value. The control signal that can be produced by the device can be used, for example, to take safety-critical equipment and systems into a safe state. For instance, the control signal that can be produced by the device can be used to shut down safety-critical equipment and systems.
In an embodiment of the device, the generator unit is designed to calculate a second quality value at a synchronization time. The second quality value is here calculated as the product of the ratio of the advance in the internal time signal between the last synchronization time and the present synchronization time to the advance in the internal time signal between the next-to-last synchronization time and the last synchronization time, and the ratio of the advance in the external time signal between the next-to-last synchronization time and the last synchronization time to the advance in the external time signal between the last synchronization time and the present synchronization time. The second quality value that can be calculated by the generator unit of the device constitutes a measure of a proportionality between the internal time signal of the device and the external time signal receivable by the device. The second quality value enables the device to take appropriate action if the advance in the internal time signal of the device is not sufficiently proportional to the advance in the external time signal.
In an embodiment of the device, the device is designed to produce a control signal if the second quality value differs from the value one by more than a specified second threshold value. The control signal that can be produced by the device can be used, for example, to take equipment and systems connected to the device into a safe state. The control signal that can be produced by the device hence enables the device to respond by appropriate action to there not being a desired proportionality between the advance in the internal time signal and the advance in the external time signal.
In an embodiment of the device, the generator unit is designed to calculate a third quality value at the determination time. The third quality value is here calculated as the difference between the value of the internal time signal at the determination time and a value of the internal time signal at a previous determination time. The third quality value that can be calculated by the generator unit of the device allows a plausibility check of the values of the internal time signal produced by the internal time generator of the device and hence also of the values of the time signal generated by the generator unit.
In an embodiment of the device, the device is designed to produce a control signal if the third quality value is not greater than or equal to zero. The control signal that can be produced by the device advantageously enables the device to take appropriate action if the values of the internal time signal produced by the first time generator of the device are not plausible. The control signal that can be produced by the device can be used, for example, to take equipment or systems connected to the device into a safe state.
In an embodiment, a system comprises a first device of the aforementioned type and a second device comprising a second time generator. In this system, the second device is designed to transmit as the external time signal a time signal produced by the second time generator to the first device. The first device of the system can advantageously use the generator unit in the first device to generate a generated time signal which approximates the external time signal provided by the second device. Thus by the generated time signal a time signal having a similar quality to the external time signal produced by the second time generator of the second device is available to the first device of the system without the first device needing to be equipped for this purpose with a time generator that has the same quality as the second time generator of the second device.
In an embodiment of the system, the second time generator has a redundant design. The second time generator can thus advantageously comply with standards for safety-related applications.
In an embodiment of the system, the first device and the second device are connected to one another via a communications link. The second device of the system can advantageously transmit as the external time signal the time signal produced by the second time generator of the second device to the first device of the system via the communications link. The communications link can be designed as a secure communications link, for example.
In an embodiment of the system, the system is designed to transmit as the external time signal the time signal produced by the second time generator to the first device at equidistant synchronization times. This can advantageously simplify the generation of the time signal generated by the generator unit.

## Claims

1. A device comprising:
a first time generator for generating an internal time signal,
a unit for receiving an external time signal at discrete synchronization times, and
a generator unit for producing a generated time signal, wherein the generator unit is designed to calculate on the basis of an algorithm the generated time signal at a determination time between two synchronization times from a value of the external time signal at a previous synchronization time and from a value of the internal time signal at the determination time,
wherein the algorithm includes an assumption of a proportionality between an advance in the internal time signal and an advance in the external time signal;
wherein the algorithm includes the assumption that a ratio of advances in the external time signal and in the internal time signal between the last synchronization time and the determination time equals a ratio of advances in the external time signal and in the internal time signal between the next-to-last synchronization time and the last synchronization time; and
wherein the algorithm is designed to calculate the generated time signal at the determination time as the sum of a value of the external time signal at the last synchronization time and of a product formed by multiplying the advance in the internal time signal between the last synchronization time and the determination time with the ratio of the advance in the external time signal between the next-to-last synchronization time and the last synchronization time to the advance in the internal time signal between the next-to-last synchronization time and the last synchronization time.

2. The device as claimed in claim 1, wherein the generator unit is designed to set the generated time signal equal to the external time signal at the synchronization times.

3. The device as claimed in claim 1, wherein the generator unit is designed to take into account an overrun of the value of the external time signal and/or of the value of the internal time signal.

4. The device as claimed in claim 1, wherein the generator unit is designed to calculate a first quality value at a synchronization time, wherein the first quality value is calculated as the difference of the value of the generated time signal, which value is calculated for the synchronization time on the basis of the algorithm, and the value of the external time signal at the synchronization time.

5. The device as claimed in claim 4, wherein the device is designed to produce a control signal if the first quality value differs from the value zero by more than a specified first threshold value.

6. The device as claimed in claim 1,
wherein the generator unit is designed to calculate a second quality value at a synchronization time,
wherein the second quality value is calculated as the product of the ratio of the advance in the internal time signal between the last synchronization time and the present synchronization time to the advance in the internal time signal between the next-to-last synchronization time and the last synchronization time, and the ratio of the advance in the external time signal between the next-to-last synchronization time and the last synchronization time to the advance in the external time signal between the last synchronization time and the present synchronization time.

7. The device as claimed in claim 6, wherein the device is designed to produce a control signal if the second quality value differs from the value one by more than a specified second threshold value.

8. The device as claimed in claim 1,
wherein the generator unit is designed to calculate a third quality value at a determination time,
wherein the third quality value is calculated as the difference between the value of the internal time signal at the determination time and a value of the internal time signal at a previous determination time.

9. The device as claimed in claim 8, wherein the device is designed to produce a control signal if the third quality value is not greater than or equal to zero.

10. A system comprising a first device as claimed in claim 1, and further comprising
a second device, which comprises a second time generator,
wherein the second device is designed to transmit as the external time signal a time signal produced by the second time generator to the first device.

11. The system as claimed in claim 10, wherein the second time generator has a redundant design to that of the first time generator.

12. The system as claimed in claim 10, wherein the first device and the second device are connected to one another via a communications link.

13. The system as claimed in claim 10, wherein the system is designed to transmit as the external time signal the time signal produced by the second time generator to the first device at equidistant synchronization times.