go_away

### Author Topic: Stepper acceleration/deceleration  (Read 1308 times)

0 Members and 1 Guest are viewing this topic.

#### Azraels

• Full Member
• Posts: 57
##### Stepper acceleration/deceleration
« on: February 18, 2013, 03:54:02 PM »
Hello everyone! While I could probably spend time searching for this information with google I thought I may as well use it as my first post. I am in the middle of building an arm with salvaged steppers. This is the second arm I have built. The first one was built using steppers and servos and only had 4 dof plus gripper and was controlled by an arduino and a couple of parallax joysticks. It was pretty limited in range of movement.
The new arm will have 6 dof and substantial more power.
My question is about accelerating steppers from stop. I have been using the 'for' statement in arduino to accelerate and decelerate. example: for(x=0; x<100; x++) { stepper.setSpeed(x); step(1); }.......then continue stepping at speed and then to stop reverse that process. I have tested this and it does work and keeps the stepper from rough stop/starts.
Is this the best way to accomplish this and should I start and stop at 0 speed or higher?
« Last Edit: February 18, 2013, 05:24:59 PM by Azraels »
If your first post is, "I want to build a super complex robot with object recognition, etc..but I have never done programming or electronics...etc."
Your doing it wrong. Start Simple and Work Up.

#### jwatte

• Supreme Robot
• Posts: 1,345
##### Re: Stepper acceleration/deceleration
« Reply #1 on: February 18, 2013, 05:18:17 PM »
That seems like a reasonable way of doing it, assuming you can get the timing right -- there's no delay built-in that loop, so it may get to full speed pretty quickly. (Maybe "step" does some delaying?)

Also, if step() does the delay based on speed, then you will actually speed up at a slower rate of acceleration in the beginning.

Best would be to use (or build) a library that has built-in support for trajectory ballistics like this, where you can say "go to speed X with an acceleration of Y" and it takes care of it using proper math and interrupts/timers.

#### newInRobotics

• Supreme Robot
• Posts: 1,015
• N.I.R.
##### Re: Stepper acceleration/deceleration
« Reply #2 on: February 19, 2013, 02:13:10 AM »
Is this the best way to accomplish this [...]
In industry it is common to use fuzzy logic to achieve what You want.
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian W

#### jwatte

• Supreme Robot
• Posts: 1,345
##### Re: Stepper acceleration/deceleration
« Reply #3 on: February 20, 2013, 11:19:37 AM »
Quote
In industry it is common to use fuzzy logic to achieve what You want.

Really? I can't find a "fuzzy logic" controller from Kollmorgen or Allen Bradley or Delta Tau, all of whom are large, industry leading motion control companies.
What industry, and what controllers, are you suggesting use bona fide "fuzzy logic"?

#### newInRobotics

• Supreme Robot
• Posts: 1,015
• N.I.R.
##### Re: Stepper acceleration/deceleration
« Reply #4 on: February 20, 2013, 11:44:59 AM »
Quote
In industry it is common to use fuzzy logic to achieve what You want.

Really? I can't find a "fuzzy logic" controller from Kollmorgen or Allen Bradley or Delta Tau, all of whom are large, industry leading motion control companies.
What industry, and what controllers, are you suggesting use bona fide "fuzzy logic"?
Just because You can't find any it does not mean it is not used Fuzzy Application Library/Technical Applications/Industrial Automation
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian W

#### jwatte

• Supreme Robot
• Posts: 1,345