cnc diagonal motion and speed problem!!!

Discuss your first ever printrbot print

cnc diagonal motion and speed problem!!!

Postby arshia » 2014-Aug-Tue-10-Aug

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??

help me out !!!!!
  • 0

arshia
Waiting to connect to printer...
 
Posts: 9
Joined: 2014-Jul-Fri-10-Jul
Reputation: 0

cnc diagonal motion and speed problem!!!

Sponsor

Sponsor
 

Re: cnc diagonal motion and speed problem!!!

Postby Mach-Chris » 2014-Aug-Tue-11-Aug

If you want to vary the angles, don't rely on speed differences, change your X or Y coordinates.

EX. starting at X0 Y0

G1 X25.0 Y25.0 F100. (45 degree line)
OR
G1 X43.3 Y25.0 F100. (30 degree line)

In essence this will on its own vary the speed of each respective motor to achieve a 100unit feedrate while traversing the desired angled linear motion.

Edit*
Its worth mentioning that your block of code responsible for the angle is either in absolute or incremental, and you will yield very different results depending on which positioning system you are using

Absolute is all predicated on your starting position and all subsequent coordinate call outs are referenced always in relation to that starting position of X0Y0

While incremental positioning will move in a distance with respect to where the spindle was at the beginning of that line of code.
  • 0

Visit Matrix Online!
Follow us on Twitter! @MatrixPrecision
User avatar
Mach-Chris
Support material...
 
Posts: 403
Joined: 2014-May-Mon-07-May
Location: Ottawa, Canada
Reputation: 38

Re: cnc diagonal motion and speed problem!!!

Postby thawkins » 2014-Aug-Tue-11-Aug

Mach-Chris wrote:If you want to vary the angles, don't rely on speed differences, change your X or Y coordinates.

EX. starting at X0 Y0

G1 X25.0 Y25.0 F100. (45 degree line)
OR
G1 X43.3 Y25.0 F100. (30 degree line)

In essence this will on its own vary the speed of each respective motor to achieve a 100unit feedrate while traversing the desired angled linear motion.

Edit*
Its worth mentioning that your block of code responsible for the angle is either in absolute or incremental, and you will yield very different results depending on which positioning system you are using

Absolute is all predicated on your starting position and all subsequent coordinate call outs are referenced always in relation to that starting position of X0Y0

While incremental positioning will move in a distance with respect to where the spindle was at the beginning of that line of code.


Marlins planner calculates the rate of change of velocity on each motor, so that

a) the path traveled is a smooth linear vector between the start and end coordinates.
B) the feedrate is applied along the direction of the vector , not on each individual contributing x and y motion.

That is basic functionality that is built into all controler programs, grbl, marlin, teacup, sailfish, and sprinter. Most came originaly from grbl.

There is a new version of grbl soon to be released, (its on github) that not only supports the mega2560, not just the uno/328p, but potentialy could run on both the RAMPS card and the printrboard. It has a new planner that claimes to step at rates up to 4x faster and 10x smoother than marlin or others. It impkements all the smooth vector stepping with feedrate management. Grbl is designed specificaly for CNC use. Unlike previous versions of grbl, it can also be compiled and uploaded with a standard aurduino IDE. Previous versions had to use the gcc-avfr toolchain directly, and uploaded via a isp or dfu/cdc util. The latest version also claims to be far more robust, and claims to be able to easily handle 1.4million line gcode files on a standard 328p processor with only 32kb flash, and 2kb ram. And 1kb eeprom.

See https://github.com/grbl/grbl
  • 0

Jonbot+
225mm x 200mm - Heated Bed
RAMPS 1.4 running Marlin 1.1.0
Full Graphic display.
-------------------------------
Zen Toolworks CNC/3d printer
230mmx360mm bed
Dual j-head hotends.
Dual heated beds.
RAMPS 1.4 running Marlin 0.98
-------------------------------
Flashforge 3d Creator Pro
Dual Extruder
220x143x150mm
Mightyboard rev e, runnimg Sailfish 7.7r1234
-------------------------------
Photon, self designed printed printer.
User avatar
thawkins
Print winner 2nd
Print winner 2nd
 
Posts: 1636
Joined: 2013-Aug-Sun-10-Aug
Location: Manila, Philippines
Reputation: 172

Re: cnc diagonal motion and speed problem!!!

