ODriveでBLDCモーターの制御 #04 ASCII Protocol


ODriveの動作には、CANやRC PWMなどの他、UARTを使ったバイナリで通信するNative Protocolと、アスキーコードで通信通信するASCII Protocolの二種類のシリアル通信用プロトコルがあります。

仕様書をざっと見ても、更に名前からも分かる通り、ASCII Protocolの方が1回の命令のパケット長が長く、高速に通信するならNative Protocolの方が良いのでしょう。

これからロボットを自作しようという話なので、SDKかサンプルプログラムを期待するわけですが、ODriveはサンプルもツールも全部pythonで作られています。python好きなら良かったのですが、どうもpythonに抵抗があるので、どうしてもC++で書き直したいところです。

ちょうど、前回触ったArduino( C++ )がasciiプロトコルのライブラリになっているため、こちらをそのままVisualC++/MFCのプロジェクトに放り込んでみます。

接続は、ODriveオンボードのUSBではなく、GPIOのUARTにUSB-TTL変換ケーブルを使って接続しました。

ODriveオンボードのUSBの場合、ODriveの電源を落とすとシリアルポートもPC上から消えてしまうのですが、変換機を使えばポートは残るので便利かなーという理由です。あと、元になったソースがArduinoライブラリなので接続を揃えたかったというのもありますね。
GPIO1,2にTxDとRxDを接続し、GND同士を結線すれば、3本繋いで接続は完了です。

接続が出来れば、実際に通信です。アスキープロトコル、非常に簡単でした。

例えば位置制御で、「axis0のモーターを2回転回転させる。速度とトルクは指定なし」の場合は下記のコマンドを送ります。小数点は省略できます。

p 0 -2 0 0[LF]

パラメータ1つめがモーターID、2,3,4はそれぞれ、位置・速度・トルクになります。floatで少数で送ってもいいし、整数で送ってもいいです。
実際、数値を変えながら連続して送ると、モーターが回ります。

また、パラメータの書き込みの場合は、例えば「axis0の速度リミットを1000回転/秒に設定する」だと・・・

w axis0.controller.config.vel_limit 1000.0[LF]

です。
ただ、設定の場合、返り値がないのが、不安なところです。

なので、書き込んだパラメータを読み取ってみます。
例えば「axis0の速度リミットの設定値を読み取る」だと・・・

r axis0.controller.config.vel_limit[LF]

になります。送るとODriveから、値のみが文字で帰ってきます。
受け取った文字列を、atoiやatofで変換すればOKです。

帰ってきた値が設定した値になっていれば、設定がうまくいったことが分かりますね。

Native Protocolの方にはCRCなどもあるようですが、ASCII Protocolには、チェックサムやエラー処理はないので、そのあたりは割り切って使うしかないようです。ここはASCII Protocolの不安ポイントですね。

さて、これらを使って、簡単にアプリを作ってみました。

ODriveのお作法ですが、電源投入から「フルキャリブレーション」→「クローズドループ」→「ひたすら位置を送信」、という手順で動作させます。

ついでに、パラメータの読み書きが出来るので、動作中のパラメータを吐き出して、グラフ化することも可能です。

ASCII Protocolに関しては、すごく素直な感じで、サクッと実装出来ました。

あとはパラメータの読み書きが出来るので、初期設定もGUIで作っちゃったら便利かなーと思ったのですが・・・

パラメータがどうなってるのが、Odrivetoolで、全容を吐き出して、その多さに愕然としております。とりあえず、せっかく吐き出したので、忘備録として張り付けておきます。(実際の設定値は参考にならないので注意!)

とりあえず、よく使うパラメータだけ設定出来るツールにしよう(^^;A

ODriveのパラメータ・変数・関数一覧

  • odrv0:
    • vbus_voltage = 12.598169326782227 (float)
    • ibus = 0.0 (float)
    • ibus_report_filter_k = 1.0 (float)
    • serial_number = ●●●●●●●●●●●● (int)
    • hw_version_major = 3 (int)
    • hw_version_minor = 6 (int)
    • hw_version_variant = 56 (int)
    • fw_version_major = 0 (int)
    • fw_version_minor = 5 (int)
    • fw_version_revision = 1 (int)
    • fw_version_unreleased = 1 (int)
    • brake_resistor_armed = True (bool)
    • brake_resistor_saturated = False (bool)
    • system_stats:
      • uptime = 7747 (int)
      • min_heap_space = 41560 (int)
      • min_stack_space_axis0 = 1684 (int)
      • min_stack_space_axis1 = 1684 (int)
      • min_stack_space_comms = 3864 (int)
      • min_stack_space_usb = 3732 (int)
      • min_stack_space_uart = 3924 (int)
      • min_stack_space_can = 836 (int)
      • min_stack_space_usb_irq = 1796 (int)
      • min_stack_space_startup = 1708 (int)
      • stack_usage_axis0 = 364 (int)
      • stack_usage_axis1 = 364 (int)
      • stack_usage_comms = 232 (int)
      • stack_usage_usb = 364 (int)
      • stack_usage_uart = 172 (int)
      • stack_usage_usb_irq = 252 (int)
      • stack_usage_startup = 340 (int)
      • stack_usage_can = 188 (int)
      • usb:
        • rx_cnt = 85 (int)
        • tx_cnt = 85 (int)
        • tx_overrun_cnt = 0 (int)
      • i2c:
        • addr = 0 (int)
        • addr_match_cnt = 0 (int)
        • rx_cnt = 0 (int)
        • error_cnt = 0 (int)
    • config:
      • enable_uart = True (bool)
      • uart_baudrate = 115200 (int)
      • enable_i2c_instead_of_can = False (bool)
      • enable_ascii_protocol_on_usb = True (bool)
      • max_regen_current = 0.0 (float)
      • brake_resistance = 0.05000000074505806 (float)
      • dc_bus_undervoltage_trip_level = 8.0 (float)
      • dc_bus_overvoltage_trip_level = 59.92000198364258 (float)
      • enable_dc_bus_overvoltage_ramp = False (bool)
      • dc_bus_overvoltage_ramp_start = 59.92000198364258 (float)
      • dc_bus_overvoltage_ramp_end = 59.92000198364258 (float)
      • dc_max_positive_current = inf (float)
      • dc_max_negative_current = -9.999999974752427e-07 (float)
      • gpio1_pwm_mapping:
        • endpoint = (0, 0) (RemoteProperty)
        • min = 0.0 (float)
        • max = 0.0 (float)
      • gpio2_pwm_mapping:
        • endpoint = (0, 0) (RemoteProperty)
        • min = 0.0 (float)
        • max = 0.0 (float)
      • gpio3_pwm_mapping:
        • endpoint = (0, 0) (RemoteProperty)
        • min = 0.0 (float)
        • max = 0.0 (float)
      • gpio4_pwm_mapping:
        • endpoint = (0, 0) (RemoteProperty)
        • min = 0.0 (float)
        • max = 0.0 (float)
      • gpio3_analog_mapping:
        • endpoint = (0, 0) (RemoteProperty)
        • min = 0.0 (float)
        • max = 0.0 (float)
      • gpio4_analog_mapping:
        • endpoint = (0, 0) (RemoteProperty)
        • min = 0.0 (float)
        • max = 0.0 (float)
    • user_config_loaded = True (bool)
    • axis0:
      • error = 0x0000 (int)
      • step_dir_active = False (bool)
      • current_state = 1 (int)
      • requested_state = 0 (int)
      • loop_counter = 5114087 (int)
      • lockin_state = 0 (int)
      • is_homed = False (bool)
      • config:
        • startup_motor_calibration = False (bool)
        • startup_encoder_index_search = False (bool)
        • startup_encoder_offset_calibration = False (bool)
        • startup_closed_loop_control = False (bool)
        • startup_sensorless_control = False (bool)
        • startup_homing = False (bool)
        • enable_step_dir = False (bool)
        • step_dir_always_on = False (bool)
        • turns_per_step = 0.0009765625 (float)
        • watchdog_timeout = 0.0 (float)
        • enable_watchdog = False (bool)
        • step_gpio_pin = 1 (int)
        • dir_gpio_pin = 2 (int)
        • calibration_lockin:
          • current = 10.0 (float)
          • ramp_time = 0.4000000059604645 (float)
          • ramp_distance = 3.1415927410125732 (float)
          • accel = 20.0 (float)
          • vel = 40.0 (float)
        • sensorless_ramp:
          • current = 10.0 (float)
          • ramp_time = 0.4000000059604645 (float)
          • ramp_distance = 3.1415927410125732 (float)
          • accel = 200.0 (float)
          • vel = 400.0 (float)
          • finish_distance = 100.0 (float)
          • finish_on_vel = True (bool)
          • finish_on_distance = False (bool)
          • finish_on_enc_idx = False (bool)
        • general_lockin:
          • current = 10.0 (float)
          • ramp_time = 0.4000000059604645 (float)
          • ramp_distance = 3.1415927410125732 (float)
          • accel = 20.0 (float)
          • vel = 40.0 (float)
          • finish_distance = 100.0 (float)
          • finish_on_vel = False (bool)
          • finish_on_distance = False (bool)
          • finish_on_enc_idx = False (bool)
        • can_node_id = 0 (int)
        • can_node_id_extended = False (bool)
        • can_heartbeat_rate_ms = 100 (int)
      • fet_thermistor:
        • error = 0x0000 (int)
        • temperature = 14.813278198242188 (float)
        • config:
          • temp_limit_lower = 100.0 (float)
          • temp_limit_upper = 120.0 (float)
          • enabled = True (bool)
      • motor_thermistor:
        • error = 0x0000 (int)
        • temperature = 0.0 (float)
        • config:
          • gpio_pin = 4 (int)
          • poly_coefficient_0 = 0.0 (float)
          • poly_coefficient_1 = 0.0 (float)
          • poly_coefficient_2 = 0.0 (float)
          • poly_coefficient_3 = 0.0 (float)
          • temp_limit_lower = 100.0 (float)
          • temp_limit_upper = 120.0 (float)
          • enabled = False (bool)
      • motor:
        • error = 0x0000 (int)
        • armed_state = 0 (int)
        • is_calibrated = True (bool)
        • current_meas_phB = 0.6694726347923279 (float)
        • current_meas_phC = 0.24526754021644592 (float)
        • DC_calib_phB = -0.3872242271900177 (float)
        • DC_calib_phC = 0.35895684361457825 (float)
        • phase_current_rev_gain = 0.02500000037252903 (float)
        • effective_current_lim = 10.0 (float)
        • current_control:
          • p_gain = inf (float)
          • i_gain = nan (float)
          • v_current_control_integral_d = 0.0 (float)
          • v_current_control_integral_q = 0.0 (float)
          • Ibus = 0.0 (float)
          • final_v_alpha = 0.0 (float)
          • final_v_beta = 0.0 (float)
          • Id_setpoint = 0.0 (float)
          • Iq_setpoint = 0.0 (float)
          • Iq_measured = 0.0 (float)
          • Id_measured = 0.0 (float)
          • I_measured_report_filter_k = 1.0 (float)
          • max_allowed_current = 60.75 (float)
          • overcurrent_trip_level = 67.5 (float)
          • acim_rotor_flux = 0.0 (float)
          • async_phase_vel = 0.0 (float)
          • async_phase_offset = 0.0 (float)
        • gate_driver:
          • drv_fault = 0 (int)
          • timing_log:
          • general = 17938 (int)
          • adc_cb_i = 3482 (int)
          • adc_cb_dc = 12870 (int)
          • meas_r = 41396 (int)
          • meas_l = 37817 (int)
          • enc_calib = 44604 (int)
          • idx_search = 34199 (int)
          • foc_voltage = 63753 (int)
          • foc_current = 19673 (int)
          • spi_start = 2246 (int)
          • sample_now = 1782 (int)
          • spi_end = 5378 (int)
        • config:
          • pre_calibrated = True (bool)
          • pole_pairs = 7 (int)
          • calibration_current = 5.0 (float)
          • resistance_calib_max_voltage = 2.0 (float)
          • phase_inductance = inf (float)
          • phase_resistance = 0.21308204531669617 (float)
          • torque_constant = 0.006889999844133854 (float)
          • direction = -1 (int)
          • motor_type = 0 (int)
          • current_lim = 11.0 (float)
          • current_lim_margin = 8.0 (float)
          • torque_lim = inf (float)
          • inverter_temp_limit_lower = 100.0 (float)
          • inverter_temp_limit_upper = 120.0 (float)
          • requested_current_range = 60.0 (float)
          • current_control_bandwidth = 1000.0 (float)
          • acim_slip_velocity = 14.706000328063965 (float)
          • acim_gain_min_flux = 10.0 (float)
          • acim_autoflux_min_Id = 10.0 (float)
          • acim_autoflux_enable = False (bool)
          • acim_autoflux_attack_gain = 10.0 (float)
          • acim_autoflux_decay_gain = 1.0 (float)
      • controller:
        • error = 0x0000 (int)
        • input_pos = 0.0 (float)
        • input_vel = 0.0 (float)
        • input_torque = 0.0 (float)
        • pos_setpoint = 0.0 (float)
        • vel_setpoint = 0.0 (float)
        • torque_setpoint = 0.0 (float)
        • trajectory_done = True (bool)
        • vel_integrator_torque = 0.0 (float)
        • anticogging_valid = False (bool)
        • config:
          • gain_scheduling_width = 10.0 (float)
          • enable_vel_limit = True (bool)
          • enable_current_mode_vel_limit = True (bool)
          • enable_gain_scheduling = False (bool)
          • enable_overspeed_error = True (bool)
          • control_mode = 3 (int)
          • input_mode = 1 (int)
          • pos_gain = 4.0 (float)
          • vel_gain = 0.007499999832361937 (float)
          • vel_integrator_gain = 0.0 (float)
          • vel_limit = 300.0 (float)
          • vel_limit_tolerance = 1.2000000476837158 (float)
          • vel_ramp_rate = 1.0 (float)
          • torque_ramp_rate = 0.009999999776482582 (float)
          • circular_setpoints = False (bool)
          • circular_setpoint_range = 1.0 (float)
          • homing_speed = 0.25 (float)
          • inertia = 0.0 (float)
          • axis_to_mirror = 255 (int)
          • mirror_ratio = 1.0 (float)
          • load_encoder_axis = 0 (int)
          • input_filter_bandwidth = 2.0 (float)
          • anticogging: …
            • index = 0 (int)
            • pre_calibrated = False (bool)
            • calib_anticogging = False (bool)
            • calib_pos_threshold = 1.0 (float)
            • calib_vel_threshold = 1.0 (float)
            • cogging_ratio = 1.0 (float)
            • anticogging_enabled = True (bool)
        • move_incremental(displacement: float, from_input_pos: bool)
        • start_anticogging_calibration()
      • encoder:
        • error = 0x0000 (int)
        • is_ready = False (bool)
        • index_found = False (bool)
        • shadow_count = 2097 (int)
        • count_in_cpr = 2098 (int)
        • interpolation = 1.0 (float)
        • phase = -2.733459711074829 (float)
        • pos_estimate = 0.1279916763305664 (float)
        • pos_estimate_counts = 2097.84375 (float)
        • pos_cpr = 0.1280050277709961 (float)
        • pos_cpr_counts = 2097.796875 (float)
        • pos_circular = 0.12796497344970703 (float)
        • hall_state = 7 (int)
        • vel_estimate = 0.0 (float)
        • vel_estimate_counts = 250.00001525878906 (float)
        • calib_scan_response = 0.0 (float)
        • pos_abs = 2098 (int)
        • spi_error_rate = 0.0 (float)
        • config:
          • mode = 257 (int)
          • use_index = False (bool)
          • find_idx_on_lockin_only = False (bool)
          • abs_spi_cs_gpio_pin = 4 (int)
          • zero_count_on_find_idx = True (bool)
          • cpr = 16384 (int)
          • offset = -8589 (int)
          • pre_calibrated = False (bool)
          • offset_float = 0.3931249976158142 (float)
          • enable_phase_interpolation = True (bool)
          • bandwidth = 1000.0 (float)
          • calib_range = 0.019999999552965164 (float)
          • calib_scan_distance = 50.26548385620117 (float)
          • calib_scan_omega = 12.566370964050293 (float)
          • idx_search_unidirectional = False (bool)
          • ignore_illegal_hall_state = False (bool)
          • sincos_gpio_pin_sin = 3 (int)
          • sincos_gpio_pin_cos = 4 (int)
        • set_linear_count(count: int)
      • sensorless_estimator:
        • error = 0x0000 (int)
        • phase = nan (float)
        • pll_pos = nan (float)
        • vel_estimate = nan (float)
        • config:
          • observer_gain = 1000.0 (float)
          • pll_bandwidth = 1000.0 (float)
          • pm_flux_linkage = 0.0015800000401213765 (float)
          • trap_traj:
          • config:
          • vel_limit = 2.0 (float)
          • accel_limit = 0.5 (float)
          • decel_limit = 0.5 (float)
      • min_endstop:
        • endstop_state = False (bool)
        • config:
          • gpio_num = 0 (int)
          • enabled = False (bool)
          • offset = 0.0 (float)
          • is_active_high = False (bool)
          • pullup = True (bool)
          • debounce_ms = 50 (int)
      • max_endstop:
        • endstop_state = False (bool)
        • config:
          • gpio_num = 0 (int)
          • enabled = False (bool)
          • offset = 0.0 (float)
          • is_active_high = False (bool)
          • pullup = True (bool)
          • debounce_ms = 50 (int)
      • watchdog_feed()
      • clear_errors()
    • axis1:
      • error = 0x0000 (int)
      • step_dir_active = False (bool)
      • current_state = 1 (int)
      • requested_state = 0 (int)
      • loop_counter = 5114087 (int)
      • lockin_state = 0 (int)
      • is_homed = False (bool)
      • config:
        • startup_motor_calibration = False (bool)
        • startup_encoder_index_search = False (bool)
        • startup_encoder_offset_calibration = False (bool)
        • startup_closed_loop_control = False (bool)
        • startup_sensorless_control = False (bool)
        • startup_homing = False (bool)
        • enable_step_dir = False (bool)
        • step_dir_always_on = False (bool)
        • turns_per_step = 0.0009765625 (float)
        • watchdog_timeout = 0.0 (float)
        • enable_watchdog = False (bool)
        • step_gpio_pin = 1 (int)
        • dir_gpio_pin = 2 (int)
        • calibration_lockin:
          • current = 10.0 (float)
          • ramp_time = 0.4000000059604645 (float)
          • ramp_distance = 3.1415927410125732 (float)
          • accel = 20.0 (float)
          • vel = 40.0 (float)
        • sensorless_ramp:
          • current = 10.0 (float)
          • ramp_time = 0.4000000059604645 (float)
          • ramp_distance = 3.1415927410125732 (float)
          • accel = 200.0 (float)
          • vel = 400.0 (float)
          • finish_distance = 100.0 (float)
          • finish_on_vel = True (bool)
          • finish_on_distance = False (bool)
          • finish_on_enc_idx = False (bool)
        • general_lockin:
          • current = 10.0 (float)
          • ramp_time = 0.4000000059604645 (float)
          • ramp_distance = 3.1415927410125732 (float)
          • accel = 20.0 (float)
          • vel = 40.0 (float)
          • finish_distance = 100.0 (float)
          • finish_on_vel = False (bool)
          • finish_on_distance = False (bool)
          • finish_on_enc_idx = False (bool)
        • can_node_id = 0 (int)
        • can_node_id_extended = False (bool)
        • can_heartbeat_rate_ms = 100 (int)
      • fet_thermistor:
        • error = 0x0000 (int)
        • temperature = 14.813278198242188 (float)
        • config:
          • temp_limit_lower = 100.0 (float)
          • temp_limit_upper = 120.0 (float)
          • enabled = True (bool)
      • motor_thermistor:
        • error = 0x0000 (int)
        • temperature = 0.0 (float)
        • config:
          • gpio_pin = 4 (int)
          • poly_coefficient_0 = 0.0 (float)
          • poly_coefficient_1 = 0.0 (float)
          • poly_coefficient_2 = 0.0 (float)
          • poly_coefficient_3 = 0.0 (float)
          • temp_limit_lower = 100.0 (float)
          • temp_limit_upper = 120.0 (float)
          • enabled = False (bool)
      • motor:
        • error = 0x0000 (int)
        • armed_state = 0 (int)
        • is_calibrated = True (bool)
        • current_meas_phB = 0.6694726347923279 (float)
        • current_meas_phC = 0.24526754021644592 (float)
        • DC_calib_phB = -0.3872242271900177 (float)
        • DC_calib_phC = 0.35895684361457825 (float)
        • phase_current_rev_gain = 0.02500000037252903 (float)
        • effective_current_lim = 10.0 (float)
        • current_control:
          • p_gain = inf (float)
          • i_gain = nan (float)
          • v_current_control_integral_d = 0.0 (float)
          • v_current_control_integral_q = 0.0 (float)
          • Ibus = 0.0 (float)
          • final_v_alpha = 0.0 (float)
          • final_v_beta = 0.0 (float)
          • Id_setpoint = 0.0 (float)
          • Iq_setpoint = 0.0 (float)
          • Iq_measured = 0.0 (float)
          • Id_measured = 0.0 (float)
          • I_measured_report_filter_k = 1.0 (float)
          • max_allowed_current = 60.75 (float)
          • overcurrent_trip_level = 67.5 (float)
          • acim_rotor_flux = 0.0 (float)
          • async_phase_vel = 0.0 (float)
          • async_phase_offset = 0.0 (float)
        • gate_driver:
          • drv_fault = 0 (int)
          • timing_log:
          • general = 17938 (int)
          • adc_cb_i = 3482 (int)
          • adc_cb_dc = 12870 (int)
          • meas_r = 41396 (int)
          • meas_l = 37817 (int)
          • enc_calib = 44604 (int)
          • idx_search = 34199 (int)
          • foc_voltage = 63753 (int)
          • foc_current = 19673 (int)
          • spi_start = 2246 (int)
          • sample_now = 1782 (int)
          • spi_end = 5378 (int)
        • config:
          • pre_calibrated = True (bool)
          • pole_pairs = 7 (int)
          • calibration_current = 5.0 (float)
          • resistance_calib_max_voltage = 2.0 (float)
          • phase_inductance = inf (float)
          • phase_resistance = 0.21308204531669617 (float)
          • torque_constant = 0.006889999844133854 (float)
          • direction = -1 (int)
          • motor_type = 0 (int)
          • current_lim = 11.0 (float)
          • current_lim_margin = 8.0 (float)
          • torque_lim = inf (float)
          • inverter_temp_limit_lower = 100.0 (float)
          • inverter_temp_limit_upper = 120.0 (float)
          • requested_current_range = 60.0 (float)
          • current_control_bandwidth = 1000.0 (float)
          • acim_slip_velocity = 14.706000328063965 (float)
          • acim_gain_min_flux = 10.0 (float)
          • acim_autoflux_min_Id = 10.0 (float)
          • acim_autoflux_enable = False (bool)
          • acim_autoflux_attack_gain = 10.0 (float)
          • acim_autoflux_decay_gain = 1.0 (float)
      • controller:
        • error = 0x0000 (int)
        • input_pos = 0.0 (float)
        • input_vel = 0.0 (float)
        • input_torque = 0.0 (float)
        • pos_setpoint = 0.0 (float)
        • vel_setpoint = 0.0 (float)
        • torque_setpoint = 0.0 (float)
        • trajectory_done = True (bool)
        • vel_integrator_torque = 0.0 (float)
        • anticogging_valid = False (bool)
        • config:
          • gain_scheduling_width = 10.0 (float)
          • enable_vel_limit = True (bool)
          • enable_current_mode_vel_limit = True (bool)
          • enable_gain_scheduling = False (bool)
          • enable_overspeed_error = True (bool)
          • control_mode = 3 (int)
          • input_mode = 1 (int)
          • pos_gain = 4.0 (float)
          • vel_gain = 0.007499999832361937 (float)
          • vel_integrator_gain = 0.0 (float)
          • vel_limit = 300.0 (float)
          • vel_limit_tolerance = 1.2000000476837158 (float)
          • vel_ramp_rate = 1.0 (float)
          • torque_ramp_rate = 0.009999999776482582 (float)
          • circular_setpoints = False (bool)
          • circular_setpoint_range = 1.0 (float)
          • homing_speed = 0.25 (float)
          • inertia = 0.0 (float)
          • axis_to_mirror = 255 (int)
          • mirror_ratio = 1.0 (float)
          • load_encoder_axis = 0 (int)
          • input_filter_bandwidth = 2.0 (float)
          • anticogging: …
            • index = 0 (int)
            • pre_calibrated = False (bool)
            • calib_anticogging = False (bool)
            • calib_pos_threshold = 1.0 (float)
            • calib_vel_threshold = 1.0 (float)
            • cogging_ratio = 1.0 (float)
            • anticogging_enabled = True (bool)
        • move_incremental(displacement: float, from_input_pos: bool)
        • start_anticogging_calibration()
      • encoder:
        • error = 0x0000 (int)
        • is_ready = False (bool)
        • index_found = False (bool)
        • shadow_count = 2097 (int)
        • count_in_cpr = 2098 (int)
        • interpolation = 1.0 (float)
        • phase = -2.733459711074829 (float)
        • pos_estimate = 0.1279916763305664 (float)
        • pos_estimate_counts = 2097.84375 (float)
        • pos_cpr = 0.1280050277709961 (float)
        • pos_cpr_counts = 2097.796875 (float)
        • pos_circular = 0.12796497344970703 (float)
        • hall_state = 7 (int)
        • vel_estimate = 0.0 (float)
        • vel_estimate_counts = 250.00001525878906 (float)
        • calib_scan_response = 0.0 (float)
        • pos_abs = 2098 (int)
        • spi_error_rate = 0.0 (float)
        • config:
          • mode = 257 (int)
          • use_index = False (bool)
          • find_idx_on_lockin_only = False (bool)
          • abs_spi_cs_gpio_pin = 4 (int)
          • zero_count_on_find_idx = True (bool)
          • cpr = 16384 (int)
          • offset = -8589 (int)
          • pre_calibrated = False (bool)
          • offset_float = 0.3931249976158142 (float)
          • enable_phase_interpolation = True (bool)
          • bandwidth = 1000.0 (float)
          • calib_range = 0.019999999552965164 (float)
          • calib_scan_distance = 50.26548385620117 (float)
          • calib_scan_omega = 12.566370964050293 (float)
          • idx_search_unidirectional = False (bool)
          • ignore_illegal_hall_state = False (bool)
          • sincos_gpio_pin_sin = 3 (int)
          • sincos_gpio_pin_cos = 4 (int)
        • set_linear_count(count: int)
      • sensorless_estimator:
        • error = 0x0000 (int)
        • phase = nan (float)
        • pll_pos = nan (float)
        • vel_estimate = nan (float)
        • config:
          • observer_gain = 1000.0 (float)
          • pll_bandwidth = 1000.0 (float)
          • pm_flux_linkage = 0.0015800000401213765 (float)
          • trap_traj:
          • config:
          • vel_limit = 2.0 (float)
          • accel_limit = 0.5 (float)
          • decel_limit = 0.5 (float)
      • min_endstop:
        • endstop_state = False (bool)
        • config:
          • gpio_num = 0 (int)
          • enabled = False (bool)
          • offset = 0.0 (float)
          • is_active_high = False (bool)
          • pullup = True (bool)
          • debounce_ms = 50 (int)
      • max_endstop:
        • endstop_state = False (bool)
        • config:
          • gpio_num = 0 (int)
          • enabled = False (bool)
          • offset = 0.0 (float)
          • is_active_high = False (bool)
          • pullup = True (bool)
          • debounce_ms = 50 (int)
      • watchdog_feed()
      • clear_errors()
    • can:
      • error = 0x0000 (int)
      • config:
        • baud_rate = 250000 (int)
        • protocol = 0 (int)
      • set_baud_rate(baudRate: int)
    • test_property = 0 (int)
    • test_function(delta: int)
    • get_oscilloscope_val(index: int)
    • get_adc_voltage(gpio: int)
    • save_configuration()
    • erase_configuration()
    • reboot()
    • enter_dfu_mode()

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください

アーカイブ

広告

Top