A4983 and A4988 Getting Started Guide

Thank you for your quick reply. I was planning on putting the 9v’s in series but will reconsider using 6 rechargable AA’s instead. I had the code running enough steps to open the lid and then stop, but it would make more sense to just have the motor stop and ignition start due to a limit switch. Thanks again.

I purchased some bipolar stepper motors off eBay and while I think I can figure which leads are for which coil, I’m not sure how to calibrate the A4988’s current limiter. The PDF on page 1 says to adjust the pot until the DMM reads 0.7* the motor’s rating. What recourse do I have in this case? And if I don’t know the voltage rating am I still ok with using 12v as the Getting Started Guide says?

EDIT: I found this page but it doesn’t tell me the current part:

http://www.nmbtc.com/motors/part-numbers/Permanent-Magnet-Stepper-15mm/PM15S-020/4846

EDIT (2): This page says “Current / Phase: 0.5 a” but then farther down there’s a table where it varies from 0.04 to 0.5

No idea what my motor’s current/phase value is. The only writing on it is “PM15S-020-CTA6”. Can someone help me decipher these specs? This is my first time using a stepper motor.

http://goot-motor.en.alibaba.com/product/850733044-218306625/5_12v_15mm_small_stepper_motor.html

Hello.

From the last link, it looks like you might have the pm15s-020-02 stepper motor. If that is the case, your current per phase rating should be 0.5A. The 0.04A rating further down on that page is for the PM15S-020-01 stepper motor. It should be fine to use a 12V supply (or higher) with your motor as long as you set the current limit on your driver appropriately. You can use either the information in the Getting Started Guide or follow the instructions under the “Current limiting” section of our A4988 carrier’s product page to set the current limit.

-Derrill

Thanks very much, Derrill! As soon as I get my A4988 I’ll give it a shot. I’ll probably try first with a 9V wall wart (as I’m using that to power my ICs through a 780r voltage regulator) and then switch to a 12V if needed.

The A4988’s arrived today so I’m going to give this a go. Quick question: if I’m using a single 12V power supply for the logic board and for the motors (the logic board has a 7805 voltage regulator to provide 5V), can I connect the two GND pins on the A4988 to the same GND plane as everything else? Or do I need a separate GND connection to the input power supply for the GND connection beside VMOT?

You can connect the two GND pins on the A4988 carrier to the same ground plane as everything else. Those GND pins are already connected to a common ground plane on the A4988 carrier’s PCB.

-Derrill

Thanks Derrill!

