|
|
@@ -1,6 +1,7 @@
|
|
|
#include "bsp/bsp.h"
|
|
|
#include "app/app.h"
|
|
|
#include "bsp/adc.h"
|
|
|
+#include "bsp/pwm.h"
|
|
|
#include "os/os_task.h"
|
|
|
#include "libs/logger.h"
|
|
|
#include "libs/utils.h"
|
|
|
@@ -127,23 +128,24 @@ static u32 _app_report_task(void *p) {
|
|
|
//sys_debug("modulation %f, %f\n", PMSM_FOC_Get()->out.f_vdqRation, PMSM_FOC_Get()->rtLim.rpmLimRamp.interpolation);
|
|
|
//sys_debug("Slow: %d - %d\n", g_meas_MCTask.intval_time, g_meas_MCTask.exec_time);
|
|
|
//sys_debug("Fast: %d - %d, err: %d-%d-%d\n", g_meas_foc.intval_time, g_meas_foc.exec_time, g_meas_foc.intval_hi_err, g_meas_foc.intval_low_err, g_meas_foc.exec_max_error_time);
|
|
|
- //sys_debug("FOC time err %d %d\n", g_meas_foc.intval_time_h_error, g_meas_foc.intval_time_l_error);
|
|
|
- //sys_debug("acc vol %d\n", get_acc_vol());
|
|
|
- //sys_debug("throttle %f\n", get_throttle_float());
|
|
|
+ sys_debug("FOC time err %d %d\n", g_meas_foc.intval_time_h_error, g_meas_foc.intval_time_l_error);
|
|
|
+ sys_debug("acc vol %d\n", get_acc_vol());
|
|
|
+ sys_debug("throttle %f\n", get_throttle_float());
|
|
|
+ sys_debug("deadtime 0x%x\n", get_deadtime());
|
|
|
//sys_debug("ADC Vref %f, %f\n", get_adc_vref(), adc_5vref_compesion());
|
|
|
//sys_debug("Vdq in %f, %f\n", PMSM_FOC_Get()->in.s_targetVdq.d, PMSM_FOC_Get()->in.s_targetVdq.q);
|
|
|
//sys_debug("Vdq out %f, %f\n", PMSM_FOC_Get()->out.s_OutVdq.d, PMSM_FOC_Get()->out.s_OutVdq.q);
|
|
|
//sys_debug("target current %f\n", PMSM_FOC_Get()->in.s_targetCurrent);
|
|
|
//thro_torque_log();
|
|
|
//sys_debug("fan rpm %d, %d\n", mc_params()->fan[0].rpm, mc_params()->fan[1].rpm);
|
|
|
- //encoder_log();
|
|
|
+ encoder_log();
|
|
|
///PMSM_FOC_LogDebug();
|
|
|
//eCtrl_debug_log();
|
|
|
//err_code_log();
|
|
|
}
|
|
|
return 200;
|
|
|
}
|
|
|
-int plot_type = 7;
|
|
|
+int plot_type = 2;
|
|
|
static void plot_smo_angle(void) {
|
|
|
float smo_angle = foc_observer_smo_angle();
|
|
|
float delta = smo_angle - PMSM_FOC_Get()->in.s_hallAngle;
|