Maker Pro
Maker Pro

Burned stepper motor driver board in my new Arduino project

Lucas29

May 11, 2020
7
Joined
May 11, 2020
Messages
7
I am trying to control 3 bipolar stepper motors (2.1VDC, 1A/phase, 2.1Ω but 2.5Ω measured with a cheap multimeter) using driver boards I had on hand - Stepper 2 Click (A4988 IC) and a 12V, 6.67A, 80W power supply. Arduino Due supplies logic voltage to the driver board (3.3V) and controls logic inputs. Code for testing the whole thing is simple - LOW on EN and DIR pins. Change LOW to HIGH every 40miliseconds on ST pin. The SL and RST pins shorted together. Longer delays on the ST pulses were causing the stepper to whine loudly and not move at all (never kept it going for more than a couple seconds that way).

Code:
int directionpin = 2;
int steppin = 3;
int enablepin = 4;

void setup() {
 Serial.begin(9600);
 Serial.println("Setup");
 pinMode(directionpin, OUTPUT);
 pinMode(steppin, OUTPUT);
 pinMode(enablepin, OUTPUT);
 digitalWrite(enablepin, LOW);
}
 
void loop() {
digitalWrite(directionpin, LOW);

  for (byte i = 0; i < 100; i++) {
    digitalWrite(steppin, LOW);
    delay(20);
    digitalWrite(steppin, HIGH);
    delay(20);
    Serial.println("Step!");
  }
Serial.println("100 steps");
}

So far I tried running one motor at the time and managed to burn the driver board - it worked fine for about 4 seconds before stopping. The A4988 IC heated up quickly, no external damage was visible, the power diode became dim, the logic voltage dropped from 3.3V to <2V and it heats up quickly when powered with logic voltage only (considering it broken).

Driver board rated voltage is 8-35V and the rated current is ±2A. It does not have a manual way of limiting current, as far as I understand. I measured the current going from the board to the motor coil at some point and it was roughly 1A. I have checked the wiring between the driver board and the motor (for testing, these are connected with M-F crimped terminal contacts) and besides, it ran fine for these few seconds, so reversed phases are unlikely.

After a bit of research, I came across potential issues with my setup:
  • Did not have any capacitors on the 12V input to the driver board (I could salvage 2x 25V/220uF electrolytic or 2x 102/2kV or 1x 630V/273J ceramic from a scrap board).
  • Did not have neutral wires connected together for a reference.
  • Did not have a heatsink on the IC chip (did not see manufacturer advise that at any point).
  • My understanding of current requirements for stepper motors is borked.
I want to understand what went wrong before frying another board or buying more appropriate replacements. Initially wanted to control all driver boards solely with the Arduino, but currently considering getting a CNC Shield V3.0 for Arduino with three DRV8255 drivers.

Disclaimer: I am fairly new to electronics and it's not my scientific background - more of a new hobby, so I lack advanced equipment.
 

Minder

Apr 24, 2015
3,478
Joined
Apr 24, 2015
Messages
3,478
If you do not have an 'intelligent' stepper controller board, you can only use a voltage supply that is exactly required by the motor rating figure.
When using an advanced type of controller, the voltage supply is typically very much higher value in order for the motor to maintain the exact rated current across the RPM range, as inductive reactance increases with rpm.
This is a feature of the advanced controller types.
M.
 

Bluejets

Oct 5, 2014
6,901
Joined
Oct 5, 2014
Messages
6,901
It does not have a manual way of limiting current, as far as I understand.

Yes there is.
It is a requirement to set the maximum current before use.
This setting must match or be lower than your specific motor.
Details for the calculations and measurement are in the spec sheet and perhaps a thousand online youtube videos.
One detail specific to these controllers is the motor must never be disconnected from the board during power up.
Motor supply is separate from the logic supply also.
 

Lucas29

May 11, 2020
7
Joined
May 11, 2020
Messages
7
If you do not have an 'intelligent' stepper controller board, you can only use a voltage supply that is exactly required by the motor rating figure.
When using an advanced type of controller, the voltage supply is typically very much higher value in order for the motor to maintain the exact rated current across the RPM range, as inductive reactance increases with rpm.
This is a feature of the advanced controller types.
M.
Thanks for the reply!

