|
|
@@ -87,16 +87,16 @@ static u32 _app_report_task(void *p) {
|
|
|
can_report_mpta_values(0x45);
|
|
|
can_report_phase_current(0x45);
|
|
|
if (mot_params_rs_ested()) {
|
|
|
- can_report_motparam(mot_params_get_est_rs(), R_TYPE);
|
|
|
+ can_report_mot_params_ested(mot_params_get_est_rs(), R_TYPE);
|
|
|
}
|
|
|
if (mot_params_ld_ested()) {
|
|
|
- can_report_motparam(mot_params_get_est_ld(), L_TYPE_D);
|
|
|
+ can_report_mot_params_ested(mot_params_get_est_ld(), L_TYPE_D);
|
|
|
}
|
|
|
if (mot_params_lq_ested()) {
|
|
|
- can_report_motparam(mot_params_get_est_lq(), L_TYPE_Q);
|
|
|
+ can_report_mot_params_ested(mot_params_get_est_lq(), L_TYPE_Q);
|
|
|
}
|
|
|
if (mot_params_flux_ested()) {
|
|
|
- can_report_motparam(mot_params_get_est_flux(), FLUX_TYPE);
|
|
|
+ can_report_mot_params_ested(mot_params_get_est_flux(), FLUX_TYPE);
|
|
|
}
|
|
|
|
|
|
if (++loop % 5 == 0) {
|
|
|
@@ -124,20 +124,26 @@ static u32 _app_report_task(void *p) {
|
|
|
}
|
|
|
int plot_type = 0;
|
|
|
static void plot_smo_angle(void) {
|
|
|
-#if 1
|
|
|
float smo_angle = foc_observer_sensorless_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(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));
|
|
|
+ s16 plot_arg1 = (s16)foc_observer_sensorless_speed();
|
|
|
+ s16 plot_arg2 = (s16)mot_contrl_get_speed(&motor.controller);
|
|
|
+ if (mot_contrl()->mode_running == CTRL_MODE_SPD) {
|
|
|
+ if (mc_is_cruise_enabled()) {
|
|
|
+ plot_arg1 = mot_contrl()->cruise_vel.target;
|
|
|
+ }else {
|
|
|
+ plot_arg1 = mot_contrl()->target_vel.target;
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ can_plot2(plot_arg1, plot_arg2);
|
|
|
+ }
|
|
|
}else if (plot_type == 2) {
|
|
|
can_plot2(mot_contrl_get_final_torque(&motor.controller), mot_contrl()->target_torque);
|
|
|
}else if (plot_type == 3) {
|