Hello Guest it is April 24, 2024, 01:59:08 AM

Author Topic: Surface Material Wizard - bug - odd values  (Read 7607 times)

0 Members and 1 Guest are viewing this topic.

Offline Sage

*
  •  365 365
    • View Profile
Surface Material Wizard - bug - odd values
« on: February 19, 2011, 12:51:03 PM »
I ran the "Surface Material" NFS Wizard and got some very strange code. As shown in the screen shots I selected a removal of 20thou presumably in two passes by selecting a 10thou depth of cut. The code shows three passes in three odd amounts. In addition the final pass is Z- .0201 which  is only a tenth too much but no reason it shoudn't be right on.
 Also I selected rapid feed rate for the repositioning move before each pass and that does not seem to show up in the code. The repositioning is done at regular feed rate.

Resulting code here. The screen shots of the setup are attached.

(Code by Newfangled Wizard, 2/19/2011)
(Version 2.85)
(Program Posted for Aluminum )
G0 G49 G40.1 G17
G80 G50 G90 G98  
G20 (Inch)
(***** Material Surfacing *****)
(Xpos=0 Ypos=0 Lenght=3 Width=3)
(Mtl top = 0 Depth = -0.02 )
(Num of Z pass=3 of 0.0067)
(Num of Y pass=2 of 1.5)
(Ymax=2.25 Ymin=0.75 )
M6 T1
M03 S1082.3
M9

G00G43 H1 Z0.1
G00 Z 0.1
G00 X -1.75 Y 2.25
G01 Z -0.0067 F 10
G01 X 4.75 F 20
G01 Y 0.75
G01 X -1.75
G00 Z 0.1
G00 X -1.75 Y 2.25
G01 Z -0.0134 F 10
G01 X 4.75 F 20
G01 Y 0.75
G01 X -1.75
G00 Z 0.1
G00 X -1.75 Y 2.25
G01 Z -0.0201 F 10
G01 X 4.75 F 20
G01 Y 0.75
G01 X -1.75
M5 M9
M30


Am I doing someting wrong here??

Sage
« Last Edit: February 19, 2011, 12:56:30 PM by Sage »
Re: Surface Material Wizard - bug - odd values
« Reply #1 on: February 19, 2011, 06:15:30 PM »
Sage,
What you are seeing is round off error, The first depth of cut is -0.0067 or approximately (-0.0200/3). The right value should have been -0.006666666666.... The second value is 2 X  0.0067 = -0.0134, and the third is 3 x 0.0067 yielding 0.0201.

The height of 0.1 is the safe-move height for Y axis movement.

