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.

AM335x EtherCAT data not valid

Other Parts Discussed in Thread: AM3357

Hi,

I use an AM3357 with EtherCAT firmware based on SYS/BIOS Ind. SDK V1.1.0.5. ESC firmware version reads V1.3.154. No changes made to the object dictionary, no changes made to ESI file. Beckhoff SSC version is V5.10. EtherCAT Slave Stack is running on a StarterWare base (no SYS/BIOS).
The firmware runs on a custom board.

I have the following test set:
- PC with Beckhoff TwinCAT PLC
- Our own node (TIESC-001, 1414070273 / 17)
- EK1100 bus coupler
- EL2008 8 channel output



PLC task with 10ms cycle is runing on the PC toggling an boolean variable in every cycle. So there is one EtherCAT frame every 10ms. TI-ESC001 node is running in DC-synchron mode. The boolean variable has a link to one EL2008 output as well as to a TI-ESC001 output.

The system runs fine, no error messages from TwinCAT. I can read all the CoE values, no problems so far.

I expect that the output of the EL2008 node as well as the output on the TI-ESC001 node toggles every 10ms although not synchronized to each other because EL2008 does not run on DC-synchron mode. Sync0Isr() is called every 10ms without noticable jitter. It seams that DC mode is running fine.

The problem is that the output on TI-ESC001 does not toggle every 10ms. Sometimes there is no toggle for more than one EtherCAT cycle. Please see picture. Channel 1 (yellow) shows EcatIsr() entry (PDI interrupt). Channel 2 (red) shows output of TI-ESC001 and channel 3 (blue) shows output on EL2008. Output on TI-ESC001 miss to toggle at least once in this sequence.

Any ideas on this problem? For me it looks as if the output data is not valid when reading  from ESC.

Thanks and best regards,
Patrick

  • Hi Patrick,

    This has been forwarded to the Industrial Protocol experts. Feedback will be posted here.

  • Hello Patrick,

    Could you share the details of your process data configuration? If you are using the same process data as the default application, which data object are you toggling in the PLC program? How did you modify the application to present this output to the oscilloscope channel?

    Thanks,
    Srikant
  • Hi Srikant,

    I use "LED 1" of "DO Outputs". I linked this to the PLC output variable. In the "APPL_OutputMapping()" procedure the process data ic copied mapped to "sDOOutputs.LEDs" variable (original code).


    In the procedure "APPL_Application()" I do the following (temporary test code):

        //###
        bEtherCATOutput=(sDOOutputs.LEDs & 0x01);
        //###

    In the same procedure I directly set or reset GPIO3_21 depending on "bEtherCATOutput" (channel 2 on the scope picture).

    Unfortunately I'm short on free GPIO's. This makes debugging a bit difficult. I also do not know where to start. There might be a problem reading the process data from ESC (HW_EscReadIsr()).

    With the EL2008 I wanted to check is the variable from the PLC is ok. So that seems to be ok.

    Thanks for the support,
    Patrick

  • Hi,

    What I have done so far:

    1. Check whether access to process data is blocked in some way in the procedure "bsp_get_process_data_address()" (by the way what does this procedure exactly?)
    --> Access to process data is always possible (no timeout, no other problems)

    2. Added additional delay in the procedure "HW_EscReadIsr()" just before reading the process data from ESC
    --> With a long delay time (~3ms) it was possible to get valid output data (toggle of output in every cycle)

    3. Patched Beckhoff Slave Sample Code V5.10 with newest patch file from SYS/BIOS Ind. SDK V1.1.0.5 and checked against used code
    --> I found out that I did not have the newest code (e.g. file "ecatappl.c" had minor changes)
    --> Incorporated newest patch change into code and total rebuild
    --> No change in the behaviour

    4. Changed procedure "PDI_Isr()" in such a way that "PDO_OutputMapping()" is not called. Changed "Sync0_Isr()" in such a way that "PDO_OutputMapping()" gets called, when slave works in DC-Synchron mode. Deleted the additional delay from point 2.
    --> In DC-Synchron mode I get an absolut stable toggle of the output (like it should be)

    5. Changed procedure "PDI_Isr()" as follows:

     

            /*###
            if ( bEcatOutputUpdateRunning )
            {
                // slave is in OP, update the outputs
                PDO_OutputMapping();
            }
            */
            if (!bDcSyncActive && bEcatOutputUpdateRunning)
            {
                // slave is in OP, update the outputs
                PDO_OutputMapping();
            }
            else

       Changed procedure "Sync0_Isr()" as follows:

    #if MAX_PD_OUTPUT_SIZE > 0
            /*
            if(!bEscIntEnabled && bEcatOutputUpdateRunning)
            {
                // Output mapping was not done by the PDI ISR
                PDO_OutputMapping();
            }
            */
            if(bEcatOutputUpdateRunning)
            {
                // Output mapping was not done by the PDI ISR
                PDO_OutputMapping();
            }
    #endif

    --> SM-Synchron mode I get a nice toggle signal on the scope
    --> In DC-Synchron mode I get a nice toggle signal most of the time. But there are still rare cases with one toggle miss.
    --> There was also a problem when switching from DC-Synchron mode to SM-Synchron mode in TwinCAT. Then lots of toggle missed. Only a reset and restart of the AM3357 helped to get a stable toggle again.

    ==> Now I need a TI EtherCAT expert with knowledge of PRU-ICSS firmware to figure out what might be the problem (maybe code change in PDI_Isr() and Sync0_Isr() is needed?) and what I can try to debug.


    Thanks.

    Patrick

  • Hi,

    Just some news:

    After spending hours reactivating my old ICE V1 board, building the original code from SYS/BIOS Ind. SDK V1.1.0.5 and modifying the procedure "APPL_Application()" as follows (and deactivating LEDDriveError() statement in HW_SetLed()):

    void APPL_Application(void)
    {
        Uint8 LED; // initial test data
        static Uint8 prevState = 55;
        
        //### Test
        if (sDOOutputs.LEDs & 0x01)
        {
        	LEDDriveError(1);
        }
        else
        {
        	LEDDriveError(0);
        }
        //### Test Ende
    
    
        LED = sDOOutputs.LEDs;


    I can see the same behaviour on the Error LED Output in DC-Synchron mode. Sometimes the toggle is missing. I have not seen missed toggle yet on SM-Synchron mode so far.

    Thanks.
    Patrick