Hi, I'm building a pen plotter and I've just been setting the electronics up. I'm using an Arduino Uno with a CNC shield and a4988 stepper motor drivers to control two NEMA 17 stepper motors, and a micro servo motor for pen up/down. I'm using UGS (Universal Gcode Sender) and I was configuring GRBL using the 'setup wizard' when I had to check if the stepper motors were spinning in the direction. When UGS told it to spin in a certain direction, it just vibrated, spinning in one direction for 1-2 steps and then another 1-2 steps in the other direction. Both the x-axis and the y-axis stepper motors are vibrating like this. I have a a 12v 2a power supply connected to the CNC shield. Pls help.
Can you please post your code as per the link above?
Can you please post a schematic of your circuit?
Please include power supplies and specs.
Can you please post links to specs/data of your hardware?
Nema 17 does not tell us the electrical spec of the steppers.
Have you developed this code yourself and in stages?
If so have you got code that JUST drives ONE stepper to prove your circuit and code method?
Sorry for all the requirements, but to give you accurate solutions/suggestions to your problem they will be helpfull.
This DIY Machine's schematic but my wiring is literally the same as his except for the fan.
My stepper motors use 1.5a and I'm using an Arduino CNC Shield v3
Is this enough information? Please let me know. This is my first time on the Arduino Forum, so I'm sorry for being incompetent.
Hi, @jay_the_great
Thanks for the image, but it is not a schematic.
Where did you get the image from?
But for the moment it will do, I'm surprised the author of the project didn't post a proper circuit.
What is the rating of your power supply?
Are you using the code supplied by the author?
A link to the specs of your stepper would be good.
You need to write some code to JUST operate one motor, to see if you have it connected correctly.
Do you have a DMM?
My power supply is 12v 2a and the code is not supplied by the author. All of the specs to the stepper motor are in chinese, so just tell me the information you want to know, and I'll tell you...If that's fine. And yes, I do have a digital multimeter. I'm going to try to just operate one motor rn.
I tested the stepper motors individually and they still vibrated. I bought 2 more stepper drivers, and connected them properly but the stepper motors still vibrate. Now what...
Hi,
That link got me to mixed nuts. So it didn't work properly.
A stepper motor in its basic form has two separate pairs of wires connected to two separate coils.
What your symptoms appear to possibly be due to the wrong connections between the stepper and the driver.
Can you post an image(s) of your project so we can see your component layout.
From left to right, the words on the top of the graph are: motor model number, motor length, the amount of degrees for each step, phase number, rated voltage, rated current, phase resistance, phase inductance, maintained rotational distance??? (I'm not too sure about this one), positioning torque (or distance I'm not too sure), rotational inertia, and motor weight.
Here are some pictures of my motors and wiring and stuff:
Thank you so much, this was really helpful, it learned loads from the video. I'm going to do as she shows in the video right now, and I'll make sure to inform you about it after I do so.
Okay, so I realized my stepper motors' wires had to cross over and overlap each other, unlike other stepper motors which use wires that are just straight and don't overlap (if you know what I mean...hopefully you do). So, after swapping the order of the wires, the motors finally spin in one direction, and not move in one direction and then the other. However, when the machine is moving slowly, it vibrates whilst moving. If the machine is moving quickly, the vibration stops, and there isn't much noise as well.
Also, I know my limit switches are wired correctly but they keep triggering without actually being triggered (I have them wired normally open). Do you know how I can solve this problem?
I use GRBL with g-code sender and it works well. Now you have got the stepper wiring sorted, the cause of the "only one direction" problem may be that the polarity of the direction signal is wrong relative to the step signal. I think GRBL has a config option for that. Or it may be that the pulse length needs adjusting. Basically the stepper driver may not be seeing the dir signal for the other direction.
As for the vibration at low speeds, well steppers move in steps and when moving slowly the steps are more evident! How have you set up the microstepping ratio? If you increase this then the step size decreases and movement gets smoother.
Limit switches are best wired NC so that they fail safe if a wire drops off. Also the circuit is then low impedance and less sensitive to picking up noise. Your spurious limit problem might be an occasional short or noise pickup. If wired NO, what value pullup resistor are you using, is it just the internal Arduino one or a physical resistor? A low value physical resistor, say 4.7k, could make the circuit less sensitive to noise pickup.
Hi,
Thank you, this was really informative. I have my limit switches wired in normally open, and I think UGS just thought I had them wired normally closed, so I just redid the setup wizard thingy and it worked fine. Also, how should I set up the microstepping ratio?
There are two aspects to this. One is to set the microstep ratio of the drivers themselves. A normal stepper does 200 steps per rev, and microstepping provides analog interpolation, typically by 4, 8, 16 times to get up to say 3200 steps/rev. This can improve resolution but mainly improves smoothness. On the CNC shield IIRC there are jumpers on pins underneath where the drivers plug in - see the shield documentation and the driver documents to check how to set these. (I have done this on my own system but it was a year or two back so can't quite be sure.)
Then in GRBL you have to set up the steps/unit, where "steps" is now "microsteps". Say the stepper is driving a leadscrew with 1mm pitch - then with no microstepping GRBL has to deliver 200 steps to move 1mm. With 4x microstepping it would be 800 steps/mm, etc.
Don't go overboard on setting microsteps in the hope of getting more precision (i.e. much smaller movements) - with normal motors and drivers this doesn't work very well beyond a certain point. MS ratio of 4 or 8 should be OK. Also as the MS ratio increases for a given max pulse frequency the speed will reduce.
Most motors will benefit from some level of microstepping. Microstepping will help to mitigate the effects of resonance. The mechanics of the system will also effect resonance. For instance, a belt drive is better damped than a lead screw and will be less susceptible to resonance.