I wired everything up according to the drivers specifications. The only thing I had trouble figuring out was the wires coming in from the motor. I eventually found the correct chart for wiring up the A1, A2, B1 and B2 pins. I did however swap some of them out, trying different combinations. The strange thing is the wire order didnt seem to change the symptoms Im having, although I do recall a combination that caused the motor to lock up. Maybe the 2 coils pulling against each other? (If thats possible?)
The problem I'm having is the motor moves a step in 1 direction, and then the next step in the opposite direction. I have a simple piece of code that sends a step to the motor twice a second. Ive got an led to monitor the steps. The really strange thing is the motor does these steps at HALF the rate of the step pulse. So, it moves once every second, even though the step pulses are sent twice a second. I grabbed the shaft and tried turning it while it was running, trying to figure out what is going on. I could feel the coils charge up and step, locking the motor, and then when the next step pulse came through the coils "discharged" allowing me to turn the shaft a bit. Half a second later, the coils charged up again, causing a step. I found this very strange. So the step pulses seem to end up at the motor in some way.
The power supply is 12v 3A, so theres sufficient current. I also adjusted the trimpot on the driver but it made no difference. (After reading a bit I see this might not have been the smartest idea. The motor is rated for 0.4A so I hope I didn't damage it by turning the pot all the way up?)
If one of these components are faulty, could they behave this way? Or would the whole contraption just be completely dead?
It's too difficult to see if it's moving one step forwards. Make it run 100 steps forwards, with about 5ms between steps. Attach some tape or anything to the shaft so you can see it move.
It's still possible you have it wired incorrectly.
corrieuys:
The problem I'm having is the motor moves a step in 1 direction, and then the next step in the opposite direction.
Usually that means one of the windings isn't getting power.
Power down, disconnect motor, test the resistance of each winding to make sure they
are undamaged.
Reconnect, double check all the connections with a multimeter in continuity mode (beeping)
so you are sure everything is connected (just looking won't find broken wires or bad
connectors, "look" with the meter).
Thanks for the feedback. So I finally got to do some diagnostics. According to the datasheet, the coils have a resistance of 32 (+- 10%) The one coil tests at 34.4 and the other at 35.0. Are these numbers supposed to be exactly the same?
Further stats of the motor: (I attached the datasheet)
Rated Voltage: 12.8v
Rated Current: 0.4A.
I measured the current with the coils charged, and it measures at around 11.98 volts, and 0.3A. Am I supposed to be able to set the driver's current limiting to 0.4A? When I turn the trimpot, it doesn't go higher than 0.3A.
My power supply is 12V 3A. Is the voltage too low?
There's no such thing as "exactly the same." Plus or minus 10%, those values are within tolerance. Nothing to worry about.
Does 0.3A achieve the holding torque you require? Then no problem. If it's not strong enough, then I doubt that getting 0.4A will make much difference. 12V 3A seems like an appropriate power supply for that motor.
I see, thanks. So minor changes in the current level should only influence the holding torque?
Ive now been going through a complete connection test and I get no current reading on the one coil. So thats the reason its jumping back and forth! Ill have to recheck where the break in connection is. It might be my soldering on the driver.
Just another quick question, if the one coil is dead, what would the resistance reading be? Will it give something much higher?
If you have ever disconnected the motor from the motor driver while everything was powered up, there is an excellent chance that the driver was damaged. You should never try to measure the coil current directly -- the readings won't make sense and you risk disconnection.
jremington:
That is exactly what you should not do.
It's what I would do / have done. It seems to be what is recommended on the Pololu A4988 webpage.
What is wrong with that - assuming a suitable multimeter and, as mentioned previously, being careful not to break any circuit while the system is powered up.
One way to measure the current without risking disconnection is to solder a shunt resistor
in the circuit (say 0.1 ohm) and then measure the voltage across that.
Old thread, but this happened to me. Tried a lot of what's being said here, testing the coils, the wiring etc, but after a while decided to go for the best way: testing another motor(s) instead. Can't explain but it's the motor. I find no logic on physical-wiring and going back and forth.