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.

Procedure to reinitialize the instaspin controllers after a fault

Other Parts Discussed in Thread: TMS320F28052F

TI-RTOS Version: C2000 2.10.01.38

CCS Version: 6.0.1.00040

Platform: Custom board using the TMS320F28052F

The Project is based on Proj_lab10a in motorware 1.01.00.13

The instaspin code is integrated into BIOS (Started with Small_TMS320F28052F)

What is the recommended procedure to reset the InstaSpin controllers? When a fault is detected (Low Voltage, Current Limit, etc) I disable Instaspin using the following procedure

 

gMotorVars.Flag_Run_Identify = false;

 

gMotorVars.Flag_enableSys = false;

// disable the PWM

HAL_disablePwm(halHandle);

 

After the re enabling the control when the fault condition is cleared (e.g. The Bus voltage is within the normal operating range). The drive applies a high voltage which causes a short circuit trip. I tried resetting the CtrlState to CTRL_State_Offline, clearing SpeedTrj_Krpm, and the PI variables for the Iq, Id and Spd PI (Ui, refValue and fbackValue) before restarting the drive but the issue still occurs. Sometimes the drive restarts but there is still a high current spike on the restart.

 

Thank you for your help

 

Regards,

 

Linley

  • Linley,

    Can you take a look at this thread to see if it answers your questions?  If not let me know:

    https://e2e.ti.com/support/microcontrollers/c2000/f/902/p/379753/1339380#1339380

    Best regards,
    Matthew

  • Hi Matthew,

     

    The link you referenced applies to the Instaspin Motion software. I am using the instaSpin FOC version, but I guess the idea is the same to reset the output voltage. I was able to restart the motor without any high current spikes by resetting the voltage variables Vab_in, Vab_out and Vdq_out.

    I am using the following procedure right now and everything works good. Do you see any issues using this procedure? should I reset any other variables?

     

    // set the enable controller flag to false

    CTRL_setFlag_enableCtrl(ctrlHandle,false);

     

    // set the controller state offline

    //CTRL_setState(ctrlHandle,CTRL_State_offline);

     

    // reset the output voltage and traj_spd

    // the following lines are implemented in an inline function in the actual application

    obj->traj_spd.targetValue = _IQ(0.0);

    obj->Vab_in.value[0] = _IQ(0.0);

    obj->Vab_in.value[1] = _IQ(0.0);

    obj->Vab_out.value[0] = _IQ(0.0);

    obj->Vab_out.value[1] = _IQ(0.0);

    obj->Vdq_out.value[0] = _IQ(0.0);

    obj->Vdq_out.value[1] = _IQ(0.0);

     

    //reset flags

    gMotorVars.Flag_Run_identify = false;

    gMotorVars.Flag_enableSys = false;

     

    // disable PWM

    HAL_disablePwm(halHandle);

     

    Thank you for your help

     

    Regards,

     

    Linley

  • Maybe very late (no kidding) but this thread did helped me so i wanted to contribute.

    I had the same problem when stoping/restarting the motor control with Instaspin and i found out that i had to reset the 3 integral used in the PIDs on top of the procedure given by Linley Rawlins.

    CTRL_Handle handle
    
    handle->Ui_Id = _IQ(0.0);
    handle->Ui_Iq = _IQ(0.0);
    handle->Ui_spd = _IQ(0.0);

    otherwise when re-enabling the controller would do a spike of current on the motor.

    Regards

    Thomas