Go Down

Topic: Stepper Motor Burning Up: Extreemly hot to touch (Read 1 time) previous topic - next topic

JamesHayek

Jun 22, 2013, 07:41 am Last Edit: Jun 22, 2013, 07:15 pm by JamesHayek Reason: 1
Hello, I purchaced a 200 step per Rev, 12V Stepper Motor which is burning up with my current wireing.

I have an Arduino Mega sitting below the official Arduino WiFi Sheild. On top this set up is a Arduino Motor Shield. I scrapped the "Vin Connect" jumper on the back of the Motor Shield.

I have a 9V battery powering the Arduino and the WiFi Shield. I also have 12V desk supply powering the Motor Shield Vin and Gnd Terminals. Coming off the Motor Shields (mounted ontop the Arduino and WiFi Shield) pin 6 is a signal wire runming to a 120 Digital RGB LED strip. I also connected 5V and Gnd from the strip to the available pins on the Motor Shield. The other end of the LED Strip is powered with a 5V wall pack.

By scrapping the jumper on the back of the sheild I was under the impression that the 12V should only pass to the motor. However I am unsure why the motor is over heating.

Here is a picture of the setup:



Any suggestions?


JamesHayek

Coding used:

Code: [Select]
/*
  WiFi Web Server LED Strip and Stepper Motor

A simple web server that lets you enable sequences from a LED Strip
and control a stepper Motor for blindss via the web.
This sketch will print the IP address of your WiFi Shield (once connected)
to the Serial monitor. From there, you can open that address in a web browser
to turn on and off the components.

If the IP address of your shield is yourAddress:
http://yourAddress/H turns the LED to scanner
http://yourAddress/L turns it to swipe

This example is written for a network using no encryption. For
WEP or WPA, change the Wifi.begin() call accordingly.

Circuit:
* WiFi shield attached
* LED attached to pin 6 and Gnd and 5V
* Motor Shield is attached
*Stepper Motor conected to terminal blocks

created 21 June 2013
by James Hayek
*/


#include <SPI.h>
#include <WiFi.h>
#include <Adafruit_NeoPixel.h>

// Parameter 1 = number of pixels in strip
// Parameter 2 = pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
//   NEO_RGB     Pixels are wired for RGB bitstream
//   NEO_GRB     Pixels are wired for GRB bitstream
//   NEO_KHZ400  400 KHz bitstream (e.g. FLORA pixels)
//   NEO_KHZ800  800 KHz bitstream (e.g. High Density LED strip)

Adafruit_NeoPixel strip = Adafruit_NeoPixel(120, 6, NEO_GRB + NEO_KHZ800);

char ssid[] = "EnGeniusE27B20";      //  your network SSID (name)
//char pass[] = "secretPassword";   // your network password
//int keyIndex = 0;                 // your network key Index number (needed only for WEP)

int status = WL_IDLE_STATUS;
WiFiServer server(80);

int delaylegnth = 500;


void setup() {

  strip.begin();
  strip.show(); // Initialize all pixels to 'off'
  pinMode(6, OUTPUT);      // set the LED pin mode

  Serial.begin(9600);      // initialize serial communication

  // check for the presence of the shield:
  if (WiFi.status() == WL_NO_SHIELD) {
    Serial.println("WiFi shield not present");
    while(true);        // don't continue
  }

  // attempt to connect to Wifi network:
  while ( status != WL_CONNECTED) {
    Serial.print("Attempting to connect to Network named: ");
    Serial.println(ssid);                   // print the network name (SSID);

    // Connect to WPA/WPA2 network. Change this line if using open or WEP network:   
    status = WiFi.begin(ssid);
    // wait 5 seconds for connection:
    delay(5000);
  }
  server.begin();                           // start the web server on port 80
  printWifiStatus();                        // you're connected now, so print out the status


    //Stepper Motor Code

  //establish motor direction toggle pins
  pinMode(12, OUTPUT); //CH A -- HIGH = forwards and LOW = backwards???
  pinMode(13, OUTPUT); //CH B -- HIGH = forwards and LOW = backwards??? 

  //establish motor brake pins
  pinMode(9, OUTPUT); //brake (disable) CH A
  pinMode(8, OUTPUT); //brake (disable) CH B


}