I just had a read about the inductive reactance - haven't heard about it before. I understood that at some point when increasing the motor speed, the effective resistance of the coils will raise too (due to magnetic fields), thus lowering the amperage. As amperage gets lower the torque will decrease (which is not a big deal for my project) and if it decreases too much - skipped steps or lack of movement (which, in turn, is a big deal). So the driver board will need a higher rated current value than the one required by the motor, to safely compensate for inductive reactance. Did I get it right?

Do you mean a chopper drive by saying 'intelligent'? Would that mean the mentioned Stepper 2 Click is not an 'intelligent' one, hence the whining motor noise and the overheating? Or that it just couldn't safely provide current big enough to compensate for inductive reactance of the coils, so it overheated trying to put more amperes through?
 

Lucas29

May 11, 2020
7
Joined
May 11, 2020
Messages
7
Yes there is.
It is a requirement to set the maximum current before use.
This setting must match or be lower than your specific motor.
Details for the calculations and measurement are in the spec sheet and perhaps a thousand online youtube videos.
One detail specific to these controllers is the motor must never be disconnected from the board during power up.
Motor supply is separate from the logic supply also.

Thanks, Bluejets! I just had a second look through the technical sheets and manuals for the fried driver board but I still couldn't find any instructions on how it would be adjusted manually for this particular unit. I have seen a few videos and posts providing guidance on how to do it for other units, ranging from an on-board V-ref screw (potentiometer?) or some additional pins present on the board, to regulated by a logic voltage incoming from AnalogPin into a separate pin of the driver board. None of these seems to be the case for my driver model. Could the adjustment be done automatically by the driver board itself? Their website mentions 'Output current is regulated - the current regulator uses an internal comparator, DA converter (DAC), and external sensing resistor. The current is limited by the sensing resistor to about 1.6A (for a reference voltage of 3.3V). Absolute current limit on this IC is 2.1A [...]'. It also mentions that 'The maximum value of current limiting is set by the selection of Rsx and the voltage at the VREF'. Rsx is fixed to the resistance of the sense resistor and VREF is tied to the 3.3V logic power rail. I have also looked at the A4988 schematic and it all checks out but it didn't help me understand how I could tune it myself on this board. In essence, I don't see what action would allow me to tune the max output current manually - looks like it is adjusted automatically, based on the internal DAC output and sense resistor. Could you please point me in the right direction? Sorry if I'm being ignorant and missing something obvious here.

Good reminder about not rewiring anything during the operation - I always made sure to turn off both logic and motor power supplies prior to changing anything. And yes, both supplies are separate - motor connected to the PSU linked in the first post via the driver board, while the logic supply is the Arduino itself.
 

Minder

Apr 24, 2015
3,478
Joined
Apr 24, 2015
Messages
3,478
Thanks for the reply!

I just had a read about the inductive reactance - haven't heard about it before. I understood that at some point when increasing the motor speed, the effective resistance of the coils will raise too (due to magnetic fields), thus lowering the amperage. As amperage gets lower the torque will decrease (which is not a big deal for my project) and if it decreases too much - skipped steps or lack of movement (which, in turn, is a big deal). So the driver board will need a higher rated current value than the one required by the motor, to safely compensate for inductive reactance. Did I get it right?
Essentially what these drives do is ensure that the motor rated current exists at all times, The higher voltage enables this, by sensing the actual current and controlling it accordingly as the inductive reactance increases.
IOW, the current should not vary from the rated value.
Before the advent of PWM, it was simply and crudely done with a series resistor.
M..
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
It is a requirement to set the maximum current before use.
From the specs I take it the current limit is fixed at 1.6 A:
By controlling the current intensity and its decay throughout the rotation cycle, a constant torque is achieved for every position. The current regulator uses an internal comparator, DA converter (DAC), and external sensing resistor. The current is limited by the sensing resistor to about 1.6A (for a reference voltage of 3.3V). Absolute current limit on this IC is 2.1A, after which the overcurrent protection is activated.
This is too much for the motors rated at 1 A.
You may be able to reduce the current limit on the driver board by changing the resistor.

