Go Down

Topic: Why so much current? (Read 1 time) previous topic - next topic

sbright33

I have 28BYJ-48 with ULN2003 driver
Why 350ma draw when 8 steps in a row every 2 sec?
Constant current.
Would expect a spike every 2 sec.
The Uno is about 50ma, the motor only when moving.
The ULN2003 takes 300ma constantly?  LED's?
If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

Grumpy_Mike

A stepping motor draws current all the time. It takes most current when it is still and less current when it is moving.
This is because it is producing its maximum torque when it is stationary.

sbright33

Great answer!  I don't need any torque when it's resting, because of all the gears it stays in place on it's own.
How can I accomplish this with my hardware?
If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

Grumpy_Mike

Disable the drive current when you are not moving it with a high sided transistor or FET.
The exact details depend on if you have a unipolar or bi polar motor.
However be warned if you are micro stepping the motor you loose the position when you disable the power.

sbright33

Tried Googling not sure if it is unipolar or bipolar.  Can it be something else?
I do want to move only 2-8 steps at a time.
Can I use a series resistor to lower the current without loosing the position?
If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

Grumpy_Mike

Quote
not sure if it is unipolar or bipolar.  Can it be something else?

No one or the other. How have you wired it up? That is the way to tell.

Quote
Can I use a series resistor to lower the current without loosing the position?

You can but you also loose torque.

sbright33

Possibly like this.  I can't see inside the motor.  I know there are only 5 wires going to the motor.  So it must be Unipolar?
http://www.eleccircuit.com/uln2003-control-stepper-motor-by-parallel-port

I would use a FET to bypass the resistor when I want to move it.
Maybe only 50ma to keep it's position with no torque applied to it?

Can this motor reverse?
Do I need a different driver IC?
See my other post.
If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

Grumpy_Mike

Quote
I know there are only 5 wires going to the motor.  So it must be Unipolar?

Yes.

Quote
Can this motor reverse?

Yes

Quote
Do I need a different driver IC?

No.

Quote
See my other post.

Link?

You need to put a PNP transistor or p-channel FET as a high sided switch in between the motor's positive supply and the common coil connection to disable the motor.

sbright33

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

Skype Brighteyes3333
(262) 696-9619

sbright33

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

Skype Brighteyes3333
(262) 696-9619

kf2qd

OR - keep track internally what your output pattern is and turn off the 4 outputs from your Arduino when you aren't moving. Then when you are ready to move again, turn on the outputs and make your move. If the outputs from the Arduino are off, the outputs from the driver chip are off.

What routine are you using to control the move? Are you using a stepper library? or are you using your own code to control the outputs?

you could do something like this -
int dir = 0;
int steps;
void loop()
{
   dir = 0;   // or -1 for opposite direction
   for(counter = 0, counter< steps,counter++){
     step;
   }
// then do this to turn off the outputs when the move is complete
   digitalWrite(4,LOW);
   digitalWrite(5,LOW);
   digitalWrite(6,LOW);
   digitalWrite(7,LOW);
  }

void Step()
{
 if (dir)
 {
   ctr-- ;
 }
 else
 {
   ctr++ ;
 }
 ctr = ctr & 3;

 switch (ctr){
 case 0:
   digitalWrite(4,HIGH);
   digitalWrite(5,LOW);
   digitalWrite(6,LOW);
   digitalWrite(7,LOW);
   break;
 case 1:
   digitalWrite(4,LOW);
   digitalWrite(5,HIGH);
   digitalWrite(6,LOW);
   digitalWrite(7,LOW);
   break;
 case 2:
   digitalWrite(4,LOW);
   digitalWrite(5,LOW);
   digitalWrite(6,HIGH);
   digitalWrite(7,LOW);
   break;
 case 3:
   digitalWrite(4,LOW);
   digitalWrite(5,LOW);
   digitalWrite(6,LOW);
   digitalWrite(7,HIGH);
   break;
 }
}

Grumpy_Mike

Post code using the # icon, understandable mistake for some one asking a question but not someone answering one.  It is poor code anyway.

Even if you missed the point about micro stepping values not being retained after restoring the power, it is nothing to do with what you said.

you reverse the motor by changing the sequence you switch the coils.

kf2qd

Well Grumpy_Kike -

I posted it as a quick example, and perhaps you could show us some better code? It is hardly complete, but might give someone some idea to work with to develop their own ideas.

sbright33

@GrumpyMike - Yes, that's how you do it in theory.  How do I do it using the Stepper library?  I tried step(-1) it goes forward.
If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

Grumpy_Mike

Look at the motor knob example.
stepper.step(-1) will do it not step(-1)


Go Up