SPRADH0 August   2024 AM625 , AM6442 , AM69 , TDA4VM

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
    1. 1.1 What is EtherCAT?
    2. 1.2 What is a PLC?
    3. 1.3 What is CODESYS?
  5. 2Evaluation Platform and Methods
    1. 2.1 Hardware
    2. 2.2 Software
    3. 2.3 Test Topology
  6. 3Performance Metrics
    1. 3.1 Cyclictest Performance Metrics
    2. 3.2 EtherCAT Performance Metrics
  7. 4Optimizations
    1. 4.1 Implemented Optimizations
    2. 4.2 Future Considerations
      1. 4.2.1 Set Maximum CPU Frequency
      2. 4.2.2 Isolate Cores
      3. 4.2.3 Set CPU Affinity
      4. 4.2.4 Isolate Cores and Set CPU Affinity
      5. 4.2.5 Ksoftirqs to FIFO
      6. 4.2.6 Increase the Real-Time Scheduling Time
      7. 4.2.7 Disable irqbalance
      8. 4.2.8 Use Separate Network Interface Card (NIC)
      9. 4.2.9 Disable Unnecessary Drivers
  8. 5Summary
  9. 6References
  10. 7Appendix A: How to Setup TI Embedded Processors as EtherCAT Controller Using the CODESYS Stack
    1. 7.1 Hardware Requirements
    2. 7.2 Software Requirements
    3. 7.3 Hardware Setup
    4. 7.4 Software Setup
      1. 7.4.1 Windows PC Setup
      2. 7.4.2 EtherCAT Controller Setup
      3. 7.4.3 CODESYS Development System Project
      4. 7.4.4 Execution
    5. 7.5 How to View Performance Measurements
      1. 7.5.1 Appendix A Resources
  11. 8Appendix B: How to Enable Unlimited Runtime on CODESYS Stack
    1. 8.1 CODESYS Licensing Background
    2. 8.2 Obtaining a CODESYS License
    3. 8.3 Activating CODESYS License
      1. 8.3.1 Background
      2. 8.3.2 Recommended Steps
    4. 8.4 Verifying CODESYS License Applied
      1. 8.4.1 Known Issues With Verifying CODESYS License Applied

Summary

The resulting benchmarks across AM62x, AM64x, AM69, and TDA4VM indicates that configuring a 1ms cycle time is achievable for the case of filtering out results from CODESYS startup or log-in. After some optimizations, higher end processors such as AM69 and TDA4VM can achieve down to 500µs cycle times whereas lower end processors such as AM62x and AM64x can achieve 1ms cycle times. Additionally, AM62x performed better than AM64x in terms of measuring a much lower maximum cycle time of 500µs compared to about 900µs. AM62x features four A53 cores running at a higher clock speed of 1.4GHz compared to AM64x at only two A53 cores running at 1GHz. The higher number of cores to redistribute “IEC tasks” that the CODESYS EtherCAT controller application uses and higher clock speed could have contributed the improvement in cycle time by about 400µs.

The expectation is to align the worst-case interrupt latency observed from cyclictest results with the cycle time observed from running CODESYS EtherCAT stack. The actual results show that CODESYS adds a significant amount of additional jitter. Further tunings such as changing clock frequency can improve cycle time performance; however, a better understanding of how CODESYS related threads impact scheduling and CPU load, helps in determining how to further optimize cycle time performance.

Note that the analysis provided in this application note are from the CODESYS EtherCAT controller stack running on Linux using a generic ethernet driver. Running an EtherCAT controller stack with a native driver can show even better performance. This is already shown by an RTOS-based EtherCAT controller stack with an optimized native driver developed by IBV (stack name is icECAT), reaching 100µs cycle time when running on a high-end MCU-based platform. With a more focused commercial stack such as IBV icECAT, better performance can also be achieved on a system running Linux, even with the standard ethernet driver (see also icECAT EtherCAT Master Stack Benchmark).