0
\$\begingroup\$

I'm trying to drive a small BLDC motor, and I've come up with a design, built it, simulated it, but it doesn't seem to be working, either in the sim or on the protoboard. Usually I see P-type transistors in BLDC drives, but I'm short one, and I have a ton of NPNs.

The three inductors are the BLDC motor windings, each .7 mH and the winding resistance is 4.2 Ohms. I've seen both types, and from what I understand, the PNP is just to reduce pin count. NPN BLDC diagram with flybacks BLDC with PMOS and NMOS

Are there any mistakes I'm making or principles I need to understand to make this work? I'm driving the BJT with 5v (arduino power), 9V for motor. The motor itself jerks to position fine when I touch the 9V battery to some leads Edit: I have a cheap oscilloscope, a bench supply and a multimeter. So far, the Arduino is functional.

My design

schematic

simulate this circuit – Schematic created using CircuitLab

Edit: Add photos of physical (bad soldering) IGNORE LOOSE WIRE (fell off while taking pic) Backside of the protoboard Front side, 5V is connected to VIN Salvaged HDD motor from Toshiba 2.5" HDD

Edit: Arduino Code below:

#define PIN_U_P 3
#define PIN_V_P 5
#define PIN_W_P 6

#define PIN_U_N 9
#define PIN_V_N 10
#define PIN_W_N 11


void setup() {
  // put your setup code here, to run once:
  pinMode(PIN_U_P, OUTPUT);
  pinMode(PIN_U_N, OUTPUT);
  pinMode(PIN_V_P, OUTPUT);
  pinMode(PIN_V_N, OUTPUT);
  pinMode(PIN_W_P, OUTPUT);
  pinMode(PIN_W_N, OUTPUT);
  pinMode(LED_BUILTIN, OUTPUT);
}

static int d = 20;
static int on = 1000;
void loop() {
  // put your main code here, to run repeatedly:
  digitalWrite(LED_BUILTIN, HIGH);
  digitalWrite(PIN_U_P, HIGH);
  digitalWrite(PIN_V_N, HIGH);
  delay(on);
  digitalWrite(PIN_U_P, LOW);
  digitalWrite(PIN_V_N, LOW);
  digitalWrite(LED_BUILTIN, LOW);
  delay(d);
  digitalWrite(LED_BUILTIN, HIGH);
  digitalWrite(PIN_V_P, HIGH);
  digitalWrite(PIN_W_N, HIGH);
  delay(on);
  digitalWrite(PIN_V_P, LOW);
  digitalWrite(PIN_W_N, LOW);
  digitalWrite(LED_BUILTIN, LOW);
  delay(d);
  digitalWrite(LED_BUILTIN, HIGH);
  digitalWrite(PIN_W_P, HIGH);
  digitalWrite(PIN_U_N, HIGH);
  delay(on);
  digitalWrite(PIN_W_P, LOW);
  digitalWrite(PIN_U_N, LOW);
  digitalWrite(LED_BUILTIN, LOW);
  delay(d);
}

\$\endgroup\$
12
  • 1
    \$\begingroup\$ The BJT is not controlled by the base. It's controlled by the base AND emitter, together. Your high-side BJT drive fail to account for that. You're applying voltages to the base relative to ground as if the BJT knows or cares what GND is. But how can it? It has zero pins connected to GND. It cannot even see GND. \$\endgroup\$
    – DKNguyen
    Jan 23, 2022 at 20:24
  • \$\begingroup\$ then what do Q1, Q3 and Q5 do? I thought that, once I switched them on, then the positive-side has a reference voltage. (May be flawed, as it may need positive voltage to turn on first?) \$\endgroup\$ Jan 23, 2022 at 20:30
  • 1
    \$\begingroup\$ @questionasker. Once you switch them off, that reference disappears. And you definitely don't want to switch them both on at once! \$\endgroup\$
    – Hearth
    Jan 23, 2022 at 20:31
  • \$\begingroup\$ @Hearth <-What they said. \$\endgroup\$
    – DKNguyen
    Jan 23, 2022 at 20:32
  • \$\begingroup\$ So, will a large resistance do to establish the reference? \$\endgroup\$ Jan 23, 2022 at 20:33

2 Answers 2

0
\$\begingroup\$

To drive a motor with half-bridge topology (three of them in this case,) it is possible to use BJTsin a similar way it to how would be done with N-channel MOSFETs. Using BJTs will require a lot more current to drive the base than the current needed to drive the gate. That current would impose a much larger bootstrap solution.

Therefore, N-channel MOSFETs provide a better solution over BJTs. To drive the N-channel, you'll need to create a bootstrap supply for the high side, one diode and one capacitor, and use a level shifter of opto-coupler to drive the gate. Looks like you'll need some changes to achieve success.

\$\endgroup\$
4
\$\begingroup\$

Well, one thing that's wrong with it is that you're using BJTs.

But less facetiously, the bigger problem is that you're trying to use NPN transistors for high-side switching, without having a drive voltage higher than Vcc. So your high side drive is incapable of being saturated, and in fact you can't output a voltage any higher than 0.6~0.7 volts below your microcontroller's output voltage.

\$\endgroup\$
9
  • \$\begingroup\$ So, if I use 3V or 4V for the motor driver, will it suddenly not be broken? \$\endgroup\$ Jan 23, 2022 at 20:25
  • \$\begingroup\$ @questionasker. It might heat up the transistors less, but I doubt your motor can run at such a low voltage. You need some way to pull the base of the high-side transistors above 9 volts, which is complicated, which is why you see motor drives with P-channel FETs and PNP BJTs. N-channel FETs are used in big industrial stuff because they have better characteristics, but that's always in conjunction with a power supply that can drive them above Vcc. \$\endgroup\$
    – Hearth
    Jan 23, 2022 at 20:30
  • \$\begingroup\$ I'm using a salvaged HDD spindle motor, and it moves at 3.3V, although a bit weakly \$\endgroup\$ Jan 23, 2022 at 20:32
  • 1
    \$\begingroup\$ In that case, it might work. But it should also work with a 9 volt supply as well if it does; I think you may have other problems. How much current does your motor need to spin? You may not be able to provide it enough with just a 2N3904. Are you sure your transistors are all functional, and remain functional? Because there's a lot of power being dissipated in the high-side transistors when you're driving them like this (can't give you the actual numbers without knowing the motor's stall current), and I wouldn't be surprised if it killed them. \$\endgroup\$
    – Hearth
    Jan 23, 2022 at 20:37
  • \$\begingroup\$ Winding resistance is 4.2 Ohms, just less than 250 mA/V, so about 800 mA \$\endgroup\$ Jan 23, 2022 at 20:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.