Guide on accelstepper

Hi guys, i am an amateur at at stepper motor and arduino. So please bear with me.

Currently i need to control two stepper motor at the same time using accellstepper.h library.

From what i understand the acceleration coding. The speed is actually step/second. And the accleration start from time=0. So from the start the motor will accelerate into the maximum speed set by user, which i think i can control perfectly.

However my concern right now is to have the another same scenario as the above. Rather than accelerate it decelerate. So when the program start. The motor will rise to speed until the maxspeed that i set then slowly decelerate per second to minimum speed i set.

So i was wondering do i need to tune the library ? Thanks for the help in advance

Looking at the AccelStepper documentation, the question is answered in the first sentence of the description for the setAcceleration method.

void AccelStepper::setAcceleration ( float acceleration )

Sets the acceleration/deceleration rate.

The "acceleration" Parameters are used identically to accelerate and decelerate. Ok, so maybe they should have Chosen a better Name...

Be aware of the fact that setting acceleration each time costs a lot of computing time. Read the excellent library manual and you will get to know a lot more interesting features, but also information about its limits (e.g. max 4000 pulses/sec).

I dont think, maybe i am wrong, the code can decelerate. Cause i try input minus value into the set.acelleration. Somehow it does not work.

Please guide me if i am wrong.

Thank you

I have suggested to the Moderator to merge your Threads. Multiple Threads on the same project are confusing and waste time. The other Thread are http://forum.arduino.cc/index.php?topic=422685 and http://forum.arduino.cc/index.php?topic=422791

...R

Cause i try input minus value into the set.acelleration.

There is no way to separate that. Acceleration and deceleration is ONE setting.

The motor starts with acceleration in place, reaches its max set speed and when it approaches the end of the travel it decelerates at the the same rate how it started until it comes to a full stop.