However: Too high a current would burn the motor, not the board as the board is obviously designed for higher current than the motor. I guess your problem lies elsewhere.
Have you studied the libraries supplied with the driver board? Compare these to your own code or simply use them. They sure are tested and should work.
 

WHONOES

May 20, 2017
1,217
Joined
May 20, 2017
Messages
1,217
One thing to be aware of is that if the driver transistors are MOSFET's, which is quite likely, they will need a minimum gate voltage to get them fully turned on. This may be reflected in the minimum voltage required for your driver board. If they are not fully turned on, their resistance will higher which will increase power dissipation in the devices which could ultimately cause them to fail.
 

Bluejets

Oct 5, 2014
6,901
Joined
Oct 5, 2014
Messages
6,901
I follow the specs and have no problems.
Set the voltage on the pot to conform with requirements for the motors I use.
I don't bother with 3v3 promini's,use the 5v instead.
 

Lucas29

May 11, 2020
7
Joined
May 11, 2020
Messages
7
Essentially what these drives do is ensure that the motor rated current exists at all times, The higher voltage enables this, by sensing the actual current and controlling it accordingly as the inductive reactance increases.
Right, got it! It seems that the 12V I'm supplying should be enough to compensate for inductive reactance, but I will try to do the math properly to double-check it.

From the specs I take it the current limit is fixed at 1.6 A [...]
This is too much for the motors rated at 1 A.
You may be able to reduce the current limit on the driver board by changing the resistor.
However: Too high a current would burn the motor, not the board as the board is obviously designed for higher current than the motor. I guess your problem lies elsewhere.
Have you studied the libraries [...]
The stepper is rated 1A/phase, and there are two phases. That would mean max draw of 2Amps if both were saturated at the same time. I assume that the board's rating of 1.6A is cumulative (i.e. 0.8A per coil if both were to be saturated at the same time). Could the explanation be as simple as lack of a heatsink? Operating in the upper current limit of the A4988 chip and over board's rated max current without added heat dissipation?
True, I could change the resistors - there are two R250 visible on the board, so I could swap them so the max current averages on the desired value. It means soldering tiny elements onto a board - considering that I have a cheap soldering iron and no spare resistors laying around, it might be easier and more cost-effective to just get appropriate drivers with a more user-friendly current limiting feature as a replacement.
I will try to have a look at the shared libraries, there might be some clues there. I didn't bother beforehand, as these are not made for Arduino in the first place so were of no use to me.

One thing to be aware of is that if the driver transistors are MOSFET's, which is quite likely, they will need a minimum gate voltage to get them fully turned on. This may be reflected in the minimum voltage required for your driver board. If they are not fully turned on, their resistance will higher which will increase power dissipation in the devices which could ultimately cause them to fail.
Both board and the A4988 chip are rated for 8-35V for the motor supply. The board logic is 3.3V (5V pin on the board is even described as NC on the other side), but the A4988 can use a range of 3-5.5V. The current output max for the board is stated as 1.6Amps (and that 2.1A trips the over-current protection), whereas the A4988 chip has the max rated current output of ±2A. The voltage delivered by the motor supply is steady at 12.2V (and it indeed does not work for anything below 8V), and 3.3V coming from the Arduino seems to be quite steady too. Could that configuration still result in inadequate MOSFET's activation?
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
I assume that the board's rating of 1.6A is cumulative (i.e. 0.8A per coil if both were to be saturated at the same time).
Likely not. I'm no expert here but I'd expect current limit on a per phase basis.
I didn't bother beforehand, as these are not made for Arduino in the first place so were of no use to me.
Have a look e.g. here.
 

Lucas29

