Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
0699c765fThis file is pinned to the selected release. Download the original to open it in your design tool.
HAL_COMP(i2t);
HAL_PIN(brake_r) = 50.0;
HAL_PIN(brake) = 2.0;
HAL_PIN(air_temp) = 20.0;
HAL_PIN(mot_air_res) = 0.0;
HAL_PIN(mot_cap) = 0.0;
HAL_PIN(mot_tau) = 300.0;
HAL_PIN(mot_temp) = 25.0;
HAL_PIN(mot_max_temp) = 130.0;
HAL_PIN(mot_res) = 1.0;
HAL_PIN(mot_psi) = 1.0;
HAL_PIN(mot_real_res) = 1.0;
HAL_PIN(mot_real_psi) = 1.0;
HAL_PIN(mot_cont_cur) = 2.15;
HAL_PIN(id) = 0.0;
HAL_PIN(iq) = 0.0;
HAL_PIN(flow) = 0.0;
MEM(float mot_temp) = 25.0;
RT(
float mot_real_res = PIN(mot_res) * (1 + 0.004 * (mot_temp - PIN(air_temp)));
float mot_max_res = PIN(mot_res) * (1 + 0.004 * (PIN(mot_max_temp) - PIN(air_temp)));
float mot_air_res = (PIN(mot_max_temp) - PIN(air_temp)) / (PIN(mot_cont_cur) * PIN(mot_cont_cur) * mot_max_res);;
float mot_cap = PIN(mot_tau) / mot_air_res;
float brake_flow = 24.0 * 24.0 / PIN(brake_r) * PIN(brake);
float flow = (PIN(id) * PIN(id) + PIN(iq) * PIN(iq)) * 3.0 / 2.0 * mot_real_res - (mot_temp - PIN(air_temp)) / mot_air_res;
flow += brake_flow;
mot_temp += flow / mot_cap * period;
PIN(flow) = flow;
PIN(mot_air_res) = mot_air_res;
PIN(mot_cap) = mot_cap;
PIN(mot_temp) = mot_temp;
PIN(mot_real_res) = mot_real_res;
PIN(mot_real_psi) = PIN(mot_psi) * (1 - 0.0013 * (mot_temp - PIN(air_temp)));;
);
ENDCOMP;