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: Problems with proj_lab01b with tms320f28069m

Part Number: TMS320F28069M
Other Parts Discussed in Thread: CONTROLSUITE, TMDSHVMTRINSPIN, MOTORWARE

Hello.

I'm trying to run proj_lab01b on custom hardware with  tms320f28069m. Actually I'm using LaunchPadXL with TMS320F28069M. I've loaded an example for hvkit_rev1p1.

I've configured USER_MOTOR == Dayton_2N865T, also I've have to add (because of errors in compilation)

#define USER_MOTOR_FREQ_LOW (5.0) // Hz - suggested to set to 10% of rated motor frequency
#define USER_MOTOR_FREQ_HIGH (50.0) // Hz - suggested to set to 100% of rated motor frequency
#define USER_MOTOR_FREQ_MAX (60.0) // Hz - suggested to set to 120% of rated motor frequency
#define USER_MOTOR_VOLT_MIN (40.0) // Volt - suggested to set to ~20% of rated motor voltage
#define USER_MOTOR_VOLT_MAX (220.0) // Volt - suggested to set to 100% of rated motor voltage

gDacData.ptrData[0] = &angle_gen.Angle_pu;
gDacData.ptrData[1] = &gPwmData.Tabc.value[0];
gDacData.ptrData[2] = &gAdcData.I.value[0];
gDacData.ptrData[3] = &gAdcData.V.value[0];

pDacData->offset[0] = _IQ(0.0);
pDacData->offset[1] = _IQ(0.5);
pDacData->offset[2] = _IQ(0.5);
pDacData->offset[3] = _IQ(0.5);

pDacData->gain[0] = _IQ(1.0);
pDacData->gain[1] = _IQ(1.0);
pDacData->gain[2] = _IQ(1.0);
pDacData->gain[3] = _IQ(1.0);

The problem when I'm running this project,  I get this:

CH1  - Angle_pu CH2 - Tabc.value[0]

Is this correct?

I've tried to run proj_lab01b for another board  - drv8312kit_revD.  It needed some changes to run with parameters for ACIM motor, and then I can see a normal graph for angle

CH1  - Angle_pu CH2 - Tabc.value[0]

Can you tell me what is wrong?

Also i've fount differences in HAL_writeDacData function for this projects. Here is for hvkit_rev1p1

static inline void HAL_writeDacData(HAL_Handle handle,HAL_DacData_t *pDacData)
{
  HAL_Obj *obj = (HAL_Obj *)handle;

  // convert values from _IQ to _IQ15
  int16_t dacValue_1 = (int16_t)_IQtoIQ15(pDacData->value[0]);
  int16_t dacValue_2 = (int16_t)_IQtoIQ15(pDacData->value[1]);
  int16_t dacValue_3 = (int16_t)_IQtoIQ15(pDacData->value[2]);
  int16_t dacValue_4 = (int16_t)_IQtoIQ15(pDacData->value[3]);

  // write the DAC data
  PWMDAC_write_CmpA(obj->pwmDacHandle[PWMDAC_Number_1],dacValue_1);
  PWMDAC_write_CmpB(obj->pwmDacHandle[PWMDAC_Number_1],dacValue_2);
  PWMDAC_write_CmpA(obj->pwmDacHandle[PWMDAC_Number_2],dacValue_3);
  PWMDAC_write_CmpA(obj->pwmDacHandle[PWMDAC_Number_3],dacValue_4);

  return;
} // end of HAL_writeDacData() function

and here is for drv8312kit_revD

