New stepper motor library with accelerations etc

hi ,Mikem,
the documentation is great
i'm referring to the Overshoot.pde example. just curiosity. i don't really need this.

another question, more concrete, i am going to use the easydriver
can i specify analog pins to the Constructor? i ran out of digital ones...

also, i need an advice-
i will have two limit switch on either side of my dolly, which moves pretty slow.
should i use interrupts or is it ok to use regular digital read calls.

and thanks again for this library

yair

ok, i just checked and the lib accepts

AccelStepper stepper(1,A1,A0); //driverMode, stepPin, dirPin

Hi Yair,

The Overshoot.pde is intended to test the reaction of the library to the case where the target position is changed while the stepper is already tracking to more distant target position. IN this case the stepper will have to slow down and reverse direction mto achive the new target.

Analog pins: Ummm, dont think so?

Re limit switches and interrupts
prob it all depends on the cycle time of your polling loop and the max speed of the steppers. Need to be sure you have enough time prevent the next step after the limit switch is tripped.

Cheers.

i noticed that the speed i get from this library is lower then with using basic calls.
i think its beacuse i dont understand the setSpeed functions.
this code will move the stepper fast

void setup() {
  pinMode(3,OUTPUT); //step pin
  pinMode(4,OUTPUT); //dir pin
}

void loop() {
  digitalWrite(3,HIGH);
  delayMicroseconds(1000); //can handle 200
  digitalWrite(3,LOW);
}

the constantSpeed example with the setSpeed @ 1000 will move the stepper slower.
the manpage advises not to go over 1000 steps per sec.
is setSpeed(1000) and delayMicroseconds(1000) the same?
is this the price of multiStepper and non-blocking?

yair

ok, the problem was with my handling of the easyDriver.
it was microstepping.
when i pulled both sp1 and sp2 to ground it picked up speed and now setSpeed(1000) looks like a good limit.

thanks for the help Mikem

Hi,
Good job !

Is this library able to drive stepper in microsteppers mode ?

Thanks

hi jpeger,
you switch to microstepping mode by the following table

////// ED_v4 Step Mode Chart //
// //
// MS1 MS2 Resolution //
// L L Full step (2 phase //
// H L Half step //
// L H Quarter step //
// H H Eighth step //
// //
////////////////////////////////////
from here, more info on the hardware there also

Thanks,

But I think for my project this interface isn't so powerfull. It must be more than 1A.

So I need to find an other hardware solution for controlling 2 stepper in microstepping mode :frowning:

Have you some idear ?

er - Help!
I'm struggling with this
I have the Stepper library installed ok
it's in a folder called Stepper inside the library folder
works a treat

I unzipped the AccelStepper into the same (library) folder
it sits in a folder called AccelStepper
but the IDE (0021) seems to be unable to find it
it can't see the .h and whinges about the function "stepper" being undefined

ok what stoopid thing did I forget? :-[

I'm just trying one of the examples first btw

bugrit

found me little problem (no not that one nurse)

I had another folder called libraries
Now the software is in the right place it all seems to work

thanks for listening! :-[

and in order to repay your kindness
here's a keywords file "wot i rote"
the "shape" is odd as keywords.txt only seems to work with a single character?!?

#######################################
# Syntax Coloring Map For AccelStepper
#######################################

#######################################
# Datatypes (KEYWORD1)
#######################################

AccelStepper      KEYWORD1

#######################################
# Methods and Functions (KEYWORD2)
#######################################

moveTo      KEYWORD2
move      KEYWORD2
run      KEYWORD2
runSpeed      KEYWORD2
setMaxSpeed      KEYWORD2
setAcceleration      KEYWORD2
setSpeed      KEYWORD2
speed      KEYWORD2
distanceToGo      KEYWORD2
targetPosition      KEYWORD2
currentPosition      KEYWORD2
steCurrentPosition      KEYWORD2
runToPosition      KEYWORD2
runSpeedToPosition      KEYWORD2
runToNewPosition      KEYWORD2
disableOutputs      KEYWORD2
enableOutputs      KEYWORD2

######################################
# Instances (KEYWORD2)
#######################################
direction      KEYWORD2
speed            KEYWORD2


#######################################
# Constants (LITERAL1)
#######################################

Thanks for this great libary - this is exact what i have been seaching for.
Is there a little chance, that the possible pulse rate of 1kHz will become faster?
I have read about the problem on the first page of this thread.
I want to connect a microstepping Driver to the Arduino.
Are 10kHz (40kHz) possible?

@SachaW
not without significant modification to the software, which I am not planning.
Cheers.

@mmcp42
thanks for the the keywords. They will be in the next release.

Cheers.

This library is awsone and almost fullfills my needs. Im building a small RC boat that uses steppers for motors instead of brushed/brushless motors as the props I have are rated at about 2300rpm MAX.

The stepper controllers im using are from PIC Linear Stepper Motor Controller and are the earlier version of the linistepper. Nice and reliable.

I need to ramp up/down the motors in order to break the resonance barrier and found that the addition of a flywheel has helped this quite a bit.

It seems there is no ramp function on the runSpeed() function and the only other option is to set the steps of the run() really high.

I have calculated that for the best performance im goign to need to sent about 17khz to the linistepper however on my original test rig was more than happpy with 8khz so hopefully at some stage this becomes possible.

this has been an awsome addition to the community and thanks for your hard work :slight_smile:

In my quest for MORE SPEED :slight_smile:
I changed the following

//unsigned long time = millis(); //<-- replaced this
unsigned long time = micros(); //<-- with this

And

//_stepInterval = abs(1000.0 / _speed); //<-- replaced this
_stepInterval = abs(1000000.0 / _speed); //<-- with this

It seems to be working OK and has increased the range a huge amount.

There are a few pops and farts but i suspect these may be the tweater i am using so as to monitor the sound output.

I've never seen steppers used for propulsion. You ought to put your projection up in the Exhibition section, I'd be interested to see it.

@ahooper:

One reason I am reluctant to use micros instead of millis is that micros will wrap after ??20 something days

Yankee: There will be quite a bit of info about this little (well large) project once its done. Unfortunatly I can not give much info at this stage but it involves BEER :slight_smile:

If i can not get the speed out of the steppers i may have to implament a 1:3 gear system and rely on the torque of the steppers instead. The think is that steppers are robust and designed to runh day in day out so for our project it will be a walk in the park for them.

mikeem:
for our project we really just need to ramp the motor up run it at full speed, ramp either left or right motor down and up for course corrections or if we need to do tight turns one reverse one forward.

We have several stepping modes and 1/2 step seems to provide the best torque/speed relationship but it seems that even setting the time to micros instead of mills will not do the job as it seems we are hitting some limit as we are ramping up.

Im just about to upgrade the project from the ArduPilot to the ArduPilot Mega in the hope that i can use the timers for the controll as an alternative.