Adafruit Motorshield speed

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
abmADF
 
Posts: 1
Joined: Mon Jul 11, 2016 7:43 am

Adafruit Motorshield speed

Post by abmADF »

Hello
Recently i've bought Adafruit Motorshield v.2.3 which i use with arduino to drive a stepper motor.
My stepper motor is good enougth (0,9°/step, max. speed about 25 rps).
It works more o less good with Adafruit Motorshield but I've found a rather "strange" thing: if I set setSpeed(100) (for example) my motor run, but its velocity is much less when 100 rpm, the same for setSpeed(1) - the motor run, but its velosity is much high when 1 rpm, and if I ask 500 rpm using setSpeed (500), the motors run, but its velocity is << 500 rpm. It seems that it is not possible to set a motor speed for a value >200 rpm (formally it is possible, but the response is the same)
Can anybody tell me how I can control the speed ?
Thank you

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

Re: Adafruit Motorshield speed

Post by adafruit_support_bill »

The speed control in the motor shield library is not particularly precise - especially when using high-step-count motors. The step timing does not compensate for the communication overhead to the board, so at higher step-rates, the timing error gets progressively larger. The ultimate top speed ends up being limited by the speed of the i2c bus.

It is possible to increase the speed of the i2c bus. It is also possible to hack the library to reduce the overhead (although you will lose microstepping capability.) See this thread for more details:
viewtopic.php?f=31&t=57041&p=292119

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

Return to “Arduino Shields from Adafruit”