PDA

View Full Version : control signals to draw a circle

lakmalp
15-06-2013, 03:18 PM
Hi,

This is my first post! :)

I am planning to build a 'plotter' and wondering how the X and Y stepper motors should be controlled. If a line to be drawn, should the X and Y motors be stepped as illustrated in the drawing? If so, when a curve is drawn controlling will be same?

9065

Red line is the line to be drawn
Pink line is the path of the pen

My intuition tells me that only one stepper is operated at a time. Your help would be greatly appreciated.

Thanks
Lakmal

irving2008
15-06-2013, 07:19 PM
Essentially you are right. Suggest you read

Bresenham's line algorithm - Wikipedia, the free encyclopedia (http://en.wikipedia.org/wiki/Bresenham's_line_algorithm)

for the basic line-drawing approach. While this will get you started however don't underestimate the complexity of handling the real-world mechanical issues of, for example, acceleration & deceleration, unless you can accept very low drawing speeds.

Both steppers could, and probably should, be operated at the same time to maximise smoothness of the line.

stirling
16-06-2013, 10:59 AM
You're entering the field of "XY Interpolation". I wouldn't worry at this stage about whether the XY motors step individually or at the same time - that's way down the road and when you understand how and when to step you'll find that sometimes the X leads and sometimes the Y and sometimes they'll step together. e.g. You've given an example of a 45 degree line and in that "special" case they can/will/should/may (depending on your implementation) both step together (IF you have the same "steps per" on X and Y).

With regards circles - for example if you start at 9 o'clock and draw clockwise, Y will lead until somewhere between 10 and 11 when both Y and Y will step together for (some) period and then X will lead until somewhere between 1 and 2 etc. etc. i.e. you'll discover you're interested in "octants" (as in half quadrants).

lakmalp
16-06-2013, 05:52 PM
Thanks and I think I got a lot of work to do. :)

Anyway ready to take the challenge and proceed. Hope you will help me whenever I am in need of help.

"Bresenham's line algorithm" being studied at the moment... :)

Thank you again for the guidance!