|
|
@@ -171,7 +171,7 @@ static void plot_smo_angle(void) {
|
|
|
can_plot3(mot_angle, smo_angle, delta);
|
|
|
}
|
|
|
|
|
|
-#if 0
|
|
|
+#ifdef CONFIG_USE_ENCODER_HALL
|
|
|
static void plot_hall_angle(void) {
|
|
|
u32 mask = cpu_enter_critical();
|
|
|
float hall_angle = hall_get_elec_angle();
|
|
|
@@ -202,8 +202,15 @@ static u32 app_plot_task(void * args) {
|
|
|
}
|
|
|
can_plot2(plot_arg1, plot_arg2);
|
|
|
}else if (plot_type == 2) {
|
|
|
+#ifdef CONFIG_USE_ENCODER_HALL
|
|
|
+ if (mot_contrl()->if_ctl.b_ena || motor.b_force_run) {
|
|
|
+ plot_hall_angle();
|
|
|
+ }else {
|
|
|
+ can_plot2(mot_contrl_get_final_torque(&motor.controller), mot_contrl()->target_torque);
|
|
|
+ }
|
|
|
+#else
|
|
|
can_plot2(mot_contrl_get_final_torque(&motor.controller), mot_contrl()->target_torque);
|
|
|
- //plot_hall_angle();
|
|
|
+#endif
|
|
|
}else if (plot_type == 3) {
|
|
|
plot_smo_angle();
|
|
|
}else if (plot_type == 4) {
|