Author Topic: Stepper motor vibrating for no apparent reason  (Read 4380 times)

0 Members and 1 Guest are viewing this topic.

Offline abdullahsebaTopic starter

  • Frequent Contributor
  • **
  • Posts: 335
  • Country: gb
Stepper motor vibrating for no apparent reason
« on: October 03, 2017, 04:59:54 pm »
Hi
I just connected a SN754410 to my Arduino and stepper motor.

I send the number of steps via serial.
Code: [Select]
#include <Stepper.h>

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(200);
  // initialize the serial port:
  Serial.begin(19200);
  Serial.setTimeout('1');
}

void loop() {
  while (Serial.available()) {
    int steps = Serial.parseInt();
    myStepper.step(steps);
    Serial.println(steps);
  }
}
After a bit (10sec to 1min) the motor starts to vibrate - I would say 1 step both ways continually, until I send another step.
Its definitely the Arduino because when I disconnect it  it stops.
Anyone know whats going on?
Is it my code?  |O |O |O |O |O
Thanks in advance.
This is my right hand this is my wrong hand
 

Offline khs

  • Regular Contributor
  • *
  • Posts: 130
  • Country: de
Re: Stepper motor vibrating for no apparent reason
« Reply #1 on: October 03, 2017, 05:58:27 pm »
Hi abdullahseba,

it looks there is no current limiter, so maybe the sn754410 switches off due to overheating.
 
The following users thanked this post: abdullahseba

Offline abdullahsebaTopic starter

  • Frequent Contributor
  • **
  • Posts: 335
  • Country: gb
Re: Stepper motor vibrating for no apparent reason
« Reply #2 on: October 03, 2017, 07:50:15 pm »
Hi abdullahseba,

it looks there is no current limiter, so maybe the sn754410 switches off due to overheating.

Thanks! It is getting really hot. what circuit do I need? Can you link something in?
or would a ground plain on a PCB be enough?
This is my right hand this is my wrong hand
 

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3781
  • Country: de
Re: Stepper motor vibrating for no apparent reason
« Reply #3 on: October 03, 2017, 09:09:45 pm »
Hi abdullahseba,

it looks there is no current limiter, so maybe the sn754410 switches off due to overheating.

Thanks! It is getting really hot. what circuit do I need? Can you link something in?
or would a ground plain on a PCB be enough?

Um, what voltage are you using? Keep in mind that steppers are usually driven from constant current drivers and if you don't limit the current, you can have large currents flowing (several amps ...) due to the low resistance of the motor windings.

That can damage both the motor and the driver you are using. These Arduino circuits using sn754410 or L239D are probably responsible for more burned out steppers than anything else.

Look into a proper stepper driver like the popular Allegro A4983 / A4988 (The "Stepstick" modules use these). However, it will also depend on the type of motor you are driving (the rated voltage/current).
« Last Edit: October 03, 2017, 09:11:34 pm by janoc »
 
The following users thanked this post: abdullahseba

Offline abdullahsebaTopic starter

  • Frequent Contributor
  • **
  • Posts: 335
  • Country: gb
Re: Stepper motor vibrating for no apparent reason
« Reply #4 on: October 03, 2017, 09:11:33 pm »
Hi abdullahseba,

it looks there is no current limiter, so maybe the sn754410 switches off due to overheating.

Thanks! It is getting really hot. what circuit do I need? Can you link something in?
or would a ground plain on a PCB be enough?

Um, what voltage are you using? Keep in mind that steppers are usually driven from constant current drivers and if you don't limit the current, you can have large currents flowing (several amps ...) due to the low resistance of the motor windings.

That can damage both the motor and the driver you are using. These Arduino circuits using sn754410 or L239D are probably responsible for more burned out steppers than anything else.

Look into a proper stepper driver like the popular Allegro A4983 / A4988 (The "Stepstick" modules use these). However, it will also depend on the type of motor you are driving.

Thanks I'll look in to it. I was using 5v 2A.
This is my right hand this is my wrong hand
 

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3781
  • Country: de
Re: Stepper motor vibrating for no apparent reason
« Reply #5 on: October 03, 2017, 09:13:55 pm »
Thanks I'll look in to it. I was using 5v 2A.

