电机最大旋转角度限定100度

财位指令旋转电机以后返回原位
This commit is contained in:
CSBOOK\44744
2026-07-01 15:54:13 +08:00
parent 5d7c3f91d4
commit bc74db61a9
3 changed files with 154 additions and 4 deletions
@@ -47,7 +47,8 @@
/* Liveness safety bound for the fixed two-cycle wealth spin intro (not the
* animation length). On timeout the worker proceeds to reveal + rotate anyway. */
#define CONTROL_PLANE_SPIN_INTRO_TIMEOUT_MS 6000
#define CONTROL_PLANE_COMMAND_ROTATION_DEG 45.0f
#define CONTROL_PLANE_COMMAND_ROTATION_DEG 100.0f
#define CONTROL_PLANE_COMMAND_RETURN_DELAY_MS 5000
#if (configSUPPORT_STATIC_ALLOCATION == 1) && \
((defined(CONFIG_FREERTOS_TASK_CREATE_ALLOW_EXT_MEM) && CONFIG_FREERTOS_TASK_CREATE_ALLOW_EXT_MEM) || \
@@ -716,8 +717,14 @@ static esp_err_t control_plane_apply_wealth_direction(size_t direction_index,
(void)direction_index;
float current_angle = domain_get_current_angle();
return control_plane_rotate_to_angle(current_angle + CONTROL_PLANE_COMMAND_ROTATION_DEG);
float start_angle = domain_get_current_angle();
esp_err_t rotate_err = control_plane_rotate_to_angle(start_angle + CONTROL_PLANE_COMMAND_ROTATION_DEG);
if (rotate_err != ESP_OK) {
return rotate_err;
}
vTaskDelay(pdMS_TO_TICKS(CONTROL_PLANE_COMMAND_RETURN_DELAY_MS));
return control_plane_rotate_to_angle(start_angle);
}
static esp_err_t control_plane_run_model_calibration_motion(void)