Hello,
I have just purchased a stepper and I'm trying to use it with Raspberry Motor HAT, however I'm having some troubles to detect the correct position of the coils. When I run the example code, it only seems to move smoothly only when I'm in the Interleaved coil parts. I think this means that I inverted some wiring.
The stepper I purchased has the following "explanation" of the wiring:
Red: A
Green: A-
Yellow: B+
Blue: B-
Honestly that doesn't mean very much to me. I tried to invert some cables, but the result is the same. Can you please give me some help on this?
Detect stepper coils
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/
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/
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: Detect stepper coils
Please post a link to the specs for the stepper you are using.
- tampe125
- Posts: 16
- Joined: Thu Dec 03, 2015 7:36 am
Re: Detect stepper coils
Thank you very much for the answer, attached you can find the specs
- Attachments
-
- nema_spec.jpg (77.87 KiB) Viewed 193 times
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: Detect stepper coils
Those are similar specs to the #324 motor we carry in the store. It should run well with the shield. What power supply are you using to power the motor?
The A+ and A- leads should connect to M1 and the B+ and B- leads to M2. It is not critical how these pairs are connected. If the motor does not run in the expected direction, you can just reverse one pair.
The A+ and A- leads should connect to M1 and the B+ and B- leads to M2. It is not critical how these pairs are connected. If the motor does not run in the expected direction, you can just reverse one pair.
- tampe125
- Posts: 16
- Joined: Thu Dec 03, 2015 7:36 am
Re: Detect stepper coils
I'm using a 12V 1A power supply
Ok, so it's not critical the order of +/- for each motor pair? I was afraid they could nullify each other.
I'll try to play a little with them.
Ok, so it's not critical the order of +/- for each motor pair? I was afraid they could nullify each other.
I'll try to play a little with them.
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: Detect stepper coils
At 12v, the motor will draw about 800mA total (400mA per phase). 'Interleave' mode is typically a little smoother than 'double'. 'microstep' is the smoothest, but the maximum speed will be much lower.
- tampe125
- Posts: 16
- Joined: Thu Dec 03, 2015 7:36 am
Re: Detect stepper coils
Ouch, I didn't consider that!
Which mode do you think I can use until I get a more powerful power supply? Is Interleave an option, even if it draws 50% more?
Which mode do you think I can use until I get a more powerful power supply? Is Interleave an option, even if it draws 50% more?
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: Detect stepper coils
You can use the 'single' step mode. That only energizes one phase at a time. It runs a little rougher and has less torque than the other modes, but uses less power.
- tampe125
- Posts: 16
- Joined: Thu Dec 03, 2015 7:36 am
Re: Detect stepper coils
Thank you very much!
- tampe125
- Posts: 16
- Joined: Thu Dec 03, 2015 7:36 am
Re: Detect stepper coils
Ok, I played a little with the wires.
There are two things that puzzle me.
The first one is that my stepper only moves when I use "Double coil" or "Interleaved coil"; if I try "Single coil" the stepper doesn't move at all.
The second thing is that the stepper is always moving in the same direction: regardless if I use the FORWARD or BACKWARD flag.
Any thoughts on that? Did I get unlucky and got a borked stepper motor?
There are two things that puzzle me.
The first one is that my stepper only moves when I use "Double coil" or "Interleaved coil"; if I try "Single coil" the stepper doesn't move at all.
The second thing is that the stepper is always moving in the same direction: regardless if I use the FORWARD or BACKWARD flag.
Any thoughts on that? Did I get unlucky and got a borked stepper motor?
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: Detect stepper coils
Disconnect the motor from the HAT and measure the resistance of the coils. They should both be pretty close to the specified 30 ohms.
- tampe125
- Posts: 16
- Joined: Thu Dec 03, 2015 7:36 am
Re: Detect stepper coils
Thank you very much for the hint!
Resistance was correct, too bad that the wiring were different from the reported specs :(
Now everything is moving smoothly, thank you again!
Resistance was correct, too bad that the wiring were different from the reported specs :(
Now everything is moving smoothly, thank you again!
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: Detect stepper coils
Unfortunately, there is no standard for wire color coding on stepper motors. And some suppliers have been known to change wire colors without updating their data sheets.
Good to hear it's working for you now.
Good to hear it's working for you now.
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/
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/