Other Parts Discussed in Thread: DRV8301, DRV8323, MOTORWARE, DRV8305-Q1EVM, CCSTUDIO
Tool/software: Code Composer Studio
Having some trouble bringing up a custom board, maybe someone can spot a dumb mistake. Exactly the same board, but with a STM32 MCU was used before pretty successfully. In fact after many tries with different user.h parameters, motor did turn in learn mode, so it seems that the problem is probably is in the code somewhere. The first thing that goes wrong is this message - "Device may be operating in low-power mode error", which appears just after I check the 'Run' checkbox, after that all the values goes crazy, but the board still runs through the learn procedure and turn the motor (not every time). With current config after several seconds it just hangs somewhere though. Tried to attach a debugger after that, but with no luck, some address outside of the source code was shown, probably incorrect. I though that it is a JTAG connection issue, shortened the wires to just 5cm, didn't help. And connection test in project properties runs just fine. Not sure if this is supposed to be like that, but it seems that MCU is not running on itself after power on, with both linker scripts, Debug in CCS and GUI Composer loads the firmware just fine. Also GUI Composer works for a long time if I do not check the Run checkbox.
Here are the numbers changed from drv8301_kit example code, which uses the same MCU:
#define USER_IQ_FULL_SCALE_VOLTAGE_V (32) #define USER_ADC_FULL_SCALE_VOLTAGE_V (33) #define USER_IQ_FULL_SCALE_CURRENT_A (55) #define USER_ADC_FULL_SCALE_CURRENT_A (55) #define I_A_offset (0.0) #define I_B_offset (0.0) #define I_C_offset (0.0) #define V_A_offset (0.0) #define V_B_offset (0.0) #define V_C_offset (0.0) #define USER_SYSTEM_FREQ_MHz (60.0) #define USER_PWM_FREQ_kHz (45.0) #define USER_NUM_PWM_TICKS_PER_ISR_TICK (1) #define USER_NUM_PWM_TICKS_PER_ISR_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_MOTOR_Rs (0.0) #define USER_MOTOR_Ls_d (0.0) #define USER_MOTOR_Ls_q (0.0) #define USER_MOTOR_RATED_FLUX (0.0) #define USER_MOTOR_MAGNETIZING_CURRENT (NULL) #define USER_MOTOR_RES_EST_CURRENT (4.0) #define USER_MOTOR_IND_EST_CURRENT (-2.0) #define USER_MOTOR_MAX_CURRENT (15.0) #define USER_MOTOR_FLUX_EST_FREQ_Hz (88.0)
I've copied the aforementioned drv8301 example project and changed the GPIO mappings, removed DRV8301 initialization, added DRV8323RS related code, changed TZ pin config and ADC mappings. Here are the project config:
MCU schematics:
The actual P/N is TMS320F28054MPNQ.
3mR shunts are used, and DRV8323RS is in default config, (20V/V gain, other parameters should not matter in this case).