Lesson 16 Stepper Motor does not reverse?

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
electronaut
 
Posts: 21
Joined: Wed Aug 20, 2014 6:25 pm

Re: Lesson 16 Stepper Motor does not reverse?

Post by electronaut »

FYI, remarks at the beginning of this post to the Arduino forum suggests that there may some issues using the Adafruit (28BYJ-48) stepper motor with the Arduino stepper motor library (requiring some pin swaps): http://forum.arduino.cc/index.php?topic=85335.0

User avatar
adafruit_support_bill
 
Posts: 88141
Joined: Sat Feb 07, 2009 10:11 am

Re: Lesson 16 Stepper Motor does not reverse?

Post by adafruit_support_bill »

A bit of misinformation there. The red wire is not VCC is indicated in the posted code. It is the common wire for unipolar wiring. It is not needed for bipolar operation.

Also, the motor does not require an 8 step sequence and there is nothing magical about that. The '8 step' sequence they refer to is the same thing as the "INTERLEAVE:" stepping mode in the Adafruit libraries. It adds a 'half-step' by de-energizing one of the coils before advancing to the next full-step. The motor works perfectly fine with normal 4-step sequence.

User avatar
electronaut
 
Posts: 21
Joined: Wed Aug 20, 2014 6:25 pm

Re: Lesson 16 Stepper Motor does not reverse?

Post by electronaut »

Thanks for the clarification.

On the original question ("motor does not reverse"), this exercise in manual stepping led to a work-around: change the line 'motor.setSpeed(20)' to 'motor.setSpeed(5)'. This makes it possible to use the Arduino stepper motor library to rotate the motor CW and CCW. Unfortunately, the motor moves very slowly with this fix. As I suspected the problem is related to timing (and rotor inertia), and the Arduino post seems to suggest that half-stepping leads to more reliable performance. I'm not sure if the Arduino library supports half-stepping.

User avatar
adafruit_support_bill
 
Posts: 88141
Joined: Sat Feb 07, 2009 10:11 am

Re: Lesson 16 Stepper Motor does not reverse?

Post by adafruit_support_bill »

Those gear-motors do seem to suffer more than most from resonant frequency problems. If you are driving at or near one of the resonant frequencies it can lead to missed steps. They do work well with interleave mode in the Adafruit library. I don't believe that the Arduino library supports that.

User avatar
electronaut
 
Posts: 21
Joined: Wed Aug 20, 2014 6:25 pm

Re: Lesson 16 Stepper Motor does not reverse?

Post by electronaut »

After a second look at this lesson on stepper motors (Lesson 16) there appears to be an error, or at least an inconsistency, in the Adafruit docs. It is noted here https://learn.adafruit.com/all-about-st ... f-steppers that a 5-wire motor can only be driven as a unipolar motor, and this makes sense because the center taps are connected to each other inside the motor. If one just ignores the center tap lead (red) and uses the others to drive this motor in a bioplar configuration, then there can be problems because current can leak from one coil to the other through the center tap connection. But this is what is done in Lesson 16. Please let me know if I am misunderstanding something there. Thanks.

User avatar
adafruit_support_bill
 
Posts: 88141
Joined: Sat Feb 07, 2009 10:11 am

Re: Lesson 16 Stepper Motor does not reverse?

Post by adafruit_support_bill »

Hmmm. That could cause some problems in some stepping modes. If you ground the red wire, does it behave better?

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Arduino products from Adafruit”