1
0
mirror of https://github.com/rene-dev/stmbl.git synced 2024-12-25 10:02:18 +00:00

pmsm limits psi_d doc, renamed psi_m to psi

This commit is contained in:
Rene Hopf 2017-04-12 02:48:58 +02:00
parent 622f02ad1e
commit f25b0a1eb0

View File

@ -35,27 +35,27 @@ RT(
float p = (int)MAX(PIN(polecount), 1.0);
//float ld = MAX(PIN(ld), 0.0001);
float lq = MAX(PIN(lq), 0.0001);
float psi_m = MAX(PIN(psi), 0.01);
float psi = MAX(PIN(psi), 0.01);
float r = MAX(PIN(r), 0.001);
float iq = PIN(iq);
float indq = PIN(indq);
float psid = PIN(psi);
float psid = psi;// psi + ld * id
float volt = PIN(ac_volt);
float abs_max_cur = volt / r;
float abs_max_vel = volt / psid / p;
float abs_max_torque = 3.0 / 2.0 * p * psi_m * abs_max_cur;
float abs_max_torque = 3.0 / 2.0 * p * psi * abs_max_cur;
float next_max_cur = iq + (volt - r * iq - indq) / lq * period;
float next_min_cur = iq + (-volt - r * iq - indq) / lq * period;
float next_max_torque = 3.0 / 2.0 * p * (psi_m * next_max_cur);
float next_min_torque = 3.0 / 2.0 * p * (psi_m * next_min_cur);
float next_max_torque = 3.0 / 2.0 * p * (psi * next_max_cur);
float next_min_torque = 3.0 / 2.0 * p * (psi * next_min_cur);
float max_cur = (volt - indq) / r;
float min_cur = (-volt - indq) / r;
float max_torque = 3.0 / 2.0 * p * (psi_m * max_cur);
float min_torque = 3.0 / 2.0 * p * (psi_m * min_cur);
float max_torque = 3.0 / 2.0 * p * (psi * max_cur);
float min_torque = 3.0 / 2.0 * p * (psi * min_cur);
PIN(abs_max_cur) = abs_max_cur;