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/
Locked
User avatar
tampe125
 
Posts: 16
Joined: Thu Dec 03, 2015 7:36 am

Detect stepper coils

Post by tampe125 »

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?

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

Re: Detect stepper coils

Post by adafruit_support_bill »

Please post a link to the specs for the stepper you are using.

User avatar
tampe125
 
Posts: 16
Joined: Thu Dec 03, 2015 7:36 am

Re: Detect stepper coils

Post by tampe125 »

Thank you very much for the answer, attached you can find the specs
Attachments
nema_spec.jpg
nema_spec.jpg (77.87 KiB) Viewed 193 times

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

Re: Detect stepper coils

Post by adafruit_support_bill »

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.

User avatar
tampe125
 
Posts: 16
Joined: Thu Dec 03, 2015 7:36 am

Re: Detect stepper coils

Post by tampe125 »

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.

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

Re: Detect stepper coils

Post by adafruit_support_bill »

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.

User avatar
tampe125
 
Posts: 16
Joined: Thu Dec 03, 2015 7:36 am

Re: Detect stepper coils

Post by tampe125 »

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?

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

Re: Detect stepper coils

Post by adafruit_support_bill »

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.

User avatar
tampe125
 
Posts: 16
Joined: Thu Dec 03, 2015 7:36 am

Re: Detect stepper coils

Post by tampe125 »

Thank you very much!

User avatar
tampe125
 
Posts: 16
Joined: Thu Dec 03, 2015 7:36 am

Re: Detect stepper coils

Post by tampe125 »

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?

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

Re: Detect stepper coils

Post by adafruit_support_bill »

Disconnect the motor from the HAT and measure the resistance of the coils. They should both be pretty close to the specified 30 ohms.

User avatar
tampe125
 
Posts: 16
Joined: Thu Dec 03, 2015 7:36 am

Re: Detect stepper coils

Post by tampe125 »

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!

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

Re: Detect stepper coils

Post by adafruit_support_bill »

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.

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”