You are here

Two phase modulation

5 posts / 0 new
Last post
jguy
Offline
Last seen: 4 months 3 weeks ago
VESC Free
Joined: 2020-02-22 03:24
Posts: 3
Two phase modulation

Hello everyone.

I made my own VESC motor controller with 3 current sensors placed series to the motor line for eco-run competition.

Due to the needs of high efficiency, I modded the firmware and implemented two phase modulation to reduce the switching loss to 66% of three phase modulation. There are varieties of two phase modulations but since I'm using a boot strap circuit for high side gate drive, I chose the one which one of the low side MOS-FETs will always be ON. Logically, I didn't come up with any issues so went for it.

WS000.png

This is the phase voltage wave form I got. Duty is 20%.

WS001.jpg

 

I've done the motor parameter detecting from VESC Tool and seems to work with out any problem. Motor is running perfectly. I think it is better to use two phase modulation in other VESC motor controllers as well since it will reduce the heat quite significantly. But since that's not the case, I think there are some reasons why three phase modulation is adopted. The problems I can imagine is listed below.

  1. Low side MOS-FETs will have more heat than high side when using low side ON method. When using high side ON method, it will be the opposite.
  2. For boards with low side shunts will have current sensing issues when using the high side ON method.
  3. When using High side ON method or high-low alternating ON method requires power supply for high side gate drive such as charge pumps implemented in DRV8353.

Is there any other problems I'm missing?

For reference, I will leave below the modded code of the "foc_svm" function in "foc_math.c".

void foc_svm(float alpha, float beta, uint32_t PWMFullDutyCycle,
				uint32_t* tAout, uint32_t* tBout, uint32_t* tCout, uint32_t *svm_sector) {
	uint32_t sector;

	if (beta >= 0.0f) {
		if (alpha >= 0.0f) {
			//quadrant I
			if (ONE_BY_SQRT3 * beta > alpha) {
				sector = 2;
			} else {
				sector = 1;
			}
		} else {
			//quadrant II
			if (-ONE_BY_SQRT3 * beta > alpha) {
				sector = 3;
			} else {
				sector = 2;
			}
		}
	} else {
		if (alpha >= 0.0f) {
			//quadrant IV5
			if (-ONE_BY_SQRT3 * beta > alpha) {
				sector = 5;
			} else {
				sector = 6;
			}
		} else {
			//quadrant III
			if (ONE_BY_SQRT3 * beta > alpha) {
				sector = 4;
			} else {
				sector = 5;
			}
		}
	}

	// PWM timings
	uint32_t tA, tB, tC;

	switch (sector) {

	// sector 1-2
	case 1: {
		// Vector on-times
		uint32_t t1 = (alpha - ONE_BY_SQRT3 * beta) * PWMFullDutyCycle;
		uint32_t t2 = (TWO_BY_SQRT3 * beta) * PWMFullDutyCycle;

		// PWM timings
		tA = t1 + t2;
		tB = t2;
		tC = 0;

		break;
	}

	// sector 2-3
	case 2: {
		// Vector on-times
		uint32_t t2 = (alpha + ONE_BY_SQRT3 * beta) * PWMFullDutyCycle;
		uint32_t t3 = (-alpha + ONE_BY_SQRT3 * beta) * PWMFullDutyCycle;

		// PWM timings
		tB = t2 + t3;
		tA = t2;
		tC = 0;

		break;
	}

	// sector 3-4
	case 3: {
		// Vector on-times
		uint32_t t3 = (TWO_BY_SQRT3 * beta) * PWMFullDutyCycle;
		uint32_t t4 = (-alpha - ONE_BY_SQRT3 * beta) * PWMFullDutyCycle;

		// PWM timings
		tB = t3 + t4;
		tC = t4;
		tA = 0;

		break;
	}

	// sector 4-5
	case 4: {
		// Vector on-times
		uint32_t t4 = (-alpha + ONE_BY_SQRT3 * beta) * PWMFullDutyCycle;
		uint32_t t5 = (-TWO_BY_SQRT3 * beta) * PWMFullDutyCycle;

		// PWM timings
		tC = t4 + t5;
		tB = t4;
		tA = 0;

		break;
	}

	// sector 5-6
	case 5: {
		// Vector on-times
		uint32_t t5 = (-alpha - ONE_BY_SQRT3 * beta) * PWMFullDutyCycle;
		uint32_t t6 = (alpha - ONE_BY_SQRT3 * beta) * PWMFullDutyCycle;

		// PWM timings
		tC = t5 + t6;
		tA = t6;
		tB = 0;

		break;
	}

	// sector 6-1
	case 6: {
		// Vector on-times
		uint32_t t6 = (-TWO_BY_SQRT3 * beta) * PWMFullDutyCycle;
		uint32_t t1 = (alpha + ONE_BY_SQRT3 * beta) * PWMFullDutyCycle;

		// PWM timings
		tA = t6 + t1;
		tC = t6;
		tB = 0;

		break;
	}
	}

	*tAout = tA;
	*tBout = tB;
	*tCout = tC;
	*svm_sector = sector;
}

 

vadicus
Offline
Last seen: 2 weeks 2 days ago
VESC Free
Joined: 2018-08-17 07:26
Posts: 431

Interesting. How does this affect the torque though? 

 

 

NextGen FOC High voltage 144v/34s, 30kw (https://vesc-project.com/node/1477)

jguy
Offline
Last seen: 4 months 3 weeks ago
VESC Free
Joined: 2020-02-22 03:24
Posts: 3

Some papers says that two phase modulation will decrease the efficiency of the motor in certain situation. Which means it will lose some torque. But I've never experienced that and always just the inverter efficiency increased.

vadicus
Offline
Last seen: 2 weeks 2 days ago
VESC Free
Joined: 2018-08-17 07:26
Posts: 431

I tried this and saw no immediate difference in performance or motor behavior compared to all phase modulation. Next thing, I'll compare the controller efficiency running it under load with 2 and 3 phase modulation. Let's hope there is a measurable improvement.

 

 

NextGen FOC High voltage 144v/34s, 30kw (https://vesc-project.com/node/1477)

jguy
Offline
Last seen: 4 months 3 weeks ago
VESC Free
Joined: 2020-02-22 03:24
Posts: 3

Thanks for actually trying it. Seems like you got the same result as me. Purpose of this method is having same motor performance with less inverter loss. You will see more improvement at high switching frequency.