You are here

hysteresis related issue in mcconf and mcpwm_foc.c

2 posts / 0 new
Last post
masifsr
Offline
Last seen: 2 years 3 months ago
Joined: 2022-01-28 08:12
Posts: 5
hysteresis related issue in mcconf and mcpwm_foc.c

Hi,

I am having hard time understanding what does macro MCCONF_FOC_SL_OPENLOOP_HYST and m_min_rpm_hyst_timer variable do?

what is the meaning of hysteresis here?

what does the section of code given below do?

float openloop_rpm_max = utils_map(fabsf(motor->m_motor_state.iq_filter),

0.0, motor->m_conf->l_current_max,

motor->m_conf->foc_openloop_rpm_low * motor->m_conf->foc_openloop_rpm,

motor->m_conf->foc_openloop_rpm);

 

utils_truncate_number_abs(&openloop_rpm_max, motor->m_conf->foc_openloop_rpm);

 

float openloop_rpm = openloop_rpm_max;

if (motor->m_conf->foc_sensor_mode != FOC_SENSOR_MODE_ENCODER) {

float time_fwd = t_lock + t_ramp + t_const - motor->m_min_rpm_timer;

if (time_fwd < t_lock) {

openloop_rpm = 0.0;

} else if (time_fwd < (t_lock + t_ramp)) {

openloop_rpm = utils_map(time_fwd, t_lock,

t_lock + t_ramp, 0.0, openloop_rpm);

}

}

 

what is t_lock, t_ramp, and t_const?

 

please help me understand this section of code and these parameters.

 

Thanks.

j.konrad
Offline
Last seen: 1 year 5 months ago
Joined: 2022-01-06 15:43
Posts: 40

In control theory, hysteresis is used to provide a deadband (region of inaction) around a setpoint (target value).  Take your home thermostat as an example. The setpoint is X degrees. The heat will not turn on until some slight difference below the setpoint.  Similarly, the heat will not turn off until some slight difference above the setpoint. This prevents the heating system from cycling too rapidly around the setpoint.