|
|
@@ -143,7 +143,7 @@ static u32 _app_report_task(void *p) {
|
|
|
}
|
|
|
return 200;
|
|
|
}
|
|
|
-static int plot_type = 7;
|
|
|
+int plot_type = 7;
|
|
|
static void plot_smo_angle(void) {
|
|
|
float smo_angle = foc_observer_smo_angle();
|
|
|
float delta = smo_angle - PMSM_FOC_Get()->in.s_hallAngle;
|
|
|
@@ -158,23 +158,24 @@ static void plot_smo_angle(void) {
|
|
|
static u32 _app_plot_task(void * args) {
|
|
|
if (plot_type == 1) {
|
|
|
can_plot2((s16)(PMSM_FOC_Get()->in.s_targetTorque*10.0f), (s16)PMSM_FOC_GetSpeed());
|
|
|
- //can_plot3((s16)PMSM_FOC_Get()->vel_lim_adrc.z1, (s16)PMSM_FOC_Get()->vel_lim_adrc.z2, (s16)PMSM_FOC_GetSpeed());
|
|
|
- //can_plot2(test_id, test_iq);
|
|
|
}else if (plot_type == 2) {
|
|
|
can_plot2(eCtrl_get_RefTorque(), eCtrl_get_FinalTorque());
|
|
|
}else if (plot_type == 3) {
|
|
|
- //can_plot2(PMSM_FOC_GetSpeed(), foc_observer_smo_speed());
|
|
|
plot_smo_angle();
|
|
|
}else if (plot_type == 4) {
|
|
|
- can_plot2(eCtrl_get_RefTorque(), PMSM_FOC_Get()->in.s_targetTorque);
|
|
|
+ can_plot2((s16)PMSM_FOC_Get()->out.s_RealIdq.d, (s16)PMSM_FOC_Get()->out.s_RealIdq.q);
|
|
|
}else if (plot_type == 5) {
|
|
|
-#ifdef CONFIG_DQ_STEP_RESPONSE
|
|
|
- can_plot2((s16)(target_d*10.0f), (s16)(PMSM_FOC_Get()->out.s_RealIdq.d * 10.0f));
|
|
|
-#endif
|
|
|
+ can_plot2((s16)PMSM_FOC_Get()->out.s_FilterIdq.d, (s16)PMSM_FOC_Get()->out.s_FilterIdq.q);
|
|
|
}else if (plot_type == 6) {
|
|
|
can_plot2((s16)(PMSM_FOC_Get()->in.s_iABC[0]), (s16)(PMSM_FOC_Get()->in.s_iABC[1]));
|
|
|
}else if (plot_type == 7) {
|
|
|
- can_plot2((s16)PMSM_FOC_Get()->out.s_RealIdq.d, (s16)PMSM_FOC_Get()->out.s_RealIdq.q);
|
|
|
+ #ifdef CONFIG_DQ_STEP_RESPONSE
|
|
|
+ can_plot2((s16)(target_d*10.0f), (s16)(PMSM_FOC_Get()->out.s_RealIdq.d * 10.0f));
|
|
|
+ #endif
|
|
|
+ }else if (plot_type == 8) {
|
|
|
+ #ifdef CONFIG_DQ_STEP_RESPONSE
|
|
|
+ can_plot2((s16)(target_q*10.0f), (s16)(PMSM_FOC_Get()->out.s_RealIdq.q * 10.0f));
|
|
|
+ #endif
|
|
|
}
|
|
|
|
|
|
return 20;
|