TIDUEM8B March   2019  – February 2021

 

  1.   1
  2.   2
  3.   3
  4.   4
  5.   5
  6.   6
    1.     7
      1.      8
      2.      9
    2.     10
  7.   11
    1.     12
    2.     13
      1.      14
      2.      15
      3.      16
      4.      17
      5.      18
      6.      19
      7.      20
      8.      21
      9.      22
      10.      23
    3.     24
      1.      25
        1.       26
        2.       27
        3.       28
        4.       29
          1.        30
          2.        31
      2.      32
        1.       33
          1.        34
          2.        35
          3.        36
          4.        37
          5.        38
          6.        39
          7.        40
        2.       41
          1.        42
        3.       43
          1.        44
            1.         45
            2.         46
          2.        47
          3.        48
  8.   49
    1.     50
      1.      51
      2.      52
        1.       53
          1.        54
          2.        55
        2.       56
      3.      57
    2.     58
      1.      59
        1.       60
        2.       61
        3.       62
          1.        63
          2.        64
            1.         65
            2.         66
              1.          67
                1.           68
                2.           69
              2.          70
              3.          71
      2.      72
        1.       73
        2.       74
  9.   75
    1.     76
    2.     77
    3.     78
      1.      79
    4.     80
    5.     81
    6.     82
  10.   83
    1.     84
  11.   85
  12.   86
per_sample_dsp()

Figure 2-14 shows the flowchart for the per_sample_dsp() function. The per_sample_dsp() function is used to calculate intermediate dot product results that are fed into the foreground process for the calculation of metrology readings. Both voltage and current samples are processed and accumulated in dedicated 64-bit registers. Per-phase active power and reactive power are also accumulated in 64-bit registers.

GUID-B96E377D-1F8C-4C9A-A47E-E90ED932B163-low.gifFigure 2-14 per_sample_dsp Function

After sufficient samples (of approximately one second) are accumulated, the foreground function is triggered to calculate the final values of VRMS; IRMS; active, reactive, and apparent powers; active, reactive, and apparent energy; frequency; and power factor. In the test software, there are two sets of dot products for a phase: at any given time, one is used by the foreground for calculation and the other used as the working set by the background. After the background process has sufficient samples, it swaps the two dot products so that the foreground uses the newly acquired dot products that the background process just calculated and the background process uses a new empty set to calculate the next set of dot products. Whenever there is a leading-edge zero-crossing (− to + voltage transition) on a voltage channel, the per_sample_dsp() function is also responsible for updating the corresponding frequency (in samples per cycle) of the phase.

The following sections describe the various elements of electricity measurement in the per_sample_dsp() function.