move vel_ramp_enable into controller.config

This commit is contained in:
Oskar Weigl
2019-10-07 16:19:30 -07:00
parent a37fa95e97
commit 27add54b3f
3 changed files with 6 additions and 3 deletions
+3
View File
@@ -6,6 +6,9 @@ Please add a note of your changes below this heading if you make a Pull Request.
* Tracking of rotor flux through rotor time constant
* Automatic d axis current for Maximum Torque Per Amp (MTPA)
### Changed
* Moved `controller.vel_ramp_enable` into `controller.config`.
# Releases
## [0.4.11] - 2019-07-25
### Added
+1 -1
View File
@@ -128,7 +128,7 @@ bool Controller::update(float pos_estimate, float vel_estimate, float* current_s
}
// Ramp rate limited velocity setpoint
if (config_.control_mode == CTRL_MODE_VELOCITY_CONTROL && vel_ramp_enable_) {
if (config_.control_mode == CTRL_MODE_VELOCITY_CONTROL && config_.vel_ramp_enable) {
float max_step_size = current_meas_period * config_.vel_ramp_rate;
float full_step = vel_ramp_target_ - vel_setpoint_;
float step;
+2 -2
View File
@@ -30,6 +30,7 @@ public:
float vel_integrator_gain = 10.0f / 10000.0f; // [A/(counts/s * s)]
float vel_limit = 20000.0f; // [counts/s]
float vel_limit_tolerance = 1.2f; // ratio to vel_lim. 0.0f to disable
bool vel_ramp_enable = false;
float vel_ramp_rate = 10000.0f; // [(counts/s) / s]
bool setpoints_in_cpr = false;
};
@@ -86,7 +87,6 @@ public:
float vel_integrator_current_ = 0.0f; // [A]
float current_setpoint_ = 0.0f; // [A]
float vel_ramp_target_ = 0.0f;
bool vel_ramp_enable_ = false;
uint32_t traj_start_loop_count_ = 0;
@@ -101,7 +101,6 @@ public:
make_protocol_property("vel_integrator_current", &vel_integrator_current_),
make_protocol_property("current_setpoint", &current_setpoint_),
make_protocol_property("vel_ramp_target", &vel_ramp_target_),
make_protocol_property("vel_ramp_enable", &vel_ramp_enable_),
make_protocol_object("config",
make_protocol_property("control_mode", &config_.control_mode),
make_protocol_property("pos_gain", &config_.pos_gain),
@@ -109,6 +108,7 @@ public:
make_protocol_property("vel_integrator_gain", &config_.vel_integrator_gain),
make_protocol_property("vel_limit", &config_.vel_limit),
make_protocol_property("vel_limit_tolerance", &config_.vel_limit_tolerance),
make_protocol_property("vel_ramp_enable", &config_.vel_ramp_enable),
make_protocol_property("vel_ramp_rate", &config_.vel_ramp_rate),
make_protocol_property("setpoints_in_cpr", &config_.setpoints_in_cpr)
),