Skip to content

Commit

Permalink
Revert "Add ramp input to the speed PID loop."
Browse files Browse the repository at this point in the history
  • Loading branch information
vedderb authored and Esben Rasmussen committed Jul 2, 2020
1 parent 55dc8fd commit d014abb
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 7 deletions.
1 change: 0 additions & 1 deletion confgenerator.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion datatypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 0 additions & 3 deletions mcconf/mcconf_default.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions mcpwm_foc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit d014abb

Please sign in to comment.