Motor with quick motion, needed range is small (<10 centimeters)

Hi all,

I've been playing around with this stepper motor hooked to an EasyDriver and an arduino uno. My needs from the motor are quick motion (e.g. move distance of 5cm in less than second) and the maximum range I'll need is quite small (10 centimeters is fine).

Briefly, the device I'm working on involves hooking a string to a finger on one end with the motor on the other end. With the use of a load cell to measure the string's tension, the program will tell the motor to either loosen (finger goes down) or tighten (finger goes up) the string. Thus, the motor needs to be quick with its motion so the finger moves at a reasonable speed.

The code that I used is quite simple: it uses AccelStepper with a set speed. Input can be read to increase or decrease the speed.

AccelStepper stepper(AccelStepper::FULL4WIRE, 4, 5, 6, 7);

void setup() {
       Serial.begin(9600);
       stepper.setMaxSpeed(10000);
}

long speed = 0;

void loop() {
	while (Serial.available()) {
		char input = Serial.read(); //Read user input and trigger appropriate function
		if (input =='1')
		{
			speed += 100;
			stepper.setSpeed(speed);
		}
		else if (input == '0') {
			speed -= 100;
			stepper.setSpeed(speed);
		}
	}

	stepper.runSpeed();
}

What I noticed is that the stepper isn't very good in accelerating. It can reach high RPM, but it ramps up slowly. So it appears I haven't coded it correctly, or a stepper doesn't suit my needs.

What kind of motor can give me sub-second acceleration with the small range that I need? Thanks!

You may want to think about how you are going to stop the motor acceleration. Remember "momentum" from school? This is where you get to use it.

Paul

idank:
Hi all,

I've been playing around with this stepper motor hooked to an EasyDriver and an arduino uno. My needs from the motor are quick motion (e.g. move distance of 5cm in less than second) and the maximum range I'll need is quite small (10 centimeters is fine).

Briefly, the device I'm working on involves hooking a string to a finger on one end with the motor on the other end. With the use of a load cell to measure the string's tension, the program will tell the motor to either loosen (finger goes down) or tighten (finger goes up) the string. Thus, the motor needs to be quick with its motion so the finger moves at a reasonable speed.

The code that I used is quite simple: it uses AccelStepper with a set speed. Input can be read to increase or decrease the speed.

AccelStepper stepper(AccelStepper::FULL4WIRE, 4, 5, 6, 7);

void setup() {
      Serial.begin(9600);
      stepper.setMaxSpeed(10000);
}

long speed = 0;

void loop() {
while (Serial.available()) {
char input = Serial.read(); //Read user input and trigger appropriate function
if (input =='1')
{
speed += 100;
stepper.setSpeed(speed);
}
else if (input == '0') {
speed -= 100;
stepper.setSpeed(speed);
}
}

stepper.runSpeed();

}




What I noticed is that the stepper isn't very good in accelerating. It can reach high RPM, but it ramps up slowly. So it appears I haven't coded it correctly, or a stepper doesn't suit my needs.

What kind of motor can give me sub-second acceleration with the small range that I need? Thanks!

Have you experimented with stepper.setAcceleration () in the setup function?

This is wrong if you are using an Easydriver

AccelStepper stepper(AccelStepper::FULL4WIRE, 4, 5, 6, 7);

You should be using

AccelStepper stepper(AccelStepper::DRIVER, stepPin, directionPin);

...R

Robin2:
This is wrong if you are using an Easydriver

AccelStepper stepper(AccelStepper::FULL4WIRE, 4, 5, 6, 7);

You should be using

AccelStepper stepper(AccelStepper::DRIVER, stepPin, directionPin);

...R

How can you tell? The stepper I have has 4 wires coming out of it.

idank:
How can you tell? The stepper I have has 4 wires coming out of it.

They go to the Easydriver, NOT to the Arduino.

The Arduino program knows nothing about whatever is on the other side of the Easydriver. And there are only two connections - Step and Direction between the Arduino and the Easydriver.

...R