Pages: [1]   Go Down
Author Topic: How to limit curent on stepper motor to prevent overheating?  (Read 2199 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 33
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello ,  I'm starting a new DIY project and I'm dealing with stepper motors for the first time, I want to build a camera slider that will be capable of moving also a DSLR camera.

I have a L298N motor driver which a few days ago, when I first powered it up,  was overheating alot in a very short time (in 1 minute the DHT22 sensor mounted near the driver readed ~43 degrees C and rising, I than disconnected the battery) and a stepper motor STP-42D138 @ 1.8 deg/step 5.2Ohm (I dont find any technical specs about this motor online unfortunately).

Yesterday after a user of this forum advised me to use a fan on the driver, I solved the first problem, now with a 33mm fan over L298N  the temperature never raised over 34 deg C.

Now I have another problem with my motor, it gets very hot, in about 10 - 15 minutes it reached 74 deg C (the DHT22 sensor was under the motor) after this point I disconnected the battery as the temperature was constantly rising.

I started this thread so I and other newbies can learn, with your guys help, how to lower the temperature of the stepper motors .

MarkT suggested to lower the curent (automatically the torque will be lower) when the motor is maintaining it's position, I found a library called StepperLab3 which it seems it supports curent limiting by setPower(), is there anything similar in the Stepper.h library ? or I should use that library instead ?

So far I only used  #include <Stepper.h> library .

In my project I could use curent limiting only in some cases, when the slider will be perfectly horizontal, but when the slider will be positioned on an angle I will need the torque to keep the camera in the same position. I will use a switch so I will activate or deactivate the "ECO" mode when I need it.

So what do you guys suggest ?

Is 75 degrees C temperature to high for a stepper motor?

Thank you.
Logged

Offline Offline
Sr. Member
****
Karma: 4
Posts: 327
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

so you have  a few points to address. and top of my head I cant answer a much,

a) temperature. if the motor does overheat, what are you going to do,
        as you have seen, you can measure the temperature quite easily,
           ( remember the motor has a high thermal mass,
                     so sencor is going to lag the real temperature )

        i.e.  if you disconnect the current, is it ok for the motor to move,  do you need a break ?

b) next up is why is motor  heating up,
     the ohms you mention is I guess the static motor resistance, as measured by a multi meter,
          this is not the same as the active resistance
 
   are you supplying full voltage to the coils all the time ?


Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 33
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

a) I didn't think to have the temp sensor mounted permanently in my project, I just added them when I noticed the driver get's hot, so my ideea wasn't to measure the temp and if it's high to disable the motor (the driver has two jumpers ENa & ENb, I belive if I remove the jumpers and add the pin to an OUTPUT pin of arduino I could disable/enable the motor using HIGH / LOW signal) , I want to find out why it's overheating (75 C is high, right ?) and have the problem fixed before I start to assemble everything.
The whole slider should work for an hour or more when I'm making time lapse photography, when it will be used in video mode it will run for short periods.

b) this is what I'm trying to find out also. If the motor is stepping correctly, one step at a time with a 1 sec delay, or when the delay is 0 it continuously rotating in oane direction, I believe the connection of the motor is made correctly, right ?
Could be a connection issue even if the motor is stepping correctly and no weird noise is heard ?

The motor specs I wrote in my first post are from it's label, did not measured it's resistance personally, I uploaded a photo of the motor.

Here is a video I made when I first noticed the driver is heating up , the messy wires are because I couldn't find the breadboard in that night when I started to play with the motor.



Quote
   are you supplying full voltage to the coils all the time ?

