|
|
@@ -236,7 +236,7 @@ void PMSM_FOC_CoreInit(void) {
|
|
|
#ifdef CONFIG_SMO_OBSERVER
|
|
|
smo_observer_init(CONFIG_SMO_PLL_BANDWITH, CONFIG_SMO_LFP_WC, CONFIG_SMO_GAIN_K, CONFIG_SMO_SIGMOID_MAX);
|
|
|
#endif
|
|
|
- gFoc_Ctrl.plot_type = Plot_SMO_OBS;
|
|
|
+ gFoc_Ctrl.plot_type = Plot_Phase_curr;
|
|
|
}
|
|
|
|
|
|
//#define PHASE_LFP_FIR
|
|
|
@@ -364,9 +364,12 @@ void PMSM_FOC_Schedule(void) {
|
|
|
gFoc_Ctrl.in.s_targetVdq.d = FOC_Get_DqRamp(&gFoc_Ctrl.vdq_ctl[0]);
|
|
|
gFoc_Ctrl.in.s_targetVdq.q = FOC_Get_DqRamp(&gFoc_Ctrl.vdq_ctl[1]);
|
|
|
}
|
|
|
-
|
|
|
- gFoc_Ctrl.out.f_vdqRation = Circle_Limitation(&gFoc_Ctrl.in.s_targetVdq, gFoc_Ctrl.in.s_vDC, gFoc_Ctrl.params.n_modulation, &gFoc_Ctrl.out.s_OutVdq);
|
|
|
|
|
|
+ gFoc_Ctrl.out.f_vdqRation = Circle_Limitation(&gFoc_Ctrl.in.s_targetVdq, gFoc_Ctrl.in.s_vDC, gFoc_Ctrl.params.n_modulation, &gFoc_Ctrl.out.s_OutVdq);
|
|
|
+
|
|
|
+ gFoc_Ctrl.out.s_OutVdq.d *= SQRT3_BY_2;
|
|
|
+ gFoc_Ctrl.out.s_OutVdq.q *= SQRT3_BY_2;
|
|
|
+
|
|
|
RevPark(&gFoc_Ctrl.out.s_OutVdq, gFoc_Ctrl.in.s_motAngle, &gFoc_Ctrl.out.s_OutVAB);
|
|
|
|
|
|
SVM_Duty_Fix(&gFoc_Ctrl.out.s_OutVAB, gFoc_Ctrl.in.s_vDC, FOC_PWM_Half_Period, &gFoc_Ctrl.out);
|