From d014abbf29afd74ed82d2b83bd9111f02d16ca59 Mon Sep 17 00:00:00 2001 From: Benjamin Vedder Date: Tue, 12 May 2020 15:30:34 +0200 Subject: [PATCH] Revert "Add ramp input to the speed PID loop." --- confgenerator.c | 1 - datatypes.h | 1 - mcconf/mcconf_default.h | 3 --- mcpwm_foc.c | 3 +-- 4 files changed, 1 insertion(+), 7 deletions(-) diff --git a/confgenerator.c b/confgenerator.c index 5793bada2..ebb2fbb92 100644 --- a/confgenerator.c +++ b/confgenerator.c @@ -119,7 +119,6 @@ int32_t confgenerator_serialize_mcconf(uint8_t *buffer, const mc_configuration * buffer_append_float32_auto(buffer, conf->s_pid_kd_filter, &ind); buffer_append_float32_auto(buffer, conf->s_pid_min_erpm, &ind); buffer[ind++] = conf->s_pid_allow_braking; - buffer_append_float32_auto(buffer, conf->s_pid_ramp_erpms_s, &ind); buffer_append_float32_auto(buffer, conf->p_pid_kp, &ind); buffer_append_float32_auto(buffer, conf->p_pid_ki, &ind); buffer_append_float32_auto(buffer, conf->p_pid_kd, &ind); diff --git a/datatypes.h b/datatypes.h index 6b57f435c..ed1c93a8d 100644 --- a/datatypes.h +++ b/datatypes.h @@ -322,7 +322,6 @@ typedef struct { float s_pid_kd_filter; float s_pid_min_erpm; bool s_pid_allow_braking; - float s_pid_ramp_erpms_s; // Pos PID float p_pid_kp; float p_pid_ki; diff --git a/mcconf/mcconf_default.h b/mcconf/mcconf_default.h index f2c0b6977..dabb0220a 100644 --- a/mcconf/mcconf_default.h +++ b/mcconf/mcconf_default.h @@ -136,9 +136,6 @@ #ifndef MCCONF_S_PID_ALLOW_BRAKING #define MCCONF_S_PID_ALLOW_BRAKING true // Allow braking in speed control mode #endif -#ifndef MCCONF_S_PID_RAMP_ERPMS_S -#define MCCONF_S_PID_RAMP_ERPMS_S -1.0 // Default Speed Input Ramp -#endif // Position PID parameters #ifndef MCCONF_P_PID_KP diff --git a/mcpwm_foc.c b/mcpwm_foc.c index 1ea9a8bfc..2a339ebfc 100644 --- a/mcpwm_foc.c +++ b/mcpwm_foc.c @@ -111,7 +111,6 @@ typedef struct { bool m_output_on; float m_pos_pid_set; float m_speed_pid_set_rpm; - float m_speed_command_rpm; float m_phase_now_observer; float m_phase_now_observer_override; bool m_phase_observer_override; @@ -166,7 +165,6 @@ typedef struct { float m_hall_dt_diff_now; } motor_all_state_t; - // Private variables static volatile bool m_dccal_done = false; static volatile float m_last_adc_isr_duration; @@ -813,6 +811,7 @@ void mcpwm_foc_set_pid_speed(float rpm) { } motor_now()->m_control_mode = CONTROL_MODE_SPEED; + motor_now()->m_speed_pid_set_rpm = rpm; if (motor_now()->m_state != MC_STATE_RUNNING) { motor_now()->m_state = MC_STATE_RUNNING;