Stepper Motor Controller and the ATMEGA168

Go To Last Post
21 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello guys and girls, got quite an interesting project on the go and was wondering if i could get some basic information?

iv worked out i need a system consisting of 2 Stepper Motors working in unison, contorted by my beloved stand alone ATMEGA168 boards, iv finally got the hang of making (thanks again to everyone who helped).

but i have a very limited knowledge of running a MC into a stepper controller and could really do with some information on what pitfalls lay ahead, what i have to take into account and what the odds are of making my own Motor Controller to service both steppers.

(as usual I have no clue what Im doing so don't really know what information to include :oops:)

Thank you as always!

�The poorest man may in his cottage bid defiance to all the forces of the Crown."
-William Pitt the Elder (1763)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Tried google on steppers? There are plenty of sites on how to use steppers; here on 'freaks there a few threads on them too; recently one with links to a manafacturer's site with interesting application notes.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Have you decided on a specific motor? Is it unipolar or bipolar?

For a bipolar there are very nice chips ready off the shelf. They contain the H-bridge and a "chopper" circuit making the most effective use of the power used. You'll need a supply voltage quite a bit higher than the nominal voltage for the motor though. A few components are needed external to the chip (current sese resistor, RC to determine chopper frequency, and "back EMF" diodes. Some have the RC and/or the diodes built in).

My favourites, for no special reason other than that they work great and that I know how to use them, are the NJM377x chips. Readily available at Mouser (and IIRC DigiKey has added them to the roster lately). The "interesting application notes" mentioned above are from NJR who makes the NJM chips, and I pointed to them in this thread: https://www.avrfreaks.net/index.p...

For unipolars I'm out of here. No special reason. Just never used them.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

JohanEkdahl wrote:
Have you decided on a specific motor? Is it unipolar or bipolar?

Was going to go with Bi, as i have two to hand

JohanEkdahl wrote:

For a bipolar there are very nice chips ready off the shelf. They contain the H-bridge and a "chopper" circuit making the most effective use of the power used. You'll need a supply voltage quite a bit higher than the nominal voltage for the motor though. A few components are needed external to the chip (current sese resistor, RC to determine chopper frequency, and "back EMF" diodes. Some have the RC and/or the diodes built in).

My favourites, for no special reason other than that they work great and that I know how to use them, are the NJM377x chips. Readily available at Mouser (and IIRC DigiKey has added them to the roster lately). The "interesting application notes" mentioned above are from NJR who makes the NJM chips, and I pointed to them in this thread: https://www.avrfreaks.net/index.p...

For unipolars I'm out of here. No special reason. Just never used them.

Excellent information and then for the link!

:D

�The poorest man may in his cottage bid defiance to all the forces of the Crown."
-William Pitt the Elder (1763)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Was going to go with Bi

IMO a good choice. Bipolars have clasically been deemed more difficult to drive, but that has changed with several good H-bridge, chopping, ICs. OTOH, talking in their favour is the fact that in a unipolar you only use half the winding at any time. Bipolars have a whole winding enegized not half of it, thus you'll get moore ooomph per size.

Yes, the NJR appnotes are excellent. IIRC one of them explains in a very good way why a chopper makes much more effective use of the electrical energy. It's been a while since I read them though, and my memory might be failing me.

Good luck, and let's hear about your stepper motor eneavours!

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have used the Allegro A3967 chip, packaged by Sparkfun on the EasyDriver board. Built-in microstepping. Only "step" and "direction" inputs required from the microcontroller. Cannot be any easier.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

andreie wrote:
I have used the Allegro A3967 chip, packaged by Sparkfun on the EasyDriver board. Built-in microstepping. Only "step" and "direction" inputs required from the microcontroller. Cannot be any easier.

Thank you, that may save me little time!

This is the plan, so any input is more then welcome (as i have no clue what im doing)!

�The poorest man may in his cottage bid defiance to all the forces of the Crown."
-William Pitt the Elder (1763)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Interesting solution I must say ;) But I think the pen will not be stable, you need a third force.

Most plotters work by moving an arm on a belt or steel wire on the X axis; This wire runs on two spools, one driven by the stepper. The arm itself contains a similar construction to move the pen in the Y axis.

If you really want to save time, maybe buying an old plotter is a better solution :D

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Very valid points jayjay, b u t......I was thinking the counterweight will help with maintaining contact on the Y axis, and the use of a belt over wire could provide Stability on the X, or the addition of a stabilizer that maintains contact each side of the pen could help?????

To me the key is space and potability, and with this setup i can pack it into a small bag and am only limited to the length of the belt i use, not the Bed size of a fixted plotter....resulting in a cheap, and simple plotter i can use to mark out sections of large murals/scean or works of art.

But please keep it comeing!!!!!!

�The poorest man may in his cottage bid defiance to all the forces of the Crown."
-William Pitt the Elder (1763)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You may want to look at this guy's design. He's doing a similar control thing, and uses a solenoid to lift the pen.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

timgoh0 wrote:
You may want to look at this guy's design. He's doing a similar control thing, and uses a solenoid to lift the pen.

Thank you timgoh0,

found this as well http://www.hektor.ch/ and plant to steal as much as I can from all there hard work!

think I will try with pen before spaypaint......but the option of paint is a dream come true.

if only it was a open source project :cry:

�The poorest man may in his cottage bid defiance to all the forces of the Crown."
-William Pitt the Elder (1763)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ok.....ummmm....any idea where I could ask the following question:

Is there a way take Illustrator vector files,
translating them to commands for 2 step motors run by AVR?

�The poorest man may in his cottage bid defiance to all the forces of the Crown."
-William Pitt the Elder (1763)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Illustrator can export to svg files, if I am not mistaken. SVG files are easily parsable XML files. Which would be nicely parsed on your system into motor control commands.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you timgoh0, your my new best friend!

Is there any chance you could give me some more information on where to research this, as iv had no experience with XML.

(do you think it is something someone with little experience will be able to do?)

please feel free to PM me if you have any questions or advice.

�The poorest man may in his cottage bid defiance to all the forces of the Crown."
-William Pitt the Elder (1763)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ok got my motors working though L293D Stepper Motor Driver and am starting to grasp plotting comands baced on this handy awnser

Quote:

Re: help with vector to stepper motor
Reply #3 - Today at 12:58:08
It is a simple matter of Pythagoras. Let your pen be at point P and motors at A & B separated by a length L. Draw this upside down with A on the left B on the right and P some point above the two.
You need to find two quantities the length AP and the length BP, given a value of X and Y (the Cartesian coordinates of the pen P).

So from the diagram you will see that AL is given by the square root of X squared plus Y squared. And the length BL is given by the root of (L-X) squared plus Y squared.

So to move to any point with a straight line make sure your motor produces the right number of steps to adjust both strings in the same unit of time.

still having so issues on how I can run this as a stand alone unit rather then using a serial connection to a computer and interfacing with a vector image file>stepper commands.

Any chance of some suggestions or a mentor!

�The poorest man may in his cottage bid defiance to all the forces of the Crown."
-William Pitt the Elder (1763)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Choose a file format for the files to be plotted... hpgl or similar might be a goos choice. Write these files to an sd card on a pc. Read the sd card on the avr and plot away!

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I like your style bobgardner, so efectivly im bulding a custom plotter and creating a simple printer driver for it on hpgl.

Then storing the image (vector code) on a SD Card to be read by the AVR who in turn send commands to the L293D Stepper Motor Driver......sounds exactly what Im after!

so next my questions are:

1: Anyone have a good guide on hpgl and how dose it relate to C (my programming skills are basic to say the least)?

2: Can I export or convert an adobe illistrator vector image to hpgl

3: Information on how get a AVR to read from SD card rather then serial (serial though the Arduino board being the only thing i have experience with)

�The poorest man may in his cottage bid defiance to all the forces of the Crown."
-William Pitt the Elder (1763)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Wik I ped Ia? nope, cant say I have ever heard of it!?

but I hear good things about this Goo-gle! ;)

�The poorest man may in his cottage bid defiance to all the forces of the Crown."
-William Pitt the Elder (1763)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Having some trouble finding a tutorial on HPGL2, or how to interface C and HPGL2 into a single code. (Other then http://en.wikipedia.org/wiki/HPGL)

any resource or experience would be sincerely appreciated!

starting to feel so near.....yet so far!

�The poorest man may in his cottage bid defiance to all the forces of the Crown."
-William Pitt the Elder (1763)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

icterror: did you try this interpreter: http://hpgs.berlios.de ? It seems to be a HPGL2 interpreter for which you can add your own devices, like custom-made plotters.

The Dark Boxes are coming.