add option to force precalib setting to bypass check

This commit is contained in:
Oskar Weigl
2021-06-21 16:23:37 -07:00
parent 0256229b22
commit 81eea96da3
3 changed files with 4 additions and 0 deletions
+2
View File
@@ -127,6 +127,8 @@ void Encoder::update_pll_gains() {
}
void Encoder::check_pre_calibrated() {
if (config_.override_precal_check)
return;
// TODO: restoring config from python backup is fragile here (ACIM motor type must be set first)
if (axis_->motor_.config_.motor_type != Motor::MOTOR_TYPE_ACIM) {
if (!is_ready_)
+1
View File
@@ -27,6 +27,7 @@ public:
int32_t cpr = (2048 * 4); // Default resolution of CUI-AMT102 encoder,
float index_offset = 0.0f;
bool use_index = false;
bool override_precal_check = false; // If true, apply pre_calibrated unconditionally
bool pre_calibrated = false; // If true, this means the offset stored in
// configuration is valid and does not need
// be determined by run_offset_calibration.
+1
View File
@@ -1088,6 +1088,7 @@ interfaces:
phase_offset: int32
phase_offset_float: float32
direction: int32
override_precal_check: bool
pre_calibrated: {type: bool, c_setter: set_pre_calibrated}
enable_phase_interpolation: bool
bandwidth: {type: float32, c_setter: set_bandwidth}