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.

InstaSpin with high current motor

Hello InstaSPIN community,

We are using the  F2806x ISO controlCARD connected in our own designed board. The motor I am using is 4KW – 28V – 117A – 2530 RPM, my VDC is a battery 48V – 500Ah

We can identify the motor's parameters successfully and the labs work well until lab 5c. In the lab 5c we can identify the motor inertia and to control the motor velocity successfully.

Some user.h parameters :

#define USER_IQ_FULL_SCALE_CURRENT_A          (800.0) 
#define USER_ADC_FULL_SCALE_CURRENT_A        (400.0)   

#define USER_MOTOR_TYPE                 MOTOR_Type_Induction
#define USER_MOTOR_NUM_POLE_PAIRS       (2)               
#define USER_MOTOR_Rr                      (0.00603492)      
#define USER_MOTOR_Rs                     (0.01054548)
#define USER_MOTOR_Ls_d                 (0.0001234099)
#define USER_MOTOR_Ls_q                 (0.0001234099)
#define USER_MOTOR_RATED_FLUX           (0.240211)
#define USER_MOTOR_MAGNETIZING_CURRENT  (27.86102)
#define USER_MOTOR_RES_EST_CURRENT      (25.0)    
#define USER_MOTOR_IND_EST_CURRENT      (NULL)     
#define USER_MOTOR_MAX_CURRENT          (100.0)            
#define USER_MOTOR_FLUX_EST_FREQ_Hz     (5.0)          
#define USER_MOTOR_ENCODER_LINES        (64.0)           
#define USER_MOTOR_MAX_SPEED_KRPM       (3.0)            
#define USER_SYSTEM_INERTIA             (11.11254972)             
#define USER_SYSTEM_FRICTION            (3.04806453)              

When I compile the lab 5d some warnings are generated:   #175-D floating-point value does not fit in required integral type  proj_lab05d.c

When I run, the motor's velocity is not the same as SpeedRef. It is very slow (about 0.031Krpm) even if I set any value of SpeedRef.

I have tried to change the code:

// set the maximum and minimum values for Iq reference

STVELCTL_setOutputMaximums(stObj->velCtlHandle, _IQmpy(gMotorVars.SpinTAC.VelCtlOutputMax_kA, _IQ(1.0/USER_IQ_FULL_SCALE_CURRENT_A/1000)), _IQmpy(gMotorVars.SpinTAC.VelCtlOutputMin_kA, _IQ(1.0/USER_IQ_FULL_SCALE_CURRENT_A/1000)));

 // initialize the watch window with maximum and minimum Iq reference

 gMotorVars.SpinTAC.VelCtlOutputMax_kA = _IQmpy(STVELCTL_getOutputMaximum(stObj->velCtlHandle), _IQ(USER_IQ_FULL_SCALE_CURRENT_A/1000));

 gMotorVars.SpinTAC.VelCtlOutputMin_kA = _IQmpy(STVELCTL_getOutputMinimum(stObj->velCtlHandle), _IQ(USER_IQ_FULL_SCALE_CURRENT_A/1000));

 

// get the Iq reference from the speed controller

gMotorVars.IqRef_kA = _IQmpy(STVELCTL_getTorqueReference(stObj->velCtlHandle), _IQ(USER_IQ_FULL_SCALE_CURRENT_A/1000));

There are no warnings anymore, but the motor's velocity is still slow.  What can I try to solve the problem ?

