启动策略:开环强拖、IPD、平滑切换
系列:电机控制系列 - 第 21 篇
一、启动难题
无感 FOC:零速无反电动势 → 观测器失效
二、开环强拖
// 强制开环旋转
void Open_Loop_Startup(FOC_t *foc, float target_speed) {
float theta = 0;
while (foc->omega_m < target_speed) {
// 1. 逐步增加频率
float freq = foc->omega_m / (2 * M_PI);
// 2. 设置电流
foc->id_ref = 0;
foc->iq_ref = 2.0f; // 固定电流
// 3. 开环角度
foc->theta_e = theta;
theta += 0.01f;
// 4. FOC 控制
FOC_Current_Loop(foc);
HAL_Delay(1);
}
}三、IPD(初始位置检测)
// 电感饱和法
void IP_Detection(void) {
// 注入脉冲 → 测量电流响应 → 判断位置
}四、平滑切换
// 开环 → 闭环切换
void Transition_To_Closed_Loop(FOC_t *foc) {
float weight = 0; // 0=开环,1=闭环
while (weight < 1.0f) {
// 混合角度
float theta_mix = foc->theta_open_loop * (1 - weight) +
foc->smo.theta_est * weight;
foc->theta_e = theta_mix;
weight += 0.01f;
HAL_Delay(10);
}
}下一篇:温度估算