I have a stepper motor of unknown origin which I can only get to go in one direction using my MotorShield V2.
I the motor diagram has B+, B- and A+, A- identified, and I have them connected to M1/M2 as A+/- gets connected to M1 according to the polarity when I run a dc motor on M1 (+ = outside, - = inside). Same for B+/- and M2.
I'm using code I've used for years,
Adafruit_MotorShield Shield = Adafruit_MotorShield();
Adafruit_StepperMotor *myMotor = Shield.getStepper(24,1); // (it's a cheap,mini motor, 24 steps per on revolultion
void Up(int Steps)
{
Serial.print("Up: "); Serial.println(Steps);
myMotor->step(Steps, FORWARD, SINGLE);
}
void Down(int Steps)
{Serial.print("Down: "); Serial.println(Steps);
myMotor->step(Steps, BACKWARD, SINGLE);
}
Both Up( 40 ) and Down( 40 ) result in about 7/ 8 of a counter clockwise revolution.
Any ideas? (other than buy from a legit source rather than the first thing that showed up on Amazon? It's really the assembly it came in that I was interested in rather than the motor, I just need the motor to work to test the assembly)
Thanks
Phil
Stepper motor only goes in 1 direction
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- dastels
- Posts: 15656
- Joined: Tue Oct 20, 2015 3:22 pm
Re: Stepper motor only goes in 1 direction
In the assembly you mention... is it meant to go in both directions?
Dave
Dave
- adafruit_support_bill
- Posts: 88091
- Joined: Sat Feb 07, 2009 10:11 am
Re: Stepper motor only goes in 1 direction
Some motors tend to run slightly better in one direction than the other. But if it is not running at all, it could be a motor compatibility problem.
Measure the resistance between one pair of the motor leads. If it is less than about 10 ohms, there is a good possibility that it is not compatible with the drivers on the shield.
Measure the resistance between one pair of the motor leads. If it is less than about 10 ohms, there is a good possibility that it is not compatible with the drivers on the shield.
- Phil_Rounds
- Posts: 57
- Joined: Thu Aug 07, 2014 5:12 pm
Re: Stepper motor only goes in 1 direction
It moves when I tell it to go Up(40) and when I tell it to go Down(40), but it goes in the same direction, even though I specify FORWARD / REVERSE in the Up / Down commands
- adafruit_support_bill
- Posts: 88091
- Joined: Sat Feb 07, 2009 10:11 am
Re: Stepper motor only goes in 1 direction
What is the resistance between the motor leads?
- Phil_Rounds
- Posts: 57
- Joined: Thu Aug 07, 2014 5:12 pm
Re: Stepper motor only goes in 1 direction
Bill - Sorry for the delay, but I was away from the lab yesterday afternoon. You were right-ish, the resistance on A+/A- was 60ohms , but B+/B- was open, so I'm guessing the motor was just shot
Thanks,
Phiul
Thanks,
Phiul
- adafruit_support_bill
- Posts: 88091
- Joined: Sat Feb 07, 2009 10:11 am
Re: Stepper motor only goes in 1 direction
With one winding open, I'm surprised that it turns at all. Normally I'd expect it to just vibrate back & forth. Could be that there is enough inertia in the drivetrain to skip over the 'dead' phases.
Please be positive and constructive with your questions and comments.