Hey SimpleFOC community!
I’ve been trying to implement some basic commutation from scratch (as a learning exercise) using a L298N and a small 3 phase brushless motor. I’m a little confused as to whether it is possible to get commutation working properly with a single L298N. In the meantime, I am just using two L298Ns… but this is nagging at me!
So, I am assuming that I want to be able to energize the phases such that I can have current flowing from:
- phase W → phase V
- phase W → phase U
- phase V → phase W
- phase V → phase U
- phase U → phase W
- phase U → phase V
Looking at the block diagram of the L298N, I’m not sure that this is possible. Below is the block diagram of the L298N, and I’ve draw a 3-phase motor and have connected the W, V and U phases to OUT1, OUT2 and OUT3 respectively:
Below I have a table with the desired sequence of phase connections to ground, power supply (Vs) and not connected (NC). I am trying to figure out how to set the pins of the L298N to go through this sequence (i.e. fill out all the "?"s).
So here is what I might try to get through the sequence, though I left a few of the cells as “?” to highlight my question.
So state 1 and state 3 are simple enough. In state 1, current flows from Phase W to Phase V, and in state 3, current flows from Phase V to Phase W. The issue is with states 2, 4, 5 and 6.
Let’s take state 2 for example. I want the current to flow from Phase W to Phase U. So I set the ENA-high, and I set the IN1-high which connects Phase W to power supply (Vs). And I set ENB-high and IN3-low, which connects Phase U to ground. But now, what do I do with Phase V?! I can’t set ENA-low to make it NC because that would disable IN1 and IN2. If I set IN2-high, then Phase W and Phase V are connected to power supply, so current flows from Phases W & V to Phase U. If I set IN2-low, then Phase V is connected to ground, and current flows from Phase W to phases U and V.
I come across his same issue for states 4, 5, and 6.
So this leads me to think that it is not possible to do this type of commutation with a single L298N. Am I crazy? Am I missing something? For the example I went through - state 2 - could I just PWM IN2 at 50% duty cycle such that it is fluctuating being connected between ground & voltage supply and hope that motor inductance prevents any current flow?
Curious to hear any thoughts!