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.

MSPM0G1507: PI Control using MSPM0G1507

Part Number: MSPM0G1507

Tool/software:

Hi 

Currently I am using PMP7647_RevC design solution using MSP430 microcontroller. I am planning to migrate to MSPM0G1507. 

I need some help regarding the issues faced (Current waveform is attached)

PI control is running very slow at 5ms using timer

I am trying with PI control for load section .

Regards,

Yogesh

/* Ki = 0.1, 0.1 x 2^31 = 2,147,483,648 = 0x0CCCCCCC   (0.001) 0x0020C49B*/
#define Ki (0x00CCCCCC)
/* Kp = 0.1, 0.3 x 2^31 = 644,245,094 = 0x2666 6666 */
#define Kp (0x00CCCCCC)



const DL_MathACL_operationConfig gMpyConfig = {
    .opType      = DL_MATHACL_OP_TYPE_MPY_32,
    .opSign      = DL_MATHACL_OPSIGN_SIGNED,
    .iterations  = 1,
    .scaleFactor = 0,
    .qType       = DL_MATHACL_Q_TYPE_Q31};

int error = Ref_Load_Current-Load_Current;
errorQ31 = (error << (31-12))-1;;
DL_MathACL_startMpyOperation(MATHACL, &gMpyConfig, Ki, errorQ31);
DL_MathACL_waitForOperation(MATHACL);
integral = integral + DL_MathACL_getResultOne(MATHACL);
if(integral>=0x50000000){
    integral = 0x50000000;
}
else if(integral < 0){
    integral =0;
}
DL_MathACL_startMpyOperation(MATHACL, &gMpyConfig, Kp, errorQ31);
DL_MathACL_waitForOperation(MATHACL);
Proportional = DL_MathACL_getResultOne(MATHACL);
output = integral + Proportional ;
if(output>=0x50000000){
    output = 0x50000000;
}
else if(output < 0){
    output = 0;
}
DL_MathACL_startMpyOperation(MATHACL, &gMpyConfig, 320, output);
DL_MathACL_waitForOperation(MATHACL);
outputPI = DL_MathACL_getResultOne(MATHACL);
Duty_Boost = outputPI;