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.

MCU-PLUS-SDK-AM243X: Endat2.2 recovery time counter for safety

Part Number: MCU-PLUS-SDK-AM243X

Tool/software:

Dear TI Experts

According to Heidenhain document (D1128897 - 03 - A - 02 8) - Safety with EnDat 2.2 and Non-Safe
EnDat Master

section 3.5.2 Counter for measuring the recovery time I

The recovery time can, for example, be measured by a counter realized within the EnDat master. The
last rising edge of the EnDat-Clock (positive signal) indicates the starting trigger and the following falling
edge of the EnDat-Data (positive signal) indicates the stop trigger for the recovery time I counter. (The
EnDat 2.2 protocol has to be analyzed within the master to obtain the correct trigger time. Also, the cable
delay has to be taken into account.)
The counter value has to be provided in a dedicated RT register at the interface of the master. The
counter and the RT register have to change dynamically in normal operation mode to detect “stuck-at”
errors of counter and RT register. This can be realized with a counter that does not reset. Therefore the
expected value for the recovery time is coded in the difference between the last and the current value.
The last value has to be stored in the safe CU.
For high efficiency fault detection (especially for multi-masters) it is necessary to load the counters of
different axes with different starting values. The difference has to be at least double the expected tolerance
range of the recovery time. Due to this and the incrementing values a forced dynamic sampling of
the counter is not necessary.

1) Section 3.5.2 specifies of a counter that does not reset as a means of RT implementation to meet "stuck at" detection requirement.

I can's seems to find "Non reset RT counter" in the endat interface.

Would you be  be able to provide "non reset RT counter" as part of endat interface

Thank you

Alan I

  • Hi Alan,

    Thanks for your query.

    I will check on this and get back to you.

    Best Regards

    Achala Ram

  • Hi Achala

    Thank you for following-up on RT counters. Heidenhain documents suggests Non reset RT counter method as a solution to detect stuck at fault. We are open to other method/solution as long as we can demonstrate stuck at fault detection.

    Thank you

    Alan I

  • Hi Achala

    Hope you are doing well. Do you have any update on this enquiry?

    Thanks

    Alan I

  • Alan

    Please note that this is a holiday season in India. Please expect the response by next week.

    Feel free to ping the thread next week if you do not get a response within a few business days.

    Regards

    Dhaval

  • Hello Ti experts

    I am just pinging the thread 

    I would like to understand if this requirement can be addressed

    Thank you

    Alan I

  • Hi Alan,

    Sorry for delay!!

    Please refer to the documentation : AM243x Motor Control SDK: EnDat Protocol Design. for the RT measurement method supported by current EnDAT firmware. 

    Method is as follows: we start counter from zero at last rising clock edge, and then read counter value on the following falling Data edge. The counter value read at the falling data edge is RT, and we store this value in shared memory as recovery time. The counter continuously increments between last rising edge of the EnDat-Clock (positive signal) and the next falling edge of the EnDat-Data (positive signal). 

    Regarding "stuck-at fault detection", We are checking with Heidenhain that how we can detect & validate "stuck at" error with non-resetting counter values!

    Can you share your use case of stuck at error with RT ? Share the conditions where you think that it should detect as stuck-at error. 

    Thanks & Regards,

    Achala Ram 

  • Hi Achala

    Thank you for the reply. As you noticed in my original post, the requirement for non-reset RT counter is a requirement specified by Heidenhain in their document "Heidenhain document (D1128897 - 03 - A - 02 8) - Safety with EnDat 2.2 and Non-Safe EnDat Master"

    Please refer to section 3.5.2 of above document.

    It is good that you are in contact with Heidenhain about this topic and we will be waiting the result of your discussion.

    Let me know if you need more information

    Thank you

    Alan I

  • Our use case for RT is specified by section 3.3 of "Heidenhain document (D1128897 - 03 - A - 02 8) - Safety with EnDat 2.2 and Non-Safe EnDat Master"

    RT Test requirement is specified by section 4 of the same document

    Where RT Test needs to be performed as part of Safe Operation test 

    Let me know if you need more information

    Alan I

  • Hello Achala

    Do you have any update on non-Reset RT counter?

    Thanks

    Alan I 

  • Hello Achala

    Do you have any update on this issue?

    Thanks

    Alan I

  • Hi Alan,

    After reviewing the Heidenhain documentations, we found that some steps are missing to meet safe CU requirements in our current firmware. Thanks for bringing this to our attention.  We will enable all the necessary safety related requirements, including stuck at error in the firmware, which will be available in the next motor control sdk release.

    Thanks & regards,

    Achala Ram

  • Achala

    Thank you for the reply. I noticed the motor control SDK 9.2.0.11 was released few weeks ago. Do you have indicative time frame for next sdk release.

    I am having problem to get RT measurement going on  mode 200: Start periodic continuous mode  ( frorm endat diagnotic) 

    Attached is my modified version of endat_drv.c / and endat_diagnotic.c where I tried to use pos_cmd=9  in periodic trigger mode.

    endat_diagnostic.cendat_drv.cendat_drv.h

    Let me know if you need more information

    Thanks

    Alan I

  • I am having problem to get RT measurement going on  mode 200

    I am reviewing your changes meanwhile can you share, What issue are you facing with this? and what values are you configuring for IEP reset cycle & trigger point ?

    Thanks & regards,

    Achala Ram

  • Hi Achala

    I tried several IEP Cycle  ie , 200000 , 400000 , trigger was set at 1000

    I have configured the encoder to do short RT 

    I have modified the endat_diagnotic.c such that  cmd 200 uses Endat Mode 9 with MRS code of 0x4d. In theory the RT should be performed on every endat mode 9 transaction.

    Let me know if you need more info.

    Thanks

    Alan I

  • Hi Alan,

    I am getting RT for CMD 9 with your changes, but these values are in PRU cycle counts, not in nanoseconds, which is expected. The endat_command_process function performs the RT conversion, and endat_get_recovery_time returns the RT in nanoseconds. However, in periodic mode, this function is called only once, so the RT conversion does not happen after the first measurement, and endat_get_recovery_time returns the RT in PRU cycle counts.

    Thanks & Regards,

    Achala Ram

  • Hi Achala

    Thank you for trying out my modified version of endat_drv.c

    If I understand correctly , the last column  ( value 571) is cycle count , then value in ns is  571 * 1/300e6 * 1e9 = 1903 ns which matches short RT value of Endat Encoder  ~2us.

    May I know the IEP cycle and trigger points used for example above

    Thank you for your hep

    Thanks

    Alan I

  • Hi Alan,

    I tried several IEP Cycle  ie , 200000 , 400000 , trigger was set at 1000

    I used, 200000 for cycle count & 1000 for trigger point. 

    then value in ns is  571 * 1/300e6 * 1e9 = 1903

    PRU clock is set to 200MHz, so exact value will be 571*(1/200e6)= 2.8us.

    Thanks & Regards,

    Achala Ram

  • Archala, thank you for the clarification.

    Could you let me know estimated release date for next motor control SDK

    Thanks

    Alan I

  • Hi Alan,

    Can you please review the method for RT and confirm, will this work for you?

    To measure Recovery Time (RT), we will use the PRU cycle counter. The measurement begins by setting the PRU counter to zero at the last rising clock edge (CLK line). Afterward, the firmware will read the PRU counter value at the next falling Data edge (RX line). This captured value represents the Recovery Time (RT), which is stored in the lower 32 bits of a 64-bit timer.

    The upper 32 bits of the 64-bit timer will function as a 32-bit counter, incrementing with each command request based on the measured RT. This counter can be used to detect “stuck-at” faults: if the counter fails to increment after an RT measurement, it indicates a potential fault.

    Thanks & regards,

    Achala Ram

  • Hello Achala

    We are just a user and we can not make any recommendation on the implementation method. I urged you to work with Heidenhain to meet all implementations and testing requirements as outlined in Heidenhain document D1128897 - 03 - A - 02 Safety with EnDat 2.2 and Non-Safe EnDat Master

    Thank you

    Alan I

  • Hello Achala

    Happy New Year. Do you have any update on this subject? 

    Thank you

    Alan I

  • Alan

    Sorry for the delayed update. We will provide an update by end of this week.

    Regards

    Dhaval

  • Hi Alan,

    Sorry for the delayed update.

    We have started the implementation for RT, and once it is completed, we will share the patch with you (next week). It will take approximately one week to finish development, review, and testing. 

    And regarding the motor control SDK release date, we will provide an update on that soon.

    Thanks & regards,

    Achala Ram

  • Hi Archala

    Thank you for looking into this issue and we are eagerly awaiting the patch

    Alan I

  • Hi Alan,

    Files to Update/Modify:

    • motor_control_sdk_am243x_09_02_00_09\examples\position_sense\endat_diagnostic\endat_diagnostic.c
    • motor_control_sdk_am243x_09_02_00_09\source\position_sense\endat\driver\endat_drv.c
    • motor_control_sdk_am243x_09_02_00_09\source\position_sense\endat\firmware\endat_diagnostic.cmd
    • motor_control_sdk_am243x_09_02_00_09\source\position_sense\endat\firmware\endat_interface.h
    • motor_control_sdk_am243x_09_02_00_09\source\position_sense\endat\firmware\endat_main.asm
    • motor_control_sdk_am243x_09_02_00_09\source\position_sense\endat\include\endat_api.h
    • motor_control_sdk_am243x_09_02_00_09\source\position_sense\endat\include\endat_drv.h
    • motor_control_sdk_am243x_09_02_00_09\source\position_sense\endat\include\endat_interface.h

    Action to Take:

    • Update or copy all these files from the provided attachment 
    • Additionally, make sure you use the updated firmware binary and driver libraries that are also in the attachment.

    motor_control_sdk.zip

    Thanks & Regards,

    Achala Ram

  • Hi everyone,

    I have a question related to this topic.

    We also plan to use TI Sitara AM243x in a safety related application, for which we need a safe position information. We´d like to follow the same implementation note by Heidenhain (Safety with EnDat 2.2 and Non-Safe EnDat Master).
    Is it possible to follow the guidelines provided by Heidenhain using the EnDat2.2 master from the AM243x MotorControlSDK or are there any further restrictions?

    Thanks in advance & best regards
    Christian Brunner

  • Yes Christian,

    We have implemented RT as per the method and guidelines described in Heidenhain document (D1128897 - 03 - A - 02 8) - Safety with EnDat 2.2 and Non-Safe EnDat Master, This will be available on ti.com with next AM243x Motor Control SDK release.  

    According to 

  • Hi Achala

    Thank you for Patch. I have run the patch using endat_diagnostic.c and RT looks much better than before.  I have one additional question regarding RT.

    Figure 6 from (D1128897 - 03 - A - 02 8) , shows that RT register is only updated once per safety cycle. 

     Question : In order to match RT counter update rate as per figure 6,  Can I enable RT measurement only to specific MRS code during safety cycle

    Thank you

    Alan I

  • Hi Alan,

    Can I enable RT measurement only to specific MRS code during safety cycle

    can you share more details on this ? to detect "stuck-at' RT -register should change in normal operation also. 

    Thanks & regards,

    Achala Ram