588,025 active members*
4,902 visitors online*
Register for free
Login
Results 1 to 13 of 13
  1. #1
    Join Date
    Jun 2006
    Posts
    247

    need 5 decimal places

    I started thinking about a macro for cutting an angled plane on the top of a block
    say I've got a 1x3 block 6" long and I want to cut back and forth in X with a positive Y-Z stepover at the end of each pass.
    The slope of the plane is ΔZ/ΔY
    The problem arises when the step-up in Z requires more than 4 decimal places
    For instance,
    If ΔZ is .75"
    and ΔY is 1"
    and the stepover is .005,
    thats 200 cuts in the X direction
    and each Z step needs to be .00375
    If this is rounded up or down. then the slope won't be true

    one thing I just thought of,
    what if I round the Z value up and down alternately each loop of the macro, then if the last step is .00005 off, I won't really care about that, and the slope might be "irregular", but immeasurably so. (at least, I couldn't measure it)

    These blocks I cut all the time are for vise jaws that have the irregular profile of an aluminum extrusion cut into them. So far I've been using bobcad-cam for this and cutting them on our Tree mill, which lets you input as many decimal places as you want. But I hate using that program and I'm always lookin for a reason to write my next macro.

    So waddya think?
    any different ideas out there?

  2. #2
    Join Date
    May 2007
    Posts
    781
    Just because the numbers on the screen are only displayed to 4 places does not mean that the variables are limited to that.
    Code:
    #100=[0.750/200]
    #101=[1.0/200]
    
    G0Y-1.1
    #102=-0.7500
    #103=-1.0000
    WHILE [#102 LT 0.0]DO1
    G1Z#102F10.0
    G1Y#103
    G1X-1
    #102=#102+#100
    #103=#103+#101
    G1Z#102F10.0
    G1Y#103
    G1X1
    #102=#102+#100
    #103=#103+#101
    END1
    The variable #100 will have a value of 0.00375 and if used in a while loop to increment the Z position you will get what you want.

  3. #3
    Join Date
    Jun 2006
    Posts
    247
    thank you Andre
    my macro was finished and I didn't even know it!

  4. #4
    Join Date
    Apr 2006
    Posts
    133
    Make sure that your machine can position to 5 places. Your servos may only position in .0001 increments. Just a thought.

  5. #5
    Join Date
    Jul 2005
    Posts
    12177
    Quote Originally Posted by JWK42 View Post
    Make sure that your machine can position to 5 places. Your servos may only position in .0001 increments. Just a thought.
    The specs on Haas machines say +/-0.0001 for positioning (repeatability), worrying about 0.00005 is a bit pointless; do the round up round down on alternate passes.
    An open mind is a virtue...so long as all the common sense has not leaked out.

  6. #6
    Join Date
    Jul 2003
    Posts
    1220
    Quote Originally Posted by kendo View Post
    ...... for cutting an angled plane on the top of a block.........any different ideas out there?
    You should be able to use code for XY plane and rotate that plane.
    Fanuc G68 'Coordinate System Rotation'

  7. #7
    Join Date
    Jun 2006
    Posts
    247
    someone would have to really explain to me how to do that.

    I've never used G68, because my understanding of it is you can rotate coordinates on a plane, but not the plane itself
    The section in the Haas manual seems pretty clear about it and I've never had any use for it

    but I did find some chatter on the web about a 3D rotation option for some fanuc controls that allows this

  8. #8
    Join Date
    Jul 2003
    Posts
    1220
    Quote Originally Posted by kendo View Post
    ........I've never used G68, because my understanding of it is you can rotate coordinates on a plane, but not the plane itself....
    Rotating the coords on a plane has the same outcome as rotating the plane.
    I have never used a Fanuc. Maybe only one plane/coordinates can be rotated at the same time?
    With a Fagor, one, two or three planes can rotated at the same time. eg. G49 A30 B10 C5

    For a Fanuc try this:
    G19 (YZ Plane)
    G68 Y0 Z0 R36.87 (Centre of rotation. R = Atan(0.75/1.0)
    .....Code......
    G69 (Cancel rotation)
    G17 (XY Plane)

  9. #9
    Join Date
    Aug 2004
    Posts
    309
    I dont know if my issue is the same or not but I have a bunch of code for 3d pockets to be cut for injection molds that have been generated in mastercam x2 that are 5 decimal place ( 1.99999 and the like) the HAAS controller comments these lines out and says its not a number .

    Is there a setting I can change to allow me to run my existing programs?

  10. #10
    Join Date
    Apr 2006
    Posts
    133
    Suburban Machinery has a very good CNC Code Editor that will search a very large file and format the different X, Y, Z commands to 4 place decimals.
    I have used it for about 12 years and really like it. I think they have a demo version to download and try before you buy it. Google "Suburban Machinery Software" and it comes right up at the top
    I don't have any interest in their company other than a satified user.

    They are--

    Suburban Machinery
    3777 Harlow Drive
    Willoughby, Ohio 44094
    216 951-8974

    [email protected]

  11. #11
    Join Date
    Nov 2003
    Posts
    236

    MCEDIT

    You already have a editor that will do what you want. Open X2, then select from the file menu OPEN/Edit External. In the dialog box press the editor button and select MCEDIT then select any file.

    When MCEDIT opens select the file you want to modify. Once it is loaded select NC Utils, then select shift. In the shift dialog put 0 for the shift factor and enter 4 for the decimal places. Then select all of the axis you want to modify. Press OK and you should be done.


    Quote Originally Posted by panaceabea View Post
    I dont know if my issue is the same or not but I have a bunch of code for 3d pockets to be cut for injection molds that have been generated in mastercam x2 that are 5 decimal place ( 1.99999 and the like) the HAAS controller comments these lines out and says its not a number .

    Is there a setting I can change to allow me to run my existing programs?

  12. #12
    Join Date
    Aug 2004
    Posts
    309
    Thanks , I figured it was a simple setting in Mcam that would generate files with the correct number of decimal places .

  13. #13
    Join Date
    Nov 2003
    Posts
    236

    MC Post Processor

    It is a simple setting in your post. If you take a quick look at it you should be able to find it and change it to four places.

    Quote Originally Posted by panaceabea View Post
    Thanks , I figured it was a simple setting in Mcam that would generate files with the correct number of decimal places .

Similar Threads

  1. putting in decimal places.
    By G00 in forum G-Code Programing
    Replies: 4
    Last Post: 08-27-2008, 08:27 PM
  2. Favrite places to buy tooling?
    By JDsto in forum Mini Lathe
    Replies: 3
    Last Post: 12-26-2007, 04:47 AM
  3. other places for RFQ/bids for work, etc.?
    By theshooter in forum Employment Opportunity
    Replies: 3
    Last Post: 02-09-2007, 05:08 PM
  4. Places to buy metals online?
    By Ben in forum Uncategorised MetalWorking Machines
    Replies: 6
    Last Post: 06-11-2003, 01:27 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •