BP-AM2BLDCSERVO: SDDF value range

Part Number: BP-AM2BLDCSERVO

Tool/software:

Hi TI support team,

Previously I have tried to run single_chip_servo demo in MOTOR_CONTROL_SDK with tamagawa encoder.
At first I couldn't get proper value of SDDF in "gSddfChSamps."
However I have modified  "mclk_iep_sync.c", I could acquire valid SDDF values.

Now I'm trying to run single_chip_servo demo on R5FSS1-1 instead of R5FSS0-0 without tamagawa encoder or Endat.
But I can get SDDF value less than 268,435,456 = 2^28 ( for example 268,435,424 or 268,435,104)
or more than 0 (for example 8 or 120)

My SDDF setting is below

/* Test Sdfm parameters */
SdfmPrms gTestSdfmPrms = {
    200000000,   /*Value of IEP clock*/
    20000000,    /*Value of SD clock (It should be exact equal to sd clock value)*/
    0,                        /*enable double update*/
     10,       /*first sample  trigger time*/
     0,       /*second sample trigger time*/
    APP_EPWM_OUTPUT_FREQ,     /*PWM output frequency 50kHz*/
    {{3500, 1000},    /*threshold parameters(High, low )*/
    {3500, 1000},
    {3500, 1000}},
    {{0,0},                /*clock sourse & clock inversion for all channels*/
    {0,0},
    {0,0}},
     15,   /*Over current osr: The effect count is OSR + 1*/
     64,   /*Normal current osr */
     0,   /*comparator enable*/
     (uint32_t)&gSddfChSamps /*Output samples base address*/
};

I know SDDF value is normalized by substracting SDDF_HALF_SCALE (=2^17)


Following are my questions.
 - How can I get valid value of SDDF?
 - Where can I set number of bits of SDDF values?

Best regards,
Dai TANAKA 
  • However I have modified  "mclk_iep_sync.c", I could acquire valid SDDF values.

    Hi Tanaka,

    As I can see, you are using IEP clock at 200MHz, due to this SD clock will not be 20MHz. The code available in mclk_iep_sync.c file configures the IEP SYNC event to generate SDFM 20MHz, and all IEP registers configuration is done assuming IEP is running at 300MHz. so you have update settings according to IEP clock.

    To get correct SDFM samples, you have to match the SDFM clock that goes to SD8_CLK with the value of SDFM clock configured in gTestSdfmPrms. If there is any difference between the clock you're providing to SDFM and the configured value of SDFM clock, that will lead to incorrect sampling

    SDFM has an API to configure IEP sync to SDFM clock. see here AM243x Motor Control SDK: ICSS SDFM Examples

     - Where can I set number of bits of SDDF values?

    You can changes the NC OSR value in gTestSdfmPrms to get different ENB.

    You can see the SDFM documentation to get more details about SDFM  AM243x Motor Control SDK: Current Sense

    Additionally, we are refactoring the reference design to make it easier to configure different encoder and sdfm settings. And the FOC implementation will be based on UMC AM263x Motor Control SDK: TIDM-02018 Universal Motor Control Reference Design for AM263x Arm® Based MCU Devices.

    Updated project will be available in the motor control 11.0 release planned for the end of this week

    Thanks & Regards,

    Achala Ram

  • Hi Achala,

    Thank you for your help.
    I learned that I should use fixed conbination of IEP clock and SD clock shown in following site. 
    AM243x Motor Control SDK: ICSS SDFM Examples

    But I'm sorry I can't understand following line.
       >You can changes the NC OSR value in gTestSdfmPrms to get different ENB.

    I know NC OCR can be 16, 32, 64 128 or 256.
    But how many bits values are returned from SDDF function with each OCR rates?
    What is "ENB"?


    The latest motor control SDK version is good news for me.
    I can't find it today. I will check it up later.

    FYI
    My problem was solved in another way.
    First I thought only "rtuSddfIrqHandler" is required with 1-Motor system.
    So I removed "pruSddfIrqHandler" and related variables.
    It seems to bad affect to RTU firmware. Wrong values have been stored in the "gSddfChSamps."
    If I have recovered deleted valiables and functions, I can get valid values.

    Best regards,
    Dai TANAKA