|
@@ -194,6 +194,25 @@ static void plot_smo_angle(void) {
|
|
|
delta = fast_atan2(s, c)/PI*180.0f;
|
|
delta = fast_atan2(s, c)/PI*180.0f;
|
|
|
can_plot3(mot_angle, smo_angle, delta);
|
|
can_plot3(mot_angle, smo_angle, delta);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+#ifdef CONFIG_USE_ENCODER_HALL
|
|
|
|
|
+static void plot_hall_angle(void) {
|
|
|
|
|
+ u32 mask = cpu_enter_critical();
|
|
|
|
|
+ float hall_angle = hall_get_elec_angle();
|
|
|
|
|
+ float mot_angle = foc()->in.mot_angle;
|
|
|
|
|
+ if (mot_contrl()->if_ctl.b_ena) {
|
|
|
|
|
+ mot_angle += 90;
|
|
|
|
|
+ }
|
|
|
|
|
+ norm_angle_deg(mot_angle);
|
|
|
|
|
+ cpu_exit_critical(mask);
|
|
|
|
|
+ float delta = hall_angle - mot_angle;
|
|
|
|
|
+ float s, c;
|
|
|
|
|
+ arm_sin_cos(delta, &s, &c);
|
|
|
|
|
+ delta = fast_atan2(s, c)/PI*180.0f;
|
|
|
|
|
+ can_plot3(mot_angle, hall_angle, delta);
|
|
|
|
|
+}
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
static u32 app_plot_task(void * args) {
|
|
static u32 app_plot_task(void * args) {
|
|
|
if (plot_type == 1) {
|
|
if (plot_type == 1) {
|
|
|
s16 plot_arg1 = mot_contrl()->ramp_vel_lim.interpolation;
|
|
s16 plot_arg1 = mot_contrl()->ramp_vel_lim.interpolation;
|