Hardware Setup
-
MCU:
ESP32-S3 -
Motor Driver:
DRV8305(6-PWMmode enabled) -
Motor:
BLDC/PMSM -
Encoder:
AS5048B(I2Cclock speed:100kHz) -
Current Sensing:
LowSideCurrentSense
Control Configuration
-
Control Mode: Torque control with
current_foctype -
Loop Frequency:
motor.loopFOC()running at ~1.6kHz -
Electrical Angle Alignment: Completed correctly with negligible load
-
motor.PID_current_q.P = 0.1; motor.PID_current_q.I = 80.5; motor.PID_current_q.D = 0.0; motor.LPF_current_q.Tf = 0.001; motor.PID_current_q.limit = 5.0; -
motor.PID_current_d.P = 0.1; motor.PID_current_d.I = 80.5; motor.PID_current_d.D = 0.0; motor.LPF_current_d.Tf = 0.001; motor.PID_current_d.limit = 5.0;
Problem Description
I’m experiencing significant current_q overshooting when the motor encounters obstacles.
Expected Behavior: When setting target_current_q = 1.0f as shown in the diagram as red dotted line, the measured iq_value as shown in the diagram as red solid line should remain close to the target, even under load variations.
Actual Behavior: When the motor hits an obstacle, the measured iq_value spikes well beyond the target value (see attached diagram - red line shows measured current, dotted line shows target).
Recovery Time: It takes approximately 200ms for the current to recover from the spike and return back to the target region.
Questions
-
Why is the current controller allowing such significant overshoot beyond the target
current_qvalue? -
Is the 200ms recovery time normal, or does it indicate a tuning issue?
-
What parameters should I focus on tuning to minimize this overshoot when hitting obstacles?
-
Could the 1.6kHz
loopFOCfrequency be insufficient for my application?
Additional Context
The spiking only occurs when the motor encounters sudden mechanical resistance (obstacles). Any guidance on tuning the current control loop or adjusting relevant SimpleFOC parameters would be greatly appreciated!