The algorithm could have been a little more careful, but an error of 0.0001 is probably outside the precision of your machine (or at least the program designer's machine). Best thing to do is adjust the final value manually if it is really important.

This is precisely why you double check the code on every project.

Thanks,
Bill

Pixel Tamer

Offline Sage

*
  •  365 365
    • View Profile
Re: Surface Material Wizard - bug - odd values
« Reply #2 on: February 19, 2011, 07:11:52 PM »
Don't be too quick to make excuses for the wizard.
There shouldn't be any round off error and there was no need for it to select three screwey sized cuts causing the problem.
It's pretty simple. I spec'd a cut of .010 and a depth of .020 - two cuts of .010 no remainder.

Normally - from what I've seen from other wizards and other programs like sheetcam etc. - the program just keeps taking cuts as specified and any remainder is left for the final cut. Never any error that way and it's just simple subtraction.

e.g assume depth specified as  .023 and depth of cut .010
Take cuts of .010+.010 and a final cut of .003 - voila exactly .023 no tricky division required.
That's the way I've always seen it done.

I'm really surprised such a simple wizzard has errors. I wouldn't normally use such a simple wizzard except I was showing someone what Mach could do with wizzards and this came up - sort of embarassing actually.

Sage

« Last Edit: February 19, 2011, 07:13:43 PM by Sage »
Re: Surface Material Wizard - bug - odd values
« Reply #3 on: February 19, 2011, 08:43:40 PM »
The wizard does try to make all the cuts about equal. I would not try to make your example of .023 with the last cut as only .003. That would be more of a rubbing action than a real cut.

The number of Z passes is calculated by the line:

Code: [Select]
Zpass=  Int(Abs((Top_mat - Depth)/DepthPer)) + 1
I really dont know why the +1 is there- Brian originally wrote that code.I suspect it was to be sure we took at least one cut.

I would not consider the wizard to have errors, just a different view of the best strategy for a cut.

Offline Sage

*
  •  365 365
    • View Profile
Re: Surface Material Wizard - bug - odd values
« Reply #4 on: February 19, 2011, 09:25:32 PM »
3 thou isn't a rub. It's a fairly typical finish pass.
Having said that the subtraction method could result in some pretty small final passes. None the less it seems to be the way it's accomplished in other programs - not my doing.

Actually the wizzard does have an error, it's one tenth. That's a lot in some circles.. (certainly not mine). Zero error would be better and could be accomplished with only bit more code to make the final pass exactly correct since we already know what the final dimension should be. (Rather than leave it to the operator to figure it out and edit the G-code). If I can figure it out then the wizzard should be able to as well.

I guess we can agree to disagree.

Sage

Re: Surface Material Wizard - bug - odd values
« Reply #5 on: February 19, 2011, 10:00:23 PM »
Hey Sage,
   The free wizard by Kiran does as you expect, just tried it.
"Surfacing with tool down in X" (function name, not description)
For .023 total depth, .01 per pass = .01, .01 then .003

Russ

Offline Sage

*
  •  365 365
    • View Profile
Re: Surface Material Wizard - bug - odd values
« Reply #6 on: February 20, 2011, 08:34:22 PM »
I'm not surprised. Sheetcam does it that way as well and it's a pretty smart program.

I was thinking about this some more and there is another reason the last past should never be over the requested amount:

The last past doesn't even need to be calculated. It can just be a copy of the value of the requested finished depth.
The intermediate passes can be calculated (like they are) but the last calculation can be scrapped in favour of just subbing in the requested depth value. Done - no error.

I guess that's a happy compromise.

So - Ron - Can you make it do that??
At least the final extra tenth (or any other rounding error produced) will be gone and won't ned to be explained.

Sage
Re: Surface Material Wizard - bug - odd values
« Reply #7 on: February 20, 2011, 09:18:00 PM »
I agree it is not good to see a total cut more than you requested. Although I don't think it will ever be more than .0001" I will see if that can be fixed without major changes.

I prefer the strategy of making all the cuts the same.
If you want to make a final finish cut you can simply program two operations, the first to rough depth, the second to finish depth.

Re: Surface Material Wizard - bug - odd values
« Reply #8 on: February 20, 2011, 09:37:23 PM »
Hey Ron, while we're at it, I was using this wizard again today and noticed another oddity.
I set the DEPTH to .020 and the Step Depth to .020 assuming it would make 1 pass ... but it makes 2 passes at .010 each.
Changed the Step Depth to .021 then it cut in one 0.020 pass.
No biggie if it isn't easy to fix, just need to be aware of it as it does not do as expected.
Easy to work around.
Thanks

Also noticed this.
DEPTH .060  , Step Depth .020 creates 4 passes .015 each. (Expected 3 passes at .020)
DEPTH .060  , Step Depth .021     "      3 passes .020 each, as expected ........ sort of.
And, the Rapid Stepover does not work here either.
« Last Edit: February 20, 2011, 11:24:20 PM by Overloaded »
Re: Surface Material Wizard - bug - odd values
« Reply #9 on: March 14, 2011, 08:28:05 PM »
Yeah, thats a result of its trying to make a number of nearly equal cuts. I suppose it would be better to offer the user the choice of equal cuts or as specified, with a leftover small cut.

Ill see what I can do.