【基础技术】永磁同步电机(PMSM)的磁场定向控制(FOC)基础模块运算

概述

FOC主要模块包括:Clarke、Park、iPark、SVPWM等基础单元组成

Carke变换

根据u、v、w相电流求解出alpha、beta相电流。
共有4种:
1、采集u、v、w三相电流;
2、采集u、v两相电流;

alpha = u;
beta = (u+2*v)/sqrt3;

2、采集u、w两相电流;

alpha = u;
beta = -(u+2*w)/sqrt3;

3、采集v、w两相电流;

在某些测试情况下,需要iClarke变换。

u = alpha;
v = (beta*SQRT3-alpha)/2;
w = -u - v;

Park变换

根据alpha、beta相电流计算出d、q轴电流。

d = alpha * CosAngle + beta * SinAngle;
q = beta * CosAngle - beta * SinAngle;

iPark变换

alpha =  d * CosAngle + q * SinAngle;
beta = d * CosAngle -  q * SinAngle;

SVPWM

	int hTimePhA, hTimePhB, hTimePhC;
	int X, Y, Z;
	int sector;

	int T = PWM_PERIOD;
	int T_2 = T * 0.50f;
	int T_4 = T * 0.25f;

	int Ualpha	=  - T * Valpha * SQRT3;
	int Ubeta	=  T * Vbeta;

	X = Ubeta;
	Y = ( Ubeta - Ualpha ) * 0.5f;
	Z = ( Ubeta + Ualpha ) * 0.5f;

	if ( Y < 0 ) {
		if (Z < 0) {
			sector = 5;
		} else {
			if (X > 0) {
				sector = 3;
			} else {
				sector = 4;
			}
		}
	} else {
		if (Z < 0) {
			if (X > 0) {
				sector = 1;
			} else {
				sector = 6;
			}
		} else {
			sector = 2;
		}
	}

	switch (sector) {
	case 1:
	case 4:
		hTimePhA = T_4 + ( ( T_2 + X - Z ) * 0.5f );
		hTimePhB = hTimePhA + Z;
		hTimePhC = hTimePhB - X;
	 break;

	case 2:
	case 5:
		hTimePhA = T_4 + ( ( T_2 + Y - Z ) * 0.5f );
		hTimePhB = hTimePhA + Z;
		hTimePhC = hTimePhA - Y;
	 break;

	case 3:
	case 6:
		hTimePhA = T_4 + ( ( T_2 + Y - X ) * 0.5f );
		hTimePhC = hTimePhA - Y;
		hTimePhB = hTimePhC + X;
	 break;
	}

	PWM1 = hTimePhA;
	PWM2 = hTimePhB;
	PWM3 = hTimePhC;
©️2020 CSDN 皮肤主题: 深蓝海洋 设计师:CSDN官方博客 返回首页