Newbie plotter question.

Hi,

Rather ambitiously (my second Ardunio project) I am trying to create a 2D plotter using an old Roland XY-plotter frame with intact stepper motors and Solenoid.

I have the hardware side completed and have used the sample sketches for stepper motors to get them moving about and drawing simple squares etc.

However, I have no idea how to implement drawing vector images from a computer?

I have investigated the G-code libraries and have absorbed as much as I can from the web on the subject of 2D and 3D Arduino plotters and printers.

Can anyone help me in understanding the steps I will need to take to take a simple vector image and get it to drive through the Arduino!

So far I am thinking the process is something like.

Image>Software>Serial>Arduino.

Many thanks for any help, rorroz.

you must implement a plotter language like HPGL

the essence comes down to

PD x1,y1 - pen down at x1, y1 PU x2,y2 - goto x2,y2 and do pen up

this generates a line from x1,y1 to x2, y2 - google for bresenham line algorithm how to implement this.

If this works you can work on circles and bezier curves which have a bit more difficult math (but only a bit).

Succes,

A common way to draw circles is the draw them as line segments. more segments for larger circles, with some minimum number of segments so they look good. Since you are moving a pen it isn’t as critical as compared to a machining operation, though delays at intersections can cause some bleed with a felt tip pen. I have an old commercial plotter and I use fine line Sharpies and some fine line ball point pens. You will need to play with them to get the best parameters. Speed is important. Some pens with write faster than others.

for motion - you need to be able to work in 2 coordinate systems - things like circles you need to be able to make your calculations as if the circle is centered at (X,Y)(0,0) and then be able to convert them to your “world” or drawing coordinates. It can all be done in incremental mode, but it is easier to visualize in absolute.

Incremental mode is where every move just references off its start. Absolute mode every position is relative to some (0,0) position on the machine/drawing.

An incremental square 2" from the corner looks like this move 2,2, move 1,0, move 0,1, move -1,0, move 0,-1
same for absolute - Move 2,2, move 3,2, move 3,3, move 2,3, move 2,2.