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.

TMS320F28027F: Default IQ limitation

Part Number: TMS320F28027F

Dear Champs,

The default GLOBAL_Q in InstaSpin FOC example project is 24, I found there is a limitation for the USER_ADC_FULL_SCALE_CURRENT_A, if this value above 128, that will cause warning. 

So what I'm thinking is to change the GLOBAL_Q to 22, but I found the compressor can not be work properly. First, I suspect there are something wrong my new board, but when I change to use my old board which USER_ADC_FULL_SCALE_CURRENT_A is 55A, it still can't work properly, can you please help me understand why? 

  • Are you changing any variables passed to the estimator from the IQ24 format? The FAST estimator is hard-coded for IQ24 and all variables used by the estimator are assumed to be in this format. You can change them but must cast them back to IQ24 before passing to the estimator

    Sean
  • Sean,

    I'm trying to change estimator in/out value to meet GLOBAL_Q change, but it looks to me that something missed. Is there any guideline/lists to show how to do this? I think this can be as standard TI's docs in future, because it can help instaspin product to use in more wide application.

    I also find that some of the offset function, such as OFFSET_setBeta, OFFSET_setInitCond,etc are build with lib, what Q format of those value?

    //! \brief Sets the beta offset filter coefficient
    //! \param[in] handle The offset handle
    //! \param[in] beta The offset filter coefficient beta
    extern void OFFSET_setBeta(OFFSET_Handle handle,const _iq beta);


    //! \brief Set the initial condition of the integrator or the value of y[n-1]
    //! \param[in] handle The offset handle
    //! \param[in] initCond The mean value that the filter will approximate to
    extern void OFFSET_setInitCond(OFFSET_Handle handle,const _iq initCond);


    //! \brief Sets the offset value
    //! \param[in] handle The offset handle
    //! \param[in] offsetValue The offset value
    extern void OFFSET_setOffset(OFFSET_Handle handle, _iq offsetValue);
  • Hi, jack,
    Instead of changing the GLOBAL_Q, You can make the USER_ADC_FULL_SCALE_CURRENT_A = (Actual Full-Scale Current /2) if it is less then 256.
    And make Your Base Current also (/2). So Now You have the base Current is 0.5 and make all the calculation using 0.5 multiplayer rations.
    Maybe this work.

    Ashutosh Bhatt
  • Hi Ashutosh,

    Can you please give a example of how to change this?

    If there is a list that show all the settings/code changes, that would be best. Thanks...
  • You don't need to change the GLOBAL_Q (in fact I would recommend not touching that), but can instead use the IQ API to cast between different Q values during intermediate calculations.

    Sean
  • Hi Sean,

    Can you please give an example of how to change this?

    For example, USER_ADC_FULL_SCALE_CURRENT_A = 400A
  • Sean,

    May I have your further comments here? Thanks...
  • May I get your update?
  • Actually, there is no error when you are defining USER_ADC_FULL_SCALE_CURRENT_A. The value is converted to PU and used to scale the currents appropriately. You are most likely seeing an error from something like this:

    gMotorVars.Iq_A = _IQmpy(CTRL_getIq_in_pu(ctrlHandle), _IQ(USER_IQ_FULL_SCALE_CURRENT_A));

    Here we are updating the global variables to show the Iq current is SI units. This is not really necessary, it is just for debug. You may consider removing lines that will display the SI unit for debug - the estimator only uses the PU value so there is no issue internally. You will need to debug using the PU unit instead of the SI unit

    Sean
  • Hi Sean,

    Thanks for your update. If this is used to convert to SI unit, I think this is not issue due to there are many other ways to convert pu to SI.