Announcement

Collapse
No announcement yet.

Problem with code?

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

  • Problem with code?

    Good Morning Guys,

    I am struggling with a project; more specifically I *think* the problem may be with either the way I've written code or perhaps my rational for writing code the way I have chosen. My explanation may be quite long and convoluted. Hopefully I don't screw this up and hopefully I am providing sufficient information.

    The project is to produce 6 spiral cuts, evenly spaced, in a piece of stock that's 14.9638" long AND the stock is tapered. Straight away, I completed the project but not without considerable manipulation of the program as cuts were being made. (See Attached Image)

    Particulars are as follows:
    1. Two points are chosen on the stock; a beginning point and the ending point.
    2. The distance between the two points is 14.9638".
    3. The beginning point has a diameter of 0.631 (minor diameter)
    4. The ending point has a diameter of 0.739 (major diameter)
    5. The amount of rise (elevation) that occurs between the minor diameter and major diameter is: 0.739 - 0.631 = 0.108/2 = 0.054".
    6. The spiral has a 360deg twist.
    7. When the entire program is executed, the finished depth of the cut should be 0.035" (at both ends)
    8. I am using a 3/8" 4 flute ball end mill (carbide)
    9. The metal is stainless steel
    10. The work piece is held at one end in a horizontal position using a 4 jaw chuck (4th axis) and supported at the other end by the tail stock. See attached image.
    11. Spindle Speed is 3740 RPM
    12. Feed rate is 6"/min
    13. Z feed rate is 0.5"/minute

    Problem:
    Each cut, when completed, *is* 0.035" deep at the starting point (minor diameter) but is *about* half that depth at the ending point.

    To accomplish what you see in the image I used the following *basic* program:

    I began by lowering the cutter to engage the work piece and then ZERO ALL.
    N01 G0 Z0.250 (up and away)
    N02 M3 S3740 (activate spindle)
    N03 G01 Z-0.005 F0.5 (lower cutter below ZERO Z )
    N04 G01 X-14.9638 Z0.054 W360.0 F6.0 (send cutter to opposite end while raising cutter as travel occurs to accommodate taper)
    N05 G0 X0.0 Z0.0 W0.0 (return to beginning)
    N06 M5 (spindle off)

    Repeat the above until program is complete.

    As stated, with each finished "slot" the major-dia-end is ALWAYS about half the depth it should be.

    To correct all cuts, I change Line 4 to read G01 X-14.9638 Z0.040 W360.0 F6.0. Doing this causes the cutter to skip over the first part of the cut and *begin* cutting approximately half way down the length so the remaining depth is attained.

    Any help would be appreciated.
    Harold

    For those having fought for it, Freedom has a flavor the protected will never know.
    Freedom is only one generation away from extinction.

  • #2
    Is that .054" that you are using for the Z move the difference in radius or diameter between the two ends? Will need the radius here. >Never mind, I read it this time and see your are accounting for that...

    Also, I'm guessing the Z move in line 5 is to Z1.0 or a similar rapid plane. A rapid to Z0 after ending the cut at Z.054 might me noisy!
    George
    Traverse City, MI

    Comment


    • #3
      Hi George,

      Glad you read it the second time BECAUSE I was about to have a difficult time trying to justify my thinking. So you approve of the math? Did I do radius or diameter? I thought I was doing radius.

      Second part of your question: No, the code as you see it (X0.0 Z0.0 W0.0) is what I have been using. What do you mean when you say "noisy"?

      Harold
      For those having fought for it, Freedom has a flavor the protected will never know.
      Freedom is only one generation away from extinction.

      Comment


      • #4
        Originally posted by hwingo View Post
        Hi George,


        SNo, the code as you see it (X0.0 Z0.0 W0.0) is what I have been using. What do you mean when you say "noisy"?

        Harold
        It looks like you are feeding from Z-.005 to Z.054. A rapid move to Z0 at the end of the cut would send the cutter down .054". Or, are you sending it home with a G28?

        Can you shim up the tailstock to level out the barrel? That way you wouldn't have to worry about the Z.
        George
        Traverse City, MI

        Comment


        • #5
          Originally posted by George Bulliss View Post
          It looks like you are feeding from Z-.005 to Z.054. A rapid move to Z0 at the end of the cut would send the cutter down .054". Or, are you sending it home with a G28?

          Can you shim up the tailstock to level out the barrel? That way you wouldn't have to worry about the Z.
          No, I am not sending it home with G28. There is a wee bit of actual audible noise when it first begins to return (perhaps a 1/2 second) but quickly begins to miss the cut entirely. Perhaps it would be best to make the cutter to first go "up and away" by 0.0125" and then send the table home.

          Yes, it's possible to shim the tail stock. Should not be an issue to do that. I will just need to order some shimming material to make the final few thousandths accurate.

          This still doesn't address the issue of WHY it's not cutting the way it should.

          Harold
          For those having fought for it, Freedom has a flavor the protected will never know.
          Freedom is only one generation away from extinction.

          Comment


          • #6
            Some machines just run the servos full tilt when reading a G0, so in this case the mill would reach Z0 long before it got back to X0. Obviously not how your machine does it, but it's always a good idea to lift to a rapid plane when doing a positioning move.

            Not sure why you would get the results you are seeing. Do the numbers on the screen say you are at Z=.054 at the end of the cut?

            Good luck - off to the NAMES show now.
            George
            Traverse City, MI

            Comment


            • #7
              Originally posted by George Bulliss View Post
              Some machines just run the servos full tilt when reading a G0, so in this case the mill would reach Z0 long before it got back to X0. Obviously not how your machine does it, but it's always a good idea to lift to a rapid plane when doing a positioning move.

              Not sure why you would get the results you are seeing. Do the numbers on the screen say you are at Z=.054 at the end of the cut?

              Good luck - off to the NAMES show now.


              George, allow me to ask a question before you run away. The program is written in ABSOLUTE. Since I touched the cutter to the uncut work piece, and then ZEROED X,Y,Z, and W (4th Axis), one would think that if I “commanded the cutter to drop below ZERO in the Z axis by a given amount, lets say Z-0.005, then sent the table in a direction in the X axis, and then told the cutter to return to ZERO, i.e. X0.0 Z0.0, the program would lift the Z axis up to its original ZERO position as the X axis returned to ZERO. Since everything is in ABSOLUTE, why would it not return to the original coordinates, i.e. ZERO?

              I have no idea if it was showing Z0.054. I will need to run the program again (in air) to learn the answer.

              Harold
              For those having fought for it, Freedom has a flavor the protected will never know.
              Freedom is only one generation away from extinction.

              Comment


              • #8
                Just out of interest try starting at the thick end and working to the smaller end with a Z-0.054"
                .

                Sir John , Earl of Bligeport & Sudspumpwater. MBE [ Motor Bike Engineer ] Nottingham England.



                Comment


                • #9
                  Harold, it would return to Z0, but at the end of the cut you are in the steel and above Z0, since you started at the small end of the taper. Because your rapid followed the cutter path back, it worked. However, a lot of the barrel is sitting above the Z0 plane - everything except the small end of the taper.

                  John's idea of starting at the top and going down sounds like a good plan.
                  George
                  Traverse City, MI

                  Comment


                  • #10
                    Originally posted by John Stevenson View Post
                    Just out of interest try starting at the thick end and working to the smaller end with a Z-0.054"
                    I'm glad I'm not the only one thinking this.
                    Starting at the thick end is safer.

                    Sent from my SM-G900M using Tapatalk

                    Comment


                    • #11
                      Hi Guys,

                      Thanks for your input. This has been driving me nuts. After my last post, I spent the entire day and well into the evening trying to figure out where things are going wrong.

                      John and burdickjp: Out of curiosity, why would starting at the large end make any difference? One would think "it's six of one and half dozen of the other". This is not meant to be a "smart a_ _ response"! I really want to learn and I would like to understand how this would/could make a difference.

                      burdickjp: You stated that starting at the thick end is safer. Please explain what you mean by *safer*. Once again, I want to learn.


                      To throw a wrench in the gears, I have the following information to add:

                      I used a standard micrometer to determine the major and minor diameters. Using math, I calculated the climb height (which was 0.054”). However, when placing a dial indicator (0.0001”) at the minor diameter and moving the table (work piece) to the major diameter, the indicator produced a reading of 0.063”. Roughly the same numerical increase was noted on a previous work piece. Using 0.063” for Z in Line 4 rather than 0.054 produces a situation whereby the cutter totally fails to cut the surface nearing the major diameter. Ostensibly, using 0.063” produced a greater incline thus the lack of any cut nearing the major diameter. I returned to the original 0.054 and made slow downward numerical adjustments in Z ultimately ending up with 0.038. After repeated cuts, in conjunction with Z adjustments, eventually the major dia depth “appeared” to be the same depth as the minor dia. Since the minor dia depth *was* cut to 0.035", and by decreasing the value of Z, the cutter would never cut deeper at the minor dia all the while slowly increasing the depth of cut as it approached the major dia. This seemed to work out BUT it doesn't jive with the math!

                      In both work pieces, cuts were basically made only for esthetic's thus function did not play a part.

                      The point is, I shouldn’t have to make these time consuming “adjustments” to include additional passes. It should be "on the money" with each pass. So somewhere I am missing the boat …… BIG TIME.

                      Thanks,
                      Harold
                      For those having fought for it, Freedom has a flavor the protected will never know.
                      Freedom is only one generation away from extinction.

                      Comment


                      • #12
                        Harold,
                        It should make no difference at all which end you start at, it was just an observation to see IF it made a difference.
                        Non of your data makes sense. It should do but as you have found it doesn't.

                        Rereading the original post leads me to wonder if it's not deflection that is fudging the figures ?
                        You have a long thin part in stainless, not the best material. Add to this you are using a 4 flute ball nose which by design has a lot of meat at the bottom of the cutter to get 4 flutes in and with any ball nose the very center is stationary.

                        Wonder what would happen if you swapped stainless for alloy or brass and use a 2 flute cutter that has more chip clearance.

                        Sorry not much help, more grasping straws but nothing you have posted so far stands out as wrong.
                        .

                        Sir John , Earl of Bligeport & Sudspumpwater. MBE [ Motor Bike Engineer ] Nottingham England.



                        Comment


                        • #13
                          Harold,
                          Looks like simple math error. Change in radius is 0.054" but your Z motion starts at -0.005" and ends at 0.054" a difference of 0.059". Also rapids need to be carefully planned. Most controls run all axis at full speed. So the short travel axis completes way before the long axis. This is a great way to clear off clamps! You should always clear the Z axis to clearance plane in a separate block before any rapid X and Y moves.

                          Comment


                          • #14
                            Originally posted by garyhlucas View Post
                            Harold,
                            Looks like simple math error. Change in radius is 0.054" but your Z motion starts at -0.005" and ends at 0.054" a difference of 0.059"..........
                            Obviously I am missing the boat somewhere. The basic program I included with the original post was written in Absolute and not Incremental. Please do me a favor and change the original code to the way it should be written when writing in ABS and post the way it should be written so I can see what you are doing.

                            I position the cutter against the metal and then zero all axis. Next I want the cutter to plunge to a depth of 0.005" (Z axis) and then I want the cutter to follow a tapered path from minor dia to major dia (a rise of 0.054"). How is that written in ABS (not Incremental)? Just change the original code that I furnished and then post the way it should be written in ABS please.

                            Harold
                            For those having fought for it, Freedom has a flavor the protected will never know.
                            Freedom is only one generation away from extinction.

                            Comment


                            • #15
                              I'm going to muddy things up here a bit, but is that change in z over the linear length from small end to big end? Or the length of the spiral. Those two lengths will be different and might account for your slope being off. I could see making that mistake if you hand wrote the code.

                              Comment

                              Working...
                              X