ODrive S1 & Flat bldc motor | INVALID_MOTOR_TYPE

Hi everyone,

Has anyone tried Odrive S1 with a 48V 90W flat bldc motor similar to maxon 608138 ?

The onboard hall sensors are used for feedback

When calibrated for current control, the calibration finishes, but the motor makes noises while rotating, and shows an error for a current limit at 1500 rpm. Actually lowering the velocity gains based on this post makes it work smoother, but the response is quite slow, and vibrates a lot on high rpm.

When calibrated for voltage control, the calibration fails with a procedure result INVALID_MOTOR_TYPE.

I’ve added some of the config information below

  "config.max_regen_current": 0.0,
  "config.dc_bus_undervoltage_trip_level": 10.5,
  "config.dc_bus_overvoltage_trip_level": 54.0,
  "config.dc_max_positive_current": Infinity,
  "config.dc_max_negative_current": -Infinity,
  "axis0.config.calibration_lockin.current": 1.399999976158142,
  "axis0.config.calibration_lockin.ramp_time": 0.4000000059604645,
  "axis0.config.calibration_lockin.ramp_distance": 0.5,
  "axis0.config.calibration_lockin.accel": 3.183098793029785,
  "axis0.config.calibration_lockin.vel": 6.36619758605957,
  "axis0.config.general_lockin.initial_pos": 0.0,
  "axis0.config.general_lockin.current": 10.0,
  "axis0.config.general_lockin.ramp_time": 0.4000000059604645,
  "axis0.config.general_lockin.ramp_distance": 3.1415927410125732,
  "axis0.config.general_lockin.accel": 20.0,
  "axis0.config.general_lockin.vel": 40.0,
  "axis0.config.general_lockin.finish_distance": 100.0,
  "axis0.config.general_lockin.finish_on_vel": false,
  "axis0.config.general_lockin.finish_on_distance": false,
  "axis0.config.load_encoder": 8,
  "axis0.config.commutation_encoder": 8,
  "axis0.config.encoder_bandwidth": 100.0,
  "axis0.config.motor.motor_type": 2,
  "axis0.config.motor.pole_pairs": 8,
  "axis0.config.motor.phase_resistance": 3.61,
  "axis0.config.motor.phase_inductance": 1.6e-3,
  "axis0.config.motor.phase_resistance_valid": true,
  "axis0.config.motor.phase_inductance_valid": true,
  "axis0.config.motor.torque_constant": 0.0786,
  "axis0.config.motor.direction": 1.0,
  "axis0.config.motor.current_control_bandwidth": 100.0,
  "axis0.config.motor.wL_FF_enable": false,
  "axis0.config.motor.bEMF_FF_enable": false,
  "axis0.config.motor.dI_dt_FF_enable": false,
  "axis0.config.motor.ff_pm_flux_linkage": 0.0,
  "axis0.config.motor.ff_pm_flux_linkage_valid": false,
  "axis0.config.motor.motor_model_l_d": 0.0,
  "axis0.config.motor.motor_model_l_q": 0.0,
  "axis0.config.motor.motor_model_l_dq_valid": false,
  "axis0.config.motor.calibration_current": 0.8999999761581421,
  "axis0.config.motor.resistance_calib_max_voltage": 6.0,
  "axis0.config.motor.current_soft_max": 1.5,
  "axis0.config.motor.current_hard_max": 2.5,
  "axis0.config.motor.current_slew_rate_limit": 10000.0,
  "axis0.config.motor.fw_enable": false,
  "axis0.config.motor.fw_mod_setpoint": 0.6103333234786987,
  "axis0.config.motor.fw_fb_bandwidth": 500.0,
  "axis0.controller.config.enable_vel_limit": true,
  "axis0.controller.config.enable_torque_mode_vel_limit": true,
  "axis0.controller.config.enable_gain_scheduling": false,
  "axis0.controller.config.gain_scheduling_width": 0.0010000000474974513,
  "axis0.controller.config.enable_overspeed_error": true,
  "axis0.controller.config.control_mode": 2,
  "axis0.controller.config.input_mode": 2,
  "axis0.controller.config.pos_gain": 20.0,
  "axis0.controller.config.vel_gain": 5.333333492279053,
  "axis0.controller.config.vel_integrator_gain": 0.3333333432674408,
  "axis0.controller.config.vel_integrator_limit": Infinity,
  "axis0.controller.config.vel_limit": 90.0,
  "axis0.controller.config.vel_limit_tolerance": 1.2000000476837158,
  "axis0.controller.config.vel_ramp_rate": 20.0,
  "axis0.controller.config.torque_ramp_rate": 0.009999999776482582,
  "axis0.controller.config.circular_setpoints": false,
  "axis0.controller.config.circular_setpoint_range": 1.0,
  "axis0.controller.config.absolute_setpoints": false,
  "axis0.controller.config.use_commutation_vel": false,
  "axis0.controller.config.use_load_encoder_for_commutation_vel": false,
  "axis0.controller.config.commutation_vel_scale": 1.0,
  "axis0.controller.config.steps_per_circular_range": 1024,
  "axis0.controller.config.homing_speed": 0.25,
  "axis0.controller.config.inertia": 0.0,
  "axis0.controller.config.input_filter_bandwidth": 20.0,

When calibrated for voltage control, the calibration fails with a procedure result INVALID_MOTOR_TYPE.

Guessing this is because you’re trying to run motor calibration – in PMSM_VOLTAGE_CONTROL, it relies on the provided phase resistance/inductance. Note the ODrive uses phase-neutral measurements, the 3.61ohm you provided is phase-phase – phase-neutral will be 3.61/2 = 1.805ohm.

That being said, you definitely want to be running this motor in current control (the default), your main issue is just that hall sensors are very very low resolution, so velocity control is going to intrinsically be less accurate. I’d say your vel gain and vel integrator gain are much higher than I’d expect to be stable for this motor with hall sensors, it may be worth retuning those.

Yeah, I read on other posts that the velocity gains need to be low for this type of motors but I didn’t expect the need to be much lower. Thanks for providing the tune guide.