Hi all,
During calibration, my motor ( D5065 270KV) snaps really fast and loud to some positions… (It sometimes also results in me having to reset the odrive)
Please see this video:
video of motor during calibration
Is this normal behaviour during calibration? I am currently using the following:
//motor_calibration
void Calibrate0() {
char c = '0';
int motornum = c-'0';
int requested_state;
requested_state = ODriveArduino::AXIS_STATE_MOTOR_CALIBRATION;
Serial << "Axis" << c << ": Requesting state " << requested_state << '\n';
odrive.run_state(motornum, requested_state, true);
requested_state = ODriveArduino::AXIS_STATE_ENCODER_INDEX_SEARCH;
Serial << "Axis" << c << ": Requesting state " << requested_state << '\n';
odrive.run_state(motornum, requested_state, true);
requested_state = ODriveArduino::AXIS_STATE_ENCODER_OFFSET_CALIBRATION;
Serial << "Axis" << c << ": Requesting state " << requested_state << '\n';
odrive.run_state(motornum, requested_state, true);
requested_state = ODriveArduino::AXIS_STATE_CLOSED_LOOP_CONTROL;
Serial << "Axis" << c << ": Requesting state " << requested_state << '\n';
odrive.run_state(motornum, requested_state, false); // don't wait
//odrive.TrapezoidalMove(0, 0.0f);
}
I am also using the following parameters
// Setting parameters
odrive_serial << "w axis0.encoder.config.cpr " << 8192 << '\n'; //amount of counts of encoder
odrive_serial << "w axis0.controller.config.vel_limit " << 10000.0f << '\n'; //this is counts/s
odrive_serial << "w axis0.controller.config.control_mode " << 3.0f << '\n'; //control mode
odrive_serial << "w axis0.controller.config.input_mode " << 5.0f << '\n'; // input mode trap trajectory
odrive_serial << "w axis0.motor.config.current_lim " << 20.0f << '\n'; //max is 60A
odrive_serial << "w axis0.motor.config.calibration_current " << 10.0f << '\n'; //to increase torque during calibration? //see https://docs.odriverobotics.com/api/odrive.motor.error
odrive_serial << "w axis0.motor.config.pole_pairs " << 7 << '\n';
odrive_serial << "w axis0.motor.config.torque_constant " << 0.0306f << '\n';
odrive_serial << "w axis0.trap_traj.config.vel_limit " << 4000.0f << '\n'; // some values chosen after some trail and error
odrive_serial << "w axis0.trap_traj.config.accel_limit " << 200.0f << '\n';// some values chosen after some trail and error
odrive_serial << "w axis0.trap_traj.config.decel_limit " << 200.0f << '\n';// some values chosen after some trail and error
my next plan was to try and do the tuning as described here but I currently don’t know if I’m on the right track anymore…