Due to high demand, expect some shipping delays at this time - orders may not ship for up to 2-3 business days.
0

Stepper behaving erratically
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Stepper behaving erratically

by mooredesign13 on Mon Jan 10, 2022 8:56 pm

Anyone ever have a nema17 (200 S/R) motor act really odd? It sort of bounces around. I am trying to make it run continuously until it hits a limit switch and it sort of jiggles around and bounces, never completing a full rotation or reaching the limit. The motor worked fine a month ago, and now it is not. I have three other motors on the rig I am making, and they are all acting fine with the same code. They are all adafruit motors on the adafruit motorshields. do these things strip out or burn up somehow?

In a semi related question: I also have an LCD hooked up. and when the power is off, the motors are all released, so I can manually move the different parts around... which spins the motors but when I do this, I noticed that the lcd will light up briefly if I spin them fast enough. Effectively, it appears that the steppers are generating power. Should I be worried about this, and if so, is there an easy fix?

mooredesign13
 
Posts: 37
Joined: Fri Apr 17, 2020 12:18 pm

Re: Stepper behaving erratically

by adafruit_support_bill on Mon Jan 10, 2022 9:24 pm

it sort of jiggles around and bounces, never completing a full rotation or reaching the limit.

Sounds like possibly a loose wire. If one of the 2 windings has a bad connection, the motor will run erratically.

I noticed that the lcd will light up briefly if I spin them fast enough. Effectively, it appears that the steppers are generating power.

Yes, all motors do that. The NEMA17 motors in the Adafruit shop are not particularly efficient as generators, so in most cases you would need to be spinning them pretty fast to gnerate enough current to do much damage.

adafruit_support_bill
 
Posts: 83780
Joined: Sat Feb 07, 2009 10:11 am

Re: Stepper behaving erratically

by mooredesign13 on Wed Jan 12, 2022 4:54 pm

Hi Bill,

Thanks, I checked the wires and they look good. I also ran a test to see if the issue was both in forward and in reverse, and it looks as though the motor runs fine going FORWARD, but with the BACKWARDS command, the motor skips. I am only trying to do 100 steps at a time (100, FORWARD, SINGLE) and (100, BACKWARD, SINGLE)

So then I tried DOUBLE steps.
Same results: Good performance going forward, but with the backward command, it gets in about good 50 steps backward, and then bounced forward about 25 steps, and then proceeded backwards again a few more steps.

Same issue with MICROSTEPS.

basically, it will step about 90% of the steps I ask for, and then bounce back and forth a few times right at the end.

mooredesign13
 
Posts: 37
Joined: Fri Apr 17, 2020 12:18 pm

Re: Stepper behaving erratically

by adafruit_support_bill on Wed Jan 12, 2022 5:18 pm

If you swap two of the motors, does the problem follow the motor or stay with the same motor driver?

adafruit_support_bill
 
Posts: 83780
Joined: Sat Feb 07, 2009 10:11 am

Re: Stepper behaving erratically

by mooredesign13 on Wed Jan 12, 2022 6:15 pm

I swapped the wires on the motor shield: M1&M2 went over to M3&M4 terminals, and visa versa. The issue did not swap motors, it still exists with the same motor. so I feel it is safe to assume the shield is operating fine.

mooredesign13
 
Posts: 37
Joined: Fri Apr 17, 2020 12:18 pm

Re: Stepper behaving erratically

by mooredesign13 on Wed Jan 12, 2022 6:35 pm

I removed the motor from the machine I'm building (which due to physical boundaries, was limiting me to only 100 steps forward or backward) and ran it to 400 steps forward and backward. The motor still runs fine going forward, but skips steps if going backward.

mooredesign13
 
Posts: 37
Joined: Fri Apr 17, 2020 12:18 pm

Re: Stepper behaving erratically

by adafruit_support_bill on Wed Jan 12, 2022 8:53 pm

Disconnect the motor from the shield and measure the resistance between the red and yellow wires and also between the green and gray wires.

adafruit_support_bill
 
Posts: 83780
Joined: Sat Feb 07, 2009 10:11 am

Re: Stepper behaving erratically

by mooredesign13 on Wed Jan 12, 2022 9:11 pm

red and yellow: 36.3 +/- 0.2
green and grey 36.4 +/- 0.2

mooredesign13
 
Posts: 37
Joined: Fri Apr 17, 2020 12:18 pm

Re: Stepper behaving erratically

by adafruit_support_bill on Thu Jan 13, 2022 7:09 am

That sounds pretty normal. What are you using to power the motors?

Also please post the code you are using.

adafruit_support_bill
 
Posts: 83780
Joined: Sat Feb 07, 2009 10:11 am

Re: Stepper behaving erratically

by mooredesign13 on Thu Jan 13, 2022 3:28 pm

The power is coming from a 12V power supply. While coding the unit, I have the USB inserted to he arduino Mega and also the 12v going to the arduino power jack. I have two adafruit moto shields V2, and both have the jumpers installed. While not coding, I simply remove the USB cord, but I leave the jumpers installed.

Key point: I have four motors. Only this specific motor is acting up. The other three are acting normally. They all have identical code during this testing phase.

So, I had intermediate wires extending the motor to where it was mounted. After testing the ohms on the motor, I hooked it directly to the shield. At first it still behaved oddly, and then after a few runs back and forth, it behaved fine. So then I hooked it back up to the original wires that extended the wiring harness... and Erratic action again! I am going to try different wires and also test the original wires. My guess is that they are the issue... although it might be possible that the motor itself has some internal issues. Pretty much everything else has been isolated. I'll post an update once I get this done.

mooredesign13
 
Posts: 37
Joined: Fri Apr 17, 2020 12:18 pm

Re: Stepper behaving erratically

by mooredesign13 on Mon Jan 17, 2022 12:28 am

Well, I still do not know what is going on except to say it might just be a faulty motor. I replaced the wires and tried everything else. Everything else works fine in this set up, so I'll just order another motor and hopefully that will do the trick.

mooredesign13
 
Posts: 37
Joined: Fri Apr 17, 2020 12:18 pm

Re: Stepper behaving erratically

by mooredesign13 on Fri Feb 04, 2022 9:11 pm

SOLVED!!!

I installed a new motor and still had the same issue. I was about to try switching leads again between differed motorshield locations when......

I discovered a short in the system! The terminal screw expansion shield that I had installed above the top motorshield had one of my solder joints (Where I had added additional circuitry on the prototyping area) touching something on top of the top motorshield. I trimmed all the solder leads a tiny bit shorter and I covered the bottom of the terminal shield with a few layers of tape and now it works! Geez... at least now I have a spare motor.

mooredesign13
 
Posts: 37
Joined: Fri Apr 17, 2020 12:18 pm

Re: Stepper behaving erratically

by adafruit_support_bill on Sat Feb 05, 2022 7:43 am

Good to hear you finally found the root cause.

adafruit_support_bill
 
Posts: 83780
Joined: Sat Feb 07, 2009 10:11 am

Please be positive and constructive with your questions and comments.