Loading...

Tutorial.MotorKnob History

Hide minor edits - Show changes to markup

November 15, 2011, at 10:40 PM by Scott Fitzgerald -
Changed lines 63-64 from:

(:source http://github.com/arduino/Arduino/raw/master/libraries/Stepper/examples/MotorKnob/MotorKnob.pde lang=arduino tabwidth=4:)

to:

(:source http://github.com/arduino/Arduino/raw/master/libraries/Stepper/examples/MotorKnob/MotorKnob.ino lang=arduino tabwidth=4:)

September 23, 2010, at 04:55 PM by Christian Cerrito -
Changed lines 3-4 from:

Motor Knob

to:

Stepper Motor Knob

September 23, 2010, at 06:45 AM by Tom Igoe -
Changed lines 63-64 from:

(:sourcehttp://github.com/arduino/Arduino/raw/master/libraries/Stepper/examples/MotorKnob/MotorKnob.pde lang=arduino tabwidth=4:)

to:

(:source http://github.com/arduino/Arduino/raw/master/libraries/Stepper/examples/MotorKnob/MotorKnob.pde lang=arduino tabwidth=4:)

September 23, 2010, at 06:44 AM by Tom Igoe -
Changed lines 63-95 from:

(:source lang=arduino tabwidth=4:)

  1. include <Stepper.h>

// change this to the number of steps on your motor

  1. define STEPS 100

// create an instance of the stepper class, specifying // the number of steps of the motor and the pins it's // attached to Stepper stepper(STEPS, 8, 9, 10, 11);

// the previous reading from the analog input int previous = 0;

void setup() {

  // set the speed of the motor to 30 RPMs
  stepper.setSpeed(30);

}

void loop() {

  // get the sensor value
  int val = analogRead(A0);

  // move a number of steps equal to the change in the
  // sensor reading
  stepper.step(val - previous);

  // remember the previous value of the sensor
  previous = val;

} (:sourceend:)

to:

(:sourcehttp://github.com/arduino/Arduino/raw/master/libraries/Stepper/examples/MotorKnob/MotorKnob.pde lang=arduino tabwidth=4:)

September 23, 2010, at 02:00 AM by Christian Cerrito -
Added lines 105-110:
  • Sweep - sweep the shaft of a servo motor back and forth.
  • Knob - control the position of a servo with a potentiometer.

September 23, 2010, at 01:59 AM by Christian Cerrito -
Changed lines 61-62 from:

(for both circuits)

to:

(for both circuits)

Changed lines 100-101 from:
to:
September 23, 2010, at 01:54 AM by Christian Cerrito -
September 23, 2010, at 01:52 AM by Christian Cerrito -
Added line 60:

(:div class=code :)

Changed lines 96-97 from:
to:

(:divend:)

September 23, 2010, at 01:50 AM by Christian Cerrito -
Changed lines 48-49 from:

'"Bipolar Stepper Schematic'''

to:

Bipolar Stepper Schematic

September 23, 2010, at 01:48 AM by Christian Cerrito -
Changed lines 50-52 from:
to:

September 23, 2010, at 01:47 AM by Christian Cerrito -
Changed lines 32-33 from:

Unipolar Stepper

to:

Unipolar Stepper Circuit

Changed lines 37-38 from:

Unipolar Schematic

to:

Unipolar Circuit Schematic

Changed lines 42-43 from:

Bipolar Stepper

to:

Bipolar Stepper Circuit

Changed lines 48-52 from:
to:

'"Bipolar Stepper Schematic'''

Attach:bipolar_bb.jpeg Δ Δ

Added lines 60-61:

(for both circuits)

September 23, 2010, at 01:43 AM by Christian Cerrito -
Changed line 34 from:
to:
Added lines 40-44:

Bipolar Stepper

September 23, 2010, at 01:41 AM by Christian Cerrito -
Added lines 37-43:

Unipolar Schematic

image developed using Fritzing. For more circuit examples, see the Fritzing project page

September 23, 2010, at 01:38 AM by Christian Cerrito -
Added lines 28-29:

In both circuits, connect a 10k pot to power and ground, with it's wiper outputting to analog pin 0.

September 23, 2010, at 01:36 AM by Christian Cerrito -
Changed line 32 from:
to:
September 23, 2010, at 01:12 AM by Christian Cerrito -
Changed lines 10-12 from:

'

Code

to:

(:div class=BOM :)

Hardware Required

  • Arduino Board
  • potentiometer
  • stepper motor
  • U2004 Darlington Array (if using a unipolar stepper)
  • SN754410ne H-Bridge (if using a bipolar stepper)

(:divend:)

  • power supply appropriate for your particular stepper
  • breadboard
  • hookup wire

(:divend:)

Circuits

(:div class=circuit :) Below you'll find circuits for both unipolar and bipolar steppers. In either case, it is best to power your stepper motors from an external supply, as they draw too much to be powered directly from your Arduino board.

Note: Both circuits below are four wire configurations. Two wire configurations will not work with the code provided.

Unipolar Stepper

image developed using Fritzing. For more circuit examples, see the Fritzing project page

(:divend:)

Code

September 23, 2010, at 01:01 AM by Christian Cerrito -
Changed lines 5-6 from:

Stepper motors are motors that, due to their design, can be controlled to a high degree of accuracy without any feedback mechanisms. The shaft of a stepper, mounted with a series of magnets, is controlled by a series of electromagnetic coils that are charged positively and negatively in a specific sequence, precisely moving it forward or backward in small "steps".

to:

Stepper motors, due to their unique design, can be controlled to a high degree of accuracy without any feedback mechanisms. The shaft of a stepper, mounted with a series of magnets, is controlled by a series of electromagnetic coils that are charged positively and negatively in a specific sequence, precisely moving it forward or backward in small "steps".

September 23, 2010, at 01:00 AM by Christian Cerrito -
Changed lines 7-10 from:

There are two types of steppers, Unipolars and Bipolars, and it is very important to know which type you are working with. For more information about the differences of the two types, and about the circuits that must be built to control a stepper, please take a look at Tom Igoe's page on stepper motors.

In this example, the turns of a potentiometer (or other sensor) on analog input 0 are used to control the movement of a stepper motor while using the Arduino Stepper Library. The unipolar or bipolar stepper is controlled by using digital pins 8, 9, 10, and 11 in conjunction with either a U2004 Darlington Array (for unipolar steppers) or a SN754410NE H-Bridge (for bipolars) Add a link to tom's stepper pages

to:

There are two types of steppers, Unipolars and Bipolars, and it is very important to know which type you are working with. For more information about the differences of the two types, and about the circuits that must be built to control a stepper, please take a look at Tom Igoe's page on stepper motors.

In this example, the turns of a potentiometer (or other sensor) on analog input 0 are used to control the movement of a stepper motor while using the Arduino Stepper Library. The unipolar or bipolar stepper is controlled by using digital pins 8, 9, 10, and 11 in conjunction with either a U2004 Darlington Array (for unipolar steppers) or a SN754410NE H-Bridge (for bipolars). '

September 23, 2010, at 12:57 AM by Christian Cerrito -
Changed lines 5-6 from:

Stepper motors are motors that, due to their design, can be controlled to a high degree of accuracy without any feedback mechanisms. The shaft of a stepper, mounted with a series of magnets, is controlled by a series of electromagnetic coils that are charged positively and negatively in a specific sequence, precisely turning it in small "steps".

to:

Stepper motors are motors that, due to their design, can be controlled to a high degree of accuracy without any feedback mechanisms. The shaft of a stepper, mounted with a series of magnets, is controlled by a series of electromagnetic coils that are charged positively and negatively in a specific sequence, precisely moving it forward or backward in small "steps".

Changed line 9 from:

In this example, the turns of a potentiometer (or other sensor) on analog input 0 are used to control the movement of a stepper motor using the Arduino Stepper Library. The unipolar or bipolar stepper is controlled by using digital pins 8, 9, 10, and 11 in conjunction with either a U2004 Darlington Array (for unipolar steppers) or a SN754410NE H-Bridge (for bipolars)

to:

In this example, the turns of a potentiometer (or other sensor) on analog input 0 are used to control the movement of a stepper motor while using the Arduino Stepper Library. The unipolar or bipolar stepper is controlled by using digital pins 8, 9, 10, and 11 in conjunction with either a U2004 Darlington Array (for unipolar steppers) or a SN754410NE H-Bridge (for bipolars)

September 23, 2010, at 12:55 AM by Christian Cerrito -
Changed lines 7-8 from:

There are two types of steppers, Unipolars and Bipolars, and it is very important to know which type you are working with. For more information about the differences of the two types, and about the circuits that must be built to control a stepper, please take a look at Tom Igoe's 'page on stepper motors.

to:

There are two types of steppers, Unipolars and Bipolars, and it is very important to know which type you are working with. For more information about the differences of the two types, and about the circuits that must be built to control a stepper, please take a look at Tom Igoe's page on stepper motors.

September 23, 2010, at 12:55 AM by Christian Cerrito -
Changed lines 5-8 from:

Stepper motors are motors that, due to their design, can be controlled to a high degree of accuracy without any feedback mechanisms. The shaft of a stepper, mounted with a series of magnets, is controlled by a series of electromagnetic coils that are charged positively and negatively in a specific sequence, precisely turning it in small "steps".

In this example, the turns of a potentiometer (or other sensor) on analog input 0 are used to control the movement of a stepper motor using the Arduino Stepper Library. The unipolar or bipolar stepper is controlled with pins 8, 9, 10, and 11, using one of the circuits on the linked pages.

to:

Stepper motors are motors that, due to their design, can be controlled to a high degree of accuracy without any feedback mechanisms. The shaft of a stepper, mounted with a series of magnets, is controlled by a series of electromagnetic coils that are charged positively and negatively in a specific sequence, precisely turning it in small "steps".

There are two types of steppers, Unipolars and Bipolars, and it is very important to know which type you are working with. For more information about the differences of the two types, and about the circuits that must be built to control a stepper, please take a look at Tom Igoe's 'page on stepper motors.

In this example, the turns of a potentiometer (or other sensor) on analog input 0 are used to control the movement of a stepper motor using the Arduino Stepper Library. The unipolar or bipolar stepper is controlled by using digital pins 8, 9, 10, and 11 in conjunction with either a U2004 Darlington Array (for unipolar steppers) or a SN754410NE H-Bridge (for bipolars)

September 23, 2010, at 12:44 AM by Christian Cerrito -
Changed lines 5-8 from:

Description

A stepper motor follows the turns of a potentiometer (or other sensor) on analog input 0. The unipolar or bipolar stepper is controlled with pins 8, 9, 10, and 11, using one of the circuits on the linked pages.

to:

Stepper motors are motors that, due to their design, can be controlled to a high degree of accuracy without any feedback mechanisms. The shaft of a stepper, mounted with a series of magnets, is controlled by a series of electromagnetic coils that are charged positively and negatively in a specific sequence, precisely turning it in small "steps".

In this example, the turns of a potentiometer (or other sensor) on analog input 0 are used to control the movement of a stepper motor using the Arduino Stepper Library. The unipolar or bipolar stepper is controlled with pins 8, 9, 10, and 11, using one of the circuits on the linked pages.

September 20, 2010, at 11:19 AM by Tom Igoe -
Added line 9:

Add a link to tom's stepper pages

September 16, 2010, at 06:01 PM by Tom Igoe -
Changed lines 34-35 from:
  int val = analogRead(0);
to:
  int val = analogRead(A0);
September 16, 2010, at 05:29 PM by Tom Igoe -
Changed line 11 from:

[@

to:

(:source lang=arduino tabwidth=4:)

Changed lines 43-44 from:

@]

to:

(:sourceend:)

May 21, 2008, at 10:40 PM by David A. Mellis -
Changed lines 45-46 from:

See Also

to:

See also

May 21, 2008, at 10:40 PM by David A. Mellis -
Changed lines 43-47 from:

@]

to:
May 21, 2008, at 10:37 PM by David A. Mellis -
Changed lines 7-8 from:

A stepper motor follows the turns of a potentiometer (or other sensor) on analog input 0. The unipolar? or bipolar? stepper is controlled with pins 8, 9, 10, and 11, using one of the circuits on the linked pages.

to:

A stepper motor follows the turns of a potentiometer (or other sensor) on analog input 0. The unipolar or bipolar stepper is controlled with pins 8, 9, 10, and 11, using one of the circuits on the linked pages.

May 21, 2008, at 10:36 PM by David A. Mellis -
Added lines 1-43:

Examples > Stepper Library

Motor Knob

Description

A stepper motor follows the turns of a potentiometer (or other sensor) on analog input 0. The unipolar? or bipolar? stepper is controlled with pins 8, 9, 10, and 11, using one of the circuits on the linked pages.

Code

#include <Stepper.h>

// change this to the number of steps on your motor
#define STEPS 100

// create an instance of the stepper class, specifying
// the number of steps of the motor and the pins it's
// attached to
Stepper stepper(STEPS, 8, 9, 10, 11);

// the previous reading from the analog input
int previous = 0;

void setup()
{
  // set the speed of the motor to 30 RPMs
  stepper.setSpeed(30);
}

void loop()
{
  // get the sensor value
  int val = analogRead(0);

  // move a number of steps equal to the change in the
  // sensor reading
  stepper.step(val - previous);

  // remember the previous value of the sensor
  previous = val;
}




Bookmark and Share