static inline void HAL_writeDacData(HAL_Handle handle,HAL_DacData_t *pDacData)
{
  HAL_Obj *obj = (HAL_Obj *)handle;

  // convert values from _IQ to _IQ15
  uint_least8_t cnt;
  _iq period;
  _iq dacData_sat_dc;
  _iq value;
  uint16_t cmpValue[4];

  period = (_iq)pDacData->PeriodMax;

  for(cnt=0;cnt<4;cnt++)
  {
	  dacData_sat_dc = _IQmpy(pDacData->value[cnt], pDacData->gain[cnt]) + pDacData->offset[cnt];
	  value = _IQmpy(dacData_sat_dc, period);
	  cmpValue[cnt] = (uint16_t)_IQsat(value, period, 0);
  }

  // write the DAC data
  if(obj->pwmDacHandle[PWMDAC_Number_1])
  {
	  PWMDAC_write_CmpA(obj->pwmDacHandle[PWMDAC_Number_1], cmpValue[0]);
	  PWMDAC_write_CmpB(obj->pwmDacHandle[PWMDAC_Number_1], cmpValue[1]);
  }

  if(obj->pwmDacHandle[PWMDAC_Number_2])
  {
	  PWMDAC_write_CmpA(obj->pwmDacHandle[PWMDAC_Number_2], cmpValue[2]);
	  PWMDAC_write_CmpB(obj->pwmDacHandle[PWMDAC_Number_2], cmpValue[3]);
  }

  return;
} // end of HAL_writeDacData() function

  • Hi Andrey,

    Are you using a specific example within ControlSUITE? If so, which one (provide directory if possible)?

    Hardware wise you mention using the F28069 LaunchPad, but the HV kit solutions are meant to be run with different hardware (i.e. ControlCARD + HV system kit, like TMDSHVMTRINSPIN).

    Is this correct?

    I've tried to run proj_lab01b for another board  - drv8312kit_revD.  It needed some changes to run with parameters for ACIM motor, and then I can see a normal graph for angle

    Does the motor spin properly and smoothly when running the projects? The first waveform showing the angle does not look correct, it should be linear like the 2nd waveform for a consistent motor speed/direction.

    Best,

    Kevin

  • Of course I have controlsuite 3.4.9(and also motorware 1_01_00_18) installed, but I'm not using it. I'm importing the project to code composer studio 8.3.0. and starting  it via debug.  I don't have TMDSHVMTRINSPIN. I've looked at HV kit schematic, and I know that it has another control cars (F2803x and F2805x afair), but there is an example proj_lab01b for  hvkit for f2806x chip and I've decided to use it, of course I'm changing some hardware related  configs in HAL.  I have my custom power board that have sumilar to HV kit schematic, and I didn't try to apply main power yet, because  this situation with angle graph is unclear for me. 

  • Hi Andrey,

    Of course I have controlsuite 3.4.9(and also motorware 1_01_00_18) installed, but I'm not using it. I'm importing the project to code composer studio 8.3.0. and starting  it via debug.

    Which project from ControlSUITE or Motorware are you specifically using for your test? I understand you made some changes, but which specific project are you building off of?

    You didn't answer, when running lab01b does the motor spin smoothly? Are you able to verify the current and voltage waveforms?

    To validate that it isn't related to the DAC code can you try plotting the angle using the datalog module and the CCS graph tool?

    Best,

    Kevin

  • Hello and thanks for answer.

    Now I've checked everything again and found out some strange things.

    Tests 1, 2 performed on LaunchPadXL TMS320F28069M

    1. I've imported proj_lab01b from C:\ti\motorware\motorware_1_01_00_18\sw\solutions\instaspin_foc\boards\hvkit_rev1p1\f28x\f2806xF

    Then I've changed motor type to Marathon_5K33GN2A, also I've added for this motor, to avoid errors in compilation.

    #define USER_MOTOR_FREQ_LOW (5.0) // Hz - suggested to set to 10% of rated motor frequency
    #define USER_MOTOR_FREQ_HIGH (50.0) // Hz - suggested to set to 100% of rated motor frequency
    #define USER_MOTOR_FREQ_MAX (60.0) // Hz - suggested to set to 120% of rated motor frequency
    #define USER_MOTOR_VOLT_MIN (40.0) // Volt - suggested to set to ~20% of rated motor voltage
    #define USER_MOTOR_VOLT_MAX (220.0) // Volt - suggested to set to 100% of rated motor voltage

    Then I've compiled it, started debug and set gMotorVars.Flag_enableSys and gMotorVars.Flag_Run_Identify.

    Here is wavefroms from main owm outputs (no sin like pwm signals, but only modulation frequency)

    2. I've imported proj_lab01b from C:\ti\motorware\motorware_1_01_00_18\sw\solutions\instaspin_foc\boards\drv8312kit_revD\f28x\f2806xF

    selected the same motor and run. (also I have to bypass user_params check, because I've got USER_ErrorCode_ctrlFreq_Hz_High error, don't know why).

    Now I get correct pwm signals.

    3. I've migrated to my custom hardware, based on  TMS320F28069M, (have to add some code, for IGBT_EN signal control at startup) and tried to run small 0,55kW  380V motor. For safety reasons, I've applied only 30V DC power supply for IGBT. And now the motor runs normally at low speed. I have not controlled current and voltage waveforms yet.

    So, I don't know what is wrong with proj_lab01b from C:\ti\motorware\motorware_1_01_00_18\sw\solutions\instaspin_foc\boards\hvkit_rev1p1\f28x\f2806xF but it seems it's not working correctly.

  • Hi Andrey,

    There are quite a few differences in the parameters found in the user.h files of these two projects. If you're using the same hardware and motor for both projects there may be some parameter values you need to change in the user.h file of the hvkit_rev1p1 project. I'd suggest using a compare tool to compare the user.h files of the two projects to help identify any parameters that should be changed.

    I'd also suggest verifying some variables other than the angle using the PWMDAC and DATALOG modules, like the sensing variables.

    Best,

    Kevin