Skip to content

Commit

Permalink
Fix for changes introduced in previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
vedderb committed Aug 22, 2023
1 parent 331741b commit 6d7c81d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions conf_general.c
Original file line number Diff line number Diff line change
Expand Up @@ -1033,6 +1033,7 @@ int conf_general_measure_flux_linkage_openloop(float current, float duty,

// Start by locking the motor
for (int i = 0;i < 200;i++) {
mc_interface_lock_override_once();
mc_interface_set_openloop_current((float)i * current / 200.0, rpm_now);
fault = mc_interface_get_fault();
if (fault != FAULT_CODE_NONE) {
Expand Down Expand Up @@ -1074,6 +1075,7 @@ int conf_general_measure_flux_linkage_openloop(float current, float duty,

while (fabsf(mc_interface_get_duty_cycle_now()) < duty) {
rpm_now += erpm_per_sec / 1000.0;
mc_interface_lock_override_once();
mc_interface_set_openloop_current(current, mcconf->m_invert_direction ? -rpm_now : rpm_now);

fault = mc_interface_get_fault();
Expand Down Expand Up @@ -1330,6 +1332,7 @@ int conf_general_autodetect_apply_sensors_foc(float current,
mc_interface_set_configuration(mcconf);

for (int i = 0;i < 1000;i++) {
mc_interface_lock_override_once();
mc_interface_set_openloop_phase((float)i * current / 1000.0, 0.0);
fault = mc_interface_get_fault();
if (fault != FAULT_CODE_NONE) {
Expand All @@ -1350,6 +1353,7 @@ int conf_general_autodetect_apply_sensors_foc(float current,
float phase_end = 0.0;

for (int i = 0;i < 180.0;i++) {
mc_interface_lock_override_once();
mc_interface_set_openloop_phase(current, i);
fault = mc_interface_get_fault();
if (fault != FAULT_CODE_NONE) {
Expand Down

0 comments on commit 6d7c81d

Please sign in to comment.