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.

MSP430I2040: Questions about calibration

Part Number: MSP430I2040

Hi,

I have a few basic questions with respect to calibration:

1. When I use the EMDC GUI to generate code for my msp430I2040, I also pass the voltage and current gain values. From the gain values I pass, the voltage and current scaling factors are determined.

Is any calibration required after doing this?

Also, is any per board calibration required to be done once the voltage and current scaling factors are determined by the TI generated code?

Thanks,

regards,

Rajkumar

  • Hello,

    1. When I use the EMDC GUI to generate code for my msp430I2040, I also pass the voltage and current gain values. From the gain values I pass, the voltage and current scaling factors are determined.

    Are you trying to manually calibrate your board using UART commands or are you using the EMDC GUI to perform the calibration?

    Is any calibration required after doing this?

    Gain calibration is the first step. Phase calibration is the next step. The EMDC GUI handles both. You can also do these manually but it's much more complex since the calculations must be done manually and are dependent on various settings (e.g. SD ADC) in the EMDC GUI.

    Also, is any per board calibration required to be done once the voltage and current scaling factors are determined by the TI generated code?

    I'm not sure what you mean. Depending on your accuracy requirements, sometimes the scaling factors can be applied to all boards. For higher accuracy applications, each board should be calibrated individually.

  • Hi James,

    Please find my replies inline:

    1. When I use the EMDC GUI to generate code for my msp430I2040, I also pass the voltage and current gain values. From the gain values I pass, the voltage and current scaling factors are determined.

    Are you trying to manually calibrate your board using UART commands or are you using the EMDC GUI to perform the calibration?

    Rajkumar>>>Actually first, I open the EMDC GUI, place the voltage sensor and the shunt resistor. Then I open the voltage sensor and pass the maximum RMS voltage and the R1 and R2 resistor values. Similarly I open the shunt sensor and pass the shunt resistance and the max current to be measured. These values that I pass generate the voltage and current gain values.
    I have the following 3 questions.
    Step 1. Will these gain values that are calculated above, accurately measure the voltage, and current values or should I do calibration after this?
    Step 2. After step 1, If I do calibration using the EMDC GUI, for voltage, current and phase, will these new calibration steps store the calibration values into Flash?
    Also, I need to change the UART protocol that is currently being used by the EMDC GUI for my project. In that case how can I do the calibration or inherit the calibration that I did in step 1 and step 2 for the boards in production?
    Is any calibration required after doing this?

    Gain calibration is the first step. Phase calibration is the next step. The EMDC GUI handles both. You can also do these manually but it's much more complex since the calculations must be done manually and are dependent on various settings (e.g. SD ADC) in the EMDC GUI.

    Also, is any per board calibration required to be done once the voltage and current scaling factors are determined by the TI generated code?

    I'm not sure what you mean. Depending on your accuracy requirements, sometimes the scaling factors can be applied to all boards. For higher accuracy applications, each board should be calibrated individually.

  • Rajkumar>>>Actually first, I open the EMDC GUI, place the voltage sensor and the shunt resistor. Then I open the voltage sensor and pass the maximum RMS voltage and the R1 and R2 resistor values. Similarly I open the shunt sensor and pass the shunt resistance and the max current to be measured. These values that I pass generate the voltage and current gain values.

    Sounds like a new project. If so, please read my earlier comments about the calibration factors.

    Step 1. Will these gain values that are calculated above, accurately measure the voltage, and current values or should I do calibration after this?

    Calibration must be done. There are external dependencies such as the voltage dividers, burden resistors, etc. that impact the calibration.

    Step 2. After step 1, If I do calibration using the EMDC GUI, for voltage, current and phase, will these new calibration steps store the calibration values into Flash?

    Not unless you click "Yes" in the pop up window after you click "Stop" after finishing the calibration in the GUI. Please read through the Calibration section in the EMDC Technology Guide.

    Also, I need to change the UART protocol that is currently being used by the EMDC GUI for my project. In that case how can I do the calibration or inherit the calibration that I did in step 1 and step 2 for the boards in production?

    The default UART protocol must not be changed in order to work with the EMDC GUI. For production, you can always use EMDC code to perform calibration, record the board-specific factors, reprogram the device and send those factors over your custom protocol.

    Otherwise, you'll need to manually perform the calibration without using EMDC. Those equations can be found in the document below.

    0552.2021-06-23 EMDC Calibration Process.pdf

  • Hi James,

    Please find my replies//queries inline(below):

    Rajkumar>>>Actually first, I open the EMDC GUI, place the voltage sensor and the shunt resistor. Then I open the voltage sensor and pass the maximum RMS voltage and the R1 and R2 resistor values. Similarly I open the shunt sensor and pass the shunt resistance and the max current to be measured. These values that I pass generate the voltage and current gain values.

    Sounds like a new project. If so, please read my earlier comments about the calibration factors.

    Step 1. Will these gain values that are calculated above, accurately measure the voltage, and current values or should I do calibration after this?

    Calibration must be done. There are external dependencies such as the voltage dividers, burden resistors, etc. that impact the calibration.

    Step 2. After step 1, If I do calibration using the EMDC GUI, for voltage, current and phase, will these new calibration steps store the calibration values into Flash?

    Not unless you click "Yes" in the pop up window after you click "Stop" after finishing the calibration in the GUI. Please read through the Calibration section in the EMDC Technology Guide.

              Raj>> I have read the technology guide. I have a couple of questions regarding the TI generated code, specifically the source file EM_userConfig.c. This file has some config values:

    ***********************************************************

    EM_Phase_Calibration g_emPhaseCalibration[EM_PHASE_LENGTH] =
    {
    //PHASE_A
    //PHASE_A
    {
    .voltageSF = _IQ24(23.629409194),
    .currentSF = _IQ24(19.068347394),
    .activePowerSF = _IQ30(0.450554701),
    .reactivePowerSF = _IQ30(0.450554701),
    .phaseCorrection = 0x0072,
    },
    };************************************************************************

    1. Are the above "voltageSF" and "currentSF" values above, determined by the R1 and R2 resistor values(for voltage sensor), shunt resistance value(For current sensor) along with the "max voltage", "max current "values passed to the EMDC GUI? Basically, are these scaling factors determined by all the values passed to the EMDC GUI?

    2. If we do the calibration also using the EMDC GUI as you suggested, will the calibration values also be stored into the "voltageSF" and "currentSF" vakues in the above source code(EM_user_Config.c), or will it directly be stored into the Flash of the microcontroller?

    regards,

    Rajkumar

  •  Raj>> I have read the technology guide. I have a couple of questions regarding the TI generated code, specifically the source file EM_userConfig.c. This file has some config values:

    ***********************************************************

    EM_Phase_Calibration g_emPhaseCalibration[EM_PHASE_LENGTH] =
    {
    //PHASE_A
    //PHASE_A
    {
    .voltageSF = _IQ24(23.629409194),
    .currentSF = _IQ24(19.068347394),
    .activePowerSF = _IQ30(0.450554701),
    .reactivePowerSF = _IQ30(0.450554701),
    .phaseCorrection = 0x0072,
    },
    };************************************************************************

    1. Are the above "voltageSF" and "currentSF" values above, determined by the R1 and R2 resistor values(for voltage sensor), shunt resistance value(For current sensor) along with the "max voltage", "max current "values passed to the EMDC GUI? Basically, are these scaling factors determined by all the values passed to the EMDC GUI?

    2. If we do the calibration also using the EMDC GUI as you suggested, will the calibration values also be stored into the "voltageSF" and "currentSF" vakues in the above source code(EM_user_Config.c), or will it directly be stored into the Flash of the microcontroller?

    regards,

    Rajkumar

  •  Raj>> I have read the technology guide. I have a couple of questions regarding the TI generated code, specifically the source file EM_userConfig.c. This file has some config values:

    ***********************************************************

    EM_Phase_Calibration g_emPhaseCalibration[EM_PHASE_LENGTH] =
    {
    //PHASE_A
    //PHASE_A
    {
    .voltageSF = _IQ24(23.629409194),
    .currentSF = _IQ24(19.068347394),
    .activePowerSF = _IQ30(0.450554701),
    .reactivePowerSF = _IQ30(0.450554701),
    .phaseCorrection = 0x0072,
    },
    };************************************************************************

    1. Are the above "voltageSF" and "currentSF" values above, determined by the R1 and R2 resistor values(for voltage sensor), shunt resistance value(For current sensor) along with the "max voltage", "max current "values passed to the EMDC GUI? Basically, are these scaling factors determined by all the values passed to the EMDC GUI?

    2. If we do the calibration also using the EMDC GUI as you suggested, will the calibration values also be stored into the "voltageSF" and "currentSF" vakues in the above source code(EM_user_Config.c), or will it directly be stored into the Flash of the microcontroller?

    regards,

    Rajkumar

  • Hi Raj,

    Quick formatting note. If you want to quote something from a previous reply, you can click click "Reply", start writing out your response, place your cursor where you'd like to insert the quote, scroll up, highlight the text with your cursor, and then click "Quote". It works well, so I wanted to share it with you.

    1. Are the above "voltageSF" and "currentSF" values above, determined by the R1 and R2 resistor values(for voltage sensor), shunt resistance value(For current sensor) along with the "max voltage", "max current "values passed to the EMDC GUI? Basically, are these scaling factors determined by all the values passed to the EMDC GUI?

    EMDC knows which MSP430 device you have selected. When you enter the R1 and R2 values and max voltage for the voltage sensor and the shunt resistance and max current for the current sensor in the GUI, EMDC automatically calculates the max input voltage to the ADC. If it's over the max full-scale range (FSR) for a PGA gain setting of 1, the calculated value will turn red and will be flagged as an error.

    Assuming it's lower than the max FSR, the max input voltage to the ADC is then used by EMDC to automatically select the highest possible PGA setting in order to fill out as much of the FSR as possible. Please note that the FSR depends on the PGA gain setting.

    For a fixed gain setting, using a smaller R2 value or smaller shunt value for the same AC inputs would require the scaling factors to be larger. So, yes they are impacted by these parameters. However, they are mainly responsible for converting register values (digital MEMx values from the ADC output) to human-understandable values (e.g. 230Vrms).

    2. If we do the calibration also using the EMDC GUI as you suggested, will the calibration values also be stored into the "voltageSF" and "currentSF" vakues in the above source code(EM_user_Config.c), or will it directly be stored into the Flash of the microcontroller?

    They will be stored in Flash if you select that option (as described earlier) during the calibration process. To make sure they get generated in 'EM_userConfig.c' the next time you generate code in the EMDC GUI, you must click "Save" in EMDC after you've finished calibration and before you close the Calibration tab or project in the EMDC GUI.

  • Hi James,

    Thanks for the tip on formatting.

    Suppose my development project in CCS is based on the TI generated EMDC code from an existing example based on my chosen device(MSP430I2040) and I want to move my(this project) custom code to a new set of R1 and R2 values, shunt resistor values etc based on the custom hardware design that I am working on, should I just replace the EM_user_Config.c in my development project(from the example) with the EM_user_config.c from the TI generated EMDC code of the custom project and then that way I will have all the correct voltage and currrent scaling factors(CurrentSF, VoltageSF)? Basically this way, will I be able to import the scaling factors and everything else that I will need for the custom project?

    If we do the calibration also using the EMDC GUI as you suggested, will the calibration values also be stored into the "voltageSF" and "currentSF" vakues in the above source code(EM_user_Config.c), or will it directly be stored into the Flash of the microcontroller?

    They will be stored in Flash if you select that option (as described earlier) during the calibration process. To make sure they get generated in 'EM_userConfig.c' the next time you generate code in the EMDC GUI, you must click "Save" in EMDC after you've finished calibration and before you close the Calibration tab or project in the EMDC GUI.

  • If nothing else changes in the EMDC project, that should be possible. I would recommend having one EMDC projects for each design. This way, they both can save their unique calibration factors, and you can use them to regenerate the code. If you have one CCS project, it may be difficult to keep the code separate for each design. Again, you could use one CCS project per design to keep things more orderly.

    If your R1, R2 and shunt values are similar, the variation may not be enough for the PGA gain to change.

**Attention** This is a public forum