DC and Stepper Motor HAT for Raspberry Pi - Not Driving Moto

Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Locked
User avatar
jordanschalm
 
Posts: 4
Joined: Fri May 29, 2015 6:54 pm

DC and Stepper Motor HAT for Raspberry Pi - Not Driving Moto

Post by jordanschalm »

Hi, I am trying to drive two 12V stepper motors using the Adafruit Motor HAT. I have the Raspberry Pi 2 Model B. When the HAT is attached, the StepperTest python code runs properly, 12V DC is attached to the power terminals and the power indicator light of the HAT is on, but neither motors move when connected to MOTOR 1 & MOTOR 2 as specified in the documentation (i.e. I have connected the five pins of a single motor to the MOTOR 1, MOTOR 2 & GRND terminals). I haven't changed the I2C address on the HAT and I assume I2C is correctly set up because I can see spidev in the /dev/ directory and I get an I2C address error if I run with code without the HAT attached.
I have manually tested both the motors with the same 12V power supply by connecting one pin of one coil to ground and moving the other pin from the same coil from 12V DC to -12V DC which steps both motors as expected. I have also used a voltmeter to check the voltages at each of the MOTOR terminals while the StepperTest code is running. Voltages ranged from 0V to around 2V and did not change at all despite the fact that the code was running. I have updated Raspbian to the latest version and ensured I have the latest version of the python-dev package.
What further troubleshooting steps can I take to determine the problem or should I be inquiring for a replacement?
Thanks

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

Re: DC and Stepper Motor HAT for Raspberry Pi - Not Driving

Post by adafruit_support_bill »

Please post the electrical specs of the motors you are trying to drive.
Also post the specs of the 12v power supply you are using.

User avatar
jordanschalm
 
Posts: 4
Joined: Fri May 29, 2015 6:54 pm

Re: DC and Stepper Motor HAT for Raspberry Pi - Not Driving

Post by jordanschalm »

One of the motors is from your store (https://www.adafruit.com/products/918)
• Unipolar stepper with 0.1" spaced 5-pin cable connector
• 32 steps per revolution
• 1/16.025 geared down reduction
• 5V-12V DC suggested operation
• Weight: 37 g.
• Dimensions: 28mm diameter, 20mm tall not including 9mm shaft with 5mm diameter
• 9" / 23 cm long cable
• Holding Torque @ 12VDC: 250 gram-force*cm, 25 N*mm/ 3.5 oz-force*in
• Shaft: 5mm diameter flattened

The other motor was pulled out of a printer so unfortunately I don't have any details about it.

The power supply is a GrayMark 808. At the terminal I am using it supports up to about 13.5V DC with a maximum current of 300mA. It also has a second terminal that supports 5V at up to 1A, which I haven't attempted to use since the motor is rated for 12V.

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

Re: DC and Stepper Motor HAT for Raspberry Pi - Not Driving

Post by adafruit_support_bill »

The other motor was pulled out of a printer so unfortunately I don't have any details about it.
Unfortunately, those details are important for making sure that you don't burn out the driver or the motor.
https://learn.adafruit.com/all-about-st ... he-stepper
.

Code: Select all

The power supply is a GrayMark 808. At the terminal I am using it supports up to about 13.5V DC with a maximum current of 300mA. It also has a second terminal that supports 5V at up to 1A, which I haven't attempted to use since the motor is rated for 12V.
But we don't even know the rating of the second motor.

Disconnect the unknown motor and test with just the #918 motor.

Once you have that working, we can try to figure out what kind of other motor you have.

User avatar
jordanschalm
 
Posts: 4
Joined: Fri May 29, 2015 6:54 pm

Re: DC and Stepper Motor HAT for Raspberry Pi - Not Driving

Post by jordanschalm »

So far I have only been testing the motors separately. I should mention that I do know the resistance across each of the coils in the unknown motor (about 180 ohms each). It has 4 pins.

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

Re: DC and Stepper Motor HAT for Raspberry Pi - Not Driving

Post by adafruit_support_bill »

Please post photos showing all your soldering and connections to the board.

User avatar
jordanschalm
 
Posts: 4
Joined: Fri May 29, 2015 6:54 pm

Re: DC and Stepper Motor HAT for Raspberry Pi - Not Driving

Post by jordanschalm »

My issue is resolved and it looks like everything is working properly now.

FYI there are a couple inconsistencies in your code/documentation:
On this page (https://learn.adafruit.com/adafruit-dc- ... per-motors) it says to connect the stepper to motor ports 1 and 2 before running StepperTest.py but in the example code (https://github.com/adafruit/Adafruit-Mo ... perTest.py) at line 20 it is initialized as:

Code: Select all

myStepper = mh.getStepper(200, 2)
which initializes the stepper on motor ports 3 and 4 instead of 1 and 2. Additionally the comment on this line incorrectly states that the motor is initialized on motor port #1

I changed this line and issued a pull request on github.

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

Re: DC and Stepper Motor HAT for Raspberry Pi - Not Driving

Post by adafruit_support_bill »

OK. Thanks for calling our attention to the inconsistency.

User avatar
adafruit2
 
Posts: 22148
Joined: Fri Mar 11, 2005 7:36 pm

Re: DC and Stepper Motor HAT for Raspberry Pi - Not Driving

Post by adafruit2 »

fixed!

Locked
Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/

Return to “Adafruit Raspberry Pi® accessories”