Postby arshia » 2014-Aug-Wed-11-Aug

Mach-Chris wrote:If you want to vary the angles, don't rely on speed differences, change your X or Y coordinates.

EX. starting at X0 Y0

G1 X25.0 Y25.0 F100. (45 degree line)
OR
G1 X43.3 Y25.0 F100. (30 degree line)

In essence this will on its own vary the speed of each respective motor to achieve a 100unit feedrate while traversing the desired angled linear motion.

Edit*
Its worth mentioning that your block of code responsible for the angle is either in absolute or incremental, and you will yield very different results depending on which positioning system you are using

Absolute is all predicated on your starting position and all subsequent coordinate call outs are referenced always in relation to that starting position of X0Y0

While incremental positioning will move in a distance with respect to where the spindle was at the beginning of that line of code.



how can u say that at G1 X43.3 Y25.0 F100. ..the line will be of 30 degree?? whats the criteria for this ? what is the formula for this?
how can i determine the angle of diagonal line through the starting and ending coordinates??
and in that case you mentioned speed of bboth motors would be same ...right???
  • 0

arshia
Waiting to connect to printer...
 
Posts: 9
Joined: 2014-Jul-Fri-10-Jul
Reputation: 0

Re: cnc diagonal motion and speed problem!!!

Postby thawkins » 2014-Aug-Wed-12-Aug

arshia wrote:
Mach-Chris wrote:If you want to vary the angles, don't rely on speed differences, change your X or Y coordinates.

EX. starting at X0 Y0

G1 X25.0 Y25.0 F100. (45 degree line)
OR
G1 X43.3 Y25.0 F100. (30 degree line)

In essence this will on its own vary the speed of each respective motor to achieve a 100unit feedrate while traversing the desired angled linear motion.

Edit*
Its worth mentioning that your block of code responsible for the angle is either in absolute or incremental, and you will yield very different results depending on which positioning system you are using

Absolute is all predicated on your starting position and all subsequent coordinate call outs are referenced always in relation to that starting position of X0Y0

While incremental positioning will move in a distance with respect to where the spindle was at the beginning of that line of code.



how can u say that at G1 X43.3 Y25.0 F100. ..the line will be of 30 degree?? whats the criteria for this ? what is the formula for this?
how can i determine the angle of diagonal line through the starting and ending coordinates??
and in that case you mentioned speed of bboth motors would be same ...right???


http://www.physicsclassroom.com/class/v ... t-Problems

The speed of the motors on a 30 degree vector is different on each axis as each motor has to cover different distances in the same amount of time. If the distances where the same then it would be a 45 degree vector and then the speed of each motor would be the same.

0,0 -> 43.3,25.0 is a 30 degree vector
0,0 -> 43.3,43.3 is a 45 degree vector
  • 0

Jonbot+
225mm x 200mm - Heated Bed
RAMPS 1.4 running Marlin 1.1.0
Full Graphic display.
-------------------------------
Zen Toolworks CNC/3d printer
230mmx360mm bed
Dual j-head hotends.
Dual heated beds.
RAMPS 1.4 running Marlin 0.98
-------------------------------
Flashforge 3d Creator Pro
Dual Extruder
220x143x150mm
Mightyboard rev e, runnimg Sailfish 7.7r1234
-------------------------------
Photon, self designed printed printer.
User avatar
thawkins
Print winner 2nd
Print winner 2nd
 
Posts: 1636
Joined: 2013-Aug-Sun-10-Aug
Location: Manila, Philippines
Reputation: 172

Re: cnc diagonal motion and speed problem!!!

Postby arshia » 2014-Aug-Wed-14-Aug

thawkins wrote:
arshia wrote:
Mach-Chris wrote:If you want to vary the angles, don't rely on speed differences, change your X or Y coordinates.

EX. starting at X0 Y0

G1 X25.0 Y25.0 F100. (45 degree line)
OR
G1 X43.3 Y25.0 F100. (30 degree line)

In essence this will on its own vary the speed of each respective motor to achieve a 100unit feedrate while traversing the desired angled linear motion.

Edit*
Its worth mentioning that your block of code responsible for the angle is either in absolute or incremental, and you will yield very different results depending on which positioning system you are using

Absolute is all predicated on your starting position and all subsequent coordinate call outs are referenced always in relation to that starting position of X0Y0

