Pages: 1 2 [3]   Go Down
Author Topic: New stepper motor library with accelerations etc  (Read 10712 times)
0 Members and 1 Guest are viewing this topic.
Leighton Buzzard, UK
Offline Offline
Edison Member
*
Karma: 21
Posts: 1339
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!  :-[
Logged

there are only 10 types of people
them that understands binary
and them that doesn't

Leighton Buzzard, UK
Offline Offline
Edison Member
*
Karma: 21
Posts: 1339
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 <tab> character?!?

Code:
#######################################
# 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)
#######################################
Logged

there are only 10 types of people
them that understands binary
and them that doesn't

D / Wuppertal
Offline Offline
Jr. Member
**
Karma: 0
Posts: 64
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

0
Offline Offline
Jr. Member
**
Karma: 2
Posts: 81
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Jr. Member
**
Karma: 2
Posts: 81
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Cheers.
Logged

Auckland, New Zealand
Offline Offline
Newbie
*
Karma: 0
Posts: 17
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 http://www.piclist.com/techref/io/stepper/linistep/index.htm 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 smiley
Logged


Auckland, New Zealand
Offline Offline
Newbie
*
Karma: 0
Posts: 17
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

In my quest for MORE SPEED smiley
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.
Logged


St. Louis, Missouri
Offline Offline
Sr. Member
****
Karma: 1
Posts: 279
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Jr. Member
**
Karma: 2
Posts: 81
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@ahooper:

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

Logged

Auckland, New Zealand
Offline Offline
Newbie
*
Karma: 0
Posts: 17
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley

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.

Logged


Pages: 1 2 [3]   Go Up
Jump to: