Controlling a Nema 17 Stepper

im wanting to build a camera slider and want to use one of these -

with a nema 17 stepper motor and some form of touch screen for the arduino

has anyone done a setup like this before and is there any coding around i could nick?

thanks in advance

Dear andy,

Requested to share data sheet for above module. I have done some project . i can share u sample code only to activate & control the motor & other algorithm part u need it do ityourself

andy_con:
im wanting to build a camera slider and want to use one of these -

http://www.banggood.com/L293D-Motor-Drive-Expansion-Shield-Board-Module-For-Arduino-Mega-UNO-p-914883.html

with a nema 17 stepper motor

No, choose your motor first according to the mechanical requirements, then choose
the right driver board.

Most steppers either need bipolar chopper drive like A4988, or unipolar drive for
which an ULN2803 might be all that's needed. So you do get to choose bipolar/unipolar.

Unipolar are typically much slower in maximum speed, but if speed isn't an issue they
are simpler to drive.

AMPS-N:
Dear andy,

Requested to share data sheet for above module. I have done some project . i can share u sample code only to activate & control the motor & other algorithm part u need it do ityourself

ok thanks

how do i request to share?

i have, im using a nema 17!

MarkT:

andy_con:
im wanting to build a camera slider and want to use one of these -

http://www.banggood.com/L293D-Motor-Drive-Expansion-Shield-Board-Module-For-Arduino-Mega-UNO-p-914883.html

with a nema 17 stepper motor

No, choose your motor first according to the mechanical requirements, then choose
the right driver board.

Most steppers either need bipolar chopper drive like A4988, or unipolar drive for
which an ULN2803 might be all that's needed. So you do get to choose bipolar/unipolar.

Unipolar are typically much slower in maximum speed, but if speed isn't an issue they
are simpler to drive.

Nema 17 is a specification for the size of the front face of the motor and the position of the fixing screws. It has nothing to do with the power of the motor.

If you have identified a specific motor that you plan to use post a link to its datasheet.

...R

Robin2:
Nema 17 is a specification for the size of the front face of the motor and the position of the fixing screws. It has nothing to do with the power of the motor.

If you have identified a specific motor that you plan to use post a link to its datasheet.

...R

ok very true :wink:

something like this is what i want to use a small nema 17

I have had good success using the Pololu bipolar drivers:

I used it to rotate a 10W solar panel, so the torque is pretty good. I purchased the NEMA 17 from them, too.

the thing im after is smoothness, im building a motorised camera slider using a very special setup which ive not seen used before.

so does that driver give a smooth output?

i also have future plans to add a pan and tilt setup, so i need to keep that in mind as well

andy_con:
something like this is what i want to use a small nema 17

3D Printer Small NEMA17 Stepper Motors - 1.8deg - 5mm Shaft - Reprap CNC & More | eBay

What we mean by the kind of stepper is coil resistance, operating current and number
of wires, not the form factor...

That one is a high-impedance bipolar by the look of it, so can be driven from 12V
from an L298 or L293 or pair of MOSFET H-bridges. It won't spin as fast as a
low-impedance bipolar motor can, but for belt-drive systems is probably OK.

so would i be better off with something like this then?

http://www.ebay.co.uk/itm/NEMA17-Hi-Torque-44N-cm-Stepper-Motor-1-8deg-1M-Cable-Reprap-3D-Printer-CNC-DIY-/231015892470?pt=LH_DefaultDomain_3&hash=item35c99ec5f6

speed isnt that important and the system is unlikely to be belt driven

MarkT:

andy_con:
something like this is what i want to use a small nema 17

3D Printer Small NEMA17 Stepper Motors - 1.8deg - 5mm Shaft - Reprap CNC & More | eBay

What we mean by the kind of stepper is coil resistance, operating current and number
of wires, not the form factor...

That one is a high-impedance bipolar by the look of it, so can be driven from 12V
from an L298 or L293 or pair of MOSFET H-bridges. It won't spin as fast as a
low-impedance bipolar motor can, but for belt-drive systems is probably OK.

The Nema 17 I bought was 200 steps, or 1.8 degrees per step. The Pololu driver provides six different step resolutions: full-step, half-step, 1/4-step, 1/8-step, 1/16-step, and 1/32-step. Seems that should be enough granularity for you.

andy_con:
im wanting to build a camera slider

take it easy on the motor selection.

what is a camera slider ?
if you are talking about a camera dolly that will house an 800 pound TV high def camera for a studio, you need to forget about that puny NEMA17 stepper.

if you want to move a web cam or lipstick cam around , then why would you use such a monster NEMA17 motor ?

for a non-contact device that rolls on rails, the dolly may not need much power to move.

Before you pick a motor, do the rest of the machine. tie a string to it and hang it off the end of a ladder. put some weights on the string to get an idea how much weight is needed to move.

I suspect you will be surprised.

While looking, dumpster diver for old printers, really old 5-1/4" floppy drives and old scanners.

