faulty motor hat?

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
z1s
 
Posts: 6
Joined: Thu Sep 24, 2015 10:37 am

faulty motor hat?

Post by z1s »

Howdy,

I'm having a bit of a connection issue with my raspberry pi motor hat and am trying to determine whether it might faulty. I've been following this tutorial: https://learn.adafruit.com/adafruit-16- ... on-library

At first I couldn't get any i2c addresses to show up so I poked around and read tried a lot of advice from forums about the device tree config files and nothing seemed to work.

I looked at the soldering and it looks fine. I tested the gpio pins with a breakout and could get an led to light on all pins except gpio 23. I then put the motor hat on top of the raspberry pi 2 and stacked the breakout on top of it. With a breakout stacked on top of the motor hat I found that if I hold the hat perfectly straight and apply a bit of pressure I could get an led to to light on all the gpio pins (even 23).

I find that if I hold the hat (with my hand) perfectly straight above the pins and apply a bit of pressure I can get addresses from sudo i2cdetect -y 1:

40: 40
70: 70

which is what I think is correct.

So now the question is why the connection requires such physical finessing. Is this normal or is this just a faulty hat connector or raspberry pi physical pin?

Thank you for any advice!

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

Re: faulty motor hat?

Post by adafruit_support_bill »

That is typical of one-or-more intermittent solder connections. Please post clear photos showing your soldering to the board.,

User avatar
z1s
 
Posts: 6
Joined: Thu Sep 24, 2015 10:37 am

Re: faulty motor hat?

Post by z1s »

Thank you for your advice. Definitely my first time doing this kind of soldering. Attached are some soldering photos:
Attachments
pi-soldering.jpg
pi-soldering.jpg (220.14 KiB) Viewed 354 times

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

Re: faulty motor hat?

Post by adafruit_support_bill »

Not bad. But the one on the end in the left photo looks a bit solder-starved. And a few of the others look a bit 'pear shaped'. That can be an indication that the solder did not wet the solder pad and may not be a reliable connection.

Ideally, the cross-section should look like the diagram below. This guide has some tips on identifying and fixing common soldering problems.
https://learn.adafruit.com/adafruit-gui ... n-problems

Image

User avatar
z1s
 
Posts: 6
Joined: Thu Sep 24, 2015 10:37 am

Re: faulty motor hat?

Post by z1s »

Thanks for taking a look. I'll try and get the ideal shape for the pins and try again.

User avatar
z1s
 
Posts: 6
Joined: Thu Sep 24, 2015 10:37 am

Re: faulty motor hat?

Post by z1s »

Still trying to get a servo moving!

I've re-soldered to the best of my ability. The soldering tip I've got is a little blunt to accurately heat the plate. I've ordered another tip and will try again when it arrives...

I'm still having the same problem with the connection but as stated before I can get i2c addresses when I hold the board in place.

I ran the python code (provided by adafruti -see below) to test a servo and was able to get the servo to move just a little and then it would stop and I would have to interrupt the process. rerunning the code would not cause the servo to move again. Restarting the pi and rerunning the code would make it work again a few times in the same manner. However, now I can't get it to move even a little bit (even after restarting the pi). Even though i2cdetect -y 1 returns the correct addresses.

I ran the debug=True option and I receive the following message (but without the servo moving):

pi@raspberrypi ~/Adafruit-Raspberry-Pi-Python-Code/Adafruit_PWM_Servo_Driver $ sudo i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: 40 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: 70 -- -- -- -- -- -- --
pi@raspberrypi ~/Adafruit-Raspberry-Pi-Python-Code/Adafruit_PWM_Servo_Driver $ sudo python Servo_Example.py
Reseting PCA9685 MODE1 (without SLEEP) and MODE2
I2C: Wrote 0x00 to register 0xFA
I2C: Wrote 0x00 to register 0xFB
I2C: Wrote 0x00 to register 0xFC
I2C: Wrote 0x00 to register 0xFD
I2C: Wrote 0x04 to register 0x01
I2C: Wrote 0x01 to register 0x00
I2C: Device 0x40 returned 0x01 from reg 0x00
I2C: Wrote 0x01 to register 0x00
Setting PWM frequency to 60 Hz
Estimated pre-scale: 100
Final pre-scale: 101
I2C: Device 0x40 returned 0x01 from reg 0x00
I2C: Wrote 0x11 to register 0x00
I2C: Wrote 0x65 to register 0xFE
I2C: Wrote 0x01 to register 0x00
I2C: Wrote 0x81 to register 0x00
I2C: Wrote 0x00 to register 0x06
I2C: Wrote 0x00 to register 0x07
I2C: Wrote 0x96 to register 0x08
I2C: Wrote 0x00 to register 0x09
I2C: Wrote 0x00 to register 0x06
I2C: Wrote 0x00 to register 0x07
I2C: Wrote 0x58 to register 0x08
I2C: Wrote 0x02 to register 0x09
I2C: Wrote 0x00 to register 0x06
I2C: Wrote 0x00 to register 0x07
I2C: Wrote 0x96 to register 0x08
I2C: Wrote 0x00 to register 0x09
I2C: Wrote 0x00 to register 0x06
I2C: Wrote 0x00 to register 0x07
I2C: Wrote 0x58 to register 0x08
I2C: Wrote 0x02 to register 0x09
I2C: Wrote 0x00 to register 0x06
I2C: Wrote 0x00 to register 0x07
I2C: Wrote 0x96 to register 0x08
I2C: Wrote 0x00 to register 0x09
I2C: Wrote 0x00 to register 0x06
I2C: Wrote 0x00 to register 0x07
I2C: Wrote 0x58 to register 0x08
I2C: Wrote 0x02 to register 0x09
I2C: Wrote 0x00 to register 0x06
I2C: Wrote 0x00 to register 0x07
I2C: Wrote 0x96 to register 0x08
I2C: Wrote 0x00 to register 0x09
I2C: Wrote 0x00 to register 0x06
I2C: Wrote 0x00 to register 0x07
I2C: Wrote 0x58 to register 0x08
I2C: Wrote 0x02 to register 0x09
I2C: Wrote 0x00 to register 0x06
I2C: Wrote 0x00 to register 0x07
I2C: Wrote 0x96 to register 0x08
I2C: Wrote 0x00 to register 0x09
I2C: Wrote 0x00 to register 0x06
I2C: Wrote 0x00 to register 0x07
I2C: Wrote 0x58 to register 0x08
I2C: Wrote 0x02 to register 0x09
I2C: Wrote 0x00 to register 0x06
I2C: Wrote 0x00 to register 0x07
I2C: Wrote 0x96 to register 0x08
I2C: Wrote 0x00 to register 0x09
I2C: Wrote 0x00 to register 0x06
I2C: Wrote 0x00 to register 0x07
I2C: Wrote 0x58 to register 0x08
I2C: Wrote 0x02 to register 0x09
^CTraceback (most recent call last):
File "Servo_Example.py", line 34, in <module>
time.sleep(1)
KeyboardInterrupt





Adafruit python code for Servo_Example.py:

#!/usr/bin/python

from Adafruit_PWM_Servo_Driver import PWM
import time

# ===========================================================================
# Example Code
# ===========================================================================

# Initialise the PWM device using the default address
#pwm = PWM(0x40)
# Note if you'd like more debug output you can instead run:
pwm = PWM(0x40, debug=True)

servoMin = 150 # Min pulse length out of 4096
servoMax = 600 # Max pulse length out of 4096

def setServoPulse(channel, pulse):
pulseLength = 1000000 # 1,000,000 us per second
pulseLength /= 60 # 60 Hz
print "%d us per period" % pulseLength
pulseLength /= 4096 # 12 bits of resolution
print "%d us per bit" % pulseLength
pulse *= 1000
pulse /= pulseLength
pwm.setPWM(channel, 0, pulse)

pwm.setPWMFreq(60) # Set frequency to 60 Hz
while (True):
# Change speed of continuous servo on channel O
pwm.setPWM(0, 0, servoMin)
time.sleep(1)
pwm.setPWM(0, 0, servoMax)
time.sleep(1)

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

Re: faulty motor hat?

Post by adafruit_support_bill »

I'm still having the same problem with the connection but as stated before I can get i2c addresses when I hold the board in place.
It sounds like you still have an intermittent connection somewhere. You need to get that fixed before the software will run reliably. Pay special attention to the SDA, SCL GND, 3.3v and 5v pins, since these are required for communication with the board.

User avatar
z1s
 
Posts: 6
Joined: Thu Sep 24, 2015 10:37 am

Re: faulty motor hat?

Post by z1s »

Hi again,

I bought a new motor hat and (using a sharper soldering tip to ensure that the plate was heated properly) soldered up the header connections.

I no longer need to hold the hat in place in order to get addresses for the i2c communication. However, the servo motors are still not moving... Any further advice would be much appreciated!!

This is what returns when I run the servo example code:

pi@raspberrypi ~ $ sudo i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: 40 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: 70 -- -- -- -- -- -- --
pi@raspberrypi ~ $ cd Adafruit-Raspberry-Pi-Python-Code
pi@raspberrypi ~/Adafruit-Raspberry-Pi-Python-Code $ cd Adafruit_PWM_Servo_Driver
pi@raspberrypi ~/Adafruit-Raspberry-Pi-Python-Code/Adafruit_PWM_Servo_Driver $ sudo python Servo_Example.py
Reseting PCA9685 MODE1 (without SLEEP) and MODE2
I2C: Wrote 0x00 to register 0xFA
I2C: Wrote 0x00 to register 0xFB
I2C: Wrote 0x00 to register 0xFC
I2C: Wrote 0x00 to register 0xFD
I2C: Wrote 0x04 to register 0x01
I2C: Wrote 0x01 to register 0x00
I2C: Device 0x40 returned 0x01 from reg 0x00
I2C: Wrote 0x01 to register 0x00
Setting PWM frequency to 60 Hz
Estimated pre-scale: 100
Final pre-scale: 101
I2C: Device 0x40 returned 0x01 from reg 0x00
I2C: Wrote 0x11 to register 0x00
I2C: Wrote 0x65 to register 0xFE
I2C: Wrote 0x01 to register 0x00
I2C: Wrote 0x81 to register 0x00
I2C: Wrote 0x00 to register 0x06
I2C: Wrote 0x00 to register 0x07
I2C: Wrote 0x96 to register 0x08
I2C: Wrote 0x00 to register 0x09
I2C: Wrote 0x00 to register 0x06
I2C: Wrote 0x00 to register 0x07
I2C: Wrote 0x58 to register 0x08
I2C: Wrote 0x02 to register 0x09
I2C: Wrote 0x00 to register 0x06
I2C: Wrote 0x00 to register 0x07
I2C: Wrote 0x96 to register 0x08
I2C: Wrote 0x00 to register 0x09
I2C: Wrote 0x00 to register 0x06
I2C: Wrote 0x00 to register 0x07
I2C: Wrote 0x58 to register 0x08
I2C: Wrote 0x02 to register 0x09
I2C: Wrote 0x00 to register 0x06
I2C: Wrote 0x00 to register 0x07
I2C: Wrote 0x96 to register 0x08
I2C: Wrote 0x00 to register 0x09
I2C: Wrote 0x00 to register 0x06
I2C: Wrote 0x00 to register 0x07
I2C: Wrote 0x58 to register 0x08
I2C: Wrote 0x02 to register 0x09
I2C: Wrote 0x00 to register 0x06
I2C: Wrote 0x00 to register 0x07
I2C: Wrote 0x96 to register 0x08
I2C: Wrote 0x00 to register 0x09
I2C: Wrote 0x00 to register 0x06
I2C: Wrote 0x00 to register 0x07
I2C: Wrote 0x58 to register 0x08
I2C: Wrote 0x02 to register 0x09
I2C: Wrote 0x00 to register 0x06
I2C: Wrote 0x00 to register 0x07
I2C: Wrote 0x96 to register 0x08
I2C: Wrote 0x00 to register 0x09
^CTraceback (most recent call last):
File "Servo_Example.py", line 32, in <module>
time.sleep(1)
KeyboardInterrupt
pi@raspberrypi ~/Adafruit-Raspberry-Pi-Python-Code/Adafruit_PWM_Servo_Driver $

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

Re: faulty motor hat?

Post by adafruit_support_bill »

Post some photos of your new soldering. And one with the servos connected also.

User avatar
z1s
 
Posts: 6
Joined: Thu Sep 24, 2015 10:37 am

Re: faulty motor hat?

Post by z1s »

Thank you for taking a look at these. I really appreciate it. Still getting the behavior described above. Is there another good way to confirm the status of the connections?
Attachments
arduino2.jpg
arduino2.jpg (726.36 KiB) Viewed 269 times
arduino1.jpg
arduino1.jpg (409.54 KiB) Viewed 269 times

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

Re: faulty motor hat?

Post by adafruit_support_bill »

Measure the voltage between the two screws on the blue power terminal block.

Do the servos twitch as you power them up?
When powered, is it possible to turn them by hand?

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”