Bladeren bron

支持设置autohold pi控制器

Signed-off-by: huhui <huhui@sharkgulf.com>
huhui 2 jaren geleden
bovenliggende
commit
7ec13b2795
3 gewijzigde bestanden met toevoegingen van 4 en 3 verwijderingen
  1. 0 1
      Applications/app/nv_storage.c
  2. 2 0
      Applications/foc/core/PMSM_FOC_Core.c
  3. 2 2
      Applications/foc/core/thro_torque.c

+ 0 - 1
Applications/app/nv_storage.c

@@ -538,7 +538,6 @@ void nv_storage_init(void) {
 	m_params.offset = 0.0f; //编码器做了零位置校准
 	m_params.est_pll_band = 200;
 	m_params.flux_linkage = MOTOR_Flux;
-	m_params.pos_lock_pll_band = 100;
 #endif
 #if CONFIG_MOT_TYPE==MOTOR_BLUESHARK_A1
 	m_params.offset = 0.0f; //编码器做了零位置校准

+ 2 - 0
Applications/foc/core/PMSM_FOC_Core.c

@@ -1391,6 +1391,8 @@ static PI_Controller *_pid(u8 id) {
 #ifndef CONFIG_SPEED_LADRC
 		pi = &gFoc_Ctrl.pi_vel;
 #endif
+	}else if (id == PID_Lock_id) {
+		pi = &gFoc_Ctrl.pi_lock;
 	}
 	return pi;
 }

+ 2 - 2
Applications/foc/core/thro_torque.c

@@ -263,6 +263,6 @@ float get_user_request_torque(void) {
 void thro_torque_log(void) {
 	sys_debug("accl %d, real %f, req %f\n", _torque.accl, _torque.torque_real, _torque.torque_req);
 	sys_debug("ration %f - %f - %f - %d\n", _torque.thro_ration, _torque.thro_ration_last, thro_torque_for_accelerate(), _torque.gear);
-	sys_debug("acc:%f,%f,%f", acc_r, acc_r_last, acc_trq);
-	sys_debug("dec:%f,%f,%f", dec_r, dec_r_last, dec_trq);
+	sys_debug("acc:%f,%f,%f\n", acc_r, acc_r_last, acc_trq);
+	sys_debug("dec:%f,%f,%f\n", dec_r, dec_r_last, dec_trq);
 }