Updated Emanuel FOC model

This commit is contained in:
2020-10-19 18:25:44 +02:00
parent 4cf506652f
commit 928daf84a2
2 changed files with 9 additions and 3 deletions

View File

@ -164,8 +164,14 @@ int main()
HAL_ADC_Start(&hadc1);
HAL_ADC_Start(&hadc2);
enum { CurrentMeasAB, CurrentMeasBC, CurrentMeasAC };
left.rtP = rtP_Left;
left.rtP.b_selPhaABCurrMeas = 1; // Left motor measured current phases = {iA, iB} -> do NOT change
#ifdef PETERS_PLATINE
left.rtP.z_selPhaCurMeasABC = CurrentMeasBC; // Left motor measured current phases = {iB, iC} -> do NOT change
#else
left.rtP.z_selPhaCurMeasABC = CurrentMeasAB; // Left motor measured current phases = {iA, iB} -> do NOT change
#endif
left.rtP.z_ctrlTypSel = uint8_t(left.state.ctrlTyp);
left.rtP.b_diagEna = DIAG_ENA;
left.rtP.i_max = (left.state.iMotMax * A2BIT_CONV) << 4; // fixdt(1,16,4)
@ -181,7 +187,7 @@ int main()
left.rtM.outputs = &left.rtY;
right.rtP = rtP_Left;
right.rtP.b_selPhaABCurrMeas = 0; // Left motor measured current phases = {iB, iC} -> do NOT change
right.rtP.z_selPhaCurMeasABC = CurrentMeasBC; // Right motor measured current phases = {iB, iC} -> do NOT change
right.rtP.z_ctrlTypSel = uint8_t(right.state.ctrlTyp);
right.rtP.b_diagEna = DIAG_ENA;
right.rtP.i_max = (right.state.iMotMax * A2BIT_CONV) << 4; // fixdt(1,16,4)