Question about stepper motor and l298n (for this particular project)

I am getting ready to build this camera slider as found here (Android Arduino Motorized Camera Dolly (Finished) - YouTube).

He has provided excellent schematics available here: https://docs.google.com/file/d/0By8XNb8wugjaZVp6WE1OYzBYeXc/edit?usp=sharing

As well as his arduino sketch here: https://docs.google.com/file/d/0By8XNb8wugjacTlCczB5R3ZMcXM/edit?usp=sharing

I have a nema 17 from inventables: https://www.inventables.com/technologies/stepper-motor-nema-17

I also purchased the L298N stepper driver board from here: Geekcreit? L298N Dual H Bridge Stepper Motor Driver Board Sale - Banggood USA

Looking at his wiring diagram it looks like he is just using a regular dc motor as I only see the two leads from the motor hitting pins 2 and 3 on the l298n (output 1 and 2). My question is If i wire up my stepper motor blue/red to output 1 and 2 as well as wiring up green/black to pins 13 and 14 will this work with this sketch?

I guess I just do not understand if his sketch will know to set high low to pins 13 and 14 on the l298n as it appears he is only running a 2 wire motor. Then again maybe I only need to hook up one phase of the stepper in this project to make it work? Any help would be greatly appreciated!
Neil

Looking at it a bit further (this is my first arduino project so take it easy on me).

Could I just define motor3 and motor 4 and modify the motor state later in the code?

int State;//1=Stop,2=Forward,3=Backward
int Lapse;
#define MotorPWM 10
#define Motor1 11
#define Motor2 12
#define Motor3 6  //Here is what I added here (which would go to pin 10 on l298n)
#define Motor4 13 //Here is what I added here (which woudl go to pin 12 on l298n)

//would I just run MotorPWM 10 out to both pin 6 and pin 11 on the l298n (enable a and enable b)?
//then make the following changes below...

void MotorTurn(String Direction, int PWM){
  if (Direction == "Forward"){
  digitalWrite(Motor1,HIGH);
  digitalWrite(Motor2,LOW);
  digitalWrite(Motor3,HIGH); //my modification not sure if this is low or high
  digitalWrite(Motor4,LOW); //my modification not sure if this is low or high
  analogWrite(MotorPWM,PWM);
  }
  else if (Direction == "Backward"){
  digitalWrite(Motor1,LOW);
  digitalWrite(Motor2,HIGH);
  digitalWrite(Motor3,LOW); //my modification not sure if this is low or high
  digitalWrite(Motor4,HIGH); //my modification not sure if this is low or high
  analogWrite(MotorPWM,PWM);
  }
  else if (Direction == "Stop"){
  digitalWrite(Motor1,LOW);
  digitalWrite(Motor2,LOW);
  digitalWrite(Motor3,LOW); //my modification
  digitalWrite(Motor4,LOW);  //my modification
  analogWrite(MotorPWM,0);
  }
}

I am a total noob but genuinely trying to learn. I appreciate any and all help I can get.
Take care,
Neil

That system doesn't have any position feedback, its open-loop and will perform
differently with different loads even. Having said that that heavy gearmotor will
be less sensitive to load than some DC motors.

If you want definite position control with a stepper motor you have two options,
either pick a high resistance motor that can be driven from 12V via a L298 or
similar dual-H-bridge, or choose a low-resistance motor that is suitable for
chopper drive (such as via an A4988).

High resistance typically means 40 ohms or thereabouts, typically labelled
something like "12V 0.25A"
low resistance would be 1 to 3 ohms or so, perhaps labelled "1.2A 2 ohm"

High impedance motors are often unipolar and easy to drive with an ULN2803
or similar, low impedance motors are always bipolar (4 wire), and with too
high a current rating you may struggle to keep the driver cool. High impedance
voltage-driven motors will run slower in general.

Occasionally you see medium impedance motors, around 10 ohm, which are
possible to drive from 6V or so via H-bridge (or via a chopper drive), which
gives more options.

Here is how my modified code would look... Still not sure if towards the bottom of the sketch for motor direction if I have the high low state set right for the stepper or if I am just shorting v+ or gnd by alternating the states..
I have attached my modified sketch and wiring changes..

Thanks again for anyone willing to help me out and understand this..

TimeLapse_Modified.ino (8.5 KB)

MarkT:
That system doesn't have any position feedback, its open-loop and will perform
differently with different loads even. Having said that that heavy gearmotor will
be less sensitive to load than some DC motors.

If you want definite position control with a stepper motor you have two options,
either pick a high resistance motor that can be driven from 12V via a L298 or
similar dual-H-bridge, or choose a low-resistance motor that is suitable for
chopper drive (such as via an A4988).

High resistance typically means 40 ohms or thereabouts, typically labelled
something like "12V 0.25A"
low resistance would be 1 to 3 ohms or so, perhaps labelled "1.2A 2 ohm"

High impedance motors are often unipolar and easy to drive with an ULN2803
or similar, low impedance motors are always bipolar (4 wire), and with too
high a current rating you may struggle to keep the driver cool. High impedance
voltage-driven motors will run slower in general.

Occasionally you see medium impedance motors, around 10 ohm, which are
possible to drive from 6V or so via H-bridge (or via a chopper drive), which
gives more options.

shoot I figured it woud not be just as simple as what I was hoping.. is there a decent cheap (sub 15$ motor you could suggest to work with his existing code)? I do not need much torque at all as I am just looking to move a small mobius camera (I realize the shutter/focus code does not pertain to my setup but..) Thanks again.
Neil

There are many places to buy motors, but remember to check all the specifications
before buying - find some possibles and post their details here, someone will be able to
confirm suitability. I would imagine NEMA17's are the size to go for as they are plentyful
and more than powerful enough (remember you get to choose the size of timing belt
pulley.)

Tip: rubber timing belt is far better than polyurethane belt for small low power
systems, polyurethane (such as T2.5 and T5 belt) is much stiffer and rated for
large forces and high power and needs lots of pretension to eliminate backlash.

Well I have the nema17 motor i listed in the top post... but since it is 2 phase it is 4 wire.. I thought you said for this sketch I needed just a two wire dc motor?

would something like this work with the original sketch??
http://www.ebay.com/itm/12V-DC-100RPM-High-Torque-Gear-Box-Electric-Motor/320914239665?_trksid=p2047675.c100005.m1851&_trkparms=aid%3D222007%26algo%3DSIC.MBE%26ao%3D1%26asc%3D20131003132420%26meid%3D8521478177354673935%26pid%3D100005%26prg%3D20131003132420%26rk%3D1%26rkt%3D6%26sd%3D300895463066&rt=nc

as far as timing belt goes I picked up this kit.
http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=321405616342&ssPageName=ADME:L:OC:US:3160

Neil

So if I am understanding you correctly I can try to find out what motor he is using (wrote him on youtube but have not heard back). Will the one I posted above on ebay work?

Or I can replace the l298n with A4988 and possibly be able to use the nema17 stepper I have which is 1.6A 1.65Ohm.

What modification to the original code would need to me done? I am looking at the datasheet for the A4988 and I see where i throw my 12v into VMOT GND then hook up my stepper to A1, A2, B1, B2. Then throw gnd and vdd from arduino into it as well..

as far as sending signals is it just as simple as swapping high, low on the step and dir pins on the a4988.

I think I am starting to get way too far away from what I am wanting to do on a first project... I was hoping the nema17 I had would work with the l298n but I see I may have to look another route for a motor (sticking with original sketch). If anyone has any suggestions I would appreciate it.

Take care
Neil