Bad Math!!

willthedancer

Registered
Registered
Joined
Jan 23, 2017
Messages
228
Back in the '90s a scientific calculator I borrowed from a coworker caused me some troubles. I was trigging out a some angles on an irregular bolt circle, and ended up with answers that did not boil out in the proofs. Those numbers just didn't add up. Turns out that the algorithm in many calculators' trig functions gave an error in the second and third decimal places. I went back to my trig book, and a simple calculator.

This beastie jumped up and bit me again a year or two back. I ordered some sheet metal laser cut with an inverse cosine curve on it. When I rolled it into its proper diameter, I did not have the nice flat plane I expected. Round and round I went with the vendor's engineers. seems that their cad-cam software used that same faulty algorithm instead of a space consuming trig table... Huh, imagine that.

Use your trig book, it always works.
 
/\/\/\/\ Very interesting Will.

Along those same lines, when testing for a CNC Machinist postition at a defense contractor, they supplied you with a simple calculator and a trig book.
 
The book was to use, the calculator was for back up. I have seen many errors over the years using calculators. The book is the best way in my opinion.

"Billy G"
 
The joys of having access to a cad program. No math required, just model the shape you want and unroll it using the sheet metal function. Perfect flat pattern every time.

Or use alternate Cad (cardboard aided design) and make a full size part out of cardboard and unroll for the flat pattern. That's the most common method used by the car enthusiast when making sheet metal parts.
 
All good unless your cad program uses the algorithm. You wont know unless you use parametric programming modes. Might be worth checking. The company doing my laser cutting is a major nationwide steel supply company. I'm not sure what CAD software they were using.
 
I'm skeptical. I'd have to see actual numbers before I'll believe this one--sorry. If anyone is curious about how trigonometric functions are calculated, you can follow this link.

Jim
 
I can see that happening, even though the individual calculations are correct, over a number of calculations (hundreds or thousands) the rounding errors start adding up and are reflected in the G-code even when working to 12 decimal places internally and then again when converting the G-code into an actual tool path on the machine.

I had the same problem when I wrote my CNC software, and was getting tool paths that did not follow the ideal path. To solve the problem, I found that rounding the 12 decimal place value to a 6 decimal place value would give a solution that was about 50/50 round up or down, and thus when multiplied by the integer encoder value and rounded again, and converted to an integer would output a true tool path that was within 1 micron.

Let's say it took me a couple of days to figure this one out.:rolleyes:
 
FYI, the errors in the trig algorithm are in the second and third decimal places. The results from the steel supplier had a second harmonic in my cosine curve.
 
Back
Top