Welcome! Log In Create A New Profile

Advanced

Custom Stepper Motor Driver 2.3 - A3982

Posted by alkalin 
Custom Stepper Motor Driver 2.3 - A3982
January 29, 2013 04:27PM
Helllo,

So I wanted to build my own A3982 driver starting from the one on reprap:
( [reprap.org] )
I made it as similar as I could (for example some resistor values are different, since I could not find the ones reprap uses. However I did the calculations so that the currents stay about where they need to).
I have attached the schematic and board.

Then I tested the driver (using an Arduino to send step signals every 1 s) at 9V, without the motor attached. I measured the outputs, and the sequencing was ok, it should have worked with the motor connected.
When I connected the motor it did some fast jerky right-left movements, then it stalled and buzzed. Tried again - same thing. I thought the motor coils were connected the wrong way, but before changing that I turned the input voltage to 12V. When I turned everything on with 12 V it did one step then stopped. It never worked since. All I read is a constant 12V (or whatever V+ is) on all of the 4 outputs. It does not do the stepping without the motor, like it did before.
So I am pretty sure the darn thing is fried (although no heating, no smoke, no nothing...)... but why? I have another one, but I don''t just want to replace it and blow it too. Does anyone spot any problems? Anything I did wrong?

Oh, about the motor, if it matters, it is a 1.8 A 1.7 Ohms (I measure 2.2 on it). The pot was set so the output was about 1..4 A, but the 12.89 tone power source i got said it only sucked in about 0.8 (if I remember correctly...), during the jerky moving. And I didn't notice any spikes in current that would burn the thing....

Any ideas will help.
Thanks
Attachments:
open | download - sch.pdf (13.7 KB)
open | download - brd.pdf (17 KB)
Re: Custom Stepper Motor Driver 2.3 - A3982
January 30, 2013 06:50AM
Quote

The pot was set so the output was about 1..4 A

Without mechanical load, a motor will move at a tenth of this current easily.

Jerky motor movement can have it's cause in a short on the board. The usual procedure: re-check the schematics, re-check the layout, re-check the soldering. I guess you know this already :-}


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Custom Stepper Motor Driver 2.3 - A3982
January 30, 2013 08:36AM
yes but what about the step sequence functioning right without the motor attached? - as it did...
I did check the schematic , and re-check, but you know how it is... same brain is consistent in its error. This is why I bring it to you, take a look at it if you please.

Edited 1 time(s). Last edit at 01/30/2013 09:00AM by alkalin.
Re: Custom Stepper Motor Driver 2.3 - A3982
January 30, 2013 12:20PM
I dont see any pullup or pulldown on enable, seems its just left floating. It needs to have a kind of pullup so to be high by default, outputs disabled, and then the microcontroller puts the enable to low in normal operation, to enable the chip outputs. If you want to test without a microcontroller, did you shorted the enable pin to gnd? Other than this, i took a glance at the other pins but nothing pops out in my eyes. Good luck!

P.S.
1. At second look, there seems to be an RC filter on the STEP line, at those values has a cutoff of 159kHz, i think you might be able to take those off, dont seem too usefull to me, dunno why its there tbh so maybe get a second opinion on it.
2. Also usually the stepper chips have some minimal caps on entrance, some electrolitics like 100 or at least 47uF perhaps should be there. Beware as you dont seem to have any, thats not the usual practice. After all these work like some sort of switching psu chopper so its noisy also at the input. Some stepper chips app notes specify a minimal electrolitic caps for entrance.
3. toner transfer similar board [www.thingiverse.com]

Edited 1 time(s). Last edit at 01/30/2013 12:42PM by NoobMan.
Re: Custom Stepper Motor Driver 2.3 - A3982
January 30, 2013 04:52PM
yeap... i omited the pull-up probably because I knew i was only going to use it with an arduino. When I tested, the enable pin was always driven low from the arduino, so i don't think that was the real issue...

1. I just copied the low pass filter form the reprap schematic, I just thought "those'' people know better then me...
2. Again, i only used the Arduino, which has the 47uF caps on both the V+ (the input) and the 5V output for the regulator it used....
(i took the V+ from the Vin pin on the Arduino, and the VDD form its 5v pin)
Re: Custom Stepper Motor Driver 2.3 - A3982
January 30, 2013 05:02PM
but first of all, is it for sure that my chip is wrecked (from the behavior i described)?
Re: Custom Stepper Motor Driver 2.3 - A3982
January 30, 2013 09:22PM
alkalin Wrote:
-------------------------------------------------------
> yeap... i omited the pull-up probably because I
> knew i was only going to use it with an arduino.
> When I tested, the enable pin was always driven
> low from the arduino, so i don't think that was
> the real issue...

Arduino drives it low when it uses the motor, ofc. I dont think it can pull it up at the start or later on though, so leaving the pin floating might end up with that voltage being somewhere in the ttl "forbidden region" where "all bets are off". I dunno if its a "dont-care" state at that time although it might be, i dont bet on it, its better to pull it up as default.

> 2. Again, i only used the Arduino, which has the
> 47uF caps on both the V+ (the input) and the 5V
> output for the regulator it used....
> (i took the V+ from the Vin pin on the
> Arduino, and the VDD form its 5v pin)

Vin pin is for voltage in arduino, not out. I havent actually checked the schematic but i think the Vin pin has a diode on it somewhere or at least i know it has a mechanism to automatically switch between Vin and usb supply or standard pwr connector. I checked that now and between board dc power connector and vin its only a forward diode so there should be voltage and current but i wouldnt abuse that diode current too much so its still probably better to avoid using Vin as Vout. A3982 needs V+ between 8V and 35V, so with that diode voltage drop say 1v you should need 9V or more on dc supply on arduino, depending on how smooth is the wave. Try a V+ line multimeter with minimum function on that line to see how low it gets, if its bellow 8 might become an issue. And/or use an additional capacitor like 100-200uf on the stepper board, cant be bad at least.

Q: What voltage you supply the arduino with, and from what source?

Edited 2 time(s). Last edit at 01/30/2013 09:52PM by NoobMan.
Re: Custom Stepper Motor Driver 2.3 - A3982
January 30, 2013 09:27PM
I'd try to:

1) leave the arduino aside, and try with a psu and stepper board alone, no motor. If no lab psu, use a wall adapter with 9v-12v output like 100-200-400mA and with some improvised 7805 voltage regulator make 5v from same supply. You can find a 7805 or other 5v regulator almost in any kind of old~ish electronics junk. While offline, prepare some wiring to tests with, in the way to follow. Also fix enable with 1k pullup resistor to 5v. Trying to check if input state changes the output as follows. Power on board, all 4 output leds should be off. Put a jumper or tie wires from enable to gnd. The output leds should light up in response, in some whatever configuration. Next input, take a 5v wire and genly touch it to the step like and back, sort of to form a pulse. In response, the output leds configuration should change to whatever else. If driver responses to enable and step, it then should work, otherwise its probably busted.
To make all this easier, if you make your own board and has some 0.127 headers make them like 5v-stp-dir-en-gnd, its then just easy to jumper the en to gnd and use a flat screwdriver head to pulse the 5v to step line a few times. Not fancy but practical. I burned like 3 ics of this kind and only one showed a physical mark, so it can burn without showing off. Other driver i have i mystically wrecked its ms1 and ms2 lines, whatever i would do to those the driver only works 1/4 microstep and no other way. So generally stepper drivers are kinda sensitive too, at least in my hands.

2) if cant make that psu improvisation: try as before with arduino, but take the V+ before arduino, from the dc its supplied with perhaps 9-12V?
Re: Custom Stepper Motor Driver 2.3 - A3982
January 31, 2013 02:29AM
ok I will try to put the pullup and 2 caps on the board, any try method 2 probably.

As for the question, i did use a lab power source, a really big heavy pro feel one. When I gave it 9V i did measure the V+ on the a3982, which was above 8 V

What did you do to burn those chips? I just want to know so i dont do the same...
Re: Custom Stepper Motor Driver 2.3 - A3982
January 31, 2013 07:32AM
ok.
I replaced the driver and put the capacitors and pull-up. i tested without the motor, and it works ok, if there were any leds they would light up in sequence.
But I got this far last time. I had problems when connecting the motor...
so i'm kindda afraid to do it again

Edited 1 time(s). Last edit at 01/31/2013 10:20AM by alkalin.
Re: Custom Stepper Motor Driver 2.3 - A3982
January 31, 2013 11:36AM
alkalin Wrote:
-------------------------------------------------------
> ok.
> I replaced the driver and put the capacitors and
> pull-up. i tested without the motor, and it works
> ok, if there were any leds they would light up in
> sequence.
> But I got this far last time. I had problems when
> connecting the motor...
> so i'm kindda afraid to do it again

At this stage you can set the motor current which is ITripMAX = VREF / ( 8 × RS) in your case 0.22 sense resistors? So without motor attached measure VREF pin and change pot to make the vref voltage between ~ 1.2 to 1.3V, that should make max current about ~0.7A. That should be enough, so dont set it over that.

Btw you can easily improvise the leds, its just a resistor followed by sort of back back 2 leds. Resistor limits the current through and leds show direction of flow both ways.

The driver has 4 outputs in pairs of 2. You must be extra sure to identify the pairs of drivers outputs correctly, and same with motor coils pairs. Driver pairs you can check by ic datasheet. Motor coils pairs you can measure for continuity or by resistance, so you should have 2 independent coils with 2 wires each. So you have a motor with 4 wires (i take it not 5), and have the pairs of motor coils tied to pairs of driver outputs. Then things should be ok.

About what not to do, do not connect or disconnect the motor while the driver is powered on, also dont make accidental shorts on pcb while powerd up and dont feed the power lines in reverse either :-).

Good luck!

Edited 1 time(s). Last edit at 01/31/2013 11:45AM by NoobMan.
Re: Custom Stepper Motor Driver 2.3 - A3982
January 31, 2013 04:24PM
any way to know which way to connect the motor pairs to the driver output pair? Meaning for a pair, which of the motor coil wires goes to OUT1A anf which to OUT1B?

I currently have a 12V 400 mA power source. The big one is... hard to get now. Can i use this one to test the motors? Should I turn the pot so as the max curr would be just that, 0.4 amps?
Re: Custom Stepper Motor Driver 2.3 - A3982
February 01, 2013 02:31AM
Must respect the pairs, on driver and motor. Beyond that, which way you connect the pairs doesnt rly matter, if you have a pair you can connect it with either termination to either out1a or out1b, doesnt matter. The only thing that reversing pair wiring would change is the direction the motor moves. On the other hand you cant connect a motor pair 1 wire to out1a and the other wire to out2a, cant disrespect the pairs or it wont move.
Not sure i am putting it right in english, but that means just respect the pairs of the driver outputs and the motor coils pairs. Thats all there is, the order of wires doesnt matter as long as pairs are respected. The current moves both ways in a pair so each pair wires are interchangeable with the other one of same pair. If you change pairs, motor moves the other direction, which is also ok.

Yes if you test it with 0.4a supply, leave some margin for the 5v logic and arduino consumption, so set the vref to like 0.5v that should make 0.5/(8*0.22) ~0.3 amps. Should move the motor with no load, but for normal usage this would probably be too low, about 0.7a current should be ok, and dont go over 1a coz you might burn it (chip is for max 2a, but probably with some heatsink, so normally set like 0.7-0.8a that should be plenty for reprap, shouldnt need more).
Re: Custom Stepper Motor Driver 2.3 - A3982
February 02, 2013 04:13AM
I got it right , thank you, your english is perfect.

One more: can i turn the pot while the thing is running? - assume i want to test the changes in torque with my hand. And speaking of that, is there any problem if i stall the motor with my hand while it's running?
Re: Custom Stepper Motor Driver 2.3 - A3982
February 02, 2013 04:57AM
Shouldnt be a problem to stall a stepper motor since the stepper driver chops the current when it reaches its max, so it wont get burned or something like a dc motor might.

