I have some of these stepper motors
SIMAX3D Nema 17 stepper motor 42-34 (5Pcs/pack) 1.5A-3.8V 2 phase 4 wires 1.8 degrees with 39.3 inch cable for Creality CR-10 10S Ender 3 3D printer/CNC extruder and Y-axis
https://www.amazon.co.uk/dp/B0B8D9WK77
and thought I was going to use the A4988 driver as shown in one of the dronebot videos. When I started looking at the specs, though, I noticed a mismatch in voltage.
The motor description shows 3.8V 1.5A and the A4988 driver shows an input voltage from 8V. Having looked at other drivers, they show a lower limit of similar voltages.
I noted from another topic in this forum section that @davee mentioned about driving the motor at a high voltage/lower current, but am unclear how to work this out for the motors I have.
So, the question is, can I run these motors at, say 12V and limit the current to 0.475A. (Have I worked that out correctly?)
or do I need to find another driver for lower voltages.
Well, that could’ve gone better 😬
@andydowns There is a bug in the forum, amazon links do not work. I use a URL shortener which does work. I think I found it on amazon.
I am no expert on steppers, but I found an arduino forum thread that covers what you are asking. Read ALL of it and make notes, some members contradict others but it should be easy to follow the people who know what they are talking about. Good luck.
https://forum.arduino.cc/t/is-my-setup-rights-for-a-nema-17/1102514/44
First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.
@zander Thanks Ron,
I'll bear the bug in mind.
I've read through said forum posts and managed to glean a little.
I have found a video by Pololu which explains it further and I think I have enough to move forward.
I've bough some A4988 and will give them a go.
Well, that could’ve gone better 😬
@andydowns You probably already have this info, but I will re-iterate just in case. Look at Bill's article at https://dronebotworkshop.com/stepper-motors-with-arduino/#A4988_Current_Adjustment
paying special attention to the section seen below
First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.
@zander Thanks Roń,
Yes, I had watched that as well. Very helpful.
Well, that could’ve gone better 😬
@andydowns Remember, watching is for overview, the matching article has the details.
First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.
EVERYONE This is the Free URL shortener I am currently using, the one I used before disappeared.
This is a chrome version, there should be similar on other browsers
First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.
Ron (@zander) has already pointed you to some useful information as to how to set up drivers like A4988, so I won't go over that. However, I am not sure if that will answer why you see motor voltage of say 3.8V, and then find the stepper driver wants (say) 12-24V or more. (I previously wrote that you might find this surprising, but as my note was already long, I avoided making it longer.
This is not a 'proper' full explanation ... just a quick 'flavour' of what is going on.
The stepper driver effectively puts a fast switch in series with the power output to each motor coil. Thus if the power supplied to driver chip is (say) 12V, then when the switch is closed, the voltage going to the coil will be (very nearly) 12V, which, if it stayed closed for more than a second or so, would soon result in magic smoke from the motor. Hence, the switch will be opened and closed many times per second, to limit the amount of power sent to the coil to a safe level, so that the motor does not overheat.
You may be interested to know, the motor presents an 'interesting' load, in this situation.
It is possible, but usually not a good idea, to supply the motor with the specified voltage ... say 3.8V. If this voltage is continuously applied to the coils, and not 'switched' or 'stepped', then the current will be determined by a simple Ohm's law situation, where the resistance, is the DC resistance of the coil.
e.g. if coil resistance is 2 Ohm, Applied voltage is 3.8V, then current will be 3.8 / 2 = 1.9 A
------------
However, in a 'more realistic' situation, the voltage applied to the pair of coils will be repeatedly stepped through a sequence, so that the rotor moves, 'following' each step.
Now each coil is also an 'inductor', in that it is a coil of wire, with an iron core, which will have inductance. And you may recall, that when a voltage is first applied to an inductor, then the current flow will not instantly rise to the full value, but instead, it will follow an exponential curve. Similarly, if the current flow is interrupted, then the inductor will try to maintain the current flow, which will similarly fall in an exponential curve fashion.
[ This effect is also the basis of a switched mode power supply, and there are many similarities in operation.]
The driver chip makes use of this 'slow' current rise and fall, by switching on and off at a sufficiently high rate, to prevent the current ever reaching the '100%' value you would expect from the simple Ohm's law calculation, based on the resistance of the wire.
By supplying a much higher voltage than (say) 3.8V, the current will rise quickly when the switch is first closed, but still be safely limited by the driver chip opening the switch, when the current approaches the specified limit, which means the motor will respond as quickly as possible, when 'stepped' to the next position.
Furthermore, because a very fast switch is used, then the switch is either 'open', with no current flow, (and no power loss) or 'closed' with minimal resistance in the path, to waste energy.
This is similar to the situation with voltage regulators ... simple linear ones, like the 7805 series, limit the current with a 'resistor-like' action, and tend to dissipate a lot of heat, whilst the switched mode ones can have efficiencies of 95% and better.
-----------
Also, when the motor is spinning at an appreciable speed, it also acts as a generator, with the generated voltage opposing the applied voltage, and tending to reduce the current, and hence the torque. The driver chip is tasked with maintaining the preset current, and to do this, it must have more 'extra' volts from the supply
Thus, stepper motors in small 3D printers are typically powered from a 24V supply, so that they can be stepped fairly quickly, whilst maintaining sufficient torque.
------------
I hope this gives a general flavour of why the driver voltage is normally much higher than the nominal 3.8V (say) that you will see in the motor spec, and why it is necessary to preset the motor current, typically by adjusting a small potentiometer, before connecting the motor, as explained in the videos.
Best wishes, Dave
@davee Thanks for explaining that Dave. That is exactly the right level for my limited electronics knowledge. I actually understood it. Any deeper would probably have lost me.
I was trying to understand it just using ohms law and now understand it is much more complicated than that. Inductance is something that has always baffled me.
Your explanation also ties in very nicely with the instruction given in the Pololu video.
I turned up a coupling to interface the stepper motor to a T8 leadscrew yesterday. The stepper drivers are coming today so things are moving along nicely.
I’m off to find some YouTube videos on inductance now. 🙂
Well, that could’ve gone better 😬
Hi @andydowns,
Thanks for the kind words. You may find some of the explanations on the effect of inductance, a bit tough going, if you haven't been involved with them before. Apologies if the following is second nature to you, but just in case, I offer a quick glimpse into the information you might find helpful:
Some articles will talk about the effects when a sine (voltage) wave is applied, using expressions like phase shift, which is more applicable to applications, like signals used in radio and audio. (Good stuff, but leave for another day!)
For stepper motors, look for the case, when the voltage change is a step. Sorry, I have only spent a few seconds Googling, but have a glance at:
https://www.electronics-tutorials.ws/inductor/lr-circuits.html
Depending on your background, the exponential in the equations may look a little scary, but if it does, please don't take fright. Simple visualisation of the curves, such as the one below, from the same reference, tells you most of the story:
This article is a little more 'formal and rigorous' than you need at present, but hopefully gives you an idea of what I was trying to explain previously. I suggest you try to find some other explanations that also show these shaped curves.
Note, that for explanations, and also for simulations, it common to show a circuit with a resistor and an inductor in series, such as this sketch (a), from the same reference:
In the case of a 'real' inductor, such as coil of copper wire, the resistance is an intrinsic property of the copper. (i.e. it is not a superconductor). So that the inductance and resistance are just one physical component which cannot be split into 'pure' resistance and 'pure' inductance.
Splitting them into two components, connected in series, is a 'fiction', which enables relatively simple maths formulas to be used to predict how it will behave.
Also note that the article talks of a time constant, (often given the Greek symbol Tau
), which is measured in seconds. If the inductance of a coil is L Henrys, and the resistance is R Ohms, then:
Time Constant = L / R
--------------------------
As I said above, this is only a rough guide as to what to look for. Hopefully the wonders of YouTube, etc., will be successful in explaining everything. Don't be surprised if it seems a little strange at first ... some of us have been puzzling over such matters for a long time.
Best wishes, Dave
@davee I’ve watched a few videos and have a very rough idea of how it works now. It certainly is a difficult subject when you scratch below the surface.
Well, that could’ve gone better 😬
@andydowns Here is a link to all the details re the A4988.
First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.
I now have the stepper motor connected to a A4988 and an ESP32 as suggested in Bill's video on stepper motors, and it all works fine.
However, I can't seem to adjust the current high enough for the stepper motor which details a 1.5A requirement.
This is the amazon page.
I have looked for a datasheet, but have been unable to find one, so am using the description of 1.5A. I guess this is the problem with buy things from Amazon.
Since I can't find an equation for this motor, I am using the method described in the DroneBots video of connecting a DMM in series with one of the coils to measure the current after pulling the step pin of the A4988 high.
My benchtop power supply is set to 12v and rated at 2A and so should be sufficient.
I originally tested the setup on a breadboard (at a lower current limit) and then connected the A4988 directly with wires to set the correct current of 1.5A.
This is my setup:
The stepper motor still functions perfectly well as a wired setup, but I don't understand why the current won't go above 0.637A when set to the max on the A4988.
What am I missing?
Well, that could’ve gone better 😬
Hi @andydowns,
I haven't actually used the A4988, but @Inq has used them in the past, and found their maximum current limit is lower than might be expected, especially when driven from a 3.3V microcontroller, like the ESP32. My understanding is that most, if not all, of his applications had more than enough torque with the available current, but each application is different. I haven't yet found the note, where he discussed actual current values, but I'll do a better search if it becomes an issue.
---------------
Just to confirm your power supply, assuming it meets its specification should be more than adequate. A consequence of supplying the driver with a considerably higher voltage than motor needs, is that the current draw from the power supply can be considerably lower than the current flowing through the motor.
To illustrate with a very simplistic fictional case. If there were no power losses, then for an imaginary motor ...
Motor draws 1A at 4V ... Power to motor = 4(V) * 1(A) = 4W
Power Supply 24V ... supplying 4W ... Current = 4(W) /24(V) = 1/6 Amp
In reality, there will be power losses. Imagine the power loss is 2W (causing the A4988 to get hotter), so the total power demand is 4W + 2W = 6W
The current demand from the power supply = 6 (W) / 24 (V) = 0.25 Amp
---------------------
My first reaction is: Do you know that you need to run the motor at full current?
Torque is proportional to current, but it is feasible that the maximum torque the motor can provide is considerably more than the application actually needs. If it doesn't need that full torque, then running at a lower current, means it runs cooler, etc., which is generally better for reliability, etc., as well as solving a problem.
Note the Amazon (or any equivalent) current spec, is a maximum recommended current .. exceeding it risks magic smoke due to overheating. It is not a minimum or a recommended value.
----------------
If you do need more torque, and hence more current, then there are options. I note Inq discussed
replacing the A4988 with the DRV8825, and there is also the TMCxxxx family, such as the TMC2209. All of these are available on similar small boards, with potentiometer, etc., albeit you need to carefully check for differences for both the connections and the software, as they are closely related, but each has certain features, etc., so they are not direct replacements.
------------
So, start by checking to see if you need to run at full torque. If you do, then feel free to ask further questions.
Best wishes and good luck, Dave
I had the same question - https://forum.dronebotworkshop.com/postid/41459/
If you are wanting closer to the 1.5A ability of your motors, I would suggest using the DRV8825 driver. It is pin compatible with the A4988 but is different to set the maximum current.
3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide