You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// see https://www.youtube.com/watch?v=InzXA7mWBWE Slide 5
329
+
staticint trap_120_map[6][3] = {
330
+
{0,1,-1},{-1,1,0},{-1,0,1},{0,-1,1},{1,-1,0},{1,0,-1} // each is 60 degrees with values for 3 phases of 1=positive -1=negative 0=high-z
331
+
};
332
+
staticint trap_120_state = 0;
333
+
trap_120_state = 6 * (_normalizeAngle(angle_el + PI/6.0 + zero_electric_angle) / _2PI); // adding PI/6 to align with other modes
334
+
335
+
Ua = Uq + trap_120_map[trap_120_state][0] * Uq;
336
+
Ub = Uq + trap_120_map[trap_120_state][1] * Uq;
337
+
Uc = Uq + trap_120_map[trap_120_state][2] * Uq;
338
+
339
+
if (centered) {
340
+
Ua += (voltage_power_supply)/2 -Uq;
341
+
Ub += (voltage_power_supply)/2 -Uq;
342
+
Uc += (voltage_power_supply)/2 -Uq;
343
+
}
344
+
break;
345
+
346
+
case FOCModulationType::Trapezoid_150 :
347
+
// see https://www.youtube.com/watch?v=InzXA7mWBWE Slide 8
348
+
staticint trap_150_map[12][3] = {
349
+
{0,1,-1},{-1,1,-1},{-1,1,0},{-1,1,1},{-1,0,1},{-1,-1,1},{0,-1,1},{1,-1,1},{1,-1,0},{1,-1,-1},{1,0,-1},{1,1,-1} // each is 30 degrees with values for 3 phases of 1=positive -1=negative 0=high-z
350
+
};
351
+
staticint trap_150_state = 0;
352
+
trap_150_state = 12 * (_normalizeAngle(angle_el + PI/6.0 + zero_electric_angle) / _2PI); // adding PI/6 to align with other modes
0 commit comments