Add input_xxx to the setpoints for autotuning

This commit is contained in:
Paul Guenette
2021-12-01 17:41:00 -05:00
parent fbb9dd4a9a
commit f04f02aff7
+3 -3
View File
@@ -226,9 +226,9 @@ bool Controller::update() {
autotuning_phase_ = wrap_pm_pi(autotuning_phase_ + (2.0f * M_PI * autotuning_.frequency * current_meas_period));
float c = our_arm_cos_f32(autotuning_phase_);
float s = our_arm_sin_f32(autotuning_phase_);
pos_setpoint_ = autotuning_.pos_amplitude * s; // + pos_amp_c * c
vel_setpoint_ = autotuning_.vel_amplitude * c;
torque_setpoint_ = autotuning_.torque_amplitude * -s;
pos_setpoint_ = input_pos_ + autotuning_.pos_amplitude * s; // + pos_amp_c * c
vel_setpoint_ = input_vel_ + autotuning_.vel_amplitude * c;
torque_setpoint_ = input_torque_ + autotuning_.torque_amplitude * -s;
} break;
default: {
set_error(ERROR_INVALID_INPUT_MODE);