Welcome! Log In Create A New Profile

Advanced

Arc mode?

Posted by tm america 
Arc mode?
November 14, 2014 01:56PM
I have a question about the standard arc mode with marlin?What arc mode is the default setting with marlin I or c?Does this get changed when going from a g90 to g91 or does it stay in the default mode?I am putting a couplle post processors together to work with my plasma,mill,-3d printers and need to know which mode to run for the arc support .I see g2 and g3 do arc dirrection but didn't see anything about arc mode?
Re: Arc mode?
November 14, 2014 03:29PM
In motion_control.cpp, the following function computes the motion for an arc command:

void mc_arc(float *position, float *target, float *offset, uint8_t axis_0, uint8_t axis_1, 
  uint8_t axis_linear, float feed_rate, float radius, uint8_t isclockwise, uint8_t extruder)
{      
  //   int acceleration_manager_was_enabled = plan_is_acceleration_manager_enabled();
  //   plan_set_acceleration_manager_enabled(false); // disable acceleration management for the duration of the arc
  float center_axis0 = position[axis_0] + offset[axis_0];
  float center_axis1 = position[axis_1] + offset[axis_1];
...

axis_0 is the I parameter and axis_1 is the J parameter. Based on that, since it's computing the center rather than it absolutely being specified, I'd say that it is I. Looking over the source I don't see anything that would indicate that an absolute mode is possible.
Re: Arc mode?
November 14, 2014 03:37PM
Awsome thanks alot..that's what i was looking for ..Now i know how to set up the post processor for what i am doing.Now i just gotta find the book c code for dummies?Cuz i really need some computer programming help ..
Re: Arc mode?
November 14, 2014 06:32PM
[arduino.cc]
i found the arduino reference page descriptive enough to be of some help. also in arduino ide there is a set of examples under file menu. the link is included above
Re: Arc mode?
November 14, 2014 06:43PM
That looks like it covers most of the ways things are writen.. i guess i get lost is digging thru the code figuring out where else things that make a certain thing happen are at?almost like a flow chart or gossary would be useful at this point..Something that would list roughly where things can be found in the code ?I realize this is not to practical as many people have added hundreds of lines of code to their firmware but it still could be a big help
Re: Arc mode?
November 17, 2014 09:35AM
You won't find that. You're right that it's not that practical. You really just need to follow the source code. How I found the likely answer was that I searched for "G2", one of the the g code for an arc in all the source code. Using a text editor like Notepad++ allows you to easily search through the entire source code. I got back a bunch of results that would include g2 somewhere in the variable name, but only Marlin.ino contained G2 as the complete string. Line 575 specifically was the start of the segment that handles the G2 code. From there, I got the functions get_arc_coordinates() and prepare_arc_move(). Searching for those functions then revealed that get_arc_coordinates then showed that it was pulling the offsets for the I and J parameters to G2...that didn't really tell us if the offsets were incremental or absolute though, although with setting a default of 0 if either parameter was a strong indicator it was only incremental offset...it just doesn't make sense to default to the origin for any arc.

prepare_arc_move() however first computes the hypotenuse based on the offsets, another strong indicator for incremental. The next line however calls the mc_arc() function that I posted above, which confirms that the offsets are being added to the position, making it incremental.

Nothing else in any of the functions has any significant branching logic to indicate that multiple modes are supported. I think this likely is because arc support I believe is pretty limited within slicers. Most slicers will just divide up an arc into many short, straight segments rather than computing the arcs. They aren't nearly as mature in all the features supported as their CNC machining big brothers.
Re: Arc mode?
November 17, 2014 12:52PM
Notepad++ great idea ..That would sure beat manually searching like i have been doing..I like it simple. Yes doing polylines instead of polyarcs makes the g code alot longer but it makes editing the nodes easier on many complex peices..The main thing i was looking for was being able to match the arc mode in marlin with the arc mode i am using in cambam..I do find other differences when using polylines vs polyarcs?When cutting circles with plasma polyarcs give better results as it can do the lead in then only have to see 4 direction changes so it can do so without accell and deccell like it might with polylines..But i don't see this being an issue with my machines running ramps-marlin as i am able to run insanely high accell rates.Making it able to maintain 400ipm in circles and other curves ...
Sorry, only registered users may post in this forum.

Click here to login