I had posted recently about stepper motor control. Since that post and the replies I received I have come to the point of building the actual motor controller. Plenty of H-Bridges exist but I wanted to use some components I had. I posted this on my first posting but received no replies; with all the spam I see show up in the group I feared it might have gotten lost so I'm reposting as a new post.
Here's the post:
Hello, all. Where I am now is I have learned a fair bit about programming Micrchip PICs and think I've got that well enough to finally implement a test design. I'm taking the suggestion that I start with rated voltages initially, so no need for current sensing yet.
I started looking for an H Bridge circuit for my test motor because running it bipolar yields higher holding torque than unipolar operation. I have a number of BUZ11 N-Channel MOSFETs that I wanted to use and, I've read, they offer less resistance to the load so less heat is generated when they are operating, particularly switching. Plus, I don't think I have a P-Channel MOSFET in captivity and I live in the sticks so I can't just run to the store and grab one.
So, after reading tons of stuff on H Bridges I kind of cobbled together a piece that works and I wanted to fly it out there and see if I've done any good or if I'm screwing up. I have the schematic done up and saved on Photo Bucket:
I've wired it up and it works. It is simply 1/4 of an H Bridge, one of the upper legs supplying positive voltage to the motor. Currently I did not put in any clamping diodes around the motor because the MOSFET has one and it'll work for just seeing if the circuit works.
Basically, I'm using 5Vdc from the PIC (simulating it now by just touching the input to +5Vdc or Gnd) to activate a NPN phototransistor. That switches +12Vdc to ground via a 3k3 pull-up resistor (it is located before the phototransistor). That line (before the phototransistor) is connected via a 10k resistor to the base of a PNP 2N3906. The collector is tied to +12Vdc via a 1k resistor. The emitter is connected to ground via a 2k2 pull-down resistor. The N Channel MOSFET gate is tied to the line after the
2N3906 but before the 2k2 pull-down resistor. The N Channel MOSFET is tied to +12Vdc on the drain and the source ties to the motor which itself is tied to ground.I used the phototransistor (SFH615A) to isolate the 5Vdc circuit from the 12Vdc circuit. When the input to it gets +5Vdc it switches on the phototransistor which allows the base of the 2N3906 to go low switching it on. That switches voltage to the leg with the 2k2 pull- down resistor and to the gate on the MOSFET.
I've tested it a few times, just powering the system up and touching the input directly to +5Vdc or Gnd. The motor holds securely when the input is energized and seems to freewheel correctly when the input is grounded (after I changed the pulldown resistor on the MOSFET gate from a 3k3 to a 2k2).
I'd appreciate input as to whether or not this is a good idea or if I simply got lucky that nothing smoked. I'm not an EE by any means and this circuit could be the silicon equivalent to a crack-baby.
Thank you.
--HC