This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430F67791A: How can I change the ADC sampling rate in the MSP430 Metering Library?

Part Number: MSP430F67791A
Other Parts Discussed in Thread: MSP-EM-DESIGN-CENTER

Hello TI community,
I am working on metering and AM using ti metering library (emeter-metrology-6779) for MSP430F67791A. The library is set to sampling rate 4096 using Over sampling ratio (OSR = 256-1). When i tried to set sampling ratio to 2048 using OSR (OSR = 512-1), The measured voltage and frequency becomes zero. The following lines of code are set:

#define sd_set_normal_live_current_mode_(a) \
sd_xxxx_reg(SD_INCTL_, a) = SD_LIVE_CURRENT_GAIN; \
sd_xxxx_reg(SD_CCTL_, a) = SD_DF_1 | SD24SCS_4; \
sd_xxxx_reg(SD_OSR_, a) = 512 - 1; \
sd_xxxx_reg(SD_PRE_, a) = 0;
#define sd_set_normal_live_current_mode(a) sd_set_normal_live_current_mode_(a)

#define sd_set_normal_neutral_current_mode_(a) \
sd_xxxx_reg(SD_INCTL_, a) = SD_NEUTRAL_CURRENT_GAIN; \
sd_xxxx_reg(SD_CCTL_, a) = SD_DF_1 | SD24SCS_4; \
sd_xxxx_reg(SD_OSR_, a) = 512 - 1; \
sd_xxxx_reg(SD_PRE_, a) = 0;
#define sd_set_normal_neutral_current_mode(a) sd_set_normal_neutral_current_mode_(a)

#define sd_set_normal_voltage_mode_(a) \

sd_xxxx_reg(SD_INCTL_, a) = SD_VOLTAGE_GAIN; \
sd_xxxx_reg(SD_CCTL_, a) = SD_DF_1 | SD24ALGN | SD24SCS_4; \
sd_xxxx_reg(SD_OSR_, a) = 512 - 1; \
sd_xxxx_reg(SD_PRE_, a) = 0;
#define sd_set_normal_voltage_mode(a) sd_set_normal_voltage_mode_(a)

---------------------------------------------and------------------------------------------------

#define SAMPLE_RATE 2048
#define ADC_BITS 16
#define SAMPLES_PER_10_SECONDS 20480

any help?

regards
Hossam

  • Hello Hossam,

    This library has limited support moving forward and is not recommended for new designs. Changing the sampling rate affects the preload between voltage and current samples and other things such as filters. Thus, I would recommend that you use our newer CCS-based Energy Measurement Design Center (MSP-EM-DESIGN-CENTER). Using the GUI, you can easily change the sampling rate, and the software library code is changed accordingly and then generated.

    Regards,

    James

  • Hello James,
    Thanks for your response. I am working on production line and it is difficult to change the whole library now. I am doing so for the new Firmware but for the old firmware i cant. So i need to alter the sampling rate in the old firmware. Can ti help me in this problem?

    best regards
    Hossam 

  • Hello Hosam,

    I would recommend searching through the code to find variables and defines that impact the SD24 modulation frequency. Once you find and modify those, I would recommend toggling a GPIO in the ADC ISR to confirm your sampling rate matches what your target is. Then, you can shift focus towards fixing any of the metrology calculations. While probably not a comprehensive list, here's a few things that may need to change:

    • SD_CLOCK_DIVISION in 'metrology-template.h' (adjust for the modulation frequency)
    • phase_shift_fir_coeffs table in 'metrology-fir-table.c' (coefficients to correct phase shift angles depend on sampling frequency)
    • SAMPLE_RATE and SAMPLES_PER_10_SECONDS in 'emeter-metrology.h'
    • SAMPLE_RATE and SAMPLES_PER_10_SECONDS in 'emeter-metrology-internal.h'
    • SD_CLOCK_DIVISION in 'metrology-setup.c'

    While I understand you're close to production using this library, these challenges around simple changes such as adjusting the sampling frequency are what drove the development of the newer EMDC library. Honestly, there may be less work porting your application code to the EMDC library than trying to adjust everything in the legacy library for the new sampling frequency.

    Regards,

    James

  • Thanks James for your guide and I am sorry for my delayed replay. This week i was fighting with metering library after changing the sample rate. My current problems are:
    -1-Frequency becomes 40 even after working on this section of code

    /* Interpolate the zero crossing by successive approx. Its faster than just dividing. */
    z = V_corrected - phase->metrology.last_V_sample;
    x = 0;
    y = 0;
    for (k = 0; k < 8; k++)
    {
    y <<= 1;
    z >>= 1;
    x += z;
    if (x > V_corrected)
    x -= z;
    else
    y |= 1;
    }
    /* Now we need to allow for skipped samples, due to spike detection */
    z = y;
    while (phase->metrology.since_last > 1)
    {
    z += y;
    phase->metrology.since_last--;
    }

    /* z is now the fraction of a sample interval between the zero
    crossing and the current sample, in units of 1/256 of a sample */
    /* A lightly damped single pole filter should now be enough to remove noise and get a
    stable value for the frequency */
    phase->metrology.voltage_period.period +=
    ((int32_t) (phase->metrology.voltage_period.cycle_samples - z) << 11) -
    (phase->metrology.voltage_period.period >> 3);


    2- power factor is bad. can you point to the section of code that process the power factor.
    3- The most important thing is const coefficient table which i didn't change it because i don't to know what to do.  can you guide me in generating this table?

    many thanks
    Hossam

  • Hi Hossam,

    Hosam said:
    Thanks James for your guide and I am sorry for my delayed replay. This week i was fighting with metering library after changing the sample rate.

    Not a problem. This is not an easy task! What code base are you using? Unfortunately there are several variants out there depending on what TI Design or EVM user's guide you're using.

    Hosam said:
    -1-Frequency becomes 40 even after working on this section of code

    That's interesting. I'm just using code from SLAA577 as a reference on my side to help. In 'emeter-background.c', I see where the code checks if the input frequency of the AC mains is between the upper (70 Hz) and lower (40 Hz) limits. For a lower sampling rate, I suspect that "phase->metrology.cycle_sample_count" is causing an issue. Notice these limits also depend on "SAMPLES_PER_10_SECONDS" which you seem to have changed correctly.

    /* Apply limits to the sample count, to avoid spikes or dying power lines disturbing the
                           frequency reading too much */
                        /* The mains should be <40Hz or >70Hz to fail this test! */
                        if (256*SAMPLES_PER_10_SECONDS/700 <= phase->metrology.voltage_period.cycle_samples
                            &&
                            phase->metrology.voltage_period.cycle_samples <= 256*SAMPLES_PER_10_SECONDS/400)

    At one point, I changed this code to work at a higher sampling frequency, but I notice now that I didn't change this filter.

    /* z is now the fraction of a sample interval between the zero
                               crossing and the current sample, in units of 1/256 of a sample */
                            /* A lightly damped single pole filter should now be enough to remove noise and get a
                               stable value for the frequency */
                            phase->metrology.voltage_period.period += ((int32_t) (phase->metrology.voltage_period.cycle_samples - z) << 12) - (phase->metrology.voltage_period.period >> 4);
                            /* Start the next cycle with the residual fraction of a sample */
                            phase->metrology.voltage_period.cycle_samples = z;

    Hosam said:
    2- power factor is bad. can you point to the section of code that process the power factor.

    In IAR, I would recommend searching (Shift + Ctrl + F) for "POWER_FACTOR_SUPPORT". It gets defined in 'emeter-3ph-neutral-6779(A).h' in SLAA577. You should be able to track down where the power factor is calculated. After a quick look, I found the "power_factor()" function in 'emeter-foreground.c' that depends on the active and apparent power. The magnitude of power factor is equal to active (real) power divided by apparent power. Perhaps one of those is causing the error in power factor.

    Hosam said:
    3- The most important thing is const coefficient table which i didn't change it because i don't to know what to do.  can you guide me in generating this table?

    I think I can dig up a script that was used to generate that coefficient table sometime next week. I'll be out on Monday and catching up on Tuesday, so I'll try to address this next Wednesday. I assume we'd keep the same number of steps at 256. What's your nominal input frequency? 50 or 60 Hz?

    Are you sure you wouldn't be better off using the EMDC code base and then adding your application code on top of it? You can very quickly configure a 2048 Hz sampling frequency and the filter coefficients and everything would be taken care of.

    Regards,

    James 

  • Hi James 

    1- Actually, yes i have updated frequency limits correctly. Also, other constants too like: 

    "phase->metrology.voltage_period.cycle_samples += 128;"  

    anyway most of 256 and 4096, 40960 constants have been updated.

    2- for single pole filter phase->metrology.voltage_period.period += ((int32_t) (phase->metrology.voltage_period.cycle_samples - z) << 12) - (phase->metrology.voltage_period.period >> 4);

    After one day of debugging , THIS line is the main parameter of frequency calculations which i couldn't adjust or understand.

    3- For power factor you are right, the power factor is the ratio of active to apparent power. The apparent power depends on reactive power which in turn depends on const table (so it is important). I really appreciate your help but try to keep me posted as fast as you can.

    4- For sorry, i have to work on this library till half of April then i will migrate to the new lib.
    5- My nominal frequency is 50Hz

    best regards
    Hossam

  • Hello Hosam,

    I'm sorry about the delay. I had some issues with my PC that were preventing me from generating the phase shift table coefficients. Those have been resolved, and I've generated the table according to your configuration:

    • ADC sampling rate: 2048 Hz
    • Input frequency: 50 Hz
    • Steps: 256

    I hope this helps. Please replace everything in  'metrology-fir-table.c' with everything in the following file. Then, recompile all the projects.

    /* This file was generated automatically by generate-phase-shift-table */
    #include <inttypes.h>
    
    #include <emeter-toolkit.h>
    
    #include "emeter-metrology.h"
    #include "metrology-structs.h"
    
    #if !defined(__HAS_SD_ADC__)  ||  defined(REACTIVE_POWER_BY_QUADRATURE_SUPPORT)
    
    /* This FIR table is used to create accurate 90 degree phase shifts */
    
    /* FIR coefficients to correct specific phase shift angles at 50.00Hz
       and sampling 2048.00 times per second. There are 256 steps
       in this table. */
    
    #if SAMPLES_PER_10_SECONDS != 20480
    #error This FIR table is for 2048.00 samples per second.
    #endif
    #if MAINS_NOMINAL_FREQUENCY != 50
    #error This FIR table is for 50.00Hz.
    #endif
    #if PHASE_SHIFT_FIR_TABLE_ELEMENTS != 256
    #error This FIR table is for 256 steps per sample.
    #endif
    
    const int16_t phase_shift_fir_coeffs[256][2] =
    {
        {  32767,   8216 }, /*   0:  4.3945 deg */
        {  32262,   8279 }, /*   1:  4.3602 deg */
        {  31765,   8343 }, /*   2:  4.3259 deg */
        {  31275,   8407 }, /*   3:  4.2915 deg */
        {  30793,   8471 }, /*   4:  4.2572 deg */
        {  30318,   8535 }, /*   5:  4.2229 deg */
        {  29849,   8598 }, /*   6:  4.1885 deg */
        {  29388,   8662 }, /*   7:  4.1542 deg */
        {  28934,   8726 }, /*   8:  4.1199 deg */
        {  28486,   8790 }, /*   9:  4.0855 deg */
        {  28044,   8854 }, /*  10:  4.0512 deg */
        {  27609,   8917 }, /*  11:  4.0169 deg */
        {  27180,   8981 }, /*  12:  3.9825 deg */
        {  26757,   9045 }, /*  13:  3.9482 deg */
        {  26340,   9109 }, /*  14:  3.9139 deg */
        {  25929,   9173 }, /*  15:  3.8795 deg */
        {  25523,   9236 }, /*  16:  3.8452 deg */
        {  25123,   9300 }, /*  17:  3.8109 deg */
        {  24729,   9364 }, /*  18:  3.7766 deg */
        {  24339,   9428 }, /*  19:  3.7422 deg */
        {  23955,   9491 }, /*  20:  3.7079 deg */
        {  23576,   9555 }, /*  21:  3.6736 deg */
        {  23202,   9619 }, /*  22:  3.6392 deg */
        {  22833,   9683 }, /*  23:  3.6049 deg */
        {  22469,   9746 }, /*  24:  3.5706 deg */
        {  22110,   9810 }, /*  25:  3.5362 deg */
        {  21755,   9874 }, /*  26:  3.5019 deg */
        {  21405,   9938 }, /*  27:  3.4676 deg */
        {  21059,  10001 }, /*  28:  3.4332 deg */
        {  20717,  10065 }, /*  29:  3.3989 deg */
        {  20380,  10129 }, /*  30:  3.3646 deg */
        {  20047,  10193 }, /*  31:  3.3302 deg */
        {  19718,  10257 }, /*  32:  3.2959 deg */
        {  19393,  10320 }, /*  33:  3.2616 deg */
        {  19072,  10384 }, /*  34:  3.2272 deg */
        {  18756,  10448 }, /*  35:  3.1929 deg */
        {  18442,  10512 }, /*  36:  3.1586 deg */
        {  18133,  10575 }, /*  37:  3.1242 deg */
        {  17827,  10639 }, /*  38:  3.0899 deg */
        {  17525,  10703 }, /*  39:  3.0556 deg */
        {  17227,  10767 }, /*  40:  3.0212 deg */
        {  16932,  10830 }, /*  41:  2.9869 deg */
        {  16640,  10894 }, /*  42:  2.9526 deg */
        {  16352,  10958 }, /*  43:  2.9182 deg */
        {  16067,  11022 }, /*  44:  2.8839 deg */
        {  15786,  11085 }, /*  45:  2.8496 deg */
        {  15507,  11149 }, /*  46:  2.8152 deg */
        {  15232,  11213 }, /*  47:  2.7809 deg */
        {  14960,  11277 }, /*  48:  2.7466 deg */
        {  14691,  11340 }, /*  49:  2.7122 deg */
        {  14425,  11404 }, /*  50:  2.6779 deg */
        {  14161,  11468 }, /*  51:  2.6436 deg */
        {  13901,  11532 }, /*  52:  2.6093 deg */
        {  13644,  11595 }, /*  53:  2.5749 deg */
        {  13389,  11659 }, /*  54:  2.5406 deg */
        {  13137,  11723 }, /*  55:  2.5063 deg */
        {  12888,  11787 }, /*  56:  2.4719 deg */
        {  12641,  11850 }, /*  57:  2.4376 deg */
        {  12397,  11914 }, /*  58:  2.4033 deg */
        {  12156,  11978 }, /*  59:  2.3689 deg */
        {  11917,  12042 }, /*  60:  2.3346 deg */
        {  11681,  12105 }, /*  61:  2.3003 deg */
        {  11447,  12169 }, /*  62:  2.2659 deg */
        {  11216,  12233 }, /*  63:  2.2316 deg */
        {  10987,  12297 }, /*  64:  2.1973 deg */
        {  10760,  12360 }, /*  65:  2.1629 deg */
        {  10535,  12424 }, /*  66:  2.1286 deg */
        {  10313,  12488 }, /*  67:  2.0943 deg */
        {  10093,  12552 }, /*  68:  2.0599 deg */
        {   9876,  12615 }, /*  69:  2.0256 deg */
        {   9660,  12679 }, /*  70:  1.9913 deg */
        {   9447,  12743 }, /*  71:  1.9569 deg */
        {   9235,  12807 }, /*  72:  1.9226 deg */
        {   9026,  12871 }, /*  73:  1.8883 deg */
        {   8819,  12934 }, /*  74:  1.8539 deg */
        {   8614,  12998 }, /*  75:  1.8196 deg */
        {   8411,  13062 }, /*  76:  1.7853 deg */
        {   8209,  13126 }, /*  77:  1.7509 deg */
        {   8010,  13189 }, /*  78:  1.7166 deg */
        {   7813,  13253 }, /*  79:  1.6823 deg */
        {   7617,  13317 }, /*  80:  1.6479 deg */
        {   7423,  13381 }, /*  81:  1.6136 deg */
        {   7232,  13445 }, /*  82:  1.5793 deg */
        {   7041,  13508 }, /*  83:  1.5450 deg */
        {   6853,  13572 }, /*  84:  1.5106 deg */
        {   6667,  13636 }, /*  85:  1.4763 deg */
        {   6482,  13700 }, /*  86:  1.4420 deg */
        {   6298,  13764 }, /*  87:  1.4076 deg */
        {   6117,  13828 }, /*  88:  1.3733 deg */
        {   5937,  13891 }, /*  89:  1.3390 deg */
        {   5759,  13955 }, /*  90:  1.3046 deg */
        {   5582,  14019 }, /*  91:  1.2703 deg */
        {   5407,  14083 }, /*  92:  1.2360 deg */
        {   5234,  14147 }, /*  93:  1.2016 deg */
        {   5062,  14210 }, /*  94:  1.1673 deg */
        {   4891,  14274 }, /*  95:  1.1330 deg */
        {   4722,  14338 }, /*  96:  1.0986 deg */
        {   4555,  14402 }, /*  97:  1.0643 deg */
        {   4389,  14466 }, /*  98:  1.0300 deg */
        {   4224,  14530 }, /*  99:  0.9956 deg */
        {   4061,  14594 }, /* 100:  0.9613 deg */
        {   3899,  14657 }, /* 101:  0.9270 deg */
        {   3739,  14721 }, /* 102:  0.8926 deg */
        {   3580,  14785 }, /* 103:  0.8583 deg */
        {   3422,  14849 }, /* 104:  0.8240 deg */
        {   3266,  14913 }, /* 105:  0.7896 deg */
        {   3110,  14977 }, /* 106:  0.7553 deg */
        {   2957,  15041 }, /* 107:  0.7210 deg */
        {   2804,  15105 }, /* 108:  0.6866 deg */
        {   2653,  15168 }, /* 109:  0.6523 deg */
        {   2503,  15232 }, /* 110:  0.6180 deg */
        {   2354,  15296 }, /* 111:  0.5836 deg */
        {   2207,  15360 }, /* 112:  0.5493 deg */
        {   2060,  15424 }, /* 113:  0.5150 deg */
        {   1915,  15488 }, /* 114:  0.4807 deg */
        {   1771,  15552 }, /* 115:  0.4463 deg */
        {   1628,  15616 }, /* 116:  0.4120 deg */
        {   1487,  15680 }, /* 117:  0.3777 deg */
        {   1346,  15744 }, /* 118:  0.3433 deg */
        {   1207,  15808 }, /* 119:  0.3090 deg */
        {   1068,  15872 }, /* 120:  0.2747 deg */
        {    931,  15936 }, /* 121:  0.2403 deg */
        {    795,  16000 }, /* 122:  0.2060 deg */
        {    660,  16064 }, /* 123:  0.1717 deg */
        {    526,  16128 }, /* 124:  0.1373 deg */
        {    393,  16192 }, /* 125:  0.1030 deg */
        {    261,  16256 }, /* 126:  0.0687 deg */
        {    130,  16320 }, /* 127:  0.0343 deg */
        {      0,  16383 }, /* 128:  0.0000 deg */
        {   -129,  16448 }, /* 129: -0.0343 deg */
        {   -257,  16512 }, /* 130: -0.0687 deg */
        {   -384,  16576 }, /* 131: -0.1030 deg */
        {   -510,  16640 }, /* 132: -0.1373 deg */
        {   -635,  16704 }, /* 133: -0.1717 deg */
        {   -759,  16768 }, /* 134: -0.2060 deg */
        {   -883,  16832 }, /* 135: -0.2403 deg */
        {  -1005,  16896 }, /* 136: -0.2747 deg */
        {  -1127,  16960 }, /* 137: -0.3090 deg */
        {  -1247,  17024 }, /* 138: -0.3433 deg */
        {  -1367,  17088 }, /* 139: -0.3777 deg */
        {  -1486,  17152 }, /* 140: -0.4120 deg */
        {  -1604,  17216 }, /* 141: -0.4463 deg */
        {  -1721,  17280 }, /* 142: -0.4807 deg */
        {  -1837,  17344 }, /* 143: -0.5150 deg */
        {  -1953,  17408 }, /* 144: -0.5493 deg */
        {  -2068,  17472 }, /* 145: -0.5836 deg */
        {  -2181,  17537 }, /* 146: -0.6180 deg */
        {  -2294,  17601 }, /* 147: -0.6523 deg */
        {  -2407,  17665 }, /* 148: -0.6866 deg */
        {  -2518,  17729 }, /* 149: -0.7210 deg */
        {  -2629,  17793 }, /* 150: -0.7553 deg */
        {  -2739,  17857 }, /* 151: -0.7896 deg */
        {  -2848,  17921 }, /* 152: -0.8240 deg */
        {  -2956,  17986 }, /* 153: -0.8583 deg */
        {  -3064,  18050 }, /* 154: -0.8926 deg */
        {  -3171,  18114 }, /* 155: -0.9270 deg */
        {  -3277,  18178 }, /* 156: -0.9613 deg */
        {  -3383,  18242 }, /* 157: -0.9956 deg */
        {  -3487,  18307 }, /* 158: -1.0300 deg */
        {  -3591,  18371 }, /* 159: -1.0643 deg */
        {  -3695,  18435 }, /* 160: -1.0986 deg */
        {  -3797,  18499 }, /* 161: -1.1330 deg */
        {  -3899,  18563 }, /* 162: -1.1673 deg */
        {  -4001,  18628 }, /* 163: -1.2016 deg */
        {  -4101,  18692 }, /* 164: -1.2360 deg */
        {  -4201,  18756 }, /* 165: -1.2703 deg */
        {  -4300,  18820 }, /* 166: -1.3046 deg */
        {  -4399,  18885 }, /* 167: -1.3390 deg */
        {  -4497,  18949 }, /* 168: -1.3733 deg */
        {  -4594,  19013 }, /* 169: -1.4076 deg */
        {  -4691,  19078 }, /* 170: -1.4420 deg */
        {  -4787,  19142 }, /* 171: -1.4763 deg */
        {  -4883,  19206 }, /* 172: -1.5106 deg */
        {  -4978,  19271 }, /* 173: -1.5450 deg */
        {  -5072,  19335 }, /* 174: -1.5793 deg */
        {  -5166,  19399 }, /* 175: -1.6136 deg */
        {  -5259,  19464 }, /* 176: -1.6479 deg */
        {  -5351,  19528 }, /* 177: -1.6823 deg */
        {  -5443,  19593 }, /* 178: -1.7166 deg */
        {  -5534,  19657 }, /* 179: -1.7509 deg */
        {  -5625,  19721 }, /* 180: -1.7853 deg */
        {  -5715,  19786 }, /* 181: -1.8196 deg */
        {  -5805,  19850 }, /* 182: -1.8539 deg */
        {  -5894,  19915 }, /* 183: -1.8883 deg */
        {  -5982,  19979 }, /* 184: -1.9226 deg */
        {  -6070,  20044 }, /* 185: -1.9569 deg */
        {  -6158,  20108 }, /* 186: -1.9913 deg */
        {  -6245,  20172 }, /* 187: -2.0256 deg */
        {  -6331,  20237 }, /* 188: -2.0599 deg */
        {  -6417,  20301 }, /* 189: -2.0943 deg */
        {  -6502,  20366 }, /* 190: -2.1286 deg */
        {  -6587,  20430 }, /* 191: -2.1629 deg */
        {  -6671,  20495 }, /* 192: -2.1973 deg */
        {  -6755,  20560 }, /* 193: -2.2316 deg */
        {  -6838,  20624 }, /* 194: -2.2659 deg */
        {  -6921,  20689 }, /* 195: -2.3003 deg */
        {  -7003,  20753 }, /* 196: -2.3346 deg */
        {  -7085,  20818 }, /* 197: -2.3689 deg */
        {  -7166,  20882 }, /* 198: -2.4033 deg */
        {  -7247,  20947 }, /* 199: -2.4376 deg */
        {  -7328,  21012 }, /* 200: -2.4719 deg */
        {  -7408,  21076 }, /* 201: -2.5063 deg */
        {  -7487,  21141 }, /* 202: -2.5406 deg */
        {  -7566,  21206 }, /* 203: -2.5749 deg */
        {  -7645,  21270 }, /* 204: -2.6093 deg */
        {  -7723,  21335 }, /* 205: -2.6436 deg */
        {  -7800,  21400 }, /* 206: -2.6779 deg */
        {  -7877,  21464 }, /* 207: -2.7122 deg */
        {  -7954,  21529 }, /* 208: -2.7466 deg */
        {  -8030,  21594 }, /* 209: -2.7809 deg */
        {  -8106,  21659 }, /* 210: -2.8152 deg */
        {  -8182,  21723 }, /* 211: -2.8496 deg */
        {  -8257,  21788 }, /* 212: -2.8839 deg */
        {  -8331,  21853 }, /* 213: -2.9182 deg */
        {  -8406,  21918 }, /* 214: -2.9526 deg */
        {  -8479,  21982 }, /* 215: -2.9869 deg */
        {  -8553,  22047 }, /* 216: -3.0212 deg */
        {  -8626,  22112 }, /* 217: -3.0556 deg */
        {  -8698,  22177 }, /* 218: -3.0899 deg */
        {  -8770,  22242 }, /* 219: -3.1242 deg */
        {  -8842,  22307 }, /* 220: -3.1586 deg */
        {  -8913,  22372 }, /* 221: -3.1929 deg */
        {  -8984,  22436 }, /* 222: -3.2272 deg */
        {  -9055,  22501 }, /* 223: -3.2616 deg */
        {  -9125,  22566 }, /* 224: -3.2959 deg */
        {  -9195,  22631 }, /* 225: -3.3302 deg */
        {  -9265,  22696 }, /* 226: -3.3646 deg */
        {  -9334,  22761 }, /* 227: -3.3989 deg */
        {  -9402,  22826 }, /* 228: -3.4332 deg */
        {  -9471,  22891 }, /* 229: -3.4676 deg */
        {  -9539,  22956 }, /* 230: -3.5019 deg */
        {  -9606,  23021 }, /* 231: -3.5362 deg */
        {  -9674,  23086 }, /* 232: -3.5706 deg */
        {  -9740,  23151 }, /* 233: -3.6049 deg */
        {  -9807,  23216 }, /* 234: -3.6392 deg */
        {  -9873,  23281 }, /* 235: -3.6736 deg */
        {  -9939,  23346 }, /* 236: -3.7079 deg */
        { -10005,  23412 }, /* 237: -3.7422 deg */
        { -10070,  23477 }, /* 238: -3.7766 deg */
        { -10135,  23542 }, /* 239: -3.8109 deg */
        { -10199,  23607 }, /* 240: -3.8452 deg */
        { -10263,  23672 }, /* 241: -3.8795 deg */
        { -10327,  23737 }, /* 242: -3.9139 deg */
        { -10391,  23803 }, /* 243: -3.9482 deg */
        { -10454,  23868 }, /* 244: -3.9825 deg */
        { -10517,  23933 }, /* 245: -4.0169 deg */
        { -10579,  23998 }, /* 246: -4.0512 deg */
        { -10642,  24064 }, /* 247: -4.0855 deg */
        { -10704,  24129 }, /* 248: -4.1199 deg */
        { -10765,  24194 }, /* 249: -4.1542 deg */
        { -10827,  24259 }, /* 250: -4.1885 deg */
        { -10888,  24325 }, /* 251: -4.2229 deg */
        { -10948,  24390 }, /* 252: -4.2572 deg */
        { -11009,  24455 }, /* 253: -4.2915 deg */
        { -11069,  24521 }, /* 254: -4.3259 deg */
        { -11129,  24586 }  /* 255: -4.3602 deg */
    };
    
    #endif

    Regards,

    James

**Attention** This is a public forum