void loop() {
  WiFiClient client = server.available();   // listen for incoming clients

  if (client) {                             // if you get a client,
    Serial.println("new client");           // print a message out the serial port
    String currentLine = "";                // make a String to hold incoming data from the client
    while (client.connected()) {            // loop while the client's connected
      if (client.available()) {             // if there's bytes to read from the client,
        char c = client.read();             // read a byte, then
        Serial.write(c);                    // print it out the serial monitor
        if (c == '\n') {                    // if the byte is a newline character

          // if the current line is blank, you got two newline characters in a row.
          // that's the end of the client HTTP request, so send a response:
          if (currentLine.length() == 0) { 
            // HTTP headers always start with a response code (e.g. HTTP/1.1 200 OK)
            // and a content-type so the client knows what's coming, then a blank line:   
            client.println("HTTP/1.1 200 OK");
            client.println("Content-type:text/html");
            client.println();

            // the content of the HTTP response follows the header:
            client.print("Click <a href=\"/H\">here</a> to run Scanner<br>");
            client.print("Click <a href=\"/L\">here</a> to run Swipe<br>");
            client.print("Click <a href=\"/B\">here</a> to run Blinds<br>");


            // The HTTP response ends with another blank line:
            client.println();
            // break out of the while loop:
            break;         
          }
          else {      // if you got a newline, then clear currentLine:
            currentLine = "";
          }
        }     
        else if (c != '\r') {    // if you got anything else but a carriage return character,
          currentLine += c;      // add it to the end of the currentLine
        }

        // Check to see if the client request was "GET /H" or "GET /L":

        if (currentLine.endsWith("GET /H") == 1 ) {

          scanner(127,0,127, 10); // Violet

        }

        if (currentLine.endsWith("GET /L") == 1) {
          colorFollow(strip.Color(127,0,127), 10); //Violet
          strip.show();
        }

        if (currentLine.endsWith("GET /B")==1){

          blindsForward();       
        }

        else {

            strip.begin();
            strip.show(); // Initialize all pixels to 'off'
        }
      }
    }
    // close the connection:
    client.stop();
    Serial.println("client disonnected");
  }
}


void printWifiStatus() {
  // print the SSID of the network you're attached to:
  Serial.print("SSID: ");
  Serial.println(WiFi.SSID());

  // print your WiFi shield's IP address:
  IPAddress ip = WiFi.localIP();
  Serial.print("IP Address: ");
  Serial.println(ip);

  // print the received signal strength:
  long rssi = WiFi.RSSI();
  Serial.print("signal strength (RSSI):");
  Serial.print(rssi);
  Serial.println(" dBm");
  // print where to go in a browser:
  Serial.print("To see this page in action, open a browser to http://");
  Serial.println(ip);
}


void colorFollow(uint32_t c, uint8_t wait) {
  for(uint16_t k=0; k<strip.numPixels()*2; k++)
  {
    strip.setPixelColor(k, c);
    strip.show();
    delay(wait);   
  }
}


// "Larson scanner" = Cylon/KITT bouncing light effect
void scanner(uint8_t r, uint8_t g, uint8_t b, uint8_t wait) {
  int i, j, pos, dir;

  pos = 0;
  dir = 1;

  for(i=0; i<((strip.numPixels()-1) * 4); i++) {
    // Draw 5 pixels centered on pos.  setPixelColor() will clip
    // any pixels off the ends of the strip, no worries there.
    // we'll make the colors dimmer at the edges for a nice pulse
    // look
    strip.setPixelColor(pos - 2, strip.Color(r/4, g/4, b/4));
    strip.setPixelColor(pos - 1, strip.Color(r/2, g/2, b/2));
    strip.setPixelColor(pos, strip.Color(r, g, b));
    strip.setPixelColor(pos + 1, strip.Color(r/2, g/2, b/2));
    strip.setPixelColor(pos + 2, strip.Color(r/4, g/4, b/4));

    strip.show();
    delay(wait);
    // If we wanted to be sneaky we could erase just the tail end
    // pixel, but it's much easier just to erase the whole thing
    // and draw a new one next time.
    for(j=-2; j<= 2; j++)
      strip.setPixelColor(pos+j, strip.Color(0,0,0));
    // Bounce off ends of strip
    pos += dir;
    if(pos < 0) {
      pos = 1;
      dir = -dir;
    }
    else if(pos >= strip.numPixels()) {
      pos = strip.numPixels() - 2;
      dir = -dir;
    }
  }
}


void blindsForward(){

  digitalWrite(9, LOW);  //ENABLE CH A
  digitalWrite(8, HIGH); //DISABLE CH B

  digitalWrite(12, HIGH);   //Sets direction of CH A
  analogWrite(3, 255);   //Moves CH A

  delay(delaylegnth);

  digitalWrite(9, HIGH);  //DISABLE CH A
  digitalWrite(8, LOW); //ENABLE CH B

  digitalWrite(13, LOW);   //Sets direction of CH B
  analogWrite(11, 255);   //Moves CH B

  delay(delaylegnth);

  digitalWrite(9, LOW);  //ENABLE CH A
  digitalWrite(8, HIGH); //DISABLE CH B

  digitalWrite(12, LOW);   //Sets direction of CH A
  analogWrite(3, 255);   //Moves CH A

  delay(delaylegnth);

  digitalWrite(9, HIGH);  //DISABLE CH A
  digitalWrite(8, LOW); //ENABLE CH B

  digitalWrite(13, HIGH);   //Sets direction of CH B
  analogWrite(11, 255);   //Moves CH B

  delay(delaylegnth);


}

