Projects > Help and Feedback

Easy Driver Stepper - Worlds Smallest stepper Project.

(1/3) > >>

Yellow:
Success …. Well kinda!
DISCLAIMER: Although there are many many hobbyist and engineers out there very proficient in the art of programming and Arduino hardware I am NOT one of those people. What may seem blatantly obvious to someone else, I am thoroughly and completely ignorant to. I have always wanted to get into the interesting world of Arduino but never seemed to have the time or project for…. Until now.

Background:
I am a mechanical engineering looking for a simple, cheap, and quick way of indexing a rotary disk for a test fixture.  The stepper will give me that degree of precision (via micro-stepping) I need. Future plans involve adding an encoder for positive feedback on exact position.
This is why I’ve found my way here.

Setup:
I am using a 5V 1amp wall wart supply that was really intended to charge a phone as a power supply. I know those ratings are rather glorified and a far stretch at its best. Everything has been breadboarded but will become a more permanent fixture once design has been finalized.

Issues:
 I was able to get things up and running pretty quickly although I have encountered a few quirks. I am certain my power supply is a tad bit too low.
Intermittently, I will notice that the micro-stepper (3.8V 650ma rated) will do nothing but jitter a little when I ask it to step (does this have to do with debounce delay?). I will have to disconnect things and retry a few times to get the stepper to index properly under zero load. The test fixture was designed so that everything rides on ball bearings so there is very little torque requirements. This little stepper should be more than capable of turning the 3” disk. I suspect my input current is far too low. I will find a more suitable power supply today.
After taking the test fixture home with me and playing with the number of steps in the sketch, I noticed that the steps behave just like the momentary switch I have hooked up. I was under the impression all I needed to do was give it a single pulsed input to have the steps count down and then stop. When I increased the steps I needed to physically hold the switch down until all the steps were complete. This is undesirable due to our future plans to have the fixture fully (or at least partially) automated. If I can adjust the sketch to read just a single input pulse to trigger the countdown that would be great. The only issue is that I am NOT a programmer by any means. I can vaguely interpret what the sketch is doing but again I am NOT a programmer and really don’t have this skill. Any guidance would really help right now.
LED Direction indicator:
I am using a Pro-Micro that does not actually have a pin 13. I assume changing it to another pin in the sketch should solve this issue for a directional visual indicator. I will work on that today as well and update.

Moving forward:
It was decided today that because the fixture will not be visible when in use there will be a need for a visual indicator (LED) that the stepper has reached then end of its steps. I can only presume that is probably a simple few lines of code yet I have no clue on how to accomplish that.



Thanks for reading my case study. Anyone that can chime in and help will be greatly appreciated. Any tips pertaining to my setup would also be beneficial. I will try and upload some pictures and maybe a short video of my setup because everyone loves pictures and vids.
Thanks!

ElectroNick:
Yellow, thanks for posting the details. I am still on a road today and will have to come back again tomorrow for a more detailed reply. Just a couple of comments for now: it's been a while since I wrote the sketch, but I've glanced at it and it appears that it should "latch" the button output, i.e. if you pressed it, it would have to count all steps (microsteps, actually, see more on that below)  to zero before it can respond to another button pres (in either direction). It would not be difficult to adjust it to work any which way you wanted regarding the button presses, I can do it in the next couple days, just need to know exactly which behavior you want.

Regarding the microsteps: do not count on microsteps (i.e. 1/2, 1/4, 1/8, 1/16 modes of operation of  Easydriver) for positioning! Some of them are so insignificant in terms of motive power that the rotor of the stepper will not even move. The main purpose of the microsteps is to smooth the otherwise very rough and vibratory characteristics of the rotor's rotation. it just lowers vibration and wear and tear on the stepper and the attached mechanical parts. But for positioning, you can only ever count of full steps. In other words, if your stepper has 200 SPR (steps per revolution) - that's all you will get in terms of positioning - 1.8° of resolution, not 200*16 = 3200 steps = 0.1125°.
I looked at my old post and I can see where I went overboard promising crazy accurate positioning of that micro stepper. It is still impressive, but I have since done a lot of testing and figured out that no microstep provides positional accuracy. So, your angular rotation with 160 steps (as in the sketch) will be 10 angular steps of 1.8° each, not 160 . Just keep that in mind.
I gotta go, will take another look at it tomorrow.
Cheers!

Yellow:
Update:
The power supply has been upgraded to a 12V 300ma one and that solved the unresponsiveness. Yet, after setting to FULL steps, every third button push (step increment) the stepper starts to jitter and not keep up with the proper number of steps in the sketch. It is very erratic. Is there a time delay that I can adjust? I suspect it has to do with the comparator portion of the sketch to eliminate noise. At 1/8 step things seem to behave appropriately.

At startup I apply power and the stepper just seems to jitter for every push on the momentary switch. It will even switch directions for a little. I try double checking connections and re-uploading the sketch. Nothing seems to work right until the stepper warms up and then things sort-of start to work. I am not sure why things are so unpredictable. Im at a loss right now. I'm starting to think this homebrew stepper motor indexer was a bit over my head.

The pin13 led direction indicator is still part of the sketch although I don't physically have one on my pro-micro board. I wonder if this has any doing on my issues. I do still need to find a way to give a visual indicator that the stepper has reached the end of its countdown so the button can be released (non-latching method) or so that the button can be safely depressed again (latching method).

BTW I want to thank you once again for getting me introduced to the world Arduino and steppers. Thank you for making your sketch public and assisting me as much as you have.

ElectroNick:
That initial jitter is a bit strange. It looks as if the pull-up resistors aren't there but since we've already discussed those, I assume they are in (with values anywhere between 1kΩ and 10kΩ).
How are you connecting the EasyDriver, btw? It needs its own 5V for the logic, and the "normal" board has a voltage regulator that takes the motor input power and converts it into 5V. I didn't catch that before when you were using 5V supply (it would be too low) but now you're using 12V, so that would not be an issue.

Are you using fully populated EasyDriver board (the Allegro chip and all of the resistors, caps and the pot are soldered in)? The only reason I ask is because I have done some "frugal" EasyDriver projects where I would buy  just the unpopulated board and solder the Allegro chip on it and nothing else (as the rest would come from outside circuitry).

Another important question: which exactly stepper are you using? Is it an actual bipolar stepper (4 wires) or is it a unipolar (6 or 8 wires) wired as a bipolar or perhaps even mis-wired?  Are you certain that you've found proper winding ends? The polarity does not matter much (although the direction of rotation will change if you swap ends within one winding) but you must connect windings A and B to their corresponding outputs on the EasyDriver properly.

The LED on digital I/O 13 is only an indicator of direction at the moment and you can easily move it to another digital I/O - line 16 in the sketch:


--- Code: ---const int ledPin =  13;      // the number of the LED pin
--- End code ---
Change 13 onto whatever output is available.

It would be trivial to add another LED and light it up when the stepsPassed variable equals "0" - which means that all of the preset steps have been completed.

Also, the debounce delay variable is debounceDelay = 50 it may actually be better to increase is somewhat - a possibility of jitter will be less.

if you want to post a picture where the connections would be visible, I'll take a look, sometimes you need a fresh pair of eyes to spot some wiring issue. Use the "attachements" feature here and upload the picture.

Yellow:
Cleaned up wiring.

Navigation

[0] Message Index

[#] Next page

Go to full version