To turn the pot, board has to be powered on to read the voltage on vref, the motor can be tied to outputs or not. Whether the motor is moving or not, as long as the motor outputs is enabled (EN pin), the currents circulate through coils - even when motor stands still, so it shouldnt made a difference. But practically when motor is moving you are distracted and perhaps boards vibrate and you dont want to slip the hand and make a short somewhere - so perhaps better try do it while things are cool and steady.
Re: Custom Stepper Motor Driver 2.3 - A3982
February 05, 2013 12:50PM
Is there a problem if the pot is set to make the outputs deliver for eg. 1 A but the power source can only give 0.5 A?
Re: Custom Stepper Motor Driver 2.3 - A3982
February 05, 2013 03:49PM
Obviously, yes. You need the power source to be bigger than all the consumers tied to it + some margin.

The 1A refers to the output current setting, but driver and rest will have some losses, e.g. dissipating heat, so it will draw even more than 1A at input. You probably need a power source that can deliver more than 0.5A anyway.
Re: Custom Stepper Motor Driver 2.3 - A3982
February 06, 2013 10:25AM
Well of course i know that. I meant if the chip or anything else would get damaged
Re: Custom Stepper Motor Driver 2.3 - A3982
February 06, 2013 11:33PM
Just might. I havent ever tried to get 1A out of 0.A at same voltage. Depends on what kind of protection the psu has, e.g. if it has short circuit protection or say over current protection so it reacts properly and fast enough when the ic driver wants to take double of the current it has to offer. There is only one way to know for sure, but i wouldnt try it on my account as the information value doesnt seem to worth the risk to me.
Re: Custom Stepper Motor Driver 2.3 - A3982
February 07, 2013 03:11AM
fair enough
Re: Custom Stepper Motor Driver 2.3 - A3982
February 07, 2013 05:17AM
but if I use full stepping, I need 3.6 worth of amps, since the each motor coil is rated 1.8 A and there are always 2 active simultaneously?
Re: Custom Stepper Motor Driver 2.3 - A3982
February 07, 2013 06:02AM
Dont bother with whats written on the motor that doesnt mean anything, perhaps as a stretch only as a max value as from the coil wiring or gauge / diameter / carrying current capabilities. Only the value you set in the stepper driver matters: the stepper motor can not draw as many amps as he likes (unlike a dc motor where ratings do matter in that sense). Stepper motor can only have what the stepper driver gives it, and if you set the stepper driver to feed him 0.7A(max), than thats max value of what motor will get. Each time the current reaches this value, the driver senses it and changes the flow, so current in the coils never get more than what the driver is set to give. At some particular given time it can get less, as actually its a switching waveform, but not more. Thats why its called Itrip(max).

This is why original driver had leds at the output: they showed the current direction in the coils. They were 4, so each coil can have current going both ways. And it just happens quite often to see both leds on same coil to light up at same time, thats coz the current in the coils changes sense faster than the leds and our eyes can separate, so we just see a continious light coz the frequency is high enough to appear as such. Those leds are quite a feature, and very nice to watch.

