I'm working on a 3 finger robotic gripper for a project and one of the finger is directly attached to Nema 17 stepper (17HS10-0704S). It's a small and not very powerful motor, but I need something lightweight.
I'm also using A4988 stepper driver and CNC Shield V3 attached to Arduino Uno (might be an overkill, but I already had the parts).
I'm running it off 12V and V-ref of the driver set to 0.400V
I'd like some help with the code. Specifically I want stepper to move relatively slow and yet with as much "power" as possible. With below code it's too weak, I can easily stop stepper movement with my fingers. What can I do increase it's power?
Here's the test code I'm using:
// Define stepper motor connections and steps per revolution:
#define dirPin 5
#define stepPin 2
#define enPin 8
#define stepsPerRevolution 200
#define motorSpeed 2000
void setup() {
// Declare pins as output:
pinMode(stepPin, OUTPUT);
pinMode(dirPin, OUTPUT);
pinMode(enPin,OUTPUT);
digitalWrite(enPin,LOW);
}
void loop() {
// Set the spinning direction clockwise:
digitalWrite(dirPin, HIGH);
// Spin the stepper motor 1 revolution slowly:
for (int i = 0; i < stepsPerRevolution; i++) {
// These four lines result in 1 step:
digitalWrite(stepPin, HIGH);
delayMicroseconds(motorSpeed);
digitalWrite(stepPin, LOW);
delayMicroseconds(motorSpeed);
}
delay(1000);
}
The speed of a stepper motor is determined by the interval between steps. The speed of movement for an individual step is not program controllable. That may make a stepper motor unsuitable for your task.
The torque of a stepper motor is also not program controllable - except in so far as the torque falls off as speed increases.
You can reduce the torque of a stepper motor by setting the driver's current limit below the max permitted for the motor - but that is not under program control.
It would be a big help if can post a diagram showing how the stepper motor operates the gripper.
I would be inclined to use the motor to drive a screw which in turn compresses a spring. That way the gripper force could be adjusted by applying more or fewer turns to the screw and that should work well with a stepper motor.
Some suggestions, the stepper data sheet rates the motor about 0.7A per phase ? So using documentation from my "Big Easydriver board" (which is also based on the Allegro A4988) the documentation suggest Vref = Imax * (8*0.11), so about 0.616A ?.
by default the driver chip is usually set to micro step at 1/16 microsteps maybe try half steps (H,L,L on MS1/2/3) and no more than 1350 rpm as you might be exceeding the max speed on usable pull out torque
Generally steppers with integral or attached gearboxes are better if you want more torque as the torque is multiplied up at the same rate as the shaft speed drops. Something like the cheapo 28BYJ-48 Unipolor stepper motor is a good one to experiment with 15rpm shaft speed with 64:1 reduction gearbox.
Dingo61:
Some suggestions, the stepper data sheet rates the motor about 0.7A per phase ? So using documentation from my "Big Easydriver board" (which is also based on the Allegro A4988) the documentation suggest Vref = Imax * (8*0.11), so about 0.616A ?.
by default the driver chip is usually set to micro step at 1/16 microsteps maybe try half steps (H,L,L on MS1/2/3) and no more than 1350 rpm as you might be exceeding the max speed on usable pull out torque
Generally steppers with integral or attached gearboxes are better if you want more torque as the torque is multiplied up at the same rate as the shaft speed drops. Something like the cheapo 28BYJ-48 Unipolor stepper motor is a good one to experiment with 15rpm shaft speed with 64:1 reduction gearbox.
Thank you! Actually increasing current helped a lot! I will also play with micro-stepping.