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.

AM3359 SDK 1.1.0.1 Cycle too Small

Other Parts Discussed in Thread: AM3359

Hi Community,

Can any one provide clarification, about “Cycle too Small” Indexes 0x1C32:0B and 0x1C33 and Its implementation in SDK 1.1.0.1

When TwinCAT Master is configured in SM-Synchron Mode (Synchronous Mode) :

TwinCAT Master, dynamically set the polling interval time to enable controller task scheduling.

Slave Controller (ICE Board) if defined a lower poll interval limit ( Example <=900us) to maintain synchronization.

If the Master polls faster than the Slave controller lower limit, then slave need to increment the cycle too small counter (Indexes 0x1C32/0x1C33, sub-index 11).

Please find the below link for reference , Operating mode 2 - Synchronous with SM event

http://infosys.beckhoff.com/english.php?content=../content/1033/ethercatsystem/html/bt_ethercat_dc_synchronizing.htm&id

Regards,

Bindu

  • Hi,

    We just released 1.1.0.3 (http://software-dl.ti.com/sitara_indus/esd/AM335x_SYSBIOS_Industrial_SDK/latest/index_FDS.html) today- this has a sample implementation on how to do this for TI ESC using EtherCAT timer - Look for SUPPORT_TI_ESC_CYCLE_EXCEEDED_COUNTER (in ecatappl.c) after applying sdk/protocols/ethercat_slave/ecat_appl/patch/TI_ECAT.patch over SSC5.01

    In TI ESC above approach won't work to figure out cycle exceeded scenario as it may take longer to clear AL event IRQ by firmware, so we measure PDI ISR period instead


  • Hi,

    "SUPPORT_TI_ESC_CYCLE_EXCEEDED_COUNTER" is not defined

    1) I Guess this was the sample implementation provided by TI ( so we can get the  time stamp before and after execution PDI_ISR())

    2) If we Implement the above "SUPPORT_TI_ESC_CYCLE_EXCEEDED_COUNTER" what are the other Implementation to be undefined (MAX_PD_INPUT and OUTPUT SIZE)

     

  • Hi,

    Just enable SUPPORT_TI_ESC_CYCLE_EXCEEDED_COUNTER. MAX_PD_INPUT and OUTPUT SIZE are stack configuration dependent and you shall not undefine if you do not intend to change your configuration.

  • Hi,

    One observation

    As per below link (Synchronous with SM2/3 event )

    http://infosys.beckhoff.com/english.php?content=../content/1033/ethercatsystem/html/bt_ethercat_dc_synchronizing.htm&id=

    "Cycle too small "  is Index 0B (1C32/1C33 : 0B), but in Ecat_appl it is with Index 0C

     

  • Hi,

    We are using TWINCAT to operate in both modes and have enabled "SUPPORT_TI_ESC_CYCLE_EXCEEDED_COUNTER"in ecatappl.c

    1) Synchronous (SM-Synchron)

    2) Asynchronous (FreeRun)

    We have some doubts, listed below

    1) We are printing the pdiIsrPeriod on UART for different cycle ticks in Twincat for synchronous mode

    a) For cycle ticks greater than 1ms ( the pdiIsrPeriod values printed are correct )

    b) For cycle ticks less than 1 ms ( example 800us or less than 1ms ) the pdiIsrPeriod is same to be as 1ms

    2)  Is SUPPORT_TI_ESC_CYCLE_EXCEEDED_COUNTER  executed based upon the Cycle ticks?  if yes then why is the behaviour of PdiIsrPeriod it will never be calulated less than 1ms?

    3) Is SUPPORT_TI_ESC_CYCLE_EXCEEDED_COUNTER  executed only for synchrous mode? and not for Asynchronous mode?

    Regards,

    Bindu

  • Bindu,

    the default Sys/Bios task cycle time is 1ms. So your measurement may be limited by this. Can you try increasing the scheduler frequency or change the way you do the measurement?

    regards,

     

  • Hi Frank,

    updated the clock.period in cnfg to 100u, but the behavior is same (limited to 1ms)

    Regards,

    bindu

  • Hi Bindu,

    i am using a DMTimer as TickSource. In the DMTimer ISR i call the Clock_tick(); function.

    In .cfg. Timer.intFreq.lo = 24000000 ;Clock.tickSource = Clock.TickSource_USER; Clock.tickPeriod = 1;

    As clk_source for DMTimer i choose CLK_M_OSC (check register) and with: timer2Params.period = 1200 (in my example: 20kHz) ; i change the frequency.

    Did you searched for sth like this?




  • Hi Daniel,

    I'm working on SDK 1.1.0.3 Ethercat application

    and using API  bsp_get_local_sys_time() to captures time in nano seconds

    app.cfg contains Clock.tickPeriod = 1000; but it does not have Timer.intFreq.lo = 24000000 ;Clock.tickSource = Clock.TickSource_USER; Clock.tickPeriod = 1;

    Regards,

    Bindu

  • Hi,

    we are using sdk 1.1.0.3, ecat appl on ICE Am3359

    EtherCAT operates in 3 modes

    1)Free Run (Asynchronous mode)

    2)SM-Sync (Synchronous mode)

    3)DC-Sync mode

    1) How is the ethercat application differentiate between these 3 modes?

  • Hi,

    I responded privately to you - for closure of this thread...

    Master select between DC SYNC mode and SM-sync/Free Run mode

    SM-sync or Free run mode depends on slave configuration, see details below

    One can’t differentiate between FreeRun/SM-sync mode from the master side

     

            /* FreeRun-Mode:  bEscIntEnabled = FALSE, bDcSyncActive = FALSE

               Synchron-Mode: bEscIntEnabled = TRUE, bDcSyncActive = FALSE

               DC-Mode:       bEscIntEnabled = FALSE, bDcSyncActive = TRUE */

     

    If interrupts are disabled at SSC, slave is in FreeRun mode otherwise it’s in SM sync mode.

     

    See ecat_def.h, AL_EVENT_ENABLED

     

    /**

    AL_EVENT_ENABLED: If an interrupt routine shall be called when one of the Events in the AL Event Register (0x220) changes, <br>

    this switch has to be defined to 1 (synchronous modes are supported). <br>

    If the AL Event register shall only be polled, this switch has to be defined to 0 (only free run mode is supported). */

    #define AL_EVENT_ENABLED                          1

     

  • Hi Pratheesh,

    As u said we cannot choose between SM Synchronous/ Free Run from Master.

    But I need to have that selection from Master since they are two separate synchronization modes.

    Can you provide your comments if this can be routed by changing the ESI file and some code.

     

  • Gayatri,

    For both SM Synchron and Free Run, the same DC settings apply for the ESC.

    On TwinCAT, SM synchron RUN [Actions -> Activate Configuration] is launched differently from Free Run [Actions -> Set / Reset TwinCAT to Config mode, followed by Yes for free run].

    To go to OP on SM Synchron, you need to have a task (a PLC program or even a dummy task) with process data.

    Regards,

    Srikant