Gallery, Projects and General > How do I??

Maths help please: Approximating a Flat Iteratively

<< < (7/13) > >>

Archie Opteryx:
I checked your A and X values against my spreadsheet, and they are spot on, so your cosine calculation is working fine. However, the angle A is relative to the centre of the flat, so you need to vary it from -30 to + 30. Try changing your first line to R10 = -30 (assuming your controller can handle negative numbers). You'll also need to change the second line to R11 = 30.

Also, D is half the AF distance. You'll need another variable for AF (which will be less than the stock diameter), and you'll need to divide that by 2 to get D.

The stock diameter only determines the angle you start and finish at (R10 and R11).

It's looking good though. Excellent work  :clap:

awemawson:
Archie that's sort of good news, but the M19 Sxx command will only take positive numbers from zero to 359.9 degrees or it errors.

I suppose some sort of offset is needed to shift the angle into the -30 to +30 before calculating the cosine  :scratch:

Archie Opteryx:
Ok, I wondered if that was the case.

Does the cosine function accept negative numbers? If so, give it (R10-30). You might need to calculate this in another variable.

Looking at your video, the cutter seems to cut away from the workpiece, not towards it.

The calculations assume X is zero when the cutter axis is in line with the spindle axis, and that positive X is towards the back of the machine.

Which way is the X positive X direction, and where is your X zero? You might need an X offset to correct for this.

awemawson:
I've no idea if the trig functions will take negative angles - that one for experiment.

X=0 is the centre of the spindle (if no tool offset applied) but travel away from the spindle, (ie larger diameters) is +ve so another correction to apply !

Archie Opteryx:
I've had another look at the video, and I now reckon the X zero position and direction are OK, What was confusing me is that the "stand clear" position is inside the travel range. This should be OK once the cosine sign issue is sorted out.

If the cosine function doesn't accept negative numbers, it would be possible to take the absolute value, since cos(x) = cos(-x). Hopefully that won't be needed though.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version