controlling stepper motor drive

Hi all

Hope u all fine

Coming to the point, iam currently involved in a project in which i have to control stepper motor using stepper drive which operates at 24 to 85 vdc for which i have to give pulse, direction and enable input to control them.

The stepper library donot give pulse output.....

Can any one suggest me to control the stepper drive accurately using pulse, direction and enable output from arduino

and one more thing about the wiring

In my stepper drive i have a, -a. b, b- terminals and i have 4 wire stepper motor

i know that wires that have connectivity belong to the same pair...

i need to know which pair is a, a- and which is b, b-

Thanks in advance for the help

Use the AccelStepper library and select the DRIVER option. Or perhaps you don't need any library - have a look at this Simple Stepper Code

...R Stepper Motor Basics

hi all

Thanks Robin2 for ur reply

the example what u provoide is a very simmple that can only make the motor move...

But for accurate programming steps per revolution, pulses per revolution all those things have to be managed and to for inc/ dec the speed iam using a potentionmeter ...

then as i said earlier, in a bipolar motor i found the pair of wire that belong to a coil buut i dont how to find a, a' and b, b' or it is ok to revrse them

Hi,

i found the pair of wire that belong to a coil buut i dont how to find a, a' and b, b' or it is ok to revrse them

As long as you have identified the two pairs, you can call one pair a and the other b, then connect and swap the a pair around and then the b pair around to find a and a' and b and b',the result will be a stepper that rotates rather than stutters. Do this at low speedso you can see what is happening.. Turn the driver OFF before changing any connections.

Tom.. :)

AccelStepper would be fine to drive 4 steppers. Pls read carefully the documentation and as long as you don't want to run all motors at 500 RPM or more, AccelStepper will do.

Don't worry about a, a' etc. The only thing you have to look for is the right pairs that belong together. Then connect those pairs to your driver. If the motor turns the "wrong way", just swap ONE of the pairs around and then the direction reverses. Make sure, you don't connect or disconnect the motors while the driver is under power - this might fry it quicker than you expect.

muralid: the example what u provoide is a very simmple that can only make the motor move...

But for accurate programming steps per revolution, pulses per revolution all those things have to be managed and to for inc/ dec the speed iam using a potentionmeter ...

The examples are only intended to help you get started. You will need to extend them with your own code. or use the AccelStepper library.

...R

Hi all

Really thankyou all for your kind support....

Iam sorry i do have to ask few more questions

Actually my stepper drive has 7 to 8 dip switches among them 4 switches is for selecting the no of pulses per revolution.....

my question is should i match the selected one with the controller, (ie) should i anywhere include that in my code and make aware of my controller about it

Next quetion is how can i increase the speed of the motor.....

the speed of my motor depends up on how fast my controller give pulses so my question is how to increase that on off time as fast as possible ..... should i do that with timer or crystal oscilator or anything else

muralid: my question is should i match the selected one with the controller, (ie) should i anywhere include that in my code and make aware of my controller about it

Next quetion is how can i increase the speed of the motor.....

the speed of my motor depends up on how fast my controller give pulses so my question is how to increase that on off time as fast as possible ..... should i do that with timer or crystal oscilator or anything else

Those questions are really meaningless without being able to see your program.

It would be common for the program to know how many steps per revolution are made by the motor but it is really only essential if you want to be able to instruct the Arduino to move R revolutions rather than SSS steps.

What is the max number of step pulses do you wish to be able to produce in a second?

...R

Hi, Can you post a link to data/spec of your driver and stepper motor please. Also a picture of each will help too.

Thanks.. Tom... :)

hi,

Thanks Robin2, TomGeorge and rpt007

now

Can you post a link to data/spec of your driver and stepper motor please. Also a picture of each will help too.

Here is the link

http://www.rta-store.com/en/product/141751-azionamento-open-frame-a-ndc-06-v-advanced--andc6v

and about the motor

iam using SANYO DENKI'S 4 wire SANMOTION F SERIES MOTOR TYPE SH2863-5141 4AMPS 1.8DEG PER STEP

Those questions are really meaningless without being able to see your program.

It would be common for the program to know how many steps per revolution are made by the motor but it is really only essential if you want to be able to instruct the Arduino to move R revolutions rather than SSS steps.

Iam using the basic program of dual motor shield of accel library in which i have commented one motor since iam using only one motor to control

My stepper drive have the ability to run up to 12800 steps per revolution and my motor has the resolution of 1.8deg per step so 200 steps per revolution

With that how can i make it run and control my stepper motor efficiently and inc/dec te speed of my motor

Hi,

I looked up the datasheet of the driver. Unfortunately they only talk about optoisolated input but never mentionif it comes as common anode or common cathode type.

The wiring for common cathode - which I assume as there are two GNDs in the schematic - would be:

Arduino -> Driver GND GND GND -STEP, -DIR, -CURRENT OFF STEP PIN STEP IN + DIR PIN DIRECTION +

Motor -> Driver Pair A+ A A- A- Pair B+ B B- B-

plus Motor power supply.

Using AccelStepper with pin 5 as STEP PIN and pin 6 as DIR PIN, the contructor would look like

AccelStepper mystepper (1, 5, 6);

For powering the driver OFF you need one more Arduino pin to connect to +CURRENT OFF. But I don't have any idea what is expected (HIGH or LOW) to shut the current ON or OFF.

Maybe you can ask the supplier of the driver about + and - CURRENT OFF - how to control that driver input.

Hi,
OPs driver.

And Connection Diagram.
SteppDriverConnections.jpg
Tom… :slight_smile:

Hi,
This may help.

http://www.cnc-plus.de/PDF/Endst-NDC.pdf

Tom… :slight_smile:

hi guys,

I actually asked programming related question (may be i may require hardware support later :) )

