Topic outline

  • Topic 1

    Introduction

    A great use for Arduinos is to run motors. Arduinos are great to provide code to switch these on and of, back and forth.

    However, the Arduino may not be robust enough to cary the load of electricity required to run these devices, so a series of solutions can be found.

    There are four main types of motors

    • Brushed and brushless motors
    • Servos
    • Solenoid and relay motors
    • Steppers

    All these motors come in many different sizes and shapes.

    Remember we inly use 9 volts power supplies here!

    Type 1 : Brushed and brushless

    Put simply, a brushed motor is the more familiar electric motor that has a rotor that spins

    A brushless motor achieves movement by spinning it's outer case, therefore achieving greater torque.

    Type 2 : Steppers

    Steppers are contrived to move in discrete "steps", typically 200 per rotation. 50 steps then is 90o and hence steppers can turn to accurate angles.

    Type 3 : Servos

    Servos contain a simple analog motor and a potentiometer. The potentiometer tells the microprocessor how far it has travelled in a feedback loop.

    Type 4 : Relays and solenoids

    Conclusion
    • Topic 2

      • Topic 3

        Drivers

        a Mechanica : servos and steppers
        b

        uln2003

        uln2003

        c
        • Topic 4

          Motors : analogue v digital

          • Topic 5

            Bi polar stepper motors

            There are two basic winding arrangements for the electromagnetic coils in a two phase stepper motor, one being bipolar and the other unipolar.

            Unipolar Stepper Motors.
            The unipolar stepper motor operates with one winding with a center tap per phase.

            Bipolar Stepper Motors
            With bipolar stepper motors there is only a single winding per phase. 
            unipolar v bipolar

            4 wires suggest a standard bipolar 2-phase scheme. You need two full bridge drivers to supply it.
            You can use 5vdc to 9vdc but motor is started working at 3vdc. But if your motor is warm(normal is not warm) please checked the timing driver.

            Quick and dirty determine which phases


            Each of the two phases should have the same resistance when measured with a multimeter. When measuring the resistance across one wire from each of the two phases, the resistance should be infinite because the circuit is open. Locate the two pairs of wires that represent the two phases; both pairs of wires will have similar internal resistance.

            bipolar


            bipolar steppers













            • Topic 6

              CD ROM stepper

              /* Stepper Matsushita 02700B4
               red to pin 7 (motorpin 4)
               white pin 6 (motorpin 3)
               blue pin 5 (motorpin 2)
               orange pin 4 (motorpin 1)
               red - blue are one coil orange - blue the other */

               int motorPin1 = 4;
              int motorPin2 = 5;
              int motorPin3 = 6;
              int motorPin4 = 7;
              int delayTime = 10;

               void setup() {
               pinMode(motorPin1, OUTPUT);
               pinMode(motorPin2, OUTPUT);
               pinMode(motorPin3, OUTPUT);
               pinMode(motorPin4, OUTPUT); }

              void loop() {
               for (int x = 0; x < 100; x++) {
               forward(); }
               delay(2000); for
              (int y = 0; y < 100; y++) { reverse(); }
               delay(2000); }

               void forward() {
               digitalWrite(motorPin1, HIGH); digitalWrite(motorPin2, HIGH); digitalWrite(motorPin3, LOW); digitalWrite(motorPin4, LOW); delay(delayTime); digitalWrite(motorPin1, LOW); digitalWrite(motorPin2, HIGH); digitalWrite(motorPin3, HIGH); digitalWrite(motorPin4, LOW); delay(delayTime); digitalWrite(motorPin1, LOW); digitalWrite(motorPin2, LOW); digitalWrite(motorPin3, HIGH); digitalWrite(motorPin4, HIGH); delay(delayTime); digitalWrite(motorPin1, HIGH); digitalWrite(motorPin2, LOW); digitalWrite(motorPin3, LOW); digitalWrite(motorPin4, HIGH); delay(delayTime); }

               void reverse()
              { digitalWrite(motorPin1, LOW); digitalWrite(motorPin2, LOW); digitalWrite(motorPin3, HIGH); digitalWrite(motorPin4, HIGH); delay(delayTime); digitalWrite(motorPin1, HIGH); digitalWrite(motorPin2, LOW); digitalWrite(motorPin3, LOW); digitalWrite(motorPin4, HIGH); delay(delayTime); digitalWrite(motorPin1, HIGH); digitalWrite(motorPin2, HIGH); digitalWrite(motorPin3, LOW); digitalWrite(motorPin4, LOW); delay(delayTime); digitalWrite(motorPin1, LOW); digitalWrite(motorPin2, HIGH); digitalWrite(motorPin3, HIGH); digitalWrite(motorPin4, LOW); delay(delayTime); }
              bipolar
              • Topic 7

                Stepper motors

                Steppers

                Stepper motors are DC motors that move in discrete steps. They have multiple coils that are organized in groups called "phases". By energizing each phase in sequence, the motor will rotate, one step at a time. With a computer controlled stepping you can achieve very precise positioning and/or speed control.

                Pin Configuration for 28byj

                No:

                Pin Name

                Wire Color

                Description

                1

                Coil 1

                Orange

                This Motor has a total of four coils. One end of all the coils are connect to +5V (red) wire and the other end of each coil is pulled out as wire colors Orange, Pink, Yellow and Blue respectively

                2

                Coil 2

                Pink

                3

                Coil 3

                Yellow

                4

                Coil 4

                Blue

                5

                +5V

                Red

                We should supply +5V to this wire, this voltage will appear across the coil that is grounded.

                zc-a0591

                stepper motor and driver driver

                Instruction sheet

                Motor Wire Color

                Sequence to Rotate in clockwise Direction

                Step 1

                Step 2

                Step 3

                Step 4

                Step 5

                Step 6

                Step 7

                Step 8

                Orange

                0

                0

                1

                1

                1

                1

                1

                0

                Yellow

                1

                0

                0

                0

                1

                1

                1

                1

                Pink

                1

                1

                1

                0

                0

                0

                1

                1

                Blue

                1

                1

                1

                1

                1

                0

                0

                0

                Red

                1

                1

                1

                1

                1

                1

                1

                1

                Code example 1

                This code uses parameter passing and subroutines to drive the stepper. More detailed programming is available in the instruction sheet.

                int motorPin1 = 8;
                int motorPin2 = 9;
                int motorPin3 = 10;
                int motorPin4 = 11;

                int motorSpeed = 1;

                void setup() {
                //declare the motor pins as outputs
                pinMode(motorPin1, OUTPUT);
                pinMode(motorPin2, OUTPUT);
                pinMode(motorPin3, OUTPUT);
                pinMode(motorPin4, OUTPUT);
                Serial.begin(9600);
                }

                //////////////////////////////////////////////////////////////////////////////
                void loop() {
                for (int i = 500; i > 0; i--)
                {
                Serial.println("clockwise");
                clockwise();
                }

                for (int i = 0; i < 500; i++)
                {
                Serial.println("counterclockwise");
                counterclockwise();
                }
                }

                void clockwise ()
                {
                motor(0, 1, 1, 1); //1
                motor(0, 0, 1, 1); //2
                motor(1, 0, 1, 1); //3
                motor(1, 0, 0, 1); //4
                motor(1, 1, 0, 1); //5
                motor(1, 1, 0, 0); //6
                motor(1, 1, 1, 0); //7
                motor(0, 1, 1, 0); //8
                }

                void counterclockwise ()
                {
                motor(0, 1, 1, 0); //8
                motor(1, 1, 1, 0); //7
                motor(1, 1, 0, 0); //6
                motor(1, 1, 0, 1); //5
                motor(1, 0, 0, 1); //4
                motor(1, 0, 1, 1); //3
                motor(0, 0, 1, 1); //2
                motor(0, 1, 1, 1); //1
                }

                void motor (int x1, int x2, int x3, int x4)
                {
                digitalWrite(motorPin1, x1);
                digitalWrite(motorPin2, x2);
                digitalWrite(motorPin3, x3);
                digitalWrite(motorPin4, x4);
                delay(motorSpeed);
                }

                Code example 2 

                This code uses the stepper.h library.

                • Topic 8

                  Stepper motors from old 5.25 inch disk drives

                  There are a number of stepper motors available from a variety of sources. They can be salvaged from old disk drives, printers and photocopiers.

                  A stepper motor is one that accurately turns in incriments, and needs to be driven with a sequence of steps. Typically a step is equal to 1.8 degrees, but this may vary.


                  With a motor salaged from a Teac 8506 stepper motor, each drive is run by a coil is approx 150 ohms centre tapped.


                  Some of these motors have only 1 common (brown) wire.

                  • * Brown (Coil 2 common)
                  • * Brown (Coil 1 common)
                  • * Yellow (Coil 1 phase 1)
                  • * Red (Coil 2 phase 1) 
                  • * Blue (Coil 1 phase 2)
                  • * White (Coil 2 phase 2) 



                  informations provided via - http://www.audiovisualdevices.com.au/...

                  Other info: 1.8 degree step.
                  Control done via Arduino UNO, and ULN2003AN driver.

                  teac

                  be aware

                  The stepper requires 12 volts to run.

                  The stepper driver chip gets very hot. Probably not designed to run as analogue motor.

                  Wire with grey stripe is negative.


                  Created 11 Mar. 2007
                  Modified 30 Nov. 2009
                  by Tom Igoe

                  */

                  #include <Stepper.h>
                  #define ledPin 13

                  const int stepsPerRevolution = 200; // 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);

                  void setup() {
                  // set the speed at 60 rpm:
                  myStepper.setSpeed(60);
                  // initialize the serial port:
                  Serial.begin(9600);
                  }

                  void loop() {
                  // step one revolution in one direction:
                  Serial.println("clockwise");
                  myStepper.step(stepsPerRevolution);
                  delay(500);
                  blink(2);
                  // step one revolution in the other direction:
                  Serial.println("counterclockwise");
                  myStepper.step(-stepsPerRevolution);
                  delay(500); 
                  blink(4);
                  }
                  // Blink the reset LED:
                  void blink(int howManyTimes) {
                  int i;
                  for (i=0; i< howManyTimes; i++) {
                  digitalWrite(ledPin, HIGH);
                  delay(200);
                  digitalWrite(ledPin, LOW);
                  delay(200);
                  }
                  }

                  • Topic 9

                    • Topic 10

                      Motor controller Shield

                      anual

                      TA0066 servo and motor controller manual 

                      • Topic 11

                        • Topic 12

                          • Topic 13

                            • Topic 14

                              • Topic 15

                                • Topic 16

                                  • Topic 17

                                    • Topic 18

                                      • Topic 19