Thank you Bill, it works now.
In which range can I adjust the holding torque ? (0 - 255) ?
What's the min and max value ?
Regards
Tom
Motor shield V2.0, connected stepper becomes to hot
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
-
- Posts: 20
- Joined: Tue May 13, 2014 4:26 am
-
- Posts: 20
- Joined: Tue May 13, 2014 4:26 am
Re: Motor shield V2.0, connected stepper becomes to hot
I see the holding torque is allway's the same.
No matter what value is given, 50, 100, 1000.
It seems not adjustable.
Tom
No matter what value is given, 50, 100, 1000.
It seems not adjustable.
Tom
- adafruit_support_bill
- Posts: 88089
- Joined: Sat Feb 07, 2009 10:11 am
Re: Motor shield V2.0, connected stepper becomes to hot
It should be adjustable between 0 and 255. Setting it to 0 should be about the same as calling 'release()'.
-
- Posts: 20
- Joined: Tue May 13, 2014 4:26 am
Re: Motor shield V2.0, connected stepper becomes to hot
Thank you very much Bill !
Greetings
Tom
Greetings
Tom
- openresistor
- Posts: 4
- Joined: Sat May 24, 2014 3:15 pm
Re: Motor shield V2.0, connected stepper becomes to hot
Thank You...This does work!
You just need to make sure that you call
myStepper1->hold(50);
(or your favorite value) AFTER the call to move that same stepper.
That value will hold until your code calls to move that stepper again, where maximum hold returns again.
Great way to control "duty cycle" with steppers without completely removing a holding current!
You just need to make sure that you call
myStepper1->hold(50);
(or your favorite value) AFTER the call to move that same stepper.
That value will hold until your code calls to move that stepper again, where maximum hold returns again.
Great way to control "duty cycle" with steppers without completely removing a holding current!
- kalniss
- Posts: 7
- Joined: Sun Aug 31, 2014 9:38 am
Re: Motor shield V2.0, connected stepper becomes to hot
This method doesn't work for me. No matter what value is passed to hold() it wont hold, the motor will "sing" and no current will be drawn. I figure that the coils are not completely powered down as with release(), but no significant current is fed to them, and for some reason I can't control the current.
I have stacked to Motor Shields V2.0 (and V2.3) that powers three Adafruit steppers.
Is there maybe some other library edit I'm missing?
I have stacked to Motor Shields V2.0 (and V2.3) that powers three Adafruit steppers.
Is there maybe some other library edit I'm missing?
- adafruit_support_bill
- Posts: 88089
- Joined: Sat Feb 07, 2009 10:11 am
Re: Motor shield V2.0, connected stepper becomes to hot
There must be some current, or the motors would be silent. Hold(255); should be the same as just not calling release().No matter what value is passed to hold() it wont hold, the motor will "sing" and no current will be drawn.
What are you using to power the motors?
- kalniss
- Posts: 7
- Joined: Sun Aug 31, 2014 9:38 am
Re: Motor shield V2.0, connected stepper becomes to hot
I'm powering both shields with the same 12 V 5 A power supply. That's plenty of power, isn't it? If I don't call release(); all three motors together draw close to 2A as expected while holding, and hold very well.
- adafruit_support_bill
- Posts: 88089
- Joined: Sat Feb 07, 2009 10:11 am
Re: Motor shield V2.0, connected stepper becomes to hot
5A should be plenty of current. Post the code you are using and we'll see if we can spot the problem.
- kalniss
- Posts: 7
- Joined: Sun Aug 31, 2014 9:38 am
Re: Motor shield V2.0, connected stepper becomes to hot
Even in this very simple test code none of the motors hold.
Also of course I have made all the library changes mentioned in this topic. And if it changes anything, I've changed IC2 to 400kHz.
Code: Select all
#include <Wire.h>
#include <Adafruit_MotorShield.h>
Adafruit_MotorShield AFMStop(0x61);
Adafruit_MotorShield AFMSbot(0x60);
Adafruit_StepperMotor *slideMotor = AFMSbot.getStepper(200, 1);
Adafruit_StepperMotor *panMotor = AFMSbot.getStepper(200, 2);
Adafruit_StepperMotor *tiltMotor = AFMStop.getStepper(200, 1);
void setup()
{
AFMStop.begin();
AFMSbot.begin();
Serial.begin(9600);
}
void loop()
{
panMotor->step(10, FORWARD, DOUBLE);
tiltMotor->step(10, FORWARD, DOUBLE);
slideMotor->step(10, FORWARD, DOUBLE);
panMotor->hold(0);
tiltMotor->hold(150);
slideMotor->hold(255);
delay(3000);
}
- adafruit_support_bill
- Posts: 88089
- Joined: Sat Feb 07, 2009 10:11 am
Re: Motor shield V2.0, connected stepper becomes to hot
i2c clock speed should not make a difference. If your library modification is correct, that code should work.
- kalniss
- Posts: 7
- Joined: Sun Aug 31, 2014 9:38 am
Re: Motor shield V2.0, connected stepper becomes to hot
Right, so the conclusion would be that there are mistakes in my library changes. Here's what I did:
In Adafruit_MotorShield.cpp right after this:
I added this:
and in Adafruit_MotorShield.h, after this:
added this:
Am I missing something? It compiles, no errors pop up. What could be other possible library issues?
In Adafruit_MotorShield.cpp right after this:
Code: Select all
void Adafruit_StepperMotor::release(void) {
MC->setPin(AIN1pin, LOW);
MC->setPin(AIN2pin, LOW);
MC->setPin(BIN1pin, LOW);
MC->setPin(BIN2pin, LOW);
MC->setPWM(PWMApin, 0);
MC->setPWM(PWMBpin, 0);
}
Code: Select all
void Adafruit_StepperMotor::hold(uint8_t holdingCurrent){
MC->setPWM(PWMApin, holdingCurrent);
MC->setPWM(PWMBpin, holdingCurrent);
}
and in Adafruit_MotorShield.h, after this:
Code: Select all
void release(void);
Code: Select all
void hold(uint8_t holdingCurrent);
- adafruit_support_bill
- Posts: 88089
- Joined: Sat Feb 07, 2009 10:11 am
Re: Motor shield V2.0, connected stepper becomes to hot
OK. I see the problem now. The range of holding currents is 0-4095 for the V2 shield (it was 0-255 on the V1 shields).
In order to set holding currents higher than 255, the holdingCurrent parameter type needs to be uint16_t - not uint8_t.
In order to set holding currents higher than 255, the holdingCurrent parameter type needs to be uint16_t - not uint8_t.
Code: Select all
void Adafruit_StepperMotor::hold(uint16_t holdingCurrent)
{
MC->setPWM(PWMApin, holdingCurrent);
MC->setPWM(PWMBpin, holdingCurrent);
}
- kalniss
- Posts: 7
- Joined: Sun Aug 31, 2014 9:38 am
Re: Motor shield V2.0, connected stepper becomes to hot
You, sir, just made my day. It works!!! :)
Please be positive and constructive with your questions and comments.