as far now i dont have doubts regarding the hardware .....

:D

Hi, Its not the hardware performance we are looking at, we need to know how you need to communicate between the arduino and the driver, not all are simple digital input, some are 485, 232, PWM or analog.

Tom.... :)

muralid: Hi all

Really thankyou all for your kind support....

Iam sorry i do have to ask few more questions

Actually my stepper drive has 7 to 8 dip switches among them 4 switches is for selecting the no of pulses per revolution.....

my question is should i match the selected one with the controller, (ie) should i anywhere include that in my code and make aware of my controller about it

AccelStepper libraries knows nothing about your motor, it only knows about pulses, pulses-per-second, so if your stepper controller has 16x microstepping and is 200 steps/rev, then your code has to deal with the fact there are 3200 pulses/revolution - and program AccelStepper accordingly.

Next quetion is how can i increase the speed of the motor.....

the speed of my motor depends up on how fast my controller give pulses so my question is how to increase that on off time as fast as possible ..... should i do that with timer or crystal oscilator or anything else

Look at the documentation in AccelStepper.h itself - each function is described. Note that the way AccelStepper works limits it to a maximum of about 4000 pulses/second, which isn't great. (the code really wants hardware floating point)

The library completely relies on you calling run() in loop() as often as possible - in other words nothing that loop() calls should take more than a couple of hundred microseconds if AccelStepper is to run at its full speed.

Other ways to handle steppers involve timer interrupts and using fixed-point rather than floating-point arithmetic - I'm not sure if there is a good library that does it this way.

I think, I have said almost everything in my previous post about AccelStepper and the way the driver and Ardu could be wired.

There are so many sketch examples around that it should be easy to adapt them for the OP's purpose.

The 4000 pulses/sec might be a limit, depending on how fast the stepper should move. But there are people who have driven AccelStepper with 6000 pulses/sec without problems.

The most critical point imho is still about the "Current OFF" input of the driver which is not explained in the manual how to deal with it software wise; does it need a HIGH or a LOW to get activated/deactivated? So trial and error, I suppose.

I would start with microstepping pretty low, maybe leave the the "Current OFF" pin unconnected and see if the motor moves. Then go up "step by step" and see how far the configuration gets. After that test the Current off thing if needed at all in the planned project. I guess that the automatic current reduction takes place anyway while the motor stands still and "Current OFF" is equivalent to other drivers' "Enable" input.

But I am only guessing and only the manufacturer knows about that secret (hopefully).

Hi all

TomGeorge: Hi, Its not the hardware performance we are looking at, we need to know how you need to communicate between the arduino and the driver, not all are simple digital input, some are 485, 232, PWM or analog.

Tom.... :)

but as far as this driver is concern it has provision only for pwm input

MarkT: AccelStepper libraries knows nothing about your motor, it only knows about pulses, pulses-per-second, so if your stepper controller has 16x microstepping and is 200 steps/rev, then your code has to deal with the fact there are 3200 pulses/revolution - and program AccelStepper accordingly.Look at the documentation in AccelStepper.h itself - each function is described. Note that the way AccelStepper works limits it to a maximum of about 4000 pulses/second, which isn't great. (the code really wants hardware floating point)

The library completely relies on you calling run() in loop() as often as possible - in other words nothing that loop() calls should take more than a couple of hundred microseconds if AccelStepper is to run at its full speed.

Other ways to handle steppers involve timer interrupts and using fixed-point rather than floating-point arithmetic - I'm not sure if there is a good library that does it this way.

MarkT i have few questions for you

1] what is 16x microstepping 2] what is hardware floating point 3]how to handle stepper with timer interupts and what is fixed point and floating point arithmetic

Iam little sry greatly confused with 2 and 3 rd questions

rpt007: The 4000 pulses/sec might be a limit, depending on how fast the stepper should move. But there are people who have driven AccelStepper with 6000 pulses/sec without problems.

The most critical point imho is still about the "Current OFF" input of the driver which is not explained in the manual how to deal with it software wise; does it need a HIGH or a LOW to get activated/deactivated? So trial and error, I suppose.

I would start with microstepping pretty low, maybe leave the the "Current OFF" pin unconnected and see if the motor moves. Then go up "step by step" and see how far the configuration gets. After that test the Current off thing if needed at all in the planned project. I guess that the automatic current reduction takes place anyway while the motor stands still and "Current OFF" is equivalent to other drivers' "Enable" input.

But I am only guessing and only the manufacturer knows about that secret (hopefully).

1] you said that some used the accel stepper with 6000p/s can y please provoide the link that has the code or can u post here

regarding this my question is since it is related to the oscilator and the max of 16mhz is already taken to account how it is possible to generate 6000 p/s

2] abt current off/on few more explanation would be helpful

3] Can i further incease the speed of the pulses per second more than 6000p/s, if yes how that can be done

Thanks all for ur support really getting greatest exposure and more advancement in my project

muralid:
but as far as this driver is concern it has provision only for pwm input

I suggest you put your other questions on hold for a moment and concentrate on this point.

Why do you think it only has provision for PWM input?

Please provide an extract from the documentation that leads you to that conclusion.

I am not saying that you are wrong, it’s just that other stuff in this Thread seems to contradict it.

Until this is sorted out there seems little point considering other matters.

…R

Hi,
I think the OP has his PWM and variable frequency confused.
SteppDriverConnections.jpg
DIRECTION IN, is a logic HIGH or LOW depending on direction needed.

STEP IN, is a pulses signal, HIGH,LOW,HIGH etc to make the stepper move a step at a time (or 1/2 or what ever the driver is set at)
To change SPEED you change the FREQUENCY of the STEP IN signal.

CURRENT OFF is a logic HIGH or LOW to RUN or STOP the stepper.

Tom… :slight_smile: