全功能完成版本V1.0

This commit is contained in:
2025-09-16 12:08:36 +08:00
parent b6be5c1ffe
commit ce198ed458
7 changed files with 187 additions and 97 deletions
@@ -34,7 +34,7 @@ void DCMOTORDBGOnOff(uint8_t OnOff)
/* Timer4 CNT */
#define TIMER4_UNIT (M4_TMR41)
#define TIMER4_CNT_CYCLE_VAL (10000u) /* Timer4 counter cycle value */
#define TIMER4_CNT_CYCLE_VAL (500u) /* Timer4 counter cycle value */
/* Timer4 OCO */
#define TIMER4_OCO_HIGH_CH (Timer4OcoOuh) /* only Timer4OcoOuh Timer4OcoOvh Timer4OcoOwh */
@@ -11,9 +11,9 @@
#define TIMER TIMER4
// 电机控制参数
#define PWM_PERIOD TIM_PERIOD // PWM周期值 (ARR)
#define MAX_SPEED 9900 // 最大速度(PWM占空比)
#define ACCEL_STEP 100 // 加速步进值
#define DECEL_STEP 100 // 减速步进值
#define MAX_SPEED 480 // 最大速度(PWM占空比)
#define ACCEL_STEP 10 // 加速步进值
#define DECEL_STEP 10 // 减速步进值
#define ACCEL_INTERVAL 2 // 加减速间隔(ms)