MarkT

You haven't told us which motor you are using.  Please always include full details
of any hardware - a link to a datasheet is quality information.

If the motor is genuinely 12V then you don't have a problem.  Stepper motors are
usually rated for something like a 50 or 60 degree temperature rise and are intended
to be bolted to a metal frame that helps dissipate heat.

You don't need to run a motor at its design current if you are happy with lower torque.

If a motor is rated for wave-mode and you use it in full-step or half-step modes it
will get hotter than its rated for too (two windings active at once).
[ I won't respond to messages, use the forum please ]

JamesHayek

#3
Jun 23, 2013, 02:19 am Last Edit: Jun 23, 2013, 02:22 am by JamesHayek Reason: 1
Thanks, This is the motor:

http://www.adafruit.com/products/324

And data sheet


The 2 meter LED strip is:
http://www.adafruit.com/products/1138

So you are saying it is normal for a stepper motor to get hot?

Quote
If a motor is rated for wave-mode and you use it in full-step or half-step modes it will get hotter than its rated for too (two windings active at once).  


So they are different ways to program a stepper motor depending on its type?

Thanks for the help




MarkT

Stepper motors run at full current when stationary (unless you program reduced current when stationary),
so yes they tend to run a lot hotter than other motors (which only warm up when running under load).

There are several ways to sequence the windings, some only activate one winding at once, some activate
both (the latter generates twice as much heat), and microstepping mode which approximates sine-wave
drive (equivalent in dissipation approximately to one winding at once)

The nominal current rating will be assuming one of these modes, typically a single winding at once.
[ I won't respond to messages, use the forum please ]

JamesHayek

I'm learning allot about steppers here, thanks for clearing some of the clouds. I will look into the different ways to sequencing the windings to reduce the amount of heat generated. 

Activating one coil at a time seems it would be less torque, but also less heat.

If this is how a stepper motor is supposed to run, why would people use them for blind automation? It seems like a DC motor will save energy in the long run. The only setback I see from a DC Motor is possibly needing an encoder.

MarkT

Looking at the datasheet it says operating temp range 0..50C, allowable temp rise 70C - that means it could
run as hot as 120C if ambient conditions were 50C, or 90C if ambient=20C.  (bottom two rows).
[ I won't respond to messages, use the forum please ]

kf2qd


I'm learning allot about steppers here, thanks for clearing some of the clouds. I will look into the different ways to sequencing the windings to reduce the amount of heat generated. 

Activating one coil at a time seems it would be less torque, but also less heat.

If this is how a stepper motor is supposed to run, why would people use them for blind automation? It seems like a DC motor will save energy in the long run. The only setback I see from a DC Motor is possibly needing an encoder.


The reason you use a stepper motor is to simplify the controls. As long as the motor is sized correctly it works just fine open loop. If you go to a DC motor you will need gearboxes and you will have to run closed loop where your program has to constantly maintain position. Or you could spend more money and go a Brushless Servo (NOT A HOBBY SERVO, and industrial unit) and run it in stepper mode. Steppers are cheap and effective and they keep the system simple. If you need more performance then you have to spend more money.

JamesHayek

Quote
Steppers are cheap and effective and they keep the system simple. If you need more performance then you have to spend more money.


I was thinking about an industrial servo, but I thought that runs full load at rest also.

After scouring the internet, forums and help from you guys, I learned steppers pull full current when stationary. I don't like the idea of a current running all the time if I don't need any holding torque from the motor.

I just finished programming a function to cut the current to the motor. I did this by sending a 0 to the PWM pins. The motor now barely generates heat.

I do not know if this could of been done in a shorter way, but here is the function:

Code: [Select]
void stepperRelease(){

 digitalWrite(9, LOW);  //ENABLE CH A
 digitalWrite(8, HIGH);  //DISABLE CH B

 digitalWrite(12, LOW);   //Sets direction of CH A
 analogWrite(3, 0);   //Moves CH A

 delay(delaylegnth);

 digitalWrite(9, HIGH); //DISABLE CH A
 digitalWrite(8, LOW); //ENABLE CH B

 digitalWrite(13, HIGH);   //Sets direction of CH B
 analogWrite(11, 0);   //Moves CH B

 delay(delaylegnth);

 digitalWrite(9, LOW);  //ENABLE CH A
 digitalWrite(8, HIGH); //DISABLE CH B

 digitalWrite(12, HIGH);   //Sets direction of CH A
 analogWrite(3, 0);   //Moves CH A

 delay(delaylegnth);

 digitalWrite(9, HIGH);  //DISABLE CH A                  
 digitalWrite(8, LOW);  //ENABLE CH B                    

 digitalWrite(13, LOW);  //Sets direction of CH B
 analogWrite(11, 0);   //Moves CH B

 delay(delaylegnth);


}




Go Up