SPRACO3 October 2019 INA240 , LMG5200 , TMS320F280021 , TMS320F280021-Q1 , TMS320F280023 , TMS320F280023-Q1 , TMS320F280023C , TMS320F280025 , TMS320F280025-Q1 , TMS320F280025C , TMS320F280025C-Q1 , TMS320F280040-Q1 , TMS320F280040C-Q1 , TMS320F280041 , TMS320F280041-Q1 , TMS320F280041C , TMS320F280041C-Q1 , TMS320F280045 , TMS320F280048-Q1 , TMS320F280048C-Q1 , TMS320F280049 , TMS320F280049-Q1 , TMS320F280049C , TMS320F280049C-Q1 , TMS320F28374D , TMS320F28374S , TMS320F28375D , TMS320F28375S , TMS320F28375S-Q1 , TMS320F28376D , TMS320F28376S , TMS320F28377D , TMS320F28377D-EP , TMS320F28377D-Q1 , TMS320F28377S , TMS320F28377S-Q1 , TMS320F28378D , TMS320F28378S , TMS320F28379D , TMS320F28379D-Q1 , TMS320F28379S
While running the motor in this build level and subsequent build levels, observe the variable 'motorVars[0].fcl_LatencyInMicroSec' in the Expressions window. Figure 26 shows a snapshot of the Expressions window.
This variable indicates the amount of time elapsed between the feedback sampling and PWM updating. The elapsed time, or latency, is computed based on the count of the EPWM timer right after the PWM update. The value shown here is more than the actual update time by a few clock cycles. Immediately after setting the 'motorVars[0].runMotor' to MOTOR_RUN and the motor begins to run, the latency time shows up as nearly 1.25µS due to initial setup in the code. This amount of latency occurs at a time when the duty cycle is moderate and is therefore acceptable. After this period, you can refresh the latency time by setting 'motorVars[0].fclClrCntr' to 1. Regardless of SAMPLING_METHOD, latency remains the same for a given FCL_CNTLR. (see the following note).
NOTE
Do the same test on motor 2 by working with structure variable motorVars[1],Figure 27 shows a snapshot of the Expressions window during the motor 1 and motor 2 run simultaneously.