|
|
@@ -126,26 +126,26 @@ int plot_type = 0;
|
|
|
static void plot_smo_angle(void) {
|
|
|
#if 1
|
|
|
float smo_angle = foc_observer_sensorless_angle();
|
|
|
- float delta = smo_angle - motor.controller.foc.in.mot_angle;
|
|
|
+ float delta = smo_angle - foc()->in.mot_angle;
|
|
|
float s, c;
|
|
|
arm_sin_cos(delta, &s, &c);
|
|
|
delta = fast_atan2(s, c)/PI*180.0f;
|
|
|
- can_plot3(motor.controller.foc.in.mot_angle, smo_angle, delta);
|
|
|
+ can_plot3(foc()->in.mot_angle, smo_angle, delta);
|
|
|
#else
|
|
|
can_plot2((s16)(foc_observer_sensorless_diff() * 100.0f), (s16)(foc_observer_sensorless_ration() * 100.0f));
|
|
|
#endif
|
|
|
}
|
|
|
static u32 _app_plot_task(void * args) {
|
|
|
if (plot_type == 1) {
|
|
|
- can_plot2((s16)foc_observer_sensorless_speed(), (s16)mot_contrl_get_speed(&motor.controller));
|
|
|
+ can_plot2((s16)foc_observer_sensorless_speed(), (s16)mot_contrl_get_speed(mot_contrl()));
|
|
|
}else if (plot_type == 2) {
|
|
|
- can_plot2(mot_contrl_get_final_torque(&motor.controller), motor.controller.target_torque);
|
|
|
+ can_plot2(mot_contrl_get_final_torque(mot_contrl()), mot_contrl()->target_torque);
|
|
|
}else if (plot_type == 3) {
|
|
|
plot_smo_angle();
|
|
|
}else if (plot_type == 4) {
|
|
|
- can_plot2((s16)motor.controller.foc.out.curr_dq.d, (s16)motor.controller.foc.out.curr_dq.q);
|
|
|
+ can_plot2((s16)foc()->out.curr_dq.d, (s16)foc()->out.curr_dq.q);
|
|
|
}else if (plot_type == 5) {
|
|
|
- can_plot2((s16)motor.controller.foc.in.target_id.interpolation , (s16)motor.controller.foc.in.target_iq.interpolation);
|
|
|
+ can_plot2((s16)foc()->in.target_id.interpolation , (s16)foc()->in.target_iq.interpolation);
|
|
|
}else if (plot_type == 6) {
|
|
|
//do it in other place
|
|
|
}else if (plot_type == 7) {
|