April 8th, 2012, 01:30 PM
I have designed an XY table with two stepper motors. One stepper motor controls the x -axis and the other controls the y –axis. I simply send a command to the parallel port which in turn sends the command to the stepper motors. Each command sends one step. One hundred steps will move the x or y axis 1mm. That is 100 steps per mm. I know how to send enough steps to draw straight lines. A line 50mm long will mean 50 x100 =5000 steps. Eg: …for 1 to 5000 do PORT[$78] := #4 . This will send 5000 steps to the X motor and so on. However I do not know any circle or ellipse algorithm. Could anyone help me with some Delphi code to send steps for a circle? I shall appreciate all help.
April 8th, 2012, 05:40 PM
did you try researching about drawing algorithms? Try. Here is the Bresenham algorithm for line and circle. You can try implementing it in Delphi.