Arduino stepper motor problems.

Thread Starter

1quickquestion1

Joined Oct 13, 2017
22
I eventually want to put together a adruino cnc machine using cd drive stepper motors but right now i just want to test if the motors even work. Iv'e been working on this for almost 2 days now and this is pretty much my last resort since i'm getting really frustrated with such a simple task that everyone seems to have done. Right now the lights on the motor controller blink in a continuous pattern but there is no movement at all. So if anyone could help me out that would be amazing. Here's my setup:

using an arduino uno, L298N Motor controller(linked), 3x 3.7v 6800mah li-on batteries (in series), and a cd drive stepper motor.
Arduino pin 8--->In 1 on controller
Arduino pin 9--->In 2 on controller
Arduino pin 10--->In 3 on controller
Arduino pin 11--->In 4 on controller

ground of battery pack is connected to ground on the motor controller and the positive is connected to the "VMS" port.(arduino powered by computer)

I identified the two internal loops of the stepper motor and just connected them from left to right on the motor to the ports on motor controller from left to right. (I tried every possible configuration and nothing worked in respect to order of the wires) I also checked and all connections had continuity.

Here is a code I found online which is supposed to work with my motor.
Code:
#include <Stepper.h>

const int stepsPerRevolution = 24;  // change this to fit the number of steps per revolution
                                     // for your motor

// initialize the stepper library on pins 8 through 11:
Stepper myStepper(stepsPerRevolution, 8,9,10,11);         

int stepCount = 0;         // number of steps the motor has taken

void setup() {
  // initialize the serial port:
  Serial.begin(9600);
}

void loop() {
  // step one step:
  myStepper.step(1);
  Serial.print("steps:" );
  Serial.println(stepCount);
  stepCount++;
  delay(100);
}
I really hope I'm missing something obvious and that the motor isn't burnt or something but any suggestions you guys have would be much appreciated! Thanks,

link to motor controller: https://abra-electronics.com/electr...l-h-bridge-motor-controller-driver-board.html
 

Reloadron

Joined Jan 15, 2015
7,889
This would go much better with a drawing of what you are doing. The L298 is an H-Bridge which is fine for reversing and controlling a DC motor, so how exactly is the motor interfaced with the L298 breakout and how is the L298 interfaced with the Arduino? You seem to have an H-Bridge and not a stepper motor driver board. A Google of Arduino stepper motor should show several stepper driver circuits interfaced with your Arduino.

Ron
 

Thread Starter

1quickquestion1

Joined Oct 13, 2017
22
It is an H-Bridge chip but its is still supposed to work with stepper motors, there are many people online using this controller in this way unless i'm missing something. I attached a few photos of my setup to make it easier to understand.20180303_125517.jpg 20180303_125456.jpg 20180303_125435.jpg
 

Reloadron

Joined Jan 15, 2015
7,889
Looking at the pictures as best I can see it should work. You may want to give some thought to:
A bipolar stepper driver can be built using a 4-channel high current driver, such as an L293, SN754410, or L298 motor driver IC. Each of the outputs should have a pair of fast acting catch diodes to prevent damage to the driver IC from flyback voltages that occur as a result of motor inductance during switching. Each phase of the stepper motor is connected to two of the output drivers, forming two H-bridges and allowing for current to be driven bidirectionally through the two phases. Only one phase should be active at a time for a standard control scheme, so the output driver enables will have to be turned on and off in addition to controlling the direction of the output drivers.
Applied Robotics/Mechanisms and Actuation/DC Stepper Motor

The code, as far as I can see looks OK also. You are sure you have a known good motor? Hopefully another member will look at this and maybe see something I am missing.

Ron
 
Top