Advice on stepper motor implementation for telescope drive

Hi,

After spending many days looking and hacking some sketches in arduino, I'm kind of hoping to get some advice how to implement a drive control system using a stepper motor.

I realize steppers aren't probably ideal for this application but there are reasons we are going with this approach.

The basic idea is this... I have a stepper motor that spends most of it's life running clockwise at a fairly slow speed to counter the motion of the earth.... precisely, it runs at 178.2943 PPS clockwise.

When in this state, the precise speed of the motor is important.

Now while running at this speed, the user may put a button to command the motor to run at a faster speed ("slewing"), which is about 3000 PPS...... after releasing the button the motor must resume at ~178 PPS clockwise.

The user can also reverse the direction of the motor to spin counter clockwise.

I obviously need to implement so sort of acceleration/deceleration curve(s) to achieve this.

The issues are... the accel/decel cannot block. Once that button is released... it must decel as quick as possible to the steady ~178 clockwise rate...

It must accelerate quickly on button press like coming up to 3000 PPS in like 500ms. When running at these faster rates, precision is not as important.

I've looked at a bunch of libraries. I thought AccelStepper was going to be my savior but that appears to not be the case.

What I've found is all the libraries are "position centric" that is, they will accel/decel to a specific position but not merely accel/decel to change constant speeds (this motor will be running for hours on end). e.g. I thought I could command the accel library to reach some far off position then when it got there, just use the "runspeed" to continuously run the motor at the new speed. But it accelerates, then when it gets close to that position it decelerates.... and then sets the speed to zero.

Before I start hacking an existing library or writing my own, wondering if anyone has done something similar? Namely, running at constant speed and accel/deceling to new speeds based upon a user command (button press)?

Hardware wise (if it matters) is the stepper is a 19:1 gearmotor turning a 4000:1 geartrain.

Using an ardiuno due (faster clock speed).

BTW, anyone know how I can figure out if my board is using crystals or ceramic resonators? On my board, the only thing stamped on them is the frequency..... crystals needed for precision as noted above.

Thanks for any insights or advice!

It is not very difficult to implement acceleration in your own code. Have a look at this Simple acceleration code.

...R Stepper Motor Basics Simple Stepper Code

There's also the AccelStepper library for this.

A stepper is probably the best option for your task, as they are indeed designed for very precise control, and with the gear ratio you're looking at you should be getting nice and smooth movement of whatever it is moving.

wvmarle: There's also the AccelStepper library for this.

The OP indicated that he does not consider it satisfactory

...R

Steppers are clearly the most appropriate approach - the inconvenient alternative is a high-resolution rotary encoder, or indeed, a number of them!

The only problem is "homing". In this application, it seems (automatic) homing is not required.

It also took me a while to find out that AccelStepper can be run non-blocking as well... somehow the documentation doesn't make that clear, while to me it should be the preferred way.

blackhole2112:

Hardware wise (if it matters) is the stepper is a 19:1 gearmotor turning a 4000:1 geartrain.

Using an ardiuno due (faster clock speed).

BTW, anyone know how I can figure out if my board is using crystals or ceramic resonators? On my board, the only thing stamped on them is the frequency… crystals needed for precision as noted above.

here is a link, read post #3

==============

ramping. If you look at the image of your target, you should be able to press your ‘rapid’ button and move to center your image. The period of time you have your finger on the button, you could send 2x speed, or some fixed speed, or, you could have multiple buttons. Button #1 moves the device by 1 field of view. Button #2 by 1/2 field of view, and so on. that way, the ramp up and ramp down would be included in the total movement.
a FWD and REV button would handle the direction.