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.

MSP430F427: HOW TO READ & CALIBRATE FOR LOW POWER FACTOR IN 3 PHASE ENERGY METER WITH HEF4052

Part Number: MSP430F427
Other Parts Discussed in Thread: , TIDM-THREEPHASEMETER-F6779, MSP430F6779A, TIDM-THREEPHASEMETER-F67641, MSP430F67641, MSP430F67641A, MSP430F47197

Dear All,

I am designing a 3 phase energy meter with MSP430F427 & HEF4052.

I am getting correct power in unity power factor after calibration for unity power factor, but i am stuck in reading power in low power factors.

Please help and guide me, how to calibrate it in 0.5 Lag power factor and read continuously correct power at all power factors.

I am using CT for reading current and thus it need to calibrate SD16PRE variable. Please guide me how to calibrate SD16PRE variable for each individual phase, as input of all phase current are coming on single channel through HEF4052.

Thanks in advance.

  • Hello Suman,

    As a heads-up, the MSP430F427 is not recommended for new designs (NRND), but the MSP430F427A is recommended. Depending on the phase shift introduced by the CT, you may have to delay more than one sample, which you have to do manually without using SD16PRE. If the uncalibrated phase shift between the voltage and current is less than one sample, you'll have to use the SD16PRE register to delay the voltage reading by the amount of delay observed on the current channel.

    Also, I suspect that there will be additional phase shift introduced by the HEF4052. Because this device is active and not passive, I would be concerned that this phase shift could vary dynamically. You'll have to investigate this to see if the delay is constant. I'm not sure why you're required to use an external mux, but I'd recommend using one of our newer devices (such as the MSP430F6779A) that has more SD channels. Also, we have several three-phase reference designs based on this device along with source code that can calibrate each phase with the help of a provided GUI. An excellent example would be the TIDM-THREEPHASEMETER-F6779 reference design.

    If you're unable to use this device, I would encourage you to refer to Section 29.2.10 in the MSP430F427's User's Guide about configuring the Sigma Delta. While you're sampling the single channel from the multiplexer, keep in mind the time delay between the muxed channels of the HFE4052 multiplexer. My suggestions would be that you figure out how to calibrate for the phase delay for a single channel. Bypass the mux and focus on compensating the phase delay at 60 degrees (0.5 power factor). Then, introduce the mux to figure out its phase delay. Then, figure out how to deal with the multiplexed channel data.

    Regards,

    James

    MSP Customer Applications

  • An excellent low-cost alternative to the MSP430F6779A is the MSP430F67641A. Please take a look at the TIDM-THREEPHASEMETER-F67641 TI Design, which features a low-cost three-phase electronic watt-hour meter based on the MSP430F67641.

    Regards,

    James

    MSP Customer Applications

  • Dear James Evans,

    Thank you so much for your reply.

    Actually I already have board designed and have to work on MSP430F427.

    I am attaching my routines for :

    1. ADC Configuration (Emeter_Init.c). (Automatically calls ADC ISR and take samples)

    2. ADC ISR routines (sb_read_adc.h). 

    3. Calibration (calibration.h) routines for UPF & 0.5Lag power pactor.

    Please see if I am doing in right way or I need to update the way I am calibrating.

    On UPF, I am getting correct data, but when I am trying to read behavior in 0.5 Lag, data changes at every 4096 samples. May be due to regularly changing SD16PRE variable value and re-initializing  ADC.

    Please help.

    Thanks in advance.sb_read_adc.hcalibration.h

    Emeter_Init.c
    #include "sk_defination.h"
    #include <msp430xE42x.h>
    
    
    void AnalogFrontEnd_init(void)
    {
    
        ESPCTL &= ~ESPEN; //For FE devices
    
    
        SD16CCTL_VOLTAGE &= ~SD16SC;
        SD16CCTL_LIVE &= ~SD16SC;
        SD16CCTL_NEUTRAL &= ~SD16SC;
    
        SD16CTL = 0x800
                | SD16SSEL_1  /* Clock is SMCLK */
                | SD16DIV_3   /* Divide by 8 => ADC clock: 1.048576MHz */
                | SD16REFON;  /* Use internal reference */
        SD16INCTL_LIVE = SD16INCH_0 | CURRENT_CT_GAIN;   	    /* Set gain for channel 0 (I1) */
        SD16CCTL_LIVE = SD16OSR_256 | SD16DF | SD16GRP;  	    /* Set oversampling ratio to 256 (default) */
        SD16PRE_LIVE = 0;
        
       
        SD16INCTL_NEUTRAL = SD16INCH_0 | VOLTAGE_GAIN; /* Set gain for channel 1 (I2) */ //CURRENT_LIVE_GAIN
        SD16CCTL_NEUTRAL = SD16OSR_256 | SD16DF | SD16GRP;     /* Set oversampling ratio to 256 (default) */
        SD16PRE_NEUTRAL = 0;
    
    
        SD16INCTL_VOLTAGE = SD16INCH_0 | VOLTAGE_GAIN;      	    /* Set gain for channel 2 (V) */
        SD16CCTL_VOLTAGE = SD16OSR_256 | SD16DF | SD16SC | SD16IE;  /* Set oversampling ratio to 256 (default) */
        SD16PRE_VOLTAGE = 0;
    
        if(cal_done==75)
        {
          switch(RYB_check)
          {
            case 0:
              SD16PRE_LIVE = SD16PRE_VAL_CH_0;
              break;
              
            case 10:
              SD16PRE_LIVE = SD16PRE_VAL_CH_1;
              break;
              
            case 20:
              SD16PRE_LIVE = SD16PRE_VAL_CH_2;
              break;        
          }
          
        }  
        else
        {SD16PRE_LIVE = 0;}
    
        SD16CCTL2 |= SD16SC;
    }
    

  • SUMAN BHARTI said:
    On UPF, I am getting correct data, but when I am trying to read behavior in 0.5 Lag, data changes at every 4096 samples. May be due to regularly changing SD16PRE variable value and re-initializing  ADC.

    You definitely don't want to change the preload or re-initialize the ADC SD during normal operation. Keep in mind that the preload can only adjust for fractional delays between samples, not integer delays. For integer delays, you need to manually delay your samples (e.g. shift a pointer or index in your results array).

    Regards,

    James

    MSP Customer Applications

  • Thanks James for reply,

    I have already uploaded my source code for ADC Initialization , ADC routine & calibration routine.

    Dear, I have designed 3 phase meter based on msp430f47197.

    I am doing same things, except the way i set to preload register. As here 3 volateg signal are being provided at one channel and 3 current signal are on onother, so preload register in each case are same, and thus i am continuously changing the preload register for the purpose.

    Additionally you have mentioned about integer delays. Can you please provide me any source code or logic about how to implement this integer delay.

    Thanks in advance for continuously supporting james.

**Attention** This is a public forum