I'm trying to make Bipolar stepper hooked to R Pi Crickit board running using this example:
https://learn.adafruit.com/adafruit-cri ... n-steppers
and I keep getting this message:
Bi-Polar or Uni-Polar Stepper motor demo!
Traceback (most recent call last):
File "/home/pi/Desktop/stepper2.py", line 8, in <module>
stepper_motor = crickit.stepper_motor
File "/home/pi/.local/lib/python3.9/site-packages/adafruit_crickit.py", line 232, in stepper_motor
return self._motor(_MOTOR_STEPPER, StepperMotor)
File "/home/pi/.local/lib/python3.9/site-packages/adafruit_crickit.py", line 247, in _motor
device = motor_class(
File "/usr/local/lib/python3.9/dist-packages/adafruit_motor/stepper.py", line 117, in __init__
if not self._coil.variable_frequency:
AttributeError: 'PWMOut' object has no attribute 'variable_frequency'
>>
Can anyone shed some light to the issue.
Crickit for Raspberry Pi stepper motor not working
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- vojmilan
- Posts: 3
- Joined: Mon Sep 26, 2022 4:00 am
- mikeysklar
- Posts: 13936
- Joined: Mon Aug 01, 2016 8:10 pm
Re: Crickit for Raspberry Pi stepper motor not working
I see a comment about unipolar vs bipolar steppers steppers. Can you show the wiring?
https://learn.adafruit.com/adafruit-cri ... n-steppersThe Drive stepper must be Unipolar - bipolar steppers are not supported on the Drive port, only on the single Motor port.
- vojmilan
- Posts: 3
- Joined: Mon Sep 26, 2022 4:00 am
Re: Crickit for Raspberry Pi stepper motor not working
It's connected to Motor outputs each coil in it's respective place.
- Attachments
-
- motor.jpg (337.77 KiB) Viewed 118 times
- mikeysklar
- Posts: 13936
- Joined: Mon Aug 01, 2016 8:10 pm
Re: Crickit for Raspberry Pi stepper motor not working
Is this the Adafruit 12v bi-polar stepper you are using?
The wiring order looks a little different that you are using than the Crickit CircuitPython guide shows (I realize you have the Pi Crickit).
https://learn.adafruit.com/adafruit-cri ... rt-2990590
The board you are using is all 5v components so you will need to supply 5v power to the Crickit as well. Since this motor is likely 12v it may not be compatible. This note is in the guide.
The wiring order looks a little different that you are using than the Crickit CircuitPython guide shows (I realize you have the Pi Crickit).
https://learn.adafruit.com/adafruit-cri ... rt-2990590
The board you are using is all 5v components so you will need to supply 5v power to the Crickit as well. Since this motor is likely 12v it may not be compatible. This note is in the guide.
https://learn.adafruit.com/adafruit-cri ... ep-3002674The voltage we use to power the motor is 5V only, so 5V power steppers are best, but sometimes you can drive 12V steppers at a slower/weaker rate
- vojmilan
- Posts: 3
- Joined: Mon Sep 26, 2022 4:00 am
Re: Crickit for Raspberry Pi stepper motor not working
Hey, thanks for pointing that out, I was following the guide where it says
"If you are using our "12V" bi-polar stepper, wire in this order: red, yellow, (skip GND center), green, gray" and completely omitted the part above.
It's linking to this motor https://www.adafruit.com/product/324 which is also 12V. Checking the specs it says its rated 350mA per phase.
Motor I'm using is SM-42BYG011-25 (https://www.digikey.com/en/products/det ... 38/5318747) rated 0.33A so it should fit the bill, given the specifications are right.
Regulated 5V 2.2A is provided to the power input.
Are 12V steppers completely incompatible with the R Pi Crickit boards or I'm missing something?
"If you are using our "12V" bi-polar stepper, wire in this order: red, yellow, (skip GND center), green, gray" and completely omitted the part above.
It's linking to this motor https://www.adafruit.com/product/324 which is also 12V. Checking the specs it says its rated 350mA per phase.
Motor I'm using is SM-42BYG011-25 (https://www.digikey.com/en/products/det ... 38/5318747) rated 0.33A so it should fit the bill, given the specifications are right.
Regulated 5V 2.2A is provided to the power input.
Are 12V steppers completely incompatible with the R Pi Crickit boards or I'm missing something?
- mikeysklar
- Posts: 13936
- Joined: Mon Aug 01, 2016 8:10 pm
Re: Crickit for Raspberry Pi stepper motor not working
An Adafruit Engineer will comment on the compatibility.
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: Crickit for Raspberry Pi stepper motor not working
That motor should be compatible. But it will have limited torque at 5v.
- MakerMelissa
- Posts: 375
- Joined: Wed Jun 05, 2013 2:10 am
Re: Crickit for Raspberry Pi stepper motor not working
Hello,
I have submitted a Pull Request at https://github.com/adafruit/Adafruit_Ci ... or/pull/70 to fix the issue.
Melissa
I have submitted a Pull Request at https://github.com/adafruit/Adafruit_Ci ... or/pull/70 to fix the issue.
Melissa
- neopi
- Posts: 1
- Joined: Mon Jun 06, 2022 5:51 pm
Re: Crickit for Raspberry Pi stepper motor not working
I'm having the same issue on a CPX/Crickit setup. I updated both bootloaders and CircuitPython (adafruit-circuitpython-circuitplayground_express_crickit-en_US-8.0.3.uf2) The instructions mention that there are three libraries now included in the Crickit version that two should be deleted from the lib directory (https://learn.adafruit.com/adafruit-cri ... ython-code).
When I try to run the bi-polar/uni-polar Stepper demo script (https://learn.adafruit.com/adafruit-cri ... n-steppers) with a bi-polar motor on the "Motor" ports, I get the following error:
I also tested with a uni-polar motor on the "Drive" ports using the suggested demo script and get the same error.
When I try to run the bi-polar/uni-polar Stepper demo script (https://learn.adafruit.com/adafruit-cri ... n-steppers) with a bi-polar motor on the "Motor" ports, I get the following error:
Code: Select all
code.py output:
Bi-Polar or Uni-Polar Stepper motor demo!
Traceback (most recent call last):
File "code.py", line 8, in <module>
File "adafruit_crickit.py", line 232, in stepper_motor
File "adafruit_crickit.py", line 248, in _motor
File "adafruit_motor/stepper.py", line 117, in __init__
AttributeError: 'PWMOut' object has no attribute 'variable_frequency'
- mikeysklar
- Posts: 13936
- Joined: Mon Aug 01, 2016 8:10 pm
Re: Crickit for Raspberry Pi stepper motor not working
Which version of the adafruit_motor library are you using?
The code fix is present in the current 3.4.9 release.
https://github.com/adafruit/Adafruit_Ci ... 054790f81d
https://github.com/adafruit/Adafruit_Ci ... thon_Motor
The code fix is present in the current 3.4.9 release.
https://github.com/adafruit/Adafruit_Ci ... 054790f81d
https://github.com/adafruit/Adafruit_Ci ... thon_Motor
Please be positive and constructive with your questions and comments.