Uh, absolute maximum ratings for SN754410 (http://www.ti.com/lit/ds/symlink/sn754410.pdf ):

Peak output current +-2A
Continuous output current +-1A

And you are surprised it doesn't like it?  :palm:

It is possible to drive a stepper using one of these chips but then either you need to drive the motor from low enough voltage that the resistance of the motor windings doesn't let large current to flow (but then you lose speed/torque) or you must add a current sensing circuit and some means to limit the current  when a preset value is exceeded - e.g. a transistor or maybe high frequency PWM where you reduce the current by reducing the duty cycle. However, if you go to these lengths, it is probably easier and cheaper to just use a dedicated driver chip like that Allegro one which includes this functionality.
« Last Edit: October 03, 2017, 09:22:07 pm by janoc »
 
The following users thanked this post: wraper, abdullahseba

Offline abdullahsebaTopic starter

  • Frequent Contributor
  • **
  • Posts: 335
  • Country: gb
Re: Stepper motor vibrating for no apparent reason
« Reply #6 on: October 03, 2017, 09:16:04 pm »
Thanks I'll look in to it. I was using 5v 2A.

Uh, absolute maximum ratings for SN754410 (http://www.ti.com/lit/ds/symlink/sn754410.pdf ):

Peak output current +-2A
Continuous output current +-1A

And you are surprised it doesn't like it?  :palm:
I guess all I can say is nub me  :-DD :-DD :-DD :scared: :palm: :phew: I just saw that schismatic and was in a rush so thought nothing of it.
This is my right hand this is my wrong hand
 

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3781
  • Country: de
Re: Stepper motor vibrating for no apparent reason
« Reply #7 on: October 03, 2017, 09:27:52 pm »
I guess all I can say is nub me  :-DD :-DD :-DD :scared: :palm: :phew: I just saw that schismatic and was in a rush so thought nothing of it.

Happens.

However, beware of these circuits - you will find in many places that one doesn't need to limit current when driving steppers with L293D (or your SN754410 which is the same thing) because they have thermal protection and thus won't burn out.

Yes, that is true. However, that doesn't mean the motor won't burn out! A lot of small steppers have windings of around 8-10\$\Omega\$, rated for about 0.5A max current, when driven from 20-26V. 26V/10\$\Omega\$ = 2.6A, so you can imagine the meltdown if there is no current limiting (or only the thermal shutdown of driver).

E.g. this motor (common on eBay or salvaged from cheap printers and copy machines): http://www.mitsumi.co.jp/latest/Catalog/compo/motor/m42sp6k_e.html

That one would be overdriven even at 5V already.
 
The following users thanked this post: abdullahseba

Offline kosacid

  • Contributor
  • Posts: 20
  • Country: gb
Re: Stepper motor vibrating for no apparent reason
« Reply #8 on: October 08, 2017, 09:46:49 am »
i posted recently about driving stepping motors, got told i would burn the H bridge out and that, this form is about helping people, but all i see is your going to blow it up burn it out and stuff like that and no help lol, so how about you so called experts show us how to handle a stepping motor of say 10ohms, instead of saying your going to blow the shit out of it, i salvaged mine from a lexmark printer i dont see no heat sinks and that so hows it done ?, that's what wee noobs want to know  :-+
 

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3781
  • Country: de
Re: Stepper motor vibrating for no apparent reason
« Reply #9 on: October 08, 2017, 10:13:54 am »
i posted recently about driving stepping motors, got told i would burn the H bridge out and that, this form is about helping people, but all i see is your going to blow it up burn it out and stuff like that and no help lol, so how about you so called experts show us how to handle a stepping motor of say 10ohms, instead of saying your going to blow the shit out of it, i salvaged mine from a lexmark printer i dont see no heat sinks and that so hows it done ?, that's what wee noobs want to know  :-+

Hmm, if you want help it would help if you mastered the art of punctuation first so that people can actually understand what are you writing about. All I can guess from your rather incoherent rant that you want to drive a stepper motor properly.

It isn't hard - look at the datasheet of the motor and dimension your driver accordingly. The winding resistance alone is not enough - you don't know how much current can the winding handle from that.

A bit of googling finds you also this application note from ST:
http://users.ece.utexas.edu/~valvano/Datasheets/Stepper_ST.pdf

That explains well the various possibilities of driving the motors and also shows how to implement the constant current driving (current limiting) in order to not destroy your motor. Or use one of the (many) available driver chips that implements all this already.

The information is widely available out there, this isn't some sort of secret sauce. Just don't expect to be handed stuff on a silver plate.
« Last Edit: October 08, 2017, 10:21:38 am by janoc »
 

Offline kosacid

  • Contributor
  • Posts: 20
  • Country: gb
Re: Stepper motor vibrating for no apparent reason
« Reply #10 on: October 08, 2017, 10:22:19 am »
firstly, i joined what i believed to be a forum for assistance. a forum that i was under the impression was supposed to be an online community of like minded (not small minded) people.
secondly, before you go ahead correcting anyone's punctuation i would like to refer you to the website below that may give you some guidance on other peoples reasoning for not being as super perfect (NOT) as you clearly are.

https://www.dyslexiascotland.org.uk/

 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 14076
  • Country: de
Re: Stepper motor vibrating for no apparent reason
« Reply #11 on: October 08, 2017, 10:31:32 am »
In the old days, before dedicated drivers with current limit, simple series resistors were used with stepper motors. They produce quite some heat, but can be Ok for a not so demanding application. Using a series resistor can be still more effective than reducing the voltage with a linear regulator, as the current can still rise faster which thus allows a higher speed.

If the motor does not need to run fast or deliver a high moment there is no need to use the full rated current. Something like 70% of the rated current already reduces the power loss in the motor to about half, so keeps the motor significant cooler.
 

Offline abdullahsebaTopic starter

  • Frequent Contributor
  • **
  • Posts: 335
  • Country: gb
Re: Stepper motor vibrating for no apparent reason
« Reply #12 on: October 08, 2017, 04:15:40 pm »
 :-\
This is my right hand this is my wrong hand
 

Offline abdullahsebaTopic starter

  • Frequent Contributor
  • **
  • Posts: 335
  • Country: gb
Re: Stepper motor vibrating for no apparent reason
« Reply #13 on: October 11, 2017, 04:12:44 pm »
Hi again
I got this http://www.ebay.co.uk/itm/A4988-Heatsink-Reprap-Stepstick-Stepper-Motor-Driver-Ramps-3D-Printer-Pololu-/182644636445?epid=1789100579&hash=item2a8677fb1d:g:5WwAAOSwvflZVkGp a4988 driver 
and used this schematic:

and this code:
Code: [Select]
void setup()
{
  pinMode(6,OUTPUT); // Enable
  pinMode(5,OUTPUT); // Step
  pinMode(4,OUTPUT); // Dir
  digitalWrite(6,LOW); // Set Enable low
}

void loop()
{
 
  digitalWrite(4,HIGH); // Set Dir high
 
  for(x = 0; x < 200; x++) // Loop 200 times
  {
      digitalWrite(5,HIGH); // Output high
      delayMicroseconds(500); // Wait 1/2 a ms
      digitalWrite(5,LOW); // Output low
      delayMicroseconds(500); // Wait 1/2 a ms
    }
  delay(1000); // pause one second
 
  digitalWrite(4,LOW); // Set Dir low
 
  for(x = 0; x < 200; x++) // Loop 2000 times
  {
      digitalWrite(5,HIGH); // Output high
      delayMicroseconds(500); // Wait 1/2 a ms
      digitalWrite(5,LOW); // Output low
      delayMicroseconds(500); // Wait 1/2 a ms
    }
    delay(1000); // pause one second
}
But it doesn't seem to work properly and makes odd noises. With no load on it turns okish, but If I put a load on it stalls even with max current on the pot.
I'm tried using a 9V battery and a 12V 5A PSU with more or less the same result.
I was getting better results with the SN754410 even tho it melted my breadboard  ;D
I made a vid of what it does.

Thanks in advance.
This is my right hand this is my wrong hand
 

Offline PA0PBZ

  • Super Contributor
  • ***
  • Posts: 5121
  • Country: nl
Re: Stepper motor vibrating for no apparent reason
« Reply #14 on: October 11, 2017, 06:29:49 pm »
Are you trying to step it too fast? what happens if you change the 2 delay lines to

Code: [Select]
delayMicroseconds(5000); // Wait 5 ms
Keyboard error: Press F1 to continue.
 
The following users thanked this post: abdullahseba

Offline abdullahsebaTopic starter

  • Frequent Contributor
  • **
  • Posts: 335
  • Country: gb
Re: Stepper motor vibrating for no apparent reason
« Reply #15 on: October 12, 2017, 06:03:05 am »
Are you trying to step it too fast? what happens if you change the 2 delay lines to

Code: [Select]
delayMicroseconds(5000); // Wait 5 ms
Thanks That seems to be it! :)
This is my right hand this is my wrong hand
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf