SPRAD20 March   2022 AM2631 , AM2631-Q1 , AM2632 , AM2632-Q1 , AM2634 , AM2634-Q1

 

  1.   Trademarks
  2. 1Introduction
  3. 2A Step-by-Step Guide to Running a Traction Inverter
    1. 2.1 Create Real Time Debug Interface
      1. 2.1.1 Confirm CCS Features
      2. 2.1.2 Create Target Configuration File
      3. 2.1.3 Add Serial Command Monitor Software
      4. 2.1.4 Launch Real Time Debug
    2. 2.2 Configure Control Peripheral and ADC Interrupt With Sysconfig
      1. 2.2.1 Generate PWM for Time Reference
      2. 2.2.2 Synchronize ADC Sampling and Interrupt Service Routine
      3. 2.2.3 Configure DMA for Resolver Excitation via DAC
    3. 2.3 Configure Gate Driver Interface With MSPI
      1. 2.3.1 Confirm Control Card Hardware Configuration for Gate Drivers
      2. 2.3.2 Configure MCSPI for UCC5870 Gate Drivers
      3. 2.3.3 Initialize UCC5870 Gate Drivers
    4. 2.4 Get Samples From ADC and Read Samples Via CCS
      1. 2.4.1 Register and Enable Interrupt
      2. 2.4.2 Add Log Code to Read Samples in Graph at Fixed Rate
      3. 2.4.3 Read ADC Samples in Expression and Graph Windows
    5. 2.5 Generate Space Vector PWM and Drive Motor in Open Loop
      1. 2.5.1 Setup SVPWM Generator Inputs
      2. 2.5.2 Read SVPWM Duty Cycles in Graph Window
      3. 2.5.3 Power Up Inverter and Spin Motor in Open Loop
    6. 2.6 Close Current Loop With Mock Speed
      1. 2.6.1 Add Transformations and Read Id-Iq in Open Loop
      2. 2.6.2 Add Controllers to Close Current Loop
      3. 2.6.3 Read Id-Iq to Close Current Loop
    7. 2.7 Add Software Resolver to Digital Converter
      1. 2.7.1 Generate Excitation for Resolver Hardware
      2. 2.7.2 Add Resolver Software
      3. 2.7.3 Read Resolver Software Outputs
    8. 2.8 Close Speed Loop With Rotor Speed
      1. 2.8.1 Add Speed Loop Controllers
      2. 2.8.2 Add Speed Loop Demo Program
      3. 2.8.3 Read Motor Speed from Graph Window
  4. 3A Brief Guide to Code Migration
    1. 3.1 SoC Architecture Overview
    2. 3.2 SDK Resources Overview
    3. 3.3 Code Migration From AM24
    4. 3.4 Code Migration From C28
  5. 4Summary
  6. 5References

Generate Excitation for Resolver Hardware

In Section 2.2.3, EDMA is configured to transfer data every EPWM7 SOCA event. To specify more details on the transfer, the function in the following line 1 is defined to initialize the EDMA with the location of data, size of data, and the location of DAC value register. To update the details, the function in the following line 2 is defined to change content of EDMA input table and DAC excitation output.

  • uint16_t RDCexc_start(uint16_t *table, uint16_t table_size, EDMA_Handle dma_handle, uint32_t dma_ch, uint32_t dac_base)
  • uint16_t RDCexc_update(uint16_t *table, uint16_t table_size, EDMA_Handle dma_handle, uint32_t dma_ch, uint32_t dac_base)

RDCexc_start should be called before control loop running, and RDCexc_update could be called while control loop running. The purpose of RDCexc_update is to reduce misalignment between excitation phase and sample time. Excitation phase can be adjusted by shifting the pointer of the input table before calling RDCexc_update. Examples are given in the following lines for both functions.

  1. RDCexc_start(gRDCtable_ptr,20,gEdmaHandle[0],DMA_TRIG_XBAR_EDMA_MODULE_0,CONFIG_DAC0_BASE_ADDR);
  2. RDCexc_update(gRDCtable_ptr,20,gEdmaHandle[0],DMA_TRIG_XBAR_EDMA_MODULE_0,CONFIG_DAC0_BASE_ADDR);

One element of a table in global scope is connected to gRDCtable_ptr. The table contains points of multiple full sine wave cycles. The element is in middle of the table so that the pointer can be shifted either right or left for excitation phase adjustment during operation. There are 20 points within one cycle. So, the length of EDMA input table is 20. EDMA handle, XBAR information and DAC address are available in configuration files.

It is worth attention that there could be pin mismatches in DAC channels between TIDM-02009 mother board and some versions of AM263x control cards. The workaround is to solder a blue wire on the mother board between resolver board excitation pin and DAC-A pin. The mother board top view is given in Figure 2-42 and the connection is shown in Figure 2-43.

GUID-20220308-SS0I-NSQH-VQKG-DX7WKC25KRR9-low.png Figure 2-42 Mother Board Top View
GUID-20220308-SS0I-76ZW-LXRN-QBT6KSF2JP7M-low.png Figure 2-43 Mother Board Blue Wire for Resolver Excitation and DAC-A