Thanks in Advance !

  • Paulo,

    I would recommend that you try out lab 05e. The primary difference between the two labs is that in lab 05e you have the ability to adjust the tuning of the SpinTAC speed controller. The issue could be a tuning problem.

    Are there any errors reported by the SpinTAC speed controller? They would appear in gMotorVars.SpinTAC.VelCtlErrId.
  • Hi Adam, thank you for the reply.

    The gMotorVars.SpinTAC.VelCtlErrId is always 0.

    I've tried the lab5e and the motor velocity does not follow the gMotorVars.SpeedRef_krpm. I have increased the variable gMotorVars.SpinTAC.VelCtlBwScale and there is no response of the motor. The velocity is always slow.

    Do you have any other suggestion ?
  • Paulo,

    It is possible that you are limiting the max/min output of the SpinTAC speed controller too much.

    I think the error is in this line:

    STVELCTL_setOutputMaximums(stObj->velCtlHandle, _IQmpy(gMotorVars.SpinTAC.VelCtlOutputMax_kA, _IQ(1.0/USER_IQ_FULL_SCALE_CURRENT_A/1000)), _IQmpy(gMotorVars.SpinTAC.VelCtlOutputMin_kA, _IQ(1.0/USER_IQ_FULL_SCALE_CURRENT_A/1000)));

    I think it should be:

    STVELCTL_setOutputMaximums(stObj->velCtlHandle, _IQmpy(gMotorVars.SpinTAC.VelCtlOutputMax_kA, _IQ(1.0/(USER_IQ_FULL_SCALE_CURRENT_A/1000))), _IQmpy(gMotorVars.SpinTAC.VelCtlOutputMin_kA, _IQ(1.0/(USER_IQ_FULL_SCALE_CURRENT_A/1000))));

    This should convert the units correctly. The way to check would be to add the variables:
    st_obj.vel.ctl.cfg.OutMax & st_obj.vel.ctl.cfg.OutMin to the watch window. these are both IQ24 variables that are in the units of scaled current. They should be scaled by USER_IQ_FULL_SCALE_CURRNET_A/1000 in your kA system.
  • Adam,

    I modified the code as you said and now the variables are:

    st_obj.vel.ctl.cfg.OutMax  125.0000018 (Q-Value(24))       

    st_obj.vel.ctl.cfg.OutMin  -125.0000019 (Q-Value(24)) 

    But the motor's behavior is the same, the velocity is still  slow. 

    Can you have any other idea on where can be the problem ?

  • Paulo,

    What is the value for USER_IQ_FULL_SCALE_CURRENT_A?  It should be larger than the largest current seen in your system.  I would expect the value for st_obj.vel.ctl.cfg.OutMax & st_obj.vel.ctl.cfg.OutMin to be less than 1.0.

  • Adam,

    The value is
    #define USER_IQ_FULL_SCALE_CURRENT_A (800.0)

    I put some user.h parameters in the first question
  • Paulo,

    There is one more place I think you need to modify the code to convert it into kA.  In the spintac_velocity.h file there are the defaults for the gMotorVars.SpinTAC structure.  In here is the default values for gMotorVars.SpinTAC.VelCtlOutMax & gMotorVars.SpinTAC.VelCtlOutMin.  I think you need to convert USER_MOTOR_MAX_CURRENT into kA by dividing by 1000.0.

    //! \brief Initalization values of SpinTAC global variables
    #define ST_VARS_DEFAULTS {false, \
    		                  ST_VEL_ID_IDLE, \
    		                  0, \
    		                  0, \
    	                      0, \
    	                      0, \
    	                      0, \
    	                      true, \
    	                      ST_CTL_IDLE, \
                              _IQ24(USER_SYSTEM_BANDWIDTH_SCALE), \
                              0, \
                              _IQ24(USER_MOTOR_MAX_CURRENT), \
                              -_IQ24(USER_MOTOR_MAX_CURRENT), \
                              0, \
                              ST_MOVE_IDLE, \
                              ST_MOVE_CUR_STCRV, \
                              0, \
                              false, \
                              0, \
                              ST_PLAN_STOP, \
                              ST_PLAN_IDLE, \
                              false, \
                              0, \
                              0, \
                              0, \
                              0}

  • Helo Adam,

    Yes, you are absolutely right. Now I can control the velocity perfectly.

    Thank You Very Much !