While incremental positioning will move in a distance with respect to where the spindle was at the beginning of that line of code.



how can u say that at G1 X43.3 Y25.0 F100. ..the line will be of 30 degree?? whats the criteria for this ? what is the formula for this?
how can i determine the angle of diagonal line through the starting and ending coordinates??
and in that case you mentioned speed of bboth motors would be same ...right???


http://www.physicsclassroom.com/class/v ... t-Problems

The speed of the motors on a 30 degree vector is different on each axis as each motor has to cover different distances in the same amount of time. If the distances where the same then it would be a 45 degree vector and then the speed of each motor would be the same.

0,0 -> 43.3,25.0 is a 30 degree vector
0,0 -> 43.3,43.3 is a 45 degree vector


okay i have got your point that how can i determine the diagonal angle through the starting and ending coordinates....
now i wanna ask a question is that i want to rotate my motors for example in 30 degree diagonal line...so both x and y motors will move simultaneously...but what should i set the speed of my motors so that it will move in 30 degree diagonal path not in any other diagonal path for eg 45 degree path....because if the speed would be same of both motors the tool will move in 45 degree diagonal path.....but if want to move in other than 45 degree path what would be the relation of speed of both motors and angle???
  • 0

arshia
Waiting to connect to printer...
 
Posts: 9
Joined: 2014-Jul-Fri-10-Jul
Reputation: 0

Re: cnc diagonal motion and speed problem!!!

Postby Mooselake » 2014-Aug-Wed-17-Aug

Arshia, did you get a chance to review those CNC articles I linked to in response to your previous post? If those didn't help, I suggest you spend a little time doing some research. Google can help you.

There is a lot of available information on CNC motion control.

Good Luck!
Kirk
  • 0

Modified KickStarter Classic Plus 7/2012
KS Thingybot Delta Pro 10/31/16
User avatar
Mooselake
My next printer is...
 
Posts: 3604
Joined: 2011-Dec-Tue-23-Dec
Location: Moose Swamp, Upper Michigan, USA
Reputation: 177

Re: cnc diagonal motion and speed problem!!!

Postby thawkins » 2014-Aug-Wed-21-Aug

Mooselake wrote:Arshia, did you get a chance to review those CNC articles I linked to in response to your previous post? If those didn't help, I suggest you spend a little time doing some research. Google can help you.

There is a lot of available information on CNC motion control.

Good Luck!
Kirk



The subject matter that you should be looking at is.

Motion kinimatics as applied to cartesian robots.

You also need to get off this speed and angle model of motion, those are values you can calculate to describe what is happening with motion, as an aid to understanding, but they are not useful for creating an algorythm, as they are ballistic, most kinimatic systems use a constrained goal seeking mechanism, where the motion controler is using an interupt mechanism to refine the pulse trains it is generating against the goal of arriving at the destination point. Its like an advanced version of the breshnam lineDDA algorythm used in 2d graphics, except breshnam does not have to deal with feedrates, acceleration and jerk. Acceleration is the rate of change of feedrate (speed), jerk is the rate of change of acceleration.

If you want to undestand this then go and read the source code for grbl (http://github.com/grbl/grbl). Its very well explained in there, and is the baseline implementation that is used by most 3d printer controller firmwares (MARLIN is based on grbl's kinimatics implementation). Accelleration/deacceleration management and jerk managemnt further complicate the problem by introducing motion profiles, plus the system has to be able to deal with hardware inertia which effects things like cornering and direction reversal.
  • 0

Jonbot+
225mm x 200mm - Heated Bed
RAMPS 1.4 running Marlin 1.1.0
Full Graphic display.
-------------------------------
Zen Toolworks CNC/3d printer
230mmx360mm bed
Dual j-head hotends.
Dual heated beds.
RAMPS 1.4 running Marlin 0.98
-------------------------------
Flashforge 3d Creator Pro
Dual Extruder
220x143x150mm
Mightyboard rev e, runnimg Sailfish 7.7r1234
-------------------------------
Photon, self designed printed printer.
User avatar
thawkins
Print winner 2nd
Print winner 2nd
 
Posts: 1636
Joined: 2013-Aug-Sun-10-Aug
Location: Manila, Philippines
Reputation: 172


Return to My first blob

Who is online

Users browsing this forum: No registered users and 1 guest

cron