Hello,
I am trying to follow this tutorial to drive a small stepper motor via Raspberry PI. (https://learn.adafruit.com/adafruits-ra ... per-motors)
So I got the following
Small Reduction Stepper Motor - 5VDC 32-Step 1/16 Gearing PRODUCT ID: 858
Adafruit Assembled Pi Cobbler Breakout + Cable for Raspberry Pi PRODUCT ID: 914
Dual H-Bridge Motor Driver for DC or Steppers - 600mA - L293D PRODUCT ID: 807
ULN2803: 8 Channel Darlington Driver (Solenoid/Unipolar Stepper) PRODUCT ID: 970
Full sized breadboard PRODUCT ID: 239
Raspberry PI Powered using Amazon Kindle PowerFast Adapter (1.8A 5V)
I have tried the setup using ULN2803 and the setup using L293D. However I do not see the motor respond.
I have no idea if the motor is faulty or the driver chips or the cobbler kit or the breadboard or if i am doing something wrong.
How can I try to figure this out
Stepper motor via Raspi
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_bill
- Posts: 88096
- Joined: Sat Feb 07, 2009 10:11 am
Re: Stepper motor via Raspi
Look closely. These motors are geared down so they move very slowly. If you attach a piece of tape to the shaft, it will be easier to see if it is turning.I do not see the motor respond.
Also, check to see if there is any noise or vibration coming from the motor. These motors are generally pretty quiet, but you should be able to feel some vibration as the coils are being energized.
- Franklin97355
- Posts: 23912
- Joined: Mon Apr 21, 2008 2:33 pm
Re: Stepper motor via Raspi
Could you post clear pictures of your board and the connections to it?
- greenman
- Posts: 16
- Joined: Wed Jul 23, 2014 6:33 pm
Re: Stepper motor via Raspi
I had attached a paper to the motor to notice any movement.
Sorry if the pictures are not clear. this is the best i could do.
Sorry if the pictures are not clear. this is the best i could do.
- Attachments
-
- D7K_1135.JPG (168.38 KiB) Viewed 778 times
-
- D7K_1134.JPG (171 KiB) Viewed 778 times
- adafruit_support_bill
- Posts: 88096
- Joined: Sat Feb 07, 2009 10:11 am
Re: Stepper motor via Raspi
Please answer the question.
Also: you mentiond both ULN2803 and L293D. Which one is shown in the photos?Also, check to see if there is any noise or vibration coming from the motor. These motors are generally pretty quiet, but you should be able to feel some vibration as the coils are being energized.
- greenman
- Posts: 16
- Joined: Wed Jul 23, 2014 6:33 pm
Re: Stepper motor via Raspi
this is the L293D
- adafruit_support_bill
- Posts: 88096
- Joined: Sat Feb 07, 2009 10:11 am
Re: Stepper motor via Raspi
Please answer the question.
And show us how you have the cobbler connected to the RasPi.Also, check to see if there is any noise or vibration coming from the motor. These motors are generally pretty quiet, but you should be able to feel some vibration as the coils are being energized.
- greenman
- Posts: 16
- Joined: Wed Jul 23, 2014 6:33 pm
Re: Stepper motor via Raspi
I held the motor in hand and sensed no vibrations or noise.
- Attachments
-
- PI is connected to the wifi dongle via a external powered USB hub. PI itself is powered by the Amazon Kindle fast charger (1.8A and 5V)
- D7K_1139.JPG (192.58 KiB) Viewed 769 times
-
- Cobbler to PI connection
- D7K_1138.JPG (185.09 KiB) Viewed 769 times
- adafruit_support_bill
- Posts: 88096
- Joined: Sat Feb 07, 2009 10:11 am
Re: Stepper motor via Raspi
Your ribbon cable is backwards. The white stripe should align with pin 1 nearest the SD card on the Pi.
- greenman
- Posts: 16
- Joined: Wed Jul 23, 2014 6:33 pm
Re: Stepper motor via Raspi
That was it. Thank you very much.
- greenman
- Posts: 16
- Joined: Wed Jul 23, 2014 6:33 pm
Re: Stepper motor via Raspi
Hi
The motor is Small Reduction Stepper Motor - 5VDC 32-Step 1/16 Gearing
which means 512 steps should make the wheel complete 1 turn (360 degrees) right?
In the stepper.py I am having to provide delay ms as 5 and forward steps as 128 to complete 360 degrees not 512.
Am I doing the math incorrectly.
The motor is Small Reduction Stepper Motor - 5VDC 32-Step 1/16 Gearing
which means 512 steps should make the wheel complete 1 turn (360 degrees) right?
In the stepper.py I am having to provide delay ms as 5 and forward steps as 128 to complete 360 degrees not 512.
Am I doing the math incorrectly.
- adafruit_support_bill
- Posts: 88096
- Joined: Sat Feb 07, 2009 10:11 am
Re: Stepper motor via Raspi
Can you post the code you are using? We have seen some variation in gearing in these from the manufacturer. I may have to tear another one apart to see what is inside.
http://forums.adafruit.com/viewtopic.ph ... 8&p=210326
http://forums.adafruit.com/viewtopic.ph ... 8&p=210326
-
- Posts: 1
- Joined: Mon May 13, 2013 9:25 pm
Re: Stepper motor via Raspi
I just bought 10 of these stepper motors from adafruit and they're all 128 steps, not 512 steps as advertised! should i return them or can you just send out 512 step replacements?
- Franklin97355
- Posts: 23912
- Joined: Mon Apr 21, 2008 2:33 pm
Re: Stepper motor via Raspi
Could you post the code you are using to test them? Thanks.
- adafruit_support_mike
- Posts: 67454
- Joined: Thu Feb 11, 2010 2:51 pm
Re: Stepper motor via Raspi
If you're using the tutorial code that defines a 'step' as a complete cycle of:
coil activations, you'll only get 128 of those from a 512-step motor.
Each coil activation above moves the rotor to a position called a 'detente', and the 512-step motors should have 512 detente positons per rotation.
The sequence of activations above is one of the smallest repeatable patterns for driving a stepper motor, and executing all four in a single routine makes the code easier because you can run the same pattern every time. Calling that pattern a 'step' sacrifices accuracy for convenience though.
Code: Select all
aL aR bL bR
------------------
{ HI, LO, LO, LO }
{ LO, LO, HI, LO }
{ LO, HI, LO, LO }
{ LO, LO, LO, HI }
Each coil activation above moves the rotor to a position called a 'detente', and the 512-step motors should have 512 detente positons per rotation.
The sequence of activations above is one of the smallest repeatable patterns for driving a stepper motor, and executing all four in a single routine makes the code easier because you can run the same pattern every time. Calling that pattern a 'step' sacrifices accuracy for convenience though.
Please be positive and constructive with your questions and comments.