SPRACM9B June   2019  – November 2020 TMS320F28384D , TMS320F28384S , TMS320F28386D , TMS320F28386S , TMS320F28388D , TMS320F28388S , TMS320F28P650DH , TMS320F28P650DK , TMS320F28P650SH , TMS320F28P650SK , TMS320F28P659DK-Q1

 

  1.   Trademarks
  2. Introduction
    1. 1.1 Acronyms Used in This Document
  3. Benefits of the TMS320F2838x MCU for High-Bandwidth Current Loop
  4. Current Loops in Servo Drives
  5. Outline of the Fast Current Loop Library
  6. Fast Current Loop Evaluation
    1. 5.1 Evaluation Setup
      1. 5.1.1 Hardware
      2. 5.1.2 Software
      3. 5.1.3 FCL With T-Format Type Position Encoder
        1. 5.1.3.1 Connecting T-Format Encoder to IDDK
        2. 5.1.3.2 T-Format Interface Software
        3. 5.1.3.3 T-Format Encoder Latency Considerations
      4. 5.1.4 SDFM
      5. 5.1.5 Incremental System Build
  7. Incremental Build Level 1
    1. 6.1 SVGEN Test
    2. 6.2 Testing SVGEN With DACs
    3. 6.3 Inverter Functionality Verification
  8. Incremental Build Level 2
    1. 7.1 Setting the Overcurrent Limit in the Software
    2. 7.2 Current Sense Method
    3. 7.3 Voltage Sense Method
    4. 7.4 Setting Current Regulator Limits
    5. 7.5 Verification of Current Sense
    6. 7.6 Position Encoder Feedback
      1. 7.6.1 Speed Observer and Position Estimator
      2. 7.6.2 Verification of Position Encoder Orientation
  9. Incremental Build Level 3
    1. 8.1 Observation One – PWM Update Latency
      1. 8.1.1 From the Expressions Window
      2. 8.1.2 From the Scope Plot
  10. Incremental Build Level 4
    1. 9.1 Observation
  11. 10Incremental Build Level 5
  12. 11Incremental Build Level 6
    1. 11.1 Integrating SFRA Library
    2. 11.2 Initial Setup Before Starting SFRA
    3. 11.3 SFRA GUIs
    4. 11.4 Setting Up the GUIs to Connect to Target Platform
    5. 11.5 Running the SFRA GUIs
    6. 11.6 Influence of Current Feedback SNR
    7. 11.7 Inferences
      1. 11.7.1 Bandwidth Determination From Closed Loop Plot
      2. 11.7.2 Phase Margin Determination From Open Loop Plot
      3. 11.7.3 Maximum Modulation Index Determination From PWM Update Time
      4. 11.7.4 Voltage Decoupling in Current Loop
    8. 11.8 Phase Margin vs Gain Crossover Frequency
  13. 12Incremental Build Level 7
    1. 12.1 Run the Code on CPU1 to Allocate ECAT to CM
    2. 12.2 Run the Code on CM to Setup ECAT
    3. 12.3 Setup TwinCAT
    4. 12.4 Scanning for EtherCAT Devices via TwinCAT
    5. 12.5 Program ControlCard EEPROM for ESC
    6. 12.6 Running the Application
  14. 13Incremental Build Level 8
    1. 13.1 Run the Code on CPU1 to Allocate ECAT to CM
    2. 13.2 Run the Code on CM to Setup ECAT
    3. 13.3 Running the Application
  15. 14References
  16. 15Revision History

Running the Application

This section deals with running the application.

  1. Verify or restore the connections if disconnected before.
  2. Reload CPU1 and CM applications
  3. Run CPU1 first and hand-off the EtherCAT peripheral to CM
  4. Run the CM next to setup the EtherCAT connection with master and IPC link with CPU1
  5. From TwinCAT window, rescan for devices, and restart TwinCAT in config mode.
    GUID-1EAEAF4D-3032-4937-931A-EEDAE989E23E-low.pngFigure 12-5 TwinCAT Restart in Config Mode Icon
  6. ECAT messages can be viewed as variables in CCS debug window. If not done already, right-click within the CCS Expressions window and choose Import. Then browse to and select fcl_f2838x_tmdxiddk_ecat_vars.txt file from the debug directory. Variables 'countMainLoop', 'dataBufferFromCM' and 'dataBuffertoCM' are used by C28x core only while 'ipcCMToCPUDataBuffer' and 'ipcCPUToCMDataBuffer' are used by both C28 and CM cores and hence can be viewed from both 'Debug' spaces.
  7. Within TwinCAT, double-click on the discovered EtherCAT box and observe that the EtherCAT slave is running in OP mode.
    GUID-92D9329B-14A7-4D19-9207-3783B9ECF525-low.pngFigure 12-6 EtherCAT Slave in OP Mode
  8. Within TwinCAT, expand the explorer to the EtherCAT box (I/O --> Devices -->Device 2 (EtherCAT) --> Box 1 (F2838x CM EtherCAT Slave(SYSTEM))) and find the various output/input mappings as shown in Figure 12-7. Double click on Box1 to get the F2838x CM slave input /output data window as shown in Figure 12-8.
    1. Select Input mapping 0 to view all the status feedback from the drive. The following are the drive parameters monitored through EtherCAT:
      1. SpeedStatus
      2. PositionStatus
      3. TorqueStatus
      4. DriveStatus
    2. Select Output mapping 0 to view and enter all the commands to the drive:
      1. DriveCommand
      2. SpeedReference
      3. PositionReference
    GUID-49D4F761-D2A8-4CC9-B51B-109833546C34-low.pngFigure 12-7 TwinCAT Solution Explorer Inputs and Outputs
    GUID-39A2C96A-EA63-4508-B217-DB861B33662D-low.gifFigure 12-8 F2838x CM EtherCAT Slave (SYSTEM) Input/Output Data
  9. This build level is a loop back example to verify the EtherCAT functionality. So, if the command data entered in a certain output mapping variable is returned back in a certain input mapping variable, it confirms the functionality of EtherCAT slave on the F2838x. The loop back association is as follows:
    1. SpeedReference --> SpeedStatus
    2. PositionReference --> PositionStatus
    3. DriveCommand --> DriveStatus
    For example, the data entered in 'SpeedReference' in output mapping should return back to show up in 'SpeedStatus' in input mapping if EtherCAT slave is functioning properly.