This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28069M: Lab01c current sensor configuration (Motor jitter issue)

Part Number: TMS320F28069M
Other Parts Discussed in Thread: MOTORWARE

Hi,

I am trying to run Lab01c to configure my current sensor circuit on my own inverter board with the TMS320F28069MPZT.

Im using the C:\ti\motorware\motorware_1_01_00_18\sw\solutions\instaspin_foc\boards\drv8301kit_revD\f28x\f2806xF projects.

Lab01b runs perfect! Thanks to this forum!

If I set the "gMotorVars.Flag_enableSys" and "gMotorVars.Flag_Run_Identify" to 1 my Telco/Anaheim DT4260-24-055-04 Motor is jittering. In this case my bench supply which is configured to 24V and 3A current limitation has problems to provide the motor with enough current, so the voltage drops and my bench supply is switching between constant current mode and constant voltage mode. I tried lab2a and noticed nearly the same Problem, the motor takes 3A current and the motor is vibrating with a high frequency.

 

These are my settings in the user.h file:

#define USER_IQ_FULL_SCALE_FREQ_Hz                            (640)

#define USER_IQ_FULL_SCALE_VOLTAGE_V                       (24.0)  

#define USER_ADC_FULL_SCALE_VOLTAGE_V                   (59.3)       

#define USER_IQ_FULL_SCALE_CURRENT_A                       (18)  

#define USER_ADC_FULL_SCALE_CURRENT_A                   (35)    

#define USER_NUM_CURRENT_SENSORS                            (3)  

#define USER_NUM_VOLTAGE_SENSORS                            (3)

#define   I_A_offset                                                                    (0.8331743479)

#define   I_B_offset                                                                    (0.8331743479)

#define   I_C_offset                                                                    (0.8331743479)

#define   V_A_offset                                                                   (0.5020679235)

#define   V_B_offset                                                                   (0.4977650046)

#define   V_C_offset                                                                   (0.4986107945)

#define USER_SYSTEM_FREQ_MHz                                      (90.0)

#define USER_PWM_FREQ_kHz                                             (45.0)

#define USER_MAX_VS_MAG_PU                                          (0.5)   

#define USER_VD_SF                                                              (0.95)

#define USER_NUM_PWM_TICKS_PER_ISR_TICK                (3)

#define USER_NUM_ISR_TICKS_PER_CTRL_TICK                (1)     

#define USER_NUM_CTRL_TICKS_PER_CURRENT_TICK    (1)     

#define USER_NUM_CTRL_TICKS_PER_EST_TICK               (1)     

#define USER_NUM_CTRL_TICKS_PER_SPEED_TICK          (15)  

#define USER_NUM_CTRL_TICKS_PER_TRAJ_TICK             (15)  

#define USER_MAX_NEGATIVE_ID_REF_CURRENT_A         (-0.5 * USER_MOTOR_MAX_CURRENT)  

#define USER_ZEROSPEEDLIMIT                                            (0.5 / USER_IQ_FULL_SCALE_FREQ_Hz)

#define USER_MAX_ACCEL_Hzps                                            (20.0)

#define USER_MAX_ACCEL_EST_Hzps                                   (5.0)     

#define USER_IDRATED_FRACTION_FOR_RATED_FLUX     (1.0)     

#define USER_IDRATED_FRACTION_FOR_L_IDENT              (1.0)     

#define USER_IDRATED_DELTA                                               (0.00002)

#define USER_SPEEDMAX_FRACTION_FOR_L_IDENT          (1.0)

#define USER_FLUX_FRACTION                                               (1.0)           

#define USER_POWERWARP_GAIN                                          (1.0)        

#define USER_R_OVER_L_EST_FREQ_Hz                               (300)               

#define USER_VOLTAGE_FILTER_POLE_Hz                            (335.648)

#define USER_OFFSET_POLE_rps                                             (20.0)

#define USER_FLUX_POLE_rps                                                 (100.0)  

#define USER_DIRECTION_POLE_rps                                       (6.0)  

#define USER_SPEED_POLE_rps                                              (100.0)  

#define USER_DCBUS_POLE_rps                                             (100.0)

#define   USER_EST_KAPPAQ                                                  (1.5)

 

Which settings are, just for the current measurment, necessary to adjust? 

Q1: Are these user.h settings okay? (Especially USER_IQ_FULL_SCALE_CURRENT_A and USER_ADC_FULL_SCALE_CURRENT_A)

 

In the picture below is my circuit for the current measurement for each Phase.

All offset voltages comming from the OPAMPs are correct.

Q2: I forgot to place a 1000pF capacitor close to the shunt resistor. Could that be the Problem?

 


 

Q3: I accidently interchanged phase C and B to the ADC inputs. Could that be a Problem as well?  

 

                                                                                  

I also noticed, when I set the "gMotorVars.IqSet_A" to 0.001 than the Motor is running well. If I increase this value aprox. to 0.015 than I get the same Problem as mentioned before.

I hope someone can help me. Thank you in advance.

Best Regards,

Martin   

 

  • Make sure that some parameters are right based on your hardware. The USER_ADC_FULL_SCALE_CURRENT_A is (33) according to your schematic, check the sign of reading current adc in HAL_readAdcData() in hal.h, and check the pwm and current/voltage adc sequence is right in hal.c for motor phases.
  • Hi,
    I´ve got it!

    The adc-configuration in the hal.c file was incorrect. A method to check if the adc-configs fit, is to look in ADCRESULT registers.

    For completeness:
    Step 1: measure the offset voltage coming from feedback circuit (for example 1.65 V)
    Step 2: go to the register view and add the particular ADCRESULT registers to the watch window. If the program run´s they will be updated permanently.
    Step 3: Now compute the value: ADC (decimal Value) = 4096 * (1.65V / 3.3V)
    ADC (decimal Value) = 2048
    Step 4: compare the value from the particular ADCRESULT register from the watch window to the computed value. If the value is approximately in this region it should be right. If isn´t (like in my case) check the adc – configuration in the hal.c file.

    I refer to the motorware_hal_tutorial.pdf. This document describes perfectly how to make the configurations.

    Regards,

    Martin
  • OK. Let's know what's the running status if you configure the ADC properly?
  • Hey Yanming,

    What do you mean with running status? I´m confused.
    If I run lab 1c with the default values for gMotorVars.Kp_Idq = 2.515524864 and gMotorVars.IqSet_A =0.5 I still have the problem that shaft is jittering and the motor current becomes too high that the voltage of my bench supply (24V 6A) droops.

    If I adjust gMotorVars.Kp_Idq, gMotorVars.IqSet_A and gMotorVars.SpeedRef_krpm I´m able to implement that the current loop is working. If I´m decelerating the motor by hand, I can observe (bench supply) that the current consumption increases. I suppose that the hardware adjustments for the current measurement are now proper.

    Thanks for your help.

    Best regards,

    Martin
  • 1. Could you please confirm the sign of ADC reading is as below in HAL_readAdcData() in hal.h?
    _iq current_sf = HAL_getCurrentScaleFactor(handle);
    _iq voltage_sf = HAL_getVoltageScaleFactor(handle);
    2. Please check the offset is correct according to your hardware board.
    3. You may use lab01b to run your motor first, and use datalog to check the current sensing. The graph using datalog should be similar to the waveform on scope. You may also check the angle output as lab guide.
    4. Tune gMotorVars.IqSet_A, and set gMotorVars.IdSet_A to zero, the motor should run well if the current sensing is correct. And you can also tune gMotorVars.SpeedRef_krpm.