Friday, October 25, 2019

Circuit diagram to control Nema 17 stepper motor

Circuit diagram to control stepper motor Nema 17 with Arduino is given in the above image. As A4988 module has a built-in translator that means we only need to connect the Step and Direction pins to Arduino. Step pin is used for controlling the steps while the direction pin is used to control the direction. Stepper motor is powered using a 12V power source, and the A4988 module is powered via Arduino. Potentiometer is used to control the direction of the motor.

If you turn the potentiometer clockwise, then stepper will rotate clockwise, and if you turn potentiometer anticlockwise, then it will rotate anticlockwise. A 47 µf capacitor is used to protect the board from voltage spikes. MS1, MS2, and MS3 pins left disconnected, that means the driver will operate in full-step mode.


Circuit diagram to control Nema 17 stepper motor


Complete connections for Arduino Nema 17 A4988 given in below table.

S.NO.

A4988 Pin

Connection

1

VMOT

+ve Of Battery

2

GND

-ve of Battery

3

VDD

5V of Arduino

4

GND

GND of Arduino

5

STP

Pin 3 of Arduino

6

DIR

Pin 2 of Arduino

7

1A, 1B, 2A, 2B

Stepper Motor



Code Explanation
Complete code with working video control Nema 17 with Arduino is given at the end of this tutorial, here we are explaining the complete program to understand the working of the project.

First of all, add the stepper motor library to your Arduino IDE. You can download the stepper motor library from here.

After that define the no of steps for the NEMA 17.  As we calculated, the no. of steps per revolution for NEMA 17 is 200.

#include <Stepper.h>
#define STEPS 200


After that, specify the pins to which driver module is connected and define the motor interface type as Type1 because the motor is connected through the driver module.

Stepper stepper(STEPS, 2, 3);
#define motorInterfaceType 1


Next set the speed for stepper motor for sale using stepper.setSpeed function. Maximum motor speed for NEMA 17 is 4688 RPM but if we run it faster than 1000 RPM torque falls of quickly.

void setup() {
    stepper.setSpeed(1000);


Now in the main loop, we will read the potentiometer value from A0 pin. In this loop, there are two functions one is potVal, and the other is Pval. If the current value, i.e., potVal is higher than the previous value, i.e., Pval than it will move ten steps in the clockwise direction and if the current value is less than previous value than it will move ten steps in the counter-clockwise direction.

potVal = map(analogRead(A0),0,1024,0,500);
  if (potVal>Pval)
      stepper.step(10);
  if (potVal<Pval)
      stepper.step(-10);

Pval = potVal;


Now connect the Arduino with your laptop and upload the code into your Arduino UNO board using Arduino IDE, select the Board and port no and then click on the upload button.

Now you can control the direction of Nema17 stepper motor using the potentiometer. The complete working of the project is shown in the video below. If you have any doubts regarding this project, post them in the comment section below. 

Code
#include <Stepper.h>
#define STEPS 200

// Define stepper motor connections and motor interface type. Motor interface type must be set to 1 when using a driver
Stepper stepper(STEPS, 2, 3); // Pin 2 connected to DIRECTION & Pin 3 connected to STEP Pin of Driver
#define motorInterfaceType 1
int Pval = 0;
int potVal = 0;

void setup() {
  // Set the maximum speed in steps per second:
  stepper.setSpeed(1000);
}
void loop() {

  potVal = map(analogRead(A0),0,1024,0,500);
  if (potVal>Pval)
      stepper.step(10);
  if (potVal<Pval)
      stepper.step(-10);

Pval = potVal;

}

http://www.apsense.com/user/yinweikou/have?id=159333


Tuesday, October 22, 2019

Stepper Motor Power Basics And Motor Connections


The motor power output (speed times torque) is determined by the power supply voltage and the motor’s inductance. The motor’s output power is proportional to the power supply voltage divided by the square root of the motor inductance.

Stepper Motor Power Basics And Motor Connections


If one changes the power supply voltage, then a new family of speed-torque curves result. As an example, if the power supply voltage is doubled then a new curve is generated; the curve now has twice the torque at any given speed in region 2. Since power equals torque times speed, the motor now generates twice as much power as well.

Hybrid stepper motors have four, six or eight wires; older motors may have five wires, but they will not be covered here.

Four-wire motors are the simplest to connect and offer no connection options. Simply connect one winding to the terminals labeled “Phase A” and “Phase /A” and connect the other winding to the terminals that say “Phase B” and “Phase /B”. If it is unknown which wires belong to which phase, simply use an ohmmeter and test which wires have continuity. The ones that have continuity will belong to the same phase; if the motor turns the wrong direction when connected just swap “Phase A” and “Phase /A”.

Check here more “beststepper motor online”.

The feature of planetary gearbox for stepper motors

Compared with ordinary gear drives, planetary gearbox for stepper motor have many characteristics. The main characteristics of planetary ge...