Arduino UNO

Hopefully I can explain my problem easily. I am totally new to microcontrollers and stepper motors. A few weeks ago I received my first order with UNO, 12v stepper motor and bread board. The motor shield I ordered was back ordered(RB-ITE-53) which I just received it. Trying to test the motor to see if I can get it to work ended in failure. I used the sketch called “Stepper Test” from Arduino.cc with all the required Adafruit shield programmed installed with it. Before plugging it all in I moved the four jumpers on the shield to “low” for one full step operation. I plugged the USB cable to the UNO first, which caused the power light to come on on the shield. Then the 12v power supply to the shield. The only thing I noticed happening was the motor has power going to it causing it to be difficult to rotate. Not sure what was going on I unplugged all of it worried I might burn something up. Just for information I plugged the shield on top of UNO. What might I be doing wrong? Please help. Thank You!

Hi,

Since you mention being new, here are typical steps to ensure proper setup for such a group of products:

  1. Connect the shield to the Arduino
  2. Connect the stepper motor to one of the ports on the stepper motor driver shield
  3. Set all jumpers, wires and extra connections needed (such as other boards, shields, etc.)
  4. Connect the 12 V DC power source to the shield
  5. Connect a power source to your Arduino (USB / barrel connector power supply / directly by Vin)
    (*** optional step *** 6) If you need to make any modification to the wiring, first remove power to the Arduino board and then remove the 12 V DC power source)

From there, you can upload code to the device from the Arduino IDE. The first code to try would be the one provided by the manufacturer in the documentation, available on the product page under Useful Links.
This documentation file includes the pinout list for the shield > Arduino pins and also an example code to get you started that rotates stepper motors.

Let us know how this goes!

Sincerely,

I tried to download the “Documentation” to run the demo but my computer cant read it??

We have tried the example and it seems to work fine.

Please find attached a copy of the example.

Also, make sure you are using the newest version of the Arduino IDE. You can download it here.

Sincerely,
_2017-02-08_RB-Ite-53_Example_code.zip (706 Bytes)

Thank you very much. I now have the motor running.
Last quick question, how do I change the rpm of the motor? like down to 2rpm? I assume its down in the “loop” settings

Controlling the RPM of a stepper motor comes down to controlling the rate at which the step transitions are produced/completed at.

In the example code attached to our last post, there seems to be a delay of 100 microseconds between steps. Changing those would change the rate at which steps are completed, which would therefore change the RPM.
Also to take note of is the size of the steps (from full step to micro steps). For example, if you perform 1/8th steps, you will need to complete them 8 times faster than at full steps to produce the same RPM. That being said, smaller steps also allow better control on the positioning and also RPM than full steps.

We recommend that you read the datasheet of the controller chip used on this stepper motor driver shield. It contains many details about the chip and how its signals are used to drive the stepper motor.

Since many other boards use the same driver chip (A3967SLB), you can use their information and code as example to do many different things (or at least get you started with advance control). Here are some of those examples that may be relevant to you (at the very least, good for grasping the concepts):

]schmalzhaus.com/EasyDriver/Examples/EasyDriverExamples.html/:m]
]youtube.com/watch?v=wn338nwjDDk/:m]
]arduino.cc/en/Reference/Stepper/:m]
]arduino.cc/en/tutorial/stepperSpeedControl/:m]

You may also be interested in having a quick read on the subject of stepper motors and controllers here.

Sincerely,

Thanks for your help

Here is a quick example of the type of calculation/considerations needed:

Assumptions:

]The stepper motor has 1.8° per step/:m]
]The stepper motor is running in full steps/:m]

Goal:
To obtain an RPM == 2.

Calculations:
First, lets obtain the number of steps per revolution. 1 revolution = 360°, therefore 1 revolution = 360°. Steps/revolution = (360° / 1 revolution) x (1 step / 1.8°) => 200 steps / revolution.
Now that we know we need to do 200 steps for 1 revolution, we need to figure out how many steps are needed for an RPM of 2.
2 RPM => 400 steps / minute. In seconds, that would be 400 / 60 => ~6.6667 steps / second.

Using the loop from the example code above, your aim would be to change the delays to provide a full step (high and low transitions of the step signals) ~6.6667 steps / second.
We can find out that full cycle duration by simply dividing 1 second by the number of steps :: 1 s / 6.6667 = ~ 0.15 s OR 150 ms (milliseconds).
Therefore, you could try having a delay of half that for each part of the signal (75 ms signal HIGH, 75 ms signal LOW).

Also, don’t forget that if you want to reach a very high RPM from rest, you should ramp up incrementally the RPM. Trying to go too fast too quickly will simply have the motor not move as it will not have enough torque to start turning at high step rate.

Good luck with your project!