This commit is contained in:
2026-09-01 14:09:31 +08:00
parent 653c7ec412
commit dac0e92ac9
11 changed files with 127 additions and 62 deletions
+6 -6
View File
@@ -102,8 +102,6 @@ static void filamentThread(void *arg)
HAL_ADCEx_MultiModeStart_DMA(&hadc1, (uint32_t *)gausAdcBuf, ADC_CHNL_NUM);
debug("ADC_CHNL_NUM = %d\n", ADC_CHNL_NUM);
__HAL_TIM_SET_COMPARE(&htim1, TIM_CHANNEL_1, 0);
HAL_TIM_PWM_Start(&htim1, TIM_CHANNEL_1);
@@ -125,8 +123,8 @@ static void filamentThread(void *arg)
iWorkCmd = 3;
if (gucWorkState == 1) {
gucWorkState = 2;
if (gusNormalDuty == 0) {
gusNormalDuty = gusPreheatDuty * 2;
if (gusNormalDuty < gusPreheatDuty * 1.5 ) {
gusNormalDuty = gusPreheatDuty * 1.5;
}
gusDuty = gusNormalDuty;
__HAL_TIM_SET_COMPARE(&htim1, TIM_CHANNEL_1, gusDuty);
@@ -157,9 +155,11 @@ static void filamentThread(void *arg)
continue;
}
iCnt = 0;
printf("\n");
printf("\n");
printf("ADC: %d,%d,%d\n", gausAdcBuf[0], gausAdcBuf[1], gausAdcBuf[2]);
printf("duty:%d%%,I:%.3fA,V:%.2fV\n", gusDuty, gusFilamentCurrent/1000.0, gusFilamentVoltage/1000.0);
printf("workState:%d,duty:%d%%,I:%.3fA,V:%.2fV\n", gucWorkState, gusDuty * 100 / 2400, gusFilamentCurrent/1000.0, gusFilamentVoltage/1000.0);
}
}