Stepper behaving erratically

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
mooredesign13
 
Posts: 37
Joined: Fri Apr 17, 2020 12:18 pm

Stepper behaving erratically

Post by mooredesign13 »

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?

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

Re: Stepper behaving erratically

Post by adafruit_support_bill »

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.

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

Re: Stepper behaving erratically

Post by mooredesign13 »

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.

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

Re: Stepper behaving erratically

Post by adafruit_support_bill »

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

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

Re: Stepper behaving erratically

Post by mooredesign13 »

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.

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

Re: Stepper behaving erratically

Post by mooredesign13 »

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.

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

Re: Stepper behaving erratically

Post by adafruit_support_bill »

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

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

Re: Stepper behaving erratically

Post by mooredesign13 »

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

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

Re: Stepper behaving erratically

Post by adafruit_support_bill »

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

Also please post the code you are using.

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

Re: Stepper behaving erratically

Post by mooredesign13 »

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.

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

Re: Stepper behaving erratically

Post by mooredesign13 »

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.

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

Re: Stepper behaving erratically

Post by mooredesign13 »

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.

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

Re: Stepper behaving erratically

Post by adafruit_support_bill »

Good to hear you finally found the root cause.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”