I believe yes (don't realy know how to check), I have searched and I found a library called StepperLab3 which it seems it supports curent limiting by setPower(), is there anything similar in the Stepper.h library ? Can I limit current somehow using the Stepper.h library or I should use a different library instead ?

Bellow are the section of codes I have used for the two situations I will use my slider.

1. Time lapse photography, where a delay of 1 - 20 seconds will be used (currently I used a pot for quick test and the delay was 0 - 1023) In this case I could use current limiting while the motor is stopped, and while the slider is horizontaly, but when it's at an angle I will need the torque to hold the camera in place.

Code:
const int stepsPerRevolution = 200;
Stepper myStepper(stepsPerRevolution, 1,2,3,4);         
int stepCount = 0;

..........................................

   potval = analogRead(potPin);
  // step one step:
  myStepper.step(1);
  stepCount++;
  delay(potval);

   lcd.setCursor(0,2);
   lcd.print("Deelay:      St:  ");
   lcd.setCursor(8,2);
   lcd.print(potval);
   lcd.setCursor(16,2);
   lcd.print(stepCount);   

2. Continuous drive video mode where I will set the speed using another POT

Code:
  int sensorReading = analogRead(potPin);
  int motorSpeed = map(sensorReading, 0, 1023, 0, 100);
  if (motorSpeed > 0) {
    myStepper.setSpeed(motorSpeed);
    myStepper.step(stepsPerRevolution/100);
  }


* stepper_motor_STP-42D138.jpg (200.74 KB, 600x800 - viewed 40 times.)
Logged

Offline Offline
Edison Member
*
Karma: 8
Posts: 1341
If you're not living on the Edge, you're taking up too much space!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have written code to make steppers run cooler, at the expense of less torque.  This way you can use 12v to run a 5v motor, and decide when you need more power, and when to use less.  When it's stopped you can turn off the coils, since there are gears to keep it in position.  It's very easy to get started.  There are many more features related to photography included.  That's what I use it for.

http://forum.arduino.cc/index.php?topic=85335.0

30,000 people can't be wrong for reading it!
Logged

If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

Offline Offline
Sr. Member
****
Karma: 4
Posts: 327
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

if your uncertain how motor is wired , this could help



and yes, a motor at 75 degrees C is not going to last to long me thinks.

Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6637
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

It is best to drive stepper motors using a proper chopper-type stepper driver. These drivers are capable of applying the full supply voltage to the stepper when you want to move it, but use PWM to limit the current when the stepper is stationary. I suggest you ditch the L298N board and get one of these http://www.pololu.com/catalog/product/1182 or one of the many cheap clones available on eBay. You can adjust the drive current to suit your motor by changing the current sense resistor. My guess is that you'll need to set the current to around 1A.
« Last Edit: July 19, 2013, 01:06:44 pm by dc42 » Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Offline Offline
Newbie
*
Karma: 0
Posts: 33
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have written code to make steppers run cooler, at the expense of less torque...

Thank you for the link, I tried the code now but I think the 4 pins are not in the same order as on my motor driver, because the motor is not continuously rotating but twitching left and right half a step or so .. I will try later to find the exact order.

if your uncertain how motor is wired , this could help

and yes, a motor at 75 degrees C is not going to last to long me thinks.

My motor has 4 wires not 6, I tried to measure the resistance and the pairs are as I thought, first two wires are a pair and the next two are the other pair, measuring the resistance in any other combination didn't showed any results. I believe I wired it correctly.

It is best to drive stepper motors using a proper chopper-type stepper driver. These drivers are capable of applying the full supply voltage to the stepper when you want to move it, but use PWM to limit the current when the stepper is stationary. I suggest you ditch the L298N board and one of these http://www.pololu.com/catalog/product/1182 or one of the many cheap clones available on eBay. You can adjust the drive current to suit your motor by changing the current sense resistor. My guess is that you'll need to set the current to around 1A.
I have to do more research to understand how the A4988 stepper motor driver carrier is used as I don't realy understand now where to connect the pololu device, I don't know if that little device is actually a motor driver, or it works in combination with (any) stepper motor driver. Thank you for your advice, I have to also check the pololu prices for international shipping as I remember the fee was high, the device itself isn't expensive at all.
Logged

Dubuque, Iowa, USA
Offline Offline
Faraday Member
**
Karma: 49
Posts: 2544
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have to do more research to understand how the A4988 stepper motor driver carrier is used as I don't realy understand now where to connect the pololu device, I don't know if that little device is actually a motor driver, or it works in combination with (any) stepper motor driver. Thank you for your advice, I have to also check the pololu prices for international shipping as I remember the fee was high, the device itself isn't expensive at all.

The A4988 driver is for bipolar (not unipolar) steppers. It contains H-bridges and would replace your L298N board; nothing else needed. It has a two pin (step/dir) interface: each pulse on the step pin makes it move one step and the direction is controlled by setting the dir pin high or low. You shouldn't have a problem finding a library that works with the step/dir interface (try the AccelStepper library).

The main chip on the driver is the Allegro A4988 and then it becomes a "carrier" because Pololu soldered it onto a board. And as dc42 said you can find lots of clones of the board so you should be able to get one with lower shipping.
Logged

Sydney, Australia
Offline Offline
Sr. Member
****
Karma: 6
Posts: 397
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have to do more research to understand how the A4988 stepper motor driver carrier is used as I don't realy understand now where to connect the pololu device, I don't know if that little device is actually a motor driver, or it works in combination with (any) stepper motor driver. Thank you for your advice, I have to also check the pololu prices for international shipping as I remember the fee was high, the device itself isn't expensive at all.

The A4988 driver is for bipolar (not unipolar) steppers. It contains H-bridges and would replace your L298N board; nothing else needed. It has a two pin (step/dir) interface: each pulse on the step pin makes it move one step and the direction is controlled by setting the dir pin high or low. You shouldn't have a problem finding a library that works with the step/dir interface (try the AccelStepper library).

The main chip on the driver is the Allegro A4988 and then it becomes a "carrier" because Pololu soldered it onto a board. And as dc42 said you can find lots of clones of the board so you should be able to get one with lower shipping.

You could also look at the EasyDriver from Sparkfun - i have used it on a number of projects and it is great.

They also have a very well priced 12v stepper motor that works fantastically with the driver

Craig
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 33
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you guys for your advices, I will get now a A4988 driver (from ebay as on pololu the shipping fee is $15) and when I'll have to get other parts from sparkfun I'll try the easydriver also.

sbright33, I don't know why with your code the motor is not spinning correctly, with the other libraries I tried it did but with your sample code it just twitched, maybe the pin order is different on the little  5v motor ?

Using StepperLab3 library the AMP draw dropped to 1,3 - 1,6A but if I used a pot to change the setPower() value it did not changed anything in Amp draw reading, nor the torque (I tried to hold the shaft in place and could not , it continued to rotate, also could not spin it while it was stoped.)

I will have to try changing the setPower() value in the void setup section , maybe setPower can't be changed in void loop, just in void setup ?

Anyone worked with the StepperLab3 library ? Do I need a special driver to enable all it's features , like SetPower()

Now with the 1.5Amp draw and with the fan pointed towards the motor , the temperature on the motor didn't raised more than 43 degrees, i belive untill I'll get my hands on different hardware I'll be good.

 craigcurtin, are you talking about this stepper motor https://www.sparkfun.com/products/9238 ?


* fan_driver_stepper_motor.jpg (100.92 KB, 600x381 - viewed 47 times.)
Logged

Sydney, Australia
Offline Offline
Sr. Member
****
Karma: 6
Posts: 397
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


 craigcurtin, are you talking about this stepper motor https://www.sparkfun.com/products/9238 ?

Yep thats the one - very gutsy little motor for the price - also worth getting some mounting brackets for it rather than trying to fab your own up

Craig
Logged

0
Offline Offline
Tesla Member
***
Karma: 145
Posts: 9682
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't do stepper motors, but you may be able to switch between using full current (which may be what a stepper library uses) and a reduced PWM to the motor coil when just holding position.
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Pages: [1]   Go Up
Jump to: