Adafruit DC & Stepper Motor Bonnet no output

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
billthefighter
 
Posts: 6
Joined: Wed Apr 13, 2022 3:10 pm

Adafruit DC & Stepper Motor Bonnet no output

Post by billthefighter »

Hello,

I recently purchased 2x of the Adafruit DC & Stepper Motor Bonnet for Raspberry Pi PID: 4280 as well as a Pimoroni pHAT Stack for Raspberry Pi PID: 3742.

I am attempting to drive a 12v DC motor with a 12v power supply. However, when I send the "throttle" command to the motor, nothing happens.

The 12v power supply was measured by a multimeter to be 12.3v. The green LED on the motor hat is on.

I have verified that i2c is on. This is the output of i2c detect:

Code: Select all

sudo i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- 3c -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: 60 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: 70 -- -- -- -- -- -- --    
I also ran blinka-test with the following output:

Code: Select all

Hello blinka!
Digital IO ok!
I2C ok!
Traceback (most recent call last):
  File "/home/hapi/hapi-water/blinka-test.py", line 16, in <module>
    spi = busio.SPI(board.SCLK, board.MOSI, board.MISO)
  File "/home/hapi/.local/share/virtualenvs/hapi-water-MyQ7nMmN/lib/python3.9/site-packages/busio.py", line 289, in __init__
    self._spi = _SPI(portId)
  File "/home/hapi/.local/share/virtualenvs/hapi-water-MyQ7nMmN/lib/python3.9/site-packages/adafruit_blinka/microcontroller/generic_linux/spi.py", line 25, in __init__
    self._spi = spi.SPI(device=(portid, 0))
  File "/home/hapi/.local/share/virtualenvs/hapi-water-MyQ7nMmN/lib/python3.9/site-packages/Adafruit_PureIO/spi.py", line 167, in __init__
    raise IOError("{} does not exist".format(device))
OSError: /dev/spidev0.0 does not exist
AFAIK SPI is not needed for this component, so I do not anticipate this being a problem, but if I am incorrect please let me know.

When I run the following test code:

Code: Select all

# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT

"""Simple test for using adafruit_motorkit with a DC motor"""
import time
import board
from adafruit_motorkit import MotorKit

kit = MotorKit(address=60)
print(kit)
print("Test!")
i=0
while i < 10:
    kit.motor1.throttle = 1
    time.sleep(1)
    print(i)
    kit.motor1.throttle = 0
    i += 1

print('done')
The following is output from the terminal:

Code: Select all

<adafruit_motorkit.MotorKit object at 0x7f8b383fd0>
Test!
0
1
2
3
4
5
6
7
8
9
done
When measuring the two M1 pins on the bonnet, no voltage difference is present while this program is running.

I have tried this with 2 separate bonnets and it seems unlikely that 2 separate bonnets would both have a hardware problem, so I am assuming something about my setup is incorrect.

Any idea what next steps I should try?

Setup image attached.
Attachments
2022-04-13_13-36-09 (Small).png
2022-04-13_13-36-09 (Small).png (648.49 KiB) Viewed 120 times

User avatar
adafruit_support_carter
 
Posts: 29150
Joined: Tue Nov 29, 2016 2:45 pm

Re: Adafruit DC & Stepper Motor Bonnet no output

Post by adafruit_support_carter »

If you apply the 12V directly to the motor, does it work?

Try setting throttle=1 via REPL and then measure the voltage on the output terminal screws.

User avatar
billthefighter
 
Posts: 6
Joined: Wed Apr 13, 2022 3:10 pm

Re: Adafruit DC & Stepper Motor Bonnet no output

Post by billthefighter »

Confirmed the motor works when connected directly to the power supply.

Motor does not work when commands sent through REPL.

REPL output:

Code: Select all

Python 3.9.2 (default, Feb 28 2021, 17:03:44) 
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from adafruit_motorkit import MotorKit
>>> kit = MotorKit(address=60)
>>> kit.motor1.throttle = 1
>>> kit.motor1.throttle = 0
>>> exit()

User avatar
adafruit_support_carter
 
Posts: 29150
Joined: Tue Nov 29, 2016 2:45 pm

Re: Adafruit DC & Stepper Motor Bonnet no output

Post by adafruit_support_carter »

Code: Select all

>>> kit.motor1.throttle = 1
After entering this command, what is the voltage on the motor output terminal block?
term.jpg
term.jpg (43.13 KiB) Viewed 111 times

User avatar
billthefighter
 
Posts: 6
Joined: Wed Apr 13, 2022 3:10 pm

Re: Adafruit DC & Stepper Motor Bonnet no output

Post by billthefighter »

The voltage difference at the output terminal block is 0v.

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

Re: Adafruit DC & Stepper Motor Bonnet no output

Post by adafruit_support_bill »

Please post the electrical specs for the motor you are connecting.

User avatar
billthefighter
 
Posts: 6
Joined: Wed Apr 13, 2022 3:10 pm

Re: Adafruit DC & Stepper Motor Bonnet no output

Post by billthefighter »

The motor is a 12v DC motor attached to a small pump. Specifically, https://www.amazon.com/gp/product/B01G3 ... UTF8&psc=1

I have connected the iincluded power supply to the motor bonnet and am using that to drive the motor.

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

Re: Adafruit DC & Stepper Motor Bonnet no output

Post by adafruit_support_bill »

The motor is a 12v DC motor attached to a small pump
"12v" is not a complete electrical spec for a motor. The link also mentions "Rated current: 0.7A". But it does not specify whether that is the no-load current, stall current, maximum efficiency current etc. The included power supply is rated for 2A @12v, so I'm guessing that the 0.7A is the no-load rating.

Try changing the code to use channel 3 and test the voltage output with no motor attached.

User avatar
billthefighter
 
Posts: 6
Joined: Wed Apr 13, 2022 3:10 pm

Re: Adafruit DC & Stepper Motor Bonnet no output

Post by billthefighter »

Try changing the code to use channel 3 and test the voltage output with no motor attached.
See attached image - when "kit.motor3.throttle = 1" same result, 0v.
M3 voltage when kit.motor3.throttle = 1
M3 voltage when kit.motor3.throttle = 1
2022-04-13_17-27-04.png (502.24 KiB) Viewed 99 times


For reference, here is the input voltage - it is now closer to 13 volts witch is a little odd. Maybe just a shitty power supply.
Input Voltage
Input Voltage
2022-04-13_17-24-17 (Small).png (566.13 KiB) Viewed 99 times

User avatar
billthefighter
 
Posts: 6
Joined: Wed Apr 13, 2022 3:10 pm

Re: Adafruit DC & Stepper Motor Bonnet no output

Post by billthefighter »

Ok. Problem solved. I did a reboot, and I also noticed that the motor seems to have a rectifier and can't be run backwards. I used the code here to test: https://github.com/adafruit/Adafruit_Ci ... dc_test.py

I noticed that when the "backward!" line came up on the terminal, the motor started spinning. so I swapped the pins and it began working.

I also verified that there was voltage across motor pins 1 which was not the case before.

So i think what happened was:

[*] There was some issue with I2C that was solved by a reboot
[*] The motor was installed backwards
[*] I failed to test forward and backwards operation.

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

Re: Adafruit DC & Stepper Motor Bonnet no output

Post by adafruit_support_bill »

Good to hear that is solved. Thanks for the follow-up.

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”