Radio controller motor help

Good day all,

I have been struggling with getting my motor to be controlled through RC and have been through ever every community post I can find about this topic and have made no progress. I am using the odrive 270kv motor that is running sensorless.

This is my code:

odrv0.config.enable_uart = False
odrv0.axis1.config.enable_step_dir = False
odrv0.axis1.controller.config.vel_gain = 0.05
odrv0.axis1.controller.config.vel_integrator_gain = 0.05
odrv0.axis1.controller.config.control_mode = 0
odrv0.axis1.controller.vel_setpoint = 1000
odrv0.axis1.motor.config.direction = 1
odrv0.axis1.motor.config.pole_pairs = 7
odrv0.axis1.motor.config.current_lim = 15
odrv0.axis1.sensorless_estimator.config.pm_flux_linkage = 5.51328895422 / 1860
odrv0.save_configuration()
odrv0.reboot()
odrv0.axis1.requested_state = AXIS_STATE_MOTOR_CALIBRATION
odrv0.axis1.motor.config.pre_calibrated = True
odrv0.config.gpio4_pwm_mapping.min = -200
odrv0.config.gpio4_pwm_mapping.max = 200
odrv0.config.gpio4_pwm_mapping.endpoint = odrv0.axis0.controller._remote_attributes[‘vel_setpoint’]
odrv0.axis1.requested_state = AXIS_STATE_SENSORLESS_CONTROL
odrv0.axis1.config.startup_sensorless_control = True
odrv0.save_configuration()
odrv0.reboot()

I get no errors when I dump but the motor just spins out of control even with the receiver plugged into gpio 4.

I am so lost,

Any advice is welcome

Control mode 0 is “voltage” control, which is only for gimbal motors.You’re going to want to use control_mode = CTRL_MODE_VELOCITY_CONTROL , or 2, and set the vel_setpoint = 0 to start