存了一下最新的pid参数
This commit is contained in:
@@ -9,8 +9,8 @@
|
||||
#define FAN_LB_PWM_A_PIN TIM10_PWM_MAP3_CH2_D3 // 左侧动力风扇
|
||||
#define FAN_LB_PWM_B_PIN TIM10_PWM_MAP3_CH4_D7 // 左侧动力风扇
|
||||
// M1
|
||||
#define FAN_RB_PWM_A_PIN TIM4_PWM_MAP1_CH3_D14 // 右侧动力风扇
|
||||
#define FAN_RB_PWM_B_PIN TIM4_PWM_MAP1_CH1_D12 // 右侧动力风扇
|
||||
#define FAN_RB_PWM_A_PIN TIM4_PWM_MAP1_CH1_D12 // 右侧动力风扇
|
||||
#define FAN_RB_PWM_B_PIN TIM4_PWM_MAP1_CH3_D14 // 右侧动力风扇
|
||||
// M3
|
||||
#define FAN_LS_PWM_A_PIN TIM10_PWM_MAP3_CH1_D1 // 左后动力风扇
|
||||
#define FAN_LS_PWM_B_PIN TIM10_PWM_MAP3_CH3_D5 // 左后动力风扇
|
||||
@@ -83,8 +83,7 @@ void by_pwm_init(void)
|
||||
pwm_init(FAN_LB_PWM_B_PIN, 12000, 0);
|
||||
pwm_init(FAN_RB_PWM_A_PIN, 12000, 0);
|
||||
pwm_init(FAN_RB_PWM_B_PIN, 12000, 0);
|
||||
// while (1)
|
||||
// ;
|
||||
// while (1);
|
||||
// system_delay_ms(3000);
|
||||
// // pwm_init(FAN_LS_PWM_PIN, 50, 1000); // 动力风扇左 1
|
||||
// // pwm_init(FAN_RS_PWM_PIN, 50, 1000); // 动力风扇右 1
|
||||
@@ -135,8 +134,7 @@ void by_pwm_power_duty(int32_t bpwm_duty_ls, int32_t bpwm_duty_rs, int32_t bpwm_
|
||||
if (bpwm_duty_ls >= 0) {
|
||||
pwm_set_duty(FAN_LS_PWM_A_PIN, bpwm_duty_ls);
|
||||
pwm_set_duty(FAN_LS_PWM_B_PIN, 0);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
pwm_set_duty(FAN_LS_PWM_A_PIN, 0);
|
||||
pwm_set_duty(FAN_LS_PWM_B_PIN, -1 * pwm_duty_ls);
|
||||
}
|
||||
@@ -144,8 +142,7 @@ void by_pwm_power_duty(int32_t bpwm_duty_ls, int32_t bpwm_duty_rs, int32_t bpwm_
|
||||
if (bpwm_duty_rs >= 0) {
|
||||
pwm_set_duty(FAN_RS_PWM_A_PIN, bpwm_duty_rs);
|
||||
pwm_set_duty(FAN_RS_PWM_B_PIN, 0);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
pwm_set_duty(FAN_RS_PWM_A_PIN, 0);
|
||||
pwm_set_duty(FAN_RS_PWM_B_PIN, -1 * pwm_duty_rs);
|
||||
}
|
||||
@@ -153,7 +150,7 @@ void by_pwm_power_duty(int32_t bpwm_duty_ls, int32_t bpwm_duty_rs, int32_t bpwm_
|
||||
if (bpwm_duty_lb >= 0) {
|
||||
pwm_set_duty(FAN_LB_PWM_A_PIN, bpwm_duty_lb);
|
||||
pwm_set_duty(FAN_LB_PWM_B_PIN, 0);
|
||||
} else {
|
||||
} else {
|
||||
pwm_set_duty(FAN_LB_PWM_A_PIN, 0);
|
||||
pwm_set_duty(FAN_LB_PWM_B_PIN, -1 * bpwm_duty_lb);
|
||||
}
|
||||
@@ -161,7 +158,7 @@ void by_pwm_power_duty(int32_t bpwm_duty_ls, int32_t bpwm_duty_rs, int32_t bpwm_
|
||||
if (bpwm_duty_rb >= 0) {
|
||||
pwm_set_duty(FAN_RB_PWM_A_PIN, bpwm_duty_rb);
|
||||
pwm_set_duty(FAN_RB_PWM_B_PIN, 0);
|
||||
} else{
|
||||
} else {
|
||||
pwm_set_duty(FAN_RB_PWM_A_PIN, 0);
|
||||
pwm_set_duty(FAN_RB_PWM_B_PIN, -1 * bpwm_duty_rb);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user