You are here

Apply current limits,1804 line mcpwm_foc.c

1 post / 0 new
aishangmu
Offline
Last seen: 3 years 2 months ago
Joined: 2018-12-19 09:37
Posts: 2
Apply current limits,1804 line mcpwm_foc.c

// Apply current limits
// TODO: Consider D axis current for the input current as well.
const float mod_q = m_motor_state.mod_q;
if (mod_q > 0.001) {
utils_truncate_number(&iq_set_tmp, m_conf->lo_in_current_min / mod_q, m_conf->lo_in_current_max / mod_q);
} else if (mod_q utils_truncate_number(&iq_set_tmp, m_conf->lo_in_current_max / mod_q, m_conf->lo_in_current_min / mod_q);
}

if (mod_q > 0.0) {
utils_truncate_number(&iq_set_tmp, m_conf->lo_current_min, m_conf->lo_current_max);
} else {
utils_truncate_number(&iq_set_tmp, -m_conf->lo_current_max, -m_conf->lo_current_min);
}

What is the purpose of the above two current limits?

m_conf->lo_in_current_min / mod_q, m_conf->lo_in_current_max / mod_q -----What is the purpose of this sub-process?