stepper motor driver dosn't work, need help!

jpanhalt

Joined Jan 18, 2008
11,087
1) You can't run an IRF540 from a PIC. The IRF540 needs 10V or so at its gate to completely turn on.
2) Your 330 ohm resistor to ground only makes the situation in #1 worse.
3) I can't tell what the source and drains are attached to. Your arrow symbol has no definition.
4) It appears you have the load attached to the source of the N-channel mosfets. That won't work in this case.

John
3)
 

SgtWookie

Joined Jul 17, 2007
22,230
[oops, I didn't see John's reply before I wrote this, but we essentially agree on everything]

1) R1 thru R4 should be between the PIC I/O pins and the gates, and reduced to 220 Ohms. Locate them as physically close to the MOSFET gates as you can.
If you want "safety" resistors to keep the gates OFF in case an I/O pin fails open, use 10k-20k resistors from the gate to ground.

2) IRF540 MOSFETs are not logic level MOSFETs. All MOSFETs beginning with IRF are standard-level MOSFETs, requiring Vgs=10v to turn fully ON. MOSFETs beginning with IRL are logic-level MOSFETs, and are generally fully ON when Vgs=4.5v.

3) The source terminals appear to be connected to some unlabeled power connectors. They should be grounded.

4) The common supply terminals of the stepper are grounded. They should be supplied power instead.

5) Because you had the wiring to the source terminals and stepper common reversed, you will also need to reverse D1-D4.
 

SgtWookie

Joined Jul 17, 2007
22,230
Just a brief note about conventions on schematic drawings;

In general, inputs should come from the left side, and outputs towards the right side. An exception would be symmetrical circuits such as H-bridges; where showing the sides of the bridge as mirrored images makes it much easier to understand.

Also, more positive voltages are towards the top of the drawing, more negative towards the bottom.

You have the first part down just fine, but you're showing grounds at the top, and what is likely a positive supply near the bottom. This goes against convention, and makes it harder to read and interpret the schematic.
 
Top