SPRAD24 august   2023 AM2631 , AM2632 , AM2632-Q1 , AM2634 , AM2634-Q1

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
    1. 1.1 Key System Specifications
  5. 2AM263x Overview
    1. 2.1 AM263x Control Card and Traction System Framework
  6. 3Guide to Running TIDM-02014 Traction Inverter
    1. 3.1 Software Set-up
      1. 3.1.1 Code Composer Studio Project
      2. 3.1.2 Software Structure
    2. 3.2 Create Real Time Debug Interface
      1. 3.2.1 Confirm CCS Features
      2. 3.2.2 Create Target Configuration File
      3. 3.2.3 Add Serial Command Monitor Software
      4. 3.2.4 Launch Real Time Debug
    3. 3.3 Running the Code
      1. 3.3.1 Project Setup
      2. 3.3.2 Running the Application
    4. 3.4 Get Samples From ADC and Read Samples Through CCS
      1. 3.4.1 Register and Enable Interrupt
      2. 3.4.2 Add Log Code to Read Samples in Graph at Fixed Rate
      3. 3.4.3 Read ADC Samples in Expression and Graph Windows
    5. 3.5 Generate Space Vector PWM and Drive Motor in Open Loop
      1. 3.5.1 Setup SVPWM Generator Inputs
      2. 3.5.2 Read SVPWM Duty Cycles in Graph Window
      3. 3.5.3 Power Up Inverter and Spin Motor in Open Loop
    6. 3.6 Close Current Loop With Mock Speed
      1. 3.6.1 Add Transformations and Read Id-Iq in Open Loop
      2. 3.6.2 Add Controllers to Close Current Loop
      3. 3.6.3 Read Id-Iq to Close Current Loop
    7. 3.7 Add Software Resolver to Digital Converter
      1. 3.7.1 Generate Excitation for Resolver Hardware
      2. 3.7.2 Add Resolver Software
      3. 3.7.3 Read Resolver Software Outputs
  7. 4Brief Guide to Code Migration
    1. 4.1 SDK Resources Overview
    2. 4.2 Code Migration From C28
    3. 4.3 Code Migration From AM24
  8. 5Summary
  9. 6References

Read ADC Samples in Expression and Graph Windows

ADC samples are read by the following lines 1 to 8 for 3-phase current, resolver sin/cos, and DC bus voltage. The SDK API is wrapped into Macros in one file. Couple simple Ctrl + left click on the variable name will help find the location where is defined. Example are given in lines 9 and 10. ADC_readResult is to read ADC result and ADC_readPPBResult is to read ADC result after Post Processing Blocks. Details on Post Processing Blocks can be find in Technical Reference Manual.

  1. motor1.I_abc_A[0] = (float32_t)IFBU_PPB;
  2. motor1.I_abc_A[1] = (float32_t)IFBV_PPB;
  3. motor1.I_abc_A[2] = (float32_t)IFBW_PPB;
  4. resolver1.sin_samples[0] = (float32_t)R_SIN1;
  5. resolver1.sin_samples[1] = (float32_t)R_SIN2;
  6. resolver1.cos_samples[0] = (float32_t)R_COS1;
  7. resolver1.cos_samples[1] = (float32_t)R_COS2;
  8. motor1.dcBus_V = (float32_t)VDC_EVT;
  9. ADC_readResult(CSL_CONTROLSS_ADC1_RESULT_U_BASE, ADC_SOC_NUMBER0)
  10. ADC_readPPBResult(CSL_CONTROLSS_ADC1_RESULT_U_BASE, ADC_PPB_NUMBER1)

To show an example on reading and plotting ADC in graph window, the log pointers are connected to 3-phase currents and log functions are called. Phase A current at no load is plotted into graph window by right clicking the gLog_CH[7] in expression window and selecting graph as shown in Figure 3-18. In this case, Phase A current is pointed to gLog_CH[7] as shown in the following list. It could be assigned to any log channel. To add gLog_CH into expression window, it is simply right clicking and adding to watch expression. More details can be found in CCS tutorial.

  1. gLog_ptr[7] = &motor1.I_abc_A[0];
  2. gLog_ptr[8] = &motor1.I_abc_A[1];
  3. gLog_ptr[9] = &motor1.I_abc_A[2];
GUID-20220308-SS0I-VSGC-91NV-K1C0Q5XS7VWC-low.pngFigure 3-18 Plotted Phase A Current at No Load

During bring up of the system at low voltage, it is recommended to calibrate the offset of the DC bus voltage feedback, as there may be an offset voltage of 10-20 V due to the large measurement scale.