I’ve switched to using these Portescap motors as the specs were readily available (http://www.portescap.com/sites/default/files/20m020d_specifications.pdf. The motors are rated at 12V and I plan on using a 12V power supply, so do I need to adjust the current limiter? Also, if I want to achieve the smoothest possible rotation (in my model, the steppers will just rotate continuously in one direction at an adjustable rpm) can I use the 1/16 step available on the the A4998? In the product description for the A2998 it seems to imply that if you want to use micro stepping you need to have a power supply that’s greater than the motor’s rated voltage and hence need to set the current limiter.

You do not need to actually limit the current when using a stepper motor with full step mode at its rated voltage since it will not draw more than the rated current. However, it is still a good idea to set the current limit to something that does not limit the current lower than the rated current of your stepper motor.

It sounds like you might be confused about why current limiting is needed for microstepping. You do not need to use a higher voltage for microstepping. Drivers like the A4988 do micro stepping by setting the current through each coil of the stepper motor in the pattern of a sine wave as shown in the decay mode graphs on pages 14 to 16 in the datasheet for the A4988 driver. Since those drivers have no way of knowing the actual current the motor wants to draw they use the current limit setting as the upper bound of the wave when calculating the current level of all the steps. So, if the current limit is set higher than the actual current the motor will draw, you will end up with a flat top on your sine wave and inconsistent movement of the stepper motor.

You should not set the current limit lower than the rated current unless you want to limit the motor’s performance, and you should not set it higher if you want microstepping to work correctly. So, in your case, you want to adjust the current limit to match the rated current of your motor.

-Derrill

Thanks Derrill. From the Portescap specs, it looks like the stepper has a rated current per phase of 100mA but I don’t know if that is the value I should use when setting the current limiter (I think it says to aim for 0.7 * rated current).

You should set the current limit using the formula in the “Current limiting” section of the A4988 carrier’s product page. In the case of the A4988 carrier the formula is:

Current Limit = VREF × 2.5

No additional math is necessary when using a micro-stepping mode. In the particular case where you are only using the driver in full step mode, you can use the formula you referred to get a little more current.

-Derrill

I appreciate your replies, Derrill, but I have to admit I’m getting more and more confused (must almost be Friday). Please bear with me and my questions:

  • If I use my motor in full step mode (unlikely if it’s really 18 deg per step) and I supply 12V to the board (and the motor is rated for 12V), do I need to worry about the current limiting pot’s setting? Does the A4998 ignore the pot in full step mode? If not, then what do I set it to?
  • The reason I thought I might need greater than 12V power supply to achieve micro stepping is from the first paragraph of ‘Current Limiting’ that you mentioned: “To achieve high step rates, the motor supply is typically much higher than would be permissible without active current limiting. For instance, a typical stepper motor might have a maximum current rating of 1 A with a 5Ω coil resistance, which would indicate a maximum motor supply of 5 V. Using such a motor with 12 V would allow higher step rates, but the current must actively be limited to under 1 A to prevent damage to the motor.” So, do I need a higher voltage power supply if I think I’m going to use the 1/16 micro stepping mode?
  • I’m confused about how to set the current limiting pot value. If I use the formula you mentioned (Current Limit = VREF x 2.5) and let’s say I measure 0.3V on the VREF pin (does it matter if I’m in full step mode or something else? Do I hook up the A4998 per the .pdf on page 1 of this thread while doing this?) does that mean I turn the pot until my DMM shows “0.75A” while connected in serial to one of the coils?

Apologies in advance for my obtuseness.

The A4988 does not ignore VREF when it is in full step mode, so as I said in my previous post, I recommend always setting the current limit to the rated current of your motor. For full-step mode or any of the microsteping modes, you can set the current limit on the A4988 using the VREF measuring instructions and this formula from the “Current Limiting” section of the A4988 product page:

Current Limit = VREF × 2.5

The A4988 product page has a “Minimal wiring diagram for connecting a microcontroller to an A4988 stepper motor driver carrier (full-step mode)” This diagram shows the connections necessary for full-step mode. If you what to use one of the microstepping modes, you can also connect the MS1, MS2, or MS3 pins to 5V according to the mode you want to use. When setting the current limit, you can measure the voltage at the VREF via. A reading of 0.3V on the VREF via would correspond to a current limit of 0.75A. If you are setting the current limit by measuring the voltage at the VREF via you do not need to also measure the current through your motor’s coil.

You do not need to use a higher voltage than your stepper motor is rated for to do microstepping. What the paragraph from the A4988’s product page that you referenced is saying is that if you find that you are not able to step your motor as fast as you want to (i.e. you try to apply a step signal that has a large number of pulses per second, but the stepper motor won’t take a step on each pulse), increasing the supply voltage might help the motor step faster.

-Derrill

If I understand you correctly:

  1. Turn the trim pot all the way counter clockwise (minimum value)
  2. To achieve the rated current of 100mA for the Portescap stepper, I adjust the trim pot until my DMM reads 0.04V

Is that right? And do I need to repeat this if I change my micro stepping mode?

Anyone? I’ve searched YouTube for examples of setting up the A4988 but only found 1


which I believe was uploaded by the author of this thread.

  • If my motor is rated at 12V and I use a 12V power supply, do I need to calibrate the A4998? If not, what does that mean-do I have to set the trim pot all the way to the left (CCW)?
  • If the calibration is done in full stepping mode per the .pdf guide on Page 1, can I assume that setting is appropriate for all micro stepping modes? The stepper motor I have is 18 deg per step so I’m pretty sure I’ll need to use the 1/16th mode.

The VREF voltage of 0.04V is correct for a current limit of 100mA. You should not need to change the current limit to do micro stepping. You only need to change the current limit if you change to a different stepper motor or change the voltage going to the VDD pin.

-Derrill

Thanks Derrill.

Thank you for doing this. It is very valuable for beginners like me.

I have a couple of questions for you.

  1. Why are you not using any capacitors for the calibration process?
  2. I have seen recommendation of a 100 uf at the Vmot. You are using smaller than than and also one for the Vdd. What are the reasons?

Thanks.

Farzad

We did not make the original post on this thread or the guide it mentions, but since the original poster might not be checking this thread regularly (his last edit was November 2013 as of this writing), I can offer some answers to your questions.

The A4988 Stepper Motor Driver Carrier product page has a note that explains why we recommend adding a large electrolytic capacitor across VMOT and ground. To summarize, it helps prevent destructive LC voltage spikes, which can exceed the maximum voltage rating (35V ) for the A4988 and permanently damage the board. These spikes can occur whenever you connect or turn on your power supply, even if you are just setting the current limit and the stepper motor is disconnected, so we recommend having the capacitor installed whenever you apply voltage to VMOT. A 100 uF capacitor should be fine in most cases; we recommend using at least 47 uF in the note on the product page that I referred to above. As for the capacitor across VDD and ground, installing a capacitor here is not as crucial in most cases, but it could help filter any noise that might be on that supply line.

-Brandon

Thanks, Brandon.

Farzad