May 11, 2020
7
Joined
May 11, 2020
Messages
7
Likely not. I'm no expert here but I'd expect current limit on a per phase basis.
Have a look e.g. here.
You are correct, the rated current on some other boards is given for each phase - so if it says 1.6A, then the driver is capable of providing that much for each coil at the time.
Thanks for the library, it looks like everything that I could ask for. I will test it out when I decide on replacement drivers.

Here is useful info when selecting motor/drive https://www.geckodrive.com/support.html
M.
Great, that came just at the right time, I was about to get some DRV8255's from Amazon.


I will get come electrolytic capacitors and decide on replacement drivers soon. Will keep this thread updated, but don't hesitate to post if there are any new ideas on how the first board got fried in the first place.
 

Lucas29

May 11, 2020
7
Joined
May 11, 2020
Messages
7
How about the old ideas.....??
Have a fair idea....:eek:
I will be most definitely revising everything that was discussed here, now when I know a bit more. That was just to say 'if anything else comes to your mind' :)

I follow the specs and have no problems.
Set the voltage on the pot to conform with requirements for the motors I use.
I don't bother with 3v3 promini's,use the 5v instead.
In relation to that, I don't have an easy way of controlling the voltage (no lab bench power supply) nor a potentiometer lying around. I would have to buy and use some buck converters to change the voltage (which is an option I considered). In the end, I was hoping to power everything by one power supply. The general recommendation that I can see in most places is to use about 10 times rated voltage (provided you have a chopper drive) to enhance stepper's performance
Not sure what you mean by promini's - I'm using Arduino Due, that runs on 3.3V. Besides, the stepper driver I had uses 3.3V logic only (5V board pin is even marked as NC).
 

Lucas29

May 11, 2020
7
Joined
May 11, 2020
Messages
7
Right, I got everything to work in the end. Will provide a quick summary here, in case anyone has a similar problem in the future.

The Click2 stepper drivers I planned to use primarily were suitable for the stepper motors - as switching boards, the higher voltage was not an issue (in fact it helps to achieve better RPM) nor was the current drawn by the motors. These boards had an "automatic" max current adjustment - it never went beyond 1A per phase. The issue was simply overheating of the A4988 chip. The board's manufacturer never mentioned the top current/voltage without additional cooling in place and the small size of the chip made it fry in a matter of seconds. The simple solution was adding a heatsink on top of the chip - it worked fine then (Side note: the overall performance of these driver boards is not worth the price).

As a replacement board, I've chosen a driver replica of Pololu's DRV8255. Here, the max current adjustment is made by changing Vref on a clearly visible potentiometer. Due to almost 6 times higher supply voltage, a heatsink is a must in this case too. One thing worth noting is that the mentioned driver uses only 70% of the max current set via the pot in the full-step mode and goes up to the max set current only in the microstepping modes. So, if one were to solely use full-steps in the project, the max current could be set to 130% with the pot. In my case, everything was getting a bit too hot, so I stayed at 70% rated max current for the motor. Despite that, I can comfortably use 400RPM top speed (which could be pushed much further, but is well beyond 'good enough' for my application), while retaining impressive torque for a small motor. According to the manufacturer's advice, I have a capacitor (25V 220μF) just before the Vin and GND pins of each driver board.

My simple Arduino sketch posted above worked well as a way of checking stepper operation and correct phase connectivity. However, for a long-term operation, I will be using the Accel Library linked by Minder. It's quite simple to use and should be easy to incorporate in my project. I still need to explore how to control few motors with it, but I might have seen a sketch covering it already (in examples provided with the library).

A big thank you for everyone's contribution and advice!
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
Good you solved the issue.
The driver boards I've seen usually seem to be shipped with heatsinks that have to be mounted onto the driver ics by the user. Yours seemingly weren't, how bad.
 

Bluejets

Oct 5, 2014
6,901
Joined
Oct 5, 2014
Messages
6,901
In relation to that, I don't have an easy way of controlling the voltage (no lab bench power supply) nor a potentiometer lying around.

The voltage adjustment pot is on the A4988 board itself and is a calculated voltage to give the correct output current limit.

Look up any A4988 video on youtube on how to adjust.
Calculations are in the data sheet.
 
Top