Edited 1 time(s). Last edit at 02/07/2013 06:14AM by NoobMan.
Re: Custom Stepper Motor Driver 2.3 - A3982
February 08, 2013 02:38AM
so if i set the max current from the driver to 0.7 A, the power source would need to provide 1.4 A (+ the extra for the logic), right?
Re: Custom Stepper Motor Driver 2.3 - A3982
February 08, 2013 03:37AM
I think that should be the big picture.
+some watts disipated as heat / efficiency loss of driver;
-the fact that in case you run the stepper in half step the max current would be like 1A both coils, each being 0.70% of Itrip(max) instead of 100% (see datasheet);
+++ some margin: coz i dont think its very good to get that close to a psu top limit; for that i would think one needs good capacitors on both psu and driver, which is unlikely if you plan to use wall adapters and such.
I dont quite understand what you are actually trying to do, so perhaps a description of context would be nice.
Re: Custom Stepper Motor Driver 2.3 - A3982
February 08, 2013 08:20AM
description: i got a solar panel that is required to move a few degrees (or so) every half an hour (or so), in order to track the sun. I got a 50:1`gear reductor so i can use such a small stepper. So: it doesn't require much speed, or long running times (each move will be just seconds...). it does reuire to be powerfull enough to do the move, and precise.

Meanwhile: I tested again, with the new chip, pull-up and filter caps, and... it works. I tested with 3 motors, and currents as high as 1 A. I bought a new power source for it (wall adapter) 12 V 3A.
The issue i see is that it fails on some steps (doesn't do them). So it would be a small error for a move, but over the entire spam of the day it could add up quite big. Why does it do that - miss steps? And how could it be reduced?

And suppose i want heatsinking (unlikely like i said in my application). What would i do then, since the chip has no heatsink pad or anyhing else...
Re: Custom Stepper Motor Driver 2.3 - A3982
February 08, 2013 12:27PM
That's interesting application. Do you plan to keep the motor enabled between moves? Coz steppers consume max current when standing still, so you need to disable them, but then you need a sort of blocking mechanism, e.g. stainless steel screw blocking effect or another stepper/solenoid etc. Yes 3A is more likely.

Missing steps can be from a range of reasons, mostly lets say filtering and decoupling. I'd say capacitors might help alot with this. I get it you have bulk capacitance on psu. Try adding 100-220nf ceramic between +5v and gnd and about 220-470nf ceramic between V+mot and gnd, as close to chip as possible. Hoping it may fix missing steps.

Heatsink the top of chip. In some case i did series of holes under the chip to ensure more airflow around it. If you want heatsink, what i do is to find an empty place on board for two 3mm holes, align sink to mark coresponding holes, and fix them using screws and just very little termal compound. As a note, in diy the chip is probably inclined from all axes so watch the sink position to not short something else. Also tighten the screws very genly, they can exert alot of force and dont want to physically break the chip. Btw, where are you from?
Re: Custom Stepper Motor Driver 2.3 - A3982
February 09, 2013 05:16AM
the motors will not be enabled (I do this by pulling the enable pin high on the a3982, right?) . the gear is worm gear, self blocking.

I will try the filtering with capacitors..
I am form Romania, this is a school project. You?
Re: Custom Stepper Motor Driver 2.3 - A3982
February 09, 2013 11:40AM
I was starting to feel smth familiar about you. Me too. Come say hello here.
Re: Custom Stepper Motor Driver 2.3 - A3982
February 11, 2013 04:32PM
alkalin Wrote:
-------------------------------------------------------
> Helllo,
>
> So I wanted to build my own A3982 driver starting
> from the one on reprap:
> ( [reprap.org]
> )

You should definitely read the A3982 datasheet.

> When I turned everything on with 12 V it did one
> step then stopped. It never worked since. All I
> read is a constant 12V (or whatever V+ is) on all
> of the 4 outputs. It does not do the stepping
> without the motor, like it did before.
> So I am pretty sure the darn thing is fried
> (although no heating, no smoke, no nothing...)...
> but why?

You should read e.g. Pololu Robotics' Understading destructive LC Voltage Spikes. What is surpricing, though, is that your schematic shows no capacitors at all connected to the VBB pins. Are you really not using any?
Re: Custom Stepper Motor Driver 2.3 - A3982
February 11, 2013 05:54PM
NoobMan Wrote:
-------------------------------------------------------
> Obviously, yes. You need the power source to be
> bigger than all the consumers tied to it + some
> margin.
>
> The 1A refers to the output current setting, but
> driver and rest will have some losses, e.g.
> dissipating heat, so it will draw even more than
> 1A at input.

How did you calculate that? I get, assuming a coil resistance of 2.2 Ω, a sense resistor of 0.22 Ω and a motor at standstill:

U_DECAY (R_DS(on) total = 0.66 Ω): (1 A) * (0.66 Ω + 2.2 Ω) = 2.86 V.

U_CHARGE (R_DS(on) total = 0.7 Ω): 12 V - (1 A) * (0.7 Ω + 0.22 Ω + 2.2 Ω) = 8.88 V.

Duty cycle = U_DECAY / U_CHARGE = 0.322.

Thus with two coils on at 1 A each, the input current becomes 2 * 1.0 A * 0.322 = 0.644 A.
Sorry, only registered users may post in this forum.

Click here to login