I was able to setup my hoverboard motor for M1.
My setup as below
In [25]: dev0.axis1.motor
Out[25]:
DC_calib_phA: 1.317206859588623 (float)
DC_calib_phB: -0.8186456561088562 (float)
DC_calib_phC: -0.4985051453113556 (float)
I_bus: 1.06131911277771 (float)
config:
I_bus_hard_max: inf (float)
I_bus_hard_min: -inf (float)
I_leak_max: 0.10000000149011612 (float)
R_wL_FF_enable: False (bool)
acim_autoflux_attack_gain: 10.0 (float)
acim_autoflux_decay_gain: 1.0 (float)
acim_autoflux_enable: False (bool)
acim_autoflux_min_Id: 10.0 (float)
acim_gain_min_flux: 10.0 (float)
bEMF_FF_enable: False (bool)
calibration_current: 10.0 (float)
current_control_bandwidth: 100.0 (float)
current_lim: 10.0 (float)
current_lim_margin: 8.0 (float)
dc_calib_tau: 0.20000000298023224 (float)
inverter_temp_limit_lower: 100.0 (float)
inverter_temp_limit_upper: 120.0 (float)
motor_type: 0 (uint8)
phase_inductance: 0.00022225403517950326 (float)
phase_resistance: 0.164923295378685 (float)
pole_pairs: 52 (int32)
pre_calibrated: True (bool)
requested_current_range: 25.0 (float)
resistance_calib_max_voltage: 4.0 (float)
torque_constant: 0.515999972820282 (float)
torque_lim: inf (float)
current_control:
I_measured_report_filter_k: 1.0 (float)
Ialpha_measured: 0.4154595136642456 (float)
Ibeta_measured: 10.034153938293457 (float)
Id_measured: 0.06779196858406067 (float)
Id_setpoint: 0.0 (float)
Iq_measured: 10.024621963500977 (float)
Iq_setpoint: 10.0 (float)
Vd_setpoint: 0.0 (float)
Vq_setpoint: 0.0 (float)
final_v_alpha: 0.10449008643627167 (float)
final_v_beta: 1.6750462055206299 (float)
i_gain: 16.49233055114746 (float)
p_gain: 0.022225404158234596 (float)
phase: -0.020852088928222656 (float)
phase_vel: 0.0 (float)
power: 25.193851470947266 (float)
v_current_control_integral_d: 0.07110793888568878 (float)
v_current_control_integral_q: 1.677383542060852 (float)
current_meas_phA: 0.2547496557235718 (float)
current_meas_phB: 8.471807479858398 (float)
current_meas_phC: -8.726564407348633 (float)
effective_current_lim: 10.0 (float)
error: 0 (uint64)
fet_thermistor:
config: ...
temperature: 32.67342758178711 (float)
is_armed: True (bool)
is_calibrated: True (bool)
last_error_time: 0.0 (float)
max_allowed_current: 30.375 (float)
max_dc_calib: 3.0375001430511475 (float)
motor_thermistor:
config: ...
temperature: 0.0 (float)
n_evt_current_measurement: 103708 (uint32)
n_evt_pwm_update: 103711 (uint32)
phase_current_rev_gain: 0.012500000186264515 (float)
The encoder setup is as below
In [26]: dev0.axis1.encoder
Out[26]:
calib_scan_response: 0.0 (float)
config:
abs_spi_cs_gpio_pin: 1 (uint16)
bandwidth: 350.0 (float)
calib_range: 0.019999999552965164 (float)
calib_scan_distance: 520.0 (float)
calib_scan_omega: 12.566370964050293 (float)
cpr: 312 (int32)
direction: 1 (int32)
enable_phase_interpolation: True (bool)
find_idx_on_lockin_only: False (bool)
hall_polarity: 0 (uint8)
hall_polarity_calibrated: True (bool)
ignore_illegal_hall_state: False (bool)
index_offset: 0.0 (float)
mode: 1 (uint16)
phase_offset: 254 (int32)
phase_offset_float: 0.5199145674705505 (float)
pre_calibrated: True (bool)
sincos_gpio_pin_cos: 4 (uint16)
sincos_gpio_pin_sin: 3 (uint16)
use_index: False (bool)
use_index_offset: True (bool)
count_in_cpr: 2 (int32)
delta_pos_cpr_counts: -5.605193857299268e-45 (float)
error: 0 (uint16)
hall_state: 2 (uint8)
index_found: False (bool)
interpolation: 0.5 (float)
is_ready: True (bool)
phase: -0.020852088928222656 (float)
pos_abs: 0 (int32)
pos_circular: 0.009337152354419231 (float)
pos_cpr_counts: 2.913195848464966 (float)
pos_estimate: 0.00933716632425785 (float)
pos_estimate_counts: 2.913195848464966 (float)
set_linear_count(obj: object_ref, count: int32)
shadow_count: 2 (int32)
spi_error_rate: 0.0 (float)
vel_estimate: 0.0 (float)
vel_estimate_counts: 0.0 (float)
I see no errors and when tried to turn the motor by entering
dev0.axis1.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL
dev0.axis1.controller.input_vel = 2
The motor turns quite fast then stop working.
After this motor returns error as below
error: 16777216 (uint64)
What am I doing wrong?
Any suggestions?