Part Number: TMDSHVMTRINSPIN
Other Parts Discussed in Thread: MOTORWARE, DRV8312, , TEST2
I use F28069M control card.
Lab 1 - done, fine.
Lab 1b
Stuck at the beggining. As recommended I try to make 4 DACPWM signals with code:
// set DAC parameters
gDacData.ptrData[0] = &gPwmData.Tabc.value[0];
gDacData.ptrData[1] = &gPwmData.Tabc.value[1];
gDacData.ptrData[2] = &gPwmData.Tabc.value[2];
gDacData.ptrData[3] = &gAdcData.V.value[0];
HAL_setDacParameters(halHandle, &gDacData);
// set PWMDAC parameters for each channel to ensure the output waveform void HAL_setDacParameters(HAL_Handle handle, HAL_DacData_t *pDacData) {
HAL_Obj *obj = (HAL_Obj *)handle;
pDacData->PeriodMax = PWMDAC_getPeriod(obj->pwmDacHandle[PWMDAC_Number_1]);
pDacData->offset[0] = _IQ(0.5);
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);
} // end of HAL_setDacParameters() function
BTW in pdf offset[2] and [3] are 0.5, but in motorware lab they are 0. Tried both values - no changes.
When I start debugging I can see 6 main PWM signals using oscilloscope at U11,U13,U15 pins 7,3.
Signals duration changing from 26 to 37 us (PWM), period 66 us (think this is fine).
What I see at pins U5 pins 1,3 DAC_PWM 3.3V most of the time, and some PWM pulses changing from 100% to 0% and back to 100%, 11.5 us period.
At pins 1,3 U7 - always zero, according to sch. U7 connected to PWM7 but in
hal.c (comes with motorware lab)
// initialize PWM DAC handles
obj->pwmDacHandle[0] = PWMDAC_init((void *)PWM_ePWM6_BASE_ADDR,sizeof(PWM_Obj));
obj->pwmDacHandle[1] = PWMDAC_init((void *)PWM_ePWM5_BASE_ADDR,sizeof(PWM_Obj));
obj->pwmDacHandle[2] = PWMDAC_init((void *)PWM_ePWM4_BASE_ADDR,sizeof(PWM_Obj));
DacHandlers use 4, 5, 6 pwm, so I suppose this is right that I see nothing.
As said in the example output waveforms captured using DRV8312_RevD kit, but I suppose there shouldn't be such difference.
Tried part 2 of the lab using datalog module, still strange results. What can be wrong with PWM_DAC?