Announcement

Collapse
No announcement yet.

Circular interpolation?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Circular interpolation?

    Can someone explain the syntax of circular interpolation? I've tried a couple of times to input a G2 command on a BOSS 5 but I don't get the results that I am expecting. On the BOSS 5 as I understand it, if you put a second X and value and second Y and value in a block it will be interpretted as an "I" and "J" value. I have tried this method and I have tried sending the command block from the PC where I can input "I" and "J" values directly but I'm still missing something. For the time being I am wittling away at some pieces of wood with a 3/8" bit. My proceedure is to enter my GCode, send it, then zero my axis and set my TLO and then run the code. I want to get a feel for GCode before I dig into automated GCode authoring tools.
    Thank you in advance,
    Spence

  • #2
    Download Craigs trial version of Qstep. It has a teach mode for people unfamilar with gcode.
    It draws on screen, instead of cutting wood, you could be drawing with 3d your commands.

    books are on the way Spence.

    Comment


    • #3
      Thanks Ibew,
      I'll take a look at that program. Still there is a certain thrill in the discovery method. It certainly impresses upon you the reality of the machine. Hitting the emergency stop button becomes a natural reflex just as nature intended. I don't expect to be writing the code for all the complex work that I want to do, but I do want to be familiar with the code a little. I don't think it will be a wasted adventure.
      I'll keep you informed on the progress on this and the other project.

      Thanks,

      Spence

      Comment


      • #4
        Try entering the code using two x values and two y values as you described. The control may be very syntax sensitive. If that does not work start checking your math and check to see if you have to turn on tool comp.

        CT

        Comment


        • #5
          I work with the small machines (toys to many of you), but the code should be the same or very similar. G02 (clockwise circular interpolation)For example: If working in absolute coordinates (G90)and Inches (G20) And the current position of the tool is 1,1 a command like G02X3Y1I2J1 will swing a 1" radius clockwise arc that starts at 1,1 with a center point at 2,1 and ends at 3,1. The XandY coordinates are the ending point of the arc and the I and J are the centerpoint. If you used the G03 (CCW circular Interpolation) with the same numbers, you should complete the circle.

          Graph paper and a pencil are helpful when hand writing code, and a bit of math skill can't hurt.

          By the way, on my machines, if you pick an ending point in your coordinates that doesn't fall on the radius you've defined by your starting point and center point, the machine will spit back an error code. In other words, the starting and ending points have to be on the arc defined by the centerpoint you chose. Hope this helps.

          regards, Matt

          Comment


          • #6
            Spence,

            You need to know how the machine wants the I,J to be specified. Generally, machines either want the values to be the relative distance from the arc start to the arc center OR the absolute coordinates of the arc center.

            Example:

            Tool at X0, Y1. To cut a CW arc of 1" radius ending at X1,Y0.

            G02 X1 Y0 I0 J0, (this method uses absolute center corrdinates)

            G02 X1 Y0 I0 J-1, (this uses relative center coordinates, the values are relative to arc start)

            You don't have a choice between the two methods, you can only use the method that the control will accept and that's what your control manual should tell you. If you don't have a manual try both methods to see which one works.

            Comment


            • #7
              I think FANUC will accept an absolute ending point followed with a r value to produce an arc. This is not as accurate as the x,y,i,j syntax but will work.

              Comment


              • #8
                C. Tate,

                I wonder why an R value for arc radius would not be as accurate? Whether it's R, or I,J the control still has to do the same basic calculations.

                Different controls do have different tolerances with respect to allowable deviation off the arc of the specified end point coordinates. Is that what you're referring to?

                Comment


                • #9
                  > Whether it's R, or I,J the control still
                  > has to do the same basic calculations.

                  I,J method removes the abiguity of two potential centerpoints under R method. Consider the draftsman's process for determining the centerpoint knowing two endpoints and the radius:

                  Swing a compass, set to radius R, from both endpoints. The resulting two circles intersect at two points. Ambiguity... R Method therefore requires some additional parameter to specify a concave or convex arc... This is why I,J is more desirable.

                  At least it makes some sense me and I'm a mathemagician on microprocessors.

                  Comment


                  • #10
                    I understand what you're saying, but am not buying the argument. The parameter to remove the ambiguity of two centers would be the G02,03 wouldn't it?

                    Now that I think about it, from an accuracy standpoint, the "R" method will always produce an arc going through the current position and the target position.

                    The I,J method may not always yield an arc going exactly through the end point if that end point is specified slightly off, but still within the controls's tolerance of the true arc.

                    So I'd say that the R method will be generally more accurate in terms of putting an arc through two points.

                    Comment


                    • #11
                      I think another aspect of the I,J method that isn't present in the radius method is in the interpolation of the arc to the end point. That is, if the end point does not exist on the path of the perfect arc then the control must interpolate a curve to the point. I haven't done enough experimenting to fully understand yet, but that is my best guess.

                      Spence

                      Comment


                      • #12
                        > the "R" method will always produce an
                        > arc going through the current position
                        > and the target position.

                        If it were a draftsman. Its likely that the algorthm used requires the midpoint. While its simple to derive the center point as a draftsman, the microcontroller (8 bit or PDP11 in the old days) has to use a math library to get higher precision (lazy programmers use math libraries).

                        So in this scenario, given endpoints and R it mathematically deduces the centerpoint. As microprocessors of the G-Code generation seldom had multiply commands, a bunch of additions and trigonometric lookup tables were likely used. Compromises are made against binary accuracy and resolution versus human world decimal numbers. Accumulating errors build up in computing the center point from which a tainted arc is now struck.

                        Microprocessor math is seldom like what we expect from spreadsheets. By the rules of minimized chained calculations, you'd not want to derive the centerpoint and then calculate the arc from there.

                        As I've already pointed out, the R method suffers from ambiguity that requires an additional parameter. Simplifying the human interface by requesting the centerpoint coordinate simplifies the job for the programming AND the machinist. After all the machinists designs the arc curve using a compass and therefore has a defined centerpoint. Seldom does one take to endpoints and through in a connecting radius without using a centerpoint. Draftsmen would do this with a circle template but even that has markings to locating the center.

                        What is gained by R method? Nothing. It has three strikes against it: Ambiguity, Accumulating error, and Complication to the designer.

                        > I,J method may not always yield an arc
                        > going exactly through the end point if
                        > that end point is specified slightly off

                        I assume the GCode calculates a table of stepper movements before it runs the arc. Sinces its digital its going to run minute increments of X, Y and XY (if its good). Going through the generation of the table its able to confirm that given all resolution issues, the arc stepping arrived at the endpoint as intended.

                        From a mathematical viewpoint, R method appears more elegant and I think we engineers and scientists would be drawn to requiring the R method. I,J appears clumsy and low tech in contrast.

                        But in putting G-Code into practice it appears that practicality won out over beauty.

                        > R method will be generally more accurate
                        > in terms of putting an arc through two
                        > points.

                        Only for a draftsman. Not for a microprocessor control system (my forte).

                        > The parameter to remove the ambiguity of
                        > two centers would be the G02,03?

                        I don't know the G-Code specification. Someone mentioned CW and CCW and that would not remove the ambiguity. Either feasible circle could still be drawn CW or CCW - the ambiguity remains.

                        > additional parameter to specify a concave
                        > or convex arc

                        Between two endpoints the definition of concave and convex is even ambiguous. Say that you are simply routing a straight vertical line in a piece of wood. half way up the vertical you are to insert an arc between two endpoints and then proceed with the vertical line as before.

                        So which is concave and which is convex? Its not relative to a material fill so its has no meaning in line art of an open structure.

                        The ambiguity remains. The only valid additional parameter would be a third point on the curve. I,J this or I,J that... reductionism leads againt to I,J centerpoint method.


                        [This message has been edited by ChipWright (edited 08-06-2003).]

                        Comment


                        • #13
                          In what I have learned so far about the arc direction using the "R" method is that the direction is determined by the positive or negative value of "R" and that different controls behave differently.
                          I found out that the GCode required to describe things like lettering in complex fonts or objects with lots of complex curves will quickly exceed the machines memory. I wonder what improvements can be made. Does any one know if memory expansion beyond the "80 feet of paper tape" is possible with these machines? Is this where DNC becomes the advantage over CNC?

                          Spence

                          Comment


                          • #14
                            chipwright,

                            You wrote:"So in this scenario, given endpoints and R it mathematically deduces the centerpoint. As microprocessors of the G-Code generation seldom had multiply commands, a bunch of additions and trigonometric lookup tables were likely used. Compromises are made against binary accuracy and resolution versus human world decimal numbers. Accumulating errors build up in computing the center point from which a tainted arc is now struck."


                            You're a little off base here when you say microprocessors of the "G-code generation". G-code is still a viable language supported on virtually all modern controls and we aren't talking microprocessors, we're talking calculations done in assembly language or C or Basic or other high level language in CPU's with a complete set of mathematical operations. Calculations to 4 decimal places are not a problem.

                            And no, a third arc point is never needed. In your example of a straight line then an arc then continue the straight line, there's no problem. The G02 or 03 determines which way the arc goes.

                            You mentioned steppers, yes, they can have some limitations in arc cutting based on their angular resolution. Because of the resolution it may not be possible to exactly reach a specified end point. This usually is not an issue anymore because very few modern machines use steppers.

                            I see no difference whatsoever between the R or I,J methods other than the I,J method allows an error factor tolerance in the specification of end point. The amount of calculating required between the two methods may be vastly different, but that's not apparent to the operator or programmer. Some controls support both arc methods as a convenience to the programmer, not because one is better than the other.

                            Comment


                            • #15
                              OK, I could go into a three page lesson on this, for teaching CNC (10 years industrial), this is about lesson "four" in programming. The foundations of it all are the Absolute and Incremental coordinate systems, which I hope you have down.

                              The keys to arc programming are as follows:

                              1. does the arc cut clockwise or CCW from the last end point of cut and in relation to the direction of cut.
                              If you are cutting "up" in the Y axis from the operator, do you swing in a convex arc, or concave arc. The convex CW arc would be like swinging fom 9:00 (clock reading) to 12:00. The concave (CCW) would be like swinging from 6:00 to 3:00.

                              2. What is the "radius" of the cut.

                              3. What is the "relative / incremental" center point (incremental) of the center of the arc. I use the example of the old drafting table drawing, using a compass to draw an arc. Where do you plant the sharp point of the compass to draw the arc. This is the arc center point.

                              4. What is your desired "end point" of the arc from the start point.

                              5. In most controls, "R" vs "I" and "J" do not mix. You use either "R", or I and J method, but not both in the same line, though many controls accept both in a total program setting(some controls will not accept "R").

                              6. G02 is CW (clockwise). Two letters, thus "2" is a good memory standard. G03 is CCW (counterclockwise), three letters, thus "3" is a good memory standard.

                              I will write this simple program, done in absoulte coordinates, and using "R" in this example:
                              G00 x0y0 (rapid feed to start point)
                              g00 z.100 (rapid to safe height above part)
                              G01 z-.100 F1.0 (plunge cutter
                              G01 X0 Y1.0 F2.0 (st line move to first point)
                              G02 X2.0 y3.0 R2.0 (moved two inches up X, 2 inches over Y, R is 2.0 inches - This creates a 9:00 to 12:00 CW arc. Note the "end point" programmed, as it is always done in programming)
                              G01 X3.0 y3.0 (did not need Y in many controls, modal, also switched to straight line, a MUST, or the cut will still try to be a CW arc, or on a FANUC you will get the infamous P/S error, which means "Program stinks - because the arc info is incomplete, or previous info on center points or "R" will not "meet" the spec'ed end point)
                              G03 x4.0 y2.0 R1.0 (moved from 9:00 to 6:00 in direction, CCW arc, 1" radius(
                              G01 x4.0 y1.0 (straight line cut down to operator - remember you must "change" modes from arcs to straight lines with the "G" code.

                              OK, hope this helped with "R". Now the same program in I and J

                              I and J are "incremental" codes, the "I" being the incremental "X" direction of the arc center, "J" being the incremental "Y" direction of the arc center - INCREMENTAL TO THE START POINT OF THE ARC. "K" is the "Z" direction incremental, and used promarily on lathes, though in 3D milling I have used this.
                              Please remember what I said in the start about a compass, and planting the point of the compass to "strike" an arc.

                              G00 x0y0 (rapid feed to start point)
                              g00 z.100 (rapid to safe height above part)
                              G01 z-.100 F1.0 (plunge cutter
                              G01 X0 Y1.0 F2.0 (st line move to first point)
                              G02 X2.0 y3.0 I0.0 j2.0 - CW arc, 9:00 to 12:00. note that from the start point of the arc, the "center point", or where I put the compass point is exactly in line with the "X" axis (I), but two inches UP from the last point in the "Y" axis (J). The point would not be "3", BUT related to the start point, you would measure up if drawing the arc on paper to plant the compass point - you would measure UP (y) 2 inches
                              G01 X3.0 y3.0 (did not need Y in many controls, modal, also switched to straight line, a MUST, or the cut will still try to be a CW arc)
                              G03 x4.0 y2.0 I1.0 J0 (moved from 9:00 to 6:00 in direction, CCW arc, measuring from start point to arc center x+1.000, y0.000 to the plant point of the compass.
                              G01 x4.0 y1.0 (straight line cut down to operator - remember you must "change" modes from arcs to straight lines with the "G" code.
                              Now for fun:
                              G02 X3.5 y.5 I-.5 J0. Note the "negative direction of the "X / I" arc start point.

                              Use my link for my personal web site for a listing of general CNC Codes, feel free to print out as a reference - go to the CNC Codes page:
                              http://homepage.fcgnetworks.net/spope/

                              Feel free to e-mail me. Much of what was said above in the other links is also great knowledge about the use of "R" vs "I and J". Knowing both is also very essential, because most CAD/CAM programs use IJK as arc standards (unless you can rig the "posts" like I do, I prefer R, and CAD/CAM makes this accurate).

                              Scott.




                              [This message has been edited by spope14 (edited 08-06-2003).]
                              CCBW, MAH

                              Comment

                              Working...
                              X