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.

BP-AM2BLDCSERVO: How to use Tamagawa encoder with the sample "Single-Chip, Dual-Servo Motor Drive Reference Design"

Part Number: BP-AM2BLDCSERVO

Tool/software:

Hi TI support team,
I'm trying to use Tamagawa encoder instead of EnDAT with "examples\tidep_01032_dual_motor_drive\single_chip_servo\am243x-lp\r5fss0-0_nortos" in the "motor_control_sdk_am243x_09_02_00_09." But I can't.

I know that IEP clock is 300MHzi n single chip_servo, it is 200MHz in t"amagawa_diagnostic\single_channel\am243x-lp\r5fss0-0_freertos" on the other hand.


I am trying to change some parameters. In one setting, I could get right SDDF output value in the "gSddfChSamps". But callback function "pruEncoderIrqHandler" was executed only once, not repeatedly.
In another setting, callback function was executed repatedly. But value in gSddfChSamps is wrong, which is bigger than 2^18.

Could you please give me some advice?
Thanks in advance.

Best regards,
Dai

  • I am trying to change some parameters. In one setting, I could get right SDDF output value in the "gSddfChSamps". But callback function "pruEncoderIrqHandler" was executed only once, not repeatedly.
    In another setting, callback function was executed repatedly. But value in gSddfChSamps is wrong, which is bigger than 2^18.

    Hi Dai,

    Could you please provide more information on the values you are configuring?

    1. Periodic mode configuration for Tamagawa: How are you configuring the periodic mode for Tamagawa? What value are you setting for the CMP 3 event? Please ensure that this value does not exceed the IEP reset cycle.
    2. SDFM parameter updates: For the second setting, are you updating the parameters for SDFM correctly in the gTestSdfms structure?

    please share the settings you are using for both configurations. This will help us to identify the cause of the problem.

    Thanks and regards,

    Achala Ram

  • Hi Achala,
    Thank you for your quick response.

    > 1. What value are you setting for the CMP 3 event? 

    CMP3 is 2000, which is used in Tamagawa sample.
    Now I'm setting CMP0 to 200MHz. I thinlk it should be IEP clock value (300MHz).
    But if I set 300MHz, only 0 is observed in the gSddfChSamps.

    > 2. For the second setting, are you updating the parameters for SDFM correctly in the gTestSdfms structure?
    I have set 200MHz for the first parameter of "SdfmPrms gTestSdfmPrms" in the second settings. In this case, values in gSddfCHsamps became huge value.

    Best regards,
    Dai

  • values in gSddfCHsamps became huge value.

    The clock settings for SDFM should be configured correctly, as the IEP sync mode is used for SDFM clock generation. Therefore, you should configure the IEP registers according to the IEP clock value (200MHz). In sdk example it is configured for 300MHz (file mclk_iep_sync.c)

    Additionally, it is crucial to ensure that the IEP clock value parameter and the SDFM clock value parameter of gTestSdfms are exactly the same as what you are configuring. If there are any changes, the clock provided to SDFM will not match the configured value, resulting in incorrect or high values.

    CMP3 is 2000, which is used in Tamagawa sample.

    you can halt the R5 core program and check the IEP registers, specifically the IEP CMP status register. This will indicate whether the CMP3 event is being hit or not. The CMP3 event should be triggered periodically to receive interrupts from the encoder PRU.

    For more information on IEP registers, you can refer to the section "6.4.14.9 PRU_IEP_IEP Registers" in the TRM. AM64x/AM243x Technical Reference Manual (Rev. H)

    Thanks & Regards,

    Achala Ram

  • Hi Achala,
    Thank you for your detailed advice.
    I will check them and share the result.

    Best regards,
    Dai

  • Thanks to your prompt help, I can solve this problem.
    Now I can rotate a motor with TAMAGAWA encoder.

    So as to values in gSddfCHsamps, I can get appropreate values within 2^18.
    The value range is 0 to 262,144. But I found stored values are around 130,992 to 131,264.

    These were -80 and +192, centered at 131072. I was expected they have bigger changes.
    But I think the values are correct, because motor is rotating.

    I am deeply grateful for your efforts.
    Thanks & Best regards,
    Dai TANAKA