I’ve found some spare time to do some testing.
Summary: ESP32 + DRV8302 + AMT102-V + DX2205-2300kv BLMotor.
esp32 is the common devkit, also known as wroom-32.
AMT102 is set at 512 ppr, and powered from VIN pin (5vdc)
Since this motor becomes neatly hot, I’m powering from a lab unit, set at 12V - max 5A.
// DRV8302 pins connections
#define INH_A 25
#define INH_B 26
#define INH_C 27
#define EN_GATE 14
#define M_PWM 18
#define M_OC 19
#define OC_ADJ 21
// AMT102
#define EN_A_pin 23
#define EN_B_pin 22
#define EN_X_pin 5
// motor instance
BLDCMotor motor = BLDCMotor(INH_A, INH_B, INH_C, 7, EN_GATE);
// encoder instance
Encoder encoder = Encoder(EN_A_pin, EN_B_pin, 512, EN_X_pin);
// Settings:
motor.voltage_power_supply = 12;
motor.voltage_sensor_align = 0.5;
motor.velocity_index_search = 3;
motor.PID_velocity.P = 0.01;
motor.PID_velocity.I = 1.0;
motor.voltage_limit = 2.0;
motor.PID_velocity.output_ramp = 50;
motor.P_angle.P = 1.0;
motor.velocity_limit = 50;
RESULT:
With these pin and settings there is a good calibration and in 10 tries no reset loop (guru meditation).
but sometimes, in position mode, after being still in a position for 3-5 seconds, it suddenly try to go somewhere at exagerate speed, asking for exagerate Current (my lab unit clamp it at 5A…) and I can only reset the board to stop it…