Those units have belts and gears and all manner of parts you can use. oh and motors too !

by the way, the motor driver you linked too the L298 device is only good for full or half step. for the same money on the same site, you can get a

this is a microstepping driver that will make your NEMA17 motor purr. the L298 will jump and cog.

I have some of these motors which have similar holding torque and current to the one you first linked to. They work well with the A4988 stepper driver. My guess (and it's not more than that) is that they would be more than adequate for you project if the camera is a regular home-movie or still camera.

The question of smoothness and quietness is more tricky. Stepper motors move in steps. Microstepping makes the steps smaller but doesn't eliminate them.

A simple DC motor with some sort of position feedback would probably be smoother - but the position system would be more complex.

You haven't said how you plan to control the position or what level of precision and repeatability you want. If (for example) you just want to move the camera in response to a joystick and if position is just managed visually by th operator then a DC motor system would be easy to implement. If you want unattended computer control with repeatable positioning the stepper motors would be a simple solution but may be bumpy and noisy.

Another "outside the box" idea is to use sail-winch servos to move the camera by winding a continuous wire or string. The Arduino can very easily control them using its Servo library. They may, however, be a little jerky. Or you could try a continuous rotation servo which allows the Arduino to control the speed but not the position.

...R

im a little open on the actual stepper motor i use.

im an engineer, i own 2x cnc milling machines with ATC's and a manual milling machine, but electronics and programming isnt my strong point.

if anymore knows how milling machines work they use a ballscrew, well thats what im going to use to build my camera slider. ballscrews are very strong, stable, really really smooth and can do fine movement. ive not decided if im going to connect the stepper directly to the ballscrew or use a belt.

movement wise i dont need anything less than 0.1mm

so open to suggestions on stepper but its getting the controls and programming right i really need help with

oh and i was probably going to put in two limit switches at either end of the slider so the system knows when its at the end

You'll probably be fine with belt, such as glass-fibre reinforced rubber timing
belt (MXL pitch). 0.1mm is easily doable with microstepping. two round rods and
some linear bearings (or drilled-out polythene/teflon sliders) to mount the platform.

Cheap and cheerful chinese linear bearings on eBay are probably good enough here
(if 0.1mm is your basic tolerance). L6UU or L8UU (depending on how long a run
you might want larger to allow stiffer rods (Stainless steel round rod).

Ball-screws are overkill here I think! And yes two limit switches is definitely
a good idea.

yep indeed over kill but its the route im going.

and yep chinese ball screws is what im getting also

so need recommendation for stepper, arduino controller, programming and touch screen setup

andy_con:
im an engineer, i own 2x cnc milling machines with ATC's and a manual milling machine, but electronics and programming isnt my strong point.

It might have short circuited some of the discussion if you had said this up front :slight_smile:

but its getting the controls and programming right i really need help with

Can you explain a bit more what sort of assistance you want. For example the following code illustrates in very simple terms how to make a stepper move - but maybe you already know that?

// testing a stepper motor with a Pololu A4988 driver board or equivalent
// on an Uno the onboard led will flash with each step
// as posted on Arduino Forum at http://forum.arduino.cc/index.php?topic=208905.0

byte directionPin = 9;
byte stepPin = 8;
int numberOfSteps = 100;
byte ledPin = 13;
int pulseWidthMicros = 20;  // microseconds
int millisbetweenSteps = 25; // milliseconds


void setup() 
{ 

  Serial.begin(9600);
  Serial.println("Starting StepperTest");
  digitalWrite(ledPin, LOW);
  
  delay(2000);

  pinMode(directionPin, OUTPUT);
  pinMode(stepPin, OUTPUT);
  pinMode(ledPin, OUTPUT);
  
 
  digitalWrite(directionPin, HIGH);
  for(int n = 0; n < numberOfSteps; n++) {
    digitalWrite(stepPin, HIGH);
    delayMicroseconds(pulseWidthMicros);
    digitalWrite(stepPin, LOW);
    
    delay(millisbetweenSteps);
    
    digitalWrite(ledPin, !digitalRead(ledPin));
  }
  
  delay(3000);
  

  digitalWrite(directionPin, LOW);
  for(int n = 0; n < numberOfSteps; n++) {
    digitalWrite(stepPin, HIGH);
    delayMicroseconds(pulseWidthMicros);
    digitalWrite(stepPin, LOW);
    
    delay(millisbetweenSteps);
    
    digitalWrite(ledPin, !digitalRead(ledPin));
  }
  
}

void loop() 
{ 

}

...R

no i didnt say that earlier my bad

thanks for the coding

well say i use this stepper

what arduino, stepper controller and touch screen would be best to use?

example is something like this any good as a touch screen?

http://www.ebay.co.uk/itm/2-8-TFT-LCD-Shield-Touch-Screen-SD-Card-Socket-For-Arduino-Board-Moudle-/181301483437?pt=UK_BOI_Electrical_Components_Supplies_ET&hash=item2a366917ad