I posted this on the Pololu support forum but I'm waiting for an answer so I'll just post it here too. I hope some people have a good experience with the A4983 stepper motor driver:

I have problems calibrating and using my A4983 driver with the Arduino UNO. When I connect my 12V DC supply to the driver I smell within 10 seconds solder and see some smoke (melting solder?) from the driver. I cannot see any unwanted solder bridges (that liquid in solder, does it conduct electricity??).I made following connections (for calibration/current limiting):- grounded STEP, DIR, MS1, MS2, MS3, and ENABLE- grounded GND logic supply- connected SLEEP to RESET- VDD logic supply to the 5V pin of my arduino- connected 5V to VDD for selecting 5V logic- 1A, 1B and 2A connectd to a stepper motor (pololu #1200) to red, blue and black wire respectively.- 2B is also connected to the stepper motor (with wire green) but got my multimeter between it to measure the current. It measured 0,00mA. So there is current going in but for a reason it can't go to the motor. The grounds are connected to the Arduino's GND pin.

I measured all pins and they are grounded or are high (sleep and reset are high). The used power supply is 12,2 V.I don't know what I have to do now, hopefully someone can tell me what is wrong. And what can I measure to know if it is still alive? I'm afraid of trying it again cause I may damage the driver even more (if it is still alive).If you need some extra info ask me please.

Wow I feel like a fool. Apparently the problem was that I switched the polarity of the power supply. I was sure it was properly connected so I never checked it! The stepper motor works fine and it is a beauty. Sorry for posting a unnecessary topic on this forum. How can I delete this topic?

When I was calibrating my motor I heard the local radio station from the motor when I touched the current limit pot on the driver with the screwdriver. Strange to say the least!

**EDIT**How do you increase the rotation speed of a stepper motor?? I have a 1 microsecond pulse every 2 microseconds at the step pin but with 1 microsecond the shaft turns very sloooow (and can't go below 1 microsecond I think).

Firstly its not worth deleting the thread - others may come along with the same problem (and same solution) - they search the forum and get a set of possible solutions to their problem!

One microsecond per step? No no, that's way too fast. Even with 1/16th microstepping I'd be surprised if you can get to 50kHz without high voltage drivers (32kHz 1/16th steps == 10 revs/second) But 500kHz?

I thought I could achieve a speed of 1 revolution per second but after some testing with various values the best I achieved was only 1 revolution every 6 seconds. That is too slow for my project (I use pololu's 42x48mm stepper motor). 1 revolution per second means 200 pulses per second (it is a 200 step motor), with full steps this means a time of 5 milliseconds so I was thinking of using a pulse length of 2 millisecond and a time between pulses of 3 millisecond. Is my reasoning correct?Here is the code I used for testing the optimal pulse:

Sorry that I'm putting the topic back in the spotlights but I'm stuck with my speed control of my stepper motor. I contacted Pololu and my motor should do a few hundred RPM. They told me that the fact I can only reach 10 RPM is due to a bad code. In the post above I posted a code that I used for checking the best pulses. The code below is my code for positioning the motor at a precise angle. I would like to reach 60 RPM which means a pulse every 5 milliseconds (200 step motor) but using 5 milliseconds results in a poor 10 rpm...

If someone as an idea why I can only reach 10RPM please tell me! Could it be due to the use of the delay function? Or maybe my driver is broken (I saw solder smoke a few times because I connected the power supply the other way around)?I will try another stepper motor and see what it does.Thank you.

Then, get the load of the shaft, if you have any. This way there isn't anything that can come in the way of the motor speed control. According to the manual, the shortest pulse is 1micro second... using 50 should still give you a good response, hopefully better than the current one.

Also, can you define what type of steps you'll be using? I haven't seen any code to see if you'll be using full step, half step, quarter step, etc, etc... maybe you haven't defined these and if they're floating it may "confuse" the driver.

The other thing that may be happening is the current limiting setting that is causing the motor to run slow.

I'm not sure the printer's step motors are the ones that run at high speeds... I need to disassemble one to check it out.

Used your test code with 500 microseconds and worked very fast and smooth (50 was too fast, the motor made noise but didn't move). The reason why your code worked was because it did not contain serial.print command. It seems that using serial.print is not a good idea. I removed it from my position control code and it worked too. Now I will test the ideal pulse but without using println.

I use full steps cause my position sensors are not accurate enough. I have no load. The motor got warm after some serious stepping exercices but not alarmingly, looks that the current limiting is good.

I thought you'd be using half or quarter step or even one sixteenth step. That way you might be able to run with lower intervals... 50 might still be too little, but I think you may achieve less than 500 easily.

I'm not 100% sure about this latest version, but I think the serial port in Arduino is coded to be used by polling. Meaning that the software stops and sends that string and then carries on. Well, serial ports, are normally used by interruption, which doesn't cause the same effect that you've witnessed, but I don't think there's a library for that.Same goes with the analogPin functions...

So the best, from my point of view, would be for you to check on how to use a timed interruption, set it with the interval you tested to be fit and keep an internal variable to control the movement. Something like this:

This way the pulse generation for the speed is always assured. Another idea would be to use a PWM output... that would be even simpler, but you'd have to read a bit about the ATmega328p internal registers.

Using PWM would be great indeed. I tried using standard PWM (500Mhz) and it works pretty well at quarter and eigth steps. Like you say changing this frequency means I have to understand the ATMega's registers. I want the most efficient result so I will surely give it a try and fine tune as long I can understand what I'm doing. But what I have now is more than enough in fact to start with.Using home-made PWM, 300 microseconds (thats 1600Mhz pulsing) is still very well and I can use half steps. Don't understand why Arduino's standard PWM doesn't work with full steps (it's slower than the home-made PWM signal).

The fact that the serial part is making it slow is no problem after all. I don't have to use it. But good to know.

I'm not sure if I understand timed interruption. Is it like the BlinkWithoutDelay example? I undrstand that example/technique.For my project I need to control 3 such stepper motors this means that I will also have to read 6 pots to control them. I don't know if my Arduino UNO can handle all that reading and writing at such a pace without loss in performance. If it can't I will have to find some more exotic/better code.

I'm not that good with the Arduino programming interface, so I have no idea how to achieve what I said in that fashion. There's plenty of C code around the internet showing how the interrupts work and how to set up the registers to achieve what you want.

If you have a look at Avrfreaks, for example, or even google AVR PWM and I'm sure examples will pop up and maybe even one or two application notes.

If you'll be using 3 stepper motors, maybe the timed interrupt with the code that I presented is the best way. That way you'll be free to connect the stepper motors wherever you want instead of being forced to use the PWM outputs. Although the PWM outputs will give you a better performance as there is no software involved to time the signals.

Reading the AD, can also be made with interrupts... but if the motors are already controlled with timed interrupts or PWM, then it shouldn't be needed.

Again, reading through the manual and checking some examples can teach a few more things about how to get the best of your microcontroller.

Sorry for digging up an old thread, but I found one thing here that I don't understand:

Quote

I thought I could achieve a speed of 1 revolution per second but after some testing with various values the best I achieved was only 1 revolution every 6 seconds. That is too slow for my project (I use pololu's 42x48mm stepper motor).

and

Quote

I contacted Pololu and my motor should do a few hundred RPM. They told me that the fact I can only reach 10 RPM is due to a bad code. In the post above I posted a code that I used for checking the best pulses. The code below is my code for positioning the motor at a precise angle. I would like to reach 60 RPM which means a pulse every 5 milliseconds (200 step motor) but using 5 milliseconds results in a poor 10 rpm

Wouldn't it be a better idea to switch to full stepping to do, let say 95% of 'turn', and then switch to microstepping to achieve better precision for the final position ?

I would assume that's the way it is done though now that no one suggested it I am a bit lost