Go Down

Topic: Arduino chip as Stepper Controller (Read 12 times) previous topic - next topic

gharryh

Now i am confused. Do you use the dedicated chip to drive the stepper or the Arduino.
If you use the PC to send Direction and Step commands what does the Arduino do?

kf2qd

A stepper motor is 4 sets of coils that you power in sequence to cause the motor to rotate. Most programs that want to do motion supply a step and a direction signal.

Now there are various ways to do this. A circuit can be made using a counter and a 2 to 4 decoder, various stepper driver chips and all require some higher power dice to actually feed power to the motor windings.

One solution is a PIC based Stepper controller, but as I have no experience with PICs no programming tools, no other pic hardware...

So - I wondered what it would take to  do this with a AVR. Program size is 1560 bytes, so I could do this with something with only 2K, but would it have enough pins to do the other functions? ( ATtiny2313 might work, but I need programming hardware 2.88 for 3 = 8.64, 14.95 for programmer total 23.50 + shipping, Arduino chip - 5.50 for 3 = 16.50)

So  - I need a chip that will - at the least - take 2 inputs, 1 STEP and 1 DIRECTION. Depending on the state of the direction pin Step causes a counter to be either incremented or decremented. And base on the value of the counter (which has limits of 0 to 3) turn on the proper output(s). Simple stepping means that winding 1, winding 2, winding 3, or winding 4 will be on at any one time. (looks like 1, 2, 3, 4, 1, 2, 3, 4,..) or I could program in another sequence (I think it is called wave mode) would look like 12, 23, 34, 41, 12, 23,34,.... Halfstepping - 1, 12, 2, 23, 3, 34, 4, 41, 1, 12, 2, 23, 3,...

I can hook up whatever output transistors I want based on my current requirements an amp or 2, or 8 to 10 amps.

So - I have my Arduino, a resonator, 4 transistors and 4 diodes, hook 3 of them up to my computer (Mach3) and have a 3 axis CNC or Robot. Or hook 3 of them to an Arduino and have a 3 axis, all Arduino CNC.

gharryh

So you have ONLY 4 transistors. In all my circuitry i am using the example given here:
http://vimeo.com/6972843

But if you need to connect 3 steppers to the Arduino there are not enough outputs to work with.
Then one has to use a dedicated chip that only uses 2 or 3 inputs eg STEP, DIRECTION and mayby als ENABLE.

But there are even circuits somewhere on the net that uses the PC's printerport and then you dont need the Arduine.

kf2qd

I know  - I can buy a dedicated chip to drive the transistors to in turn drive a stepper motor.

Those chips all have their limitations and requirements. I was attempting to use an Arduino/AVR chip in a similar way to the PICStepper.

I have the logic working and I now need to see how fast it will function.

By using a programmable chip I can easily use standard stepping (1, 2, 3 ,4 ,1...)
or I can use wave stepping (12, 23, 34, 41, 12...)
or I can use Half Stepping (1, 12, 2, 23, 3, 34, 4, 41, 1...)

I can use an Arduino, a resonator, 4 transistors and 4 diodes and 4 resistors and a small piece of perfboard.

Some-one else has created a version that has microstepping abilities.

The Arduino doe not have to be the primary brain in a circuit to be use appropriately. Some times it can be an auxiliary circuit.

What i am looking at is this - can I put together a multi-axis system and could the Arduino be a useful part of the circuit? I have to get a few driver transistors and see just how fast the Arduino will switch and how fast I can run a motor using the Arduino as a  stepper controller.

1 Arduino with 2 inputs to the interrupt pins, and 4 pins outputting for the 4 phases of a unipolar stepper motor, to start. A couple H bridges and it would work with unipolar steppers.

Just because someone has already created a circuit for a function doesn't mean that we can't try to do it a different way. Using the logic that says that there are already chips out there to drive a stepper would also suggeswt that one should not bother trying to create a computer because someone else has already done that.

>gharryh -
>And how do you hook it up to a computer? I don't see any IO going on.
Read the code - interrupts are inputs. If nothing happens on the interrupt pins (pins 2 & 3 ) then nothing happens in the program. Interrupts are fast, non-polled (interrupt) inputs. When the pin meets the conditions in the interrupt definition line, the currently executing code is INTERRUPTED, and the appropriate routine is executed.
>Now i am confused. Do you use the dedicated chip to drive the stepper or the Arduino.
The Arduino becomes the dedicated chip that drives the stepper motor.
>If you use the PC to send Direction and Step commands what does the Arduino do?
It takes the step and direction signals and drives the outputs to the transistors that power the stepper motor. The Arduino is the STEPPER CONTROLLER CHIP.
>But if you need to connect 3 steppers to the Arduino there are not enough outputs to work with.
No, I use 3 arduinos setup as stepper controllers and each Arduino drives 1 stepper motor. Later I can add limit switch inputs or other functionality that I think I might want. In software it is rather cheap to try things. I can create a different version of my stepper controller and I don't have to use a soldering iron, instead I use my keyboard...
>Then one has to use a dedicated chip that only uses 2 or 3 inputs eg STEP, DIRECTION and mayby als ENABLE.
If you would have read my comments you would have seen that I am not trying to hook more than 1 stepper to the Arduino - I am trying to use the arduino as the stepper controller.
>But there are even circuits somewhere on the net that uses the PC's printerport and then you dont need the Arduino.
The I guess we should all scrap our Arduinos because we are all recreating stuff that is already out there, but in a different form than we might wish to use. And it would appear that you feel I have an obligation to fund these other projects, even if they are not quite what I want? You need to (to use an over-used phrase) think outside the box. In other words, try something different, just because, and see if maybe you can come up with a better, faster, cheaper, more personally satisfying solution for what you wish to do. After all - that is what the Arduino is all about.
I want a stepper controller as part of a system, Not a standalone Arduino making 2 stepper motors move. The arduino is probably overkill, but the chip is cheap, is easy to work with and I have them in hand. Maybe later I will get the stuff and try it with an ATtiny2313, but then I will have to learn a few different tools and I am just a bit lazy...

celem

kfqtd - Please follow up with future posts on your progress. The thought of using the ATtiny2313 as a component is appealing to me. I used to do similar stuff back in the Z80 days (I am a retired engineer) and the Arduino has sparked my interest anew. It has been fun to knock the dust off of my old soldering iron and tinker again. I used to use the Z80 in lots of interrupt driven situations and I am eager to see more sophisticated uses for the Arduino/ATtiny2313.

Go Up