# diagonal motion in cnc by stepper motor



## maham ahmed (Aug 5, 2014)

hi every1! i am designing my own 2d cnc machine....we have to do linear motion for which we are using G01 and G00 code
like G00 x07y04

like in above example our both motors (x and y)will move simultaneously and the tool will move in diagonal line ..... the speed of both motors will decide the angle of diagonal line like in above example the speed motor x will be greater as compare to motor y(as the angle of diagonal line would be less than 45 degree).

but the problem is if we are using G01 command so it consist the feedrate for eg G01 x07y04F200 ...and our spindle speed should be according to this feedrate ...and our spindle speed depends on the speed of both x and y motors...so how could we change the speed of our both motors..because if we set the speed of our motors according to this feedrate then the angle of diagonal line will be changed and then we wont be able to achieve the target coordinate.

another thing is we have only 1 feedrate value means our bith x and y motors will have same speed corresponding to that feedrate so in that case the angle of diagonal line will always be 45 degree and we wont be able to achieve the target coordinate.

kindly help us ...how could we sort out this problem????how could we relate that feedrate with the speed of x and y motors??? and how can we achieve 2 different speed of both motors by the same feedrate??


----------



## Semipro (Mar 22, 2013)

Maham, welcome to Router Forums, glad to have you join us, I'm positive the members of the community would be more than willing to answer any questions you have


----------



## Check twice! (Feb 11, 2008)

Hi Maham, welcome to the forums.

My understanding of a CNC is that it has three basic needs for your steppers to function proper.

1. A design program, to layout what you would like to do. 

2. A translating program, like Mach3 or similar, to take the information from the design program and translate it into a machine language.

3.A control box to (we built our own) take the information from Mach3 and properly assign a pulse to the appropriate stepper at the right time. 

Now that is a simple breakdown as to how a homemade machine works,,,or at least ours did. 

Hope this was what you are looking for,, if not I am sure someone will help you or give you better direction.

Have a fine day.


----------



## old55 (Aug 11, 2013)

Welcome to the forum Maham.


----------



## bgriggs (Nov 26, 2008)

Use an S command to set the spindle RPM.


----------



## bgriggs (Nov 26, 2008)

F command is the feed at which the motors will move in either inches per minute or mm per minute (your choice).

S command is the speed of the spindle rotation per minute RPM

G0 is a rapid positioning movement (you are not cutting just moving between points)

G1 is linear interpolation move. From one place to another while cutting.

There are many more codes but that should get you started.

Bill


----------



## 4DThinker (Feb 16, 2014)

Most controllers given start and end coordinates will calculate to maintain the set feed speed straight or diagonally. You shouldn't worry about it unless you are writing your own g-code interpreter/controller firmware.


----------



## wisconsin-knight (Sep 4, 2014)

*Is Alibre still around?*

I would PM you but I don't have 10 posts yet. With any luck, I'll never have that much to say.

You mention Alibre in your post. I purchased a version about 6 years ago and I have the book, CD's and Tutorials. I don't have my user name or password. (I forgot.)

Is there anyway to contact Alibre? The only thing I have found is they appear to have been sold. I get no response from new company.

I would love to be able to use this software now.

Rowland


----------

