Associate III
June 13, 2022
Question
Ramp current too high
- June 13, 2022
- 3 replies
- 1581 views
My ramp cranks current up to my max within 5 pwm cycles. I'm traced it down to STC_CalcTorqueReference, it calculates some increment value. I assume that's the issue. the math works out but something is wrong here.
This is a custom power stage and I have gone over every part of the config, i've tested the current sensors and confirmed they match the configuration calculations. Would appreciate any suggestions where to look next. I understand the shunt / gain is weird, and they will be changed in the next rev but the value does come back correct (if a bit noisy)
#define THREE_SHUNT
#define RSHUNT 0.003
#define AMPLIFICATION_GAIN 200.0/***************** MOTOR ELECTRICAL PARAMETERS ******************************/
#define POLE_PAIR_NUM 7 /* Number of motor pole pairs */
#define RS 0.63 /* Stator resistance , ohm*/
#define LS 0.000042 /* Stator inductance, H
For I-PMSM it is equal to Lq */
#define NOMINAL_CURRENT 8579
#define MOTOR_MAX_SPEED_RPM 15000 /*!< Maximum rated speed */
#define MOTOR_VOLTAGE_CONSTANT 0.6 /*!< Volts RMS ph-ph /kRPM */
#define ID_DEMAG -8579 /*!< Demagnetization current *//* Phase 1 */
#define PHASE1_DURATION 1000 /*milliseconds */
#define PHASE1_FINAL_SPEED_UNIT (0*SPEED_UNIT/U_RPM)
#define PHASE1_FINAL_CURRENT 8579
/* Phase 2 */
#define PHASE2_DURATION 6000 /*milliseconds */
#define PHASE2_FINAL_SPEED_UNIT (2814*SPEED_UNIT/U_RPM)
#define PHASE2_FINAL_CURRENT 8579The plot attached is my phase B low side (yellow) and Bus Current (red).
Appreciate any where i can go to look.
