Using a stepper motor to rotate a solar panel which is riding on bearings, a process that the stepper should be able to do easily. However, when initiating the code, the motor only vibrates and barely exhibits any torque. Could this problem be coming from the motor itself? I've used a multitude of A4988 drivers and different motor wiring configurations, so the motor seems like the only thing left.
Simple code being used to test movement below:
#include <Stepper.h>
const int stepPin = 5;
const int dirPin = 3;
void setup() {
SethC:
Using a stepper motor to rotate a solar panel which is riding on bearings, a process that the stepper should be able to do easily. However, when initiating the code, the motor only vibrates and barely exhibits any torque. Could this problem be coming from the motor itself? I've used a multitude of A4988 drivers and different motor wiring configurations, so the motor seems like the only thing left.
Simple code being used to test movement below:
#include <Stepper.h>
const int stepPin = 5;
const int dirPin = 3;
void setup() {
}
void loop(){
//step forward 100 steps
stepperFWD();
motorStep();
delay(10000);
A side note first ... After 26 posts, you should know that folks here don't much like it when you don't use code tags or post incomplete code.
As for the issue, have you studied how the motor is supposed to be wired and verified that yours is wired that way? It's a common mistake.
Why not start by defining the problem with specifications including a flow chart, schematic, power requirements, and EMI requirements if any. Define what the expected outcome needs to be. Purchase the Arduino cookbook and read it, this will give you some basics. also use the online tutorials and videos available, there are many good ones on this web site. At this point you will be able to define the problem and may have already solved it. Partial information only gives partial answers which most of the time do not solve your problem.
Please read the post at the start of any forum , entitled "How to use this Forum".
OR http://forum.arduino.cc/index.php/topic,148850.0.html.
Then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.
Can you post a schematic of your project please?
Your code is missing a massive amount of code.
Look at the stepper library example.
If you are using A4988, there is a specific library for it if you look at the Pololu site.
TomGeorge:
If you are using A4988, there is a specific library for it if you look at the Pololu site.
? ? ?
The AccelStepper library is the one commonly used. It is not specific to Pololu
It is also very easy to drive an A4988 without any library. See this Simple Stepper Code which is useful for testing.
However the motor is being controlled start with a very slow step rate. Vibrations often mean the motor is trying to move too quickly and is missing steps.