I understand I have to limit the current to the motor somewhat when I want to run off a 3 cell LiPo by using the included on driver potentiometer. I understand that the max current of the driver is lower than that of the stepper.
The board however, was connected directly to the stepper with no "protection" as it were. I assume that is where I went wrong and managed to fry it with ENR (or voltage spike etc.).
Should I use say a 5v UBEC on the 3 cell LiPo and limit the current on the coils to 0.8A instead of the 12.6v-10v 3 cell voltage?
Is there a way I can dampen the power supply against spikes or should the UBEC provide enough protection from spikes?
Should I use an optoisolator or transitor between arduino and the driver?
These devices have internal protection and are meant to connect directly to the motor. 3 Li-poly cells are well within the specified voltage range for the device.
How long did you run before failure? Did the motor operate correctly before failure? How hot was the motor at failure? Did you change any wiring? The device has thermal protection and will usually only be destroyed by a dead-short or incorrect wiring such as reversing polarity to the battery.
The current limiting pot is very useful for preventing overheating and inproving efficiency.
I think I did unplug the motor cable while it was powered up. That may have caused the damage?
Either way, the motor was working and not hot before.
After, it kinda just jiggled between 2 positions like it had lost its mind. It seems regular but I hadnt changed any code and I played with the pot again with no luck...
I understand I have to limit the current to the motor somewhat when I want to run off a 3 cell LiPo by using the included on driver potentiometer.
You MUST adjust the potentiometer on the driver board to limit current. That is how you control drive current to the stepper when using an A4988 based board.
Look up "a4988 current adjust" on Google. You'll need to figure out what part values are on the board you bought. As most of them are built, the total adjustment from min to max current is over a very small portion of the trim pot adjustment. There are websites describing what and how to modify the board so the adjustment is spread out over more of the trim pot rotation.
There are some difficulties using 1/16th microstepping in setting the current. I have some limits in what I can look up at the moment, but I do recall there are some helpful videos on You Tube.
Oh, and never -NEVER- disconnect or connect motors or steppers while the circuit is powered. NEVER.
You should consider a fuse for your LiPo, they are capable of fiercely large currents if
accidentally shorted.
I agree strongly. You can also use "protected cells" which have current limiting or builtin fuses.
I once shorted a 3 cell RC-type LiPo and witnessed a very impressive display of sparks. A prolonged short can cause the battery to ignite. Lithium fires make a great fireworks display - provided you view them from a safe distance.