Non-circular boring. (Linuxcnc fun)

More
03 Mar 2021 18:49 - 03 Mar 2021 18:51 #200925 by alkabal
I'm also french. ;)

If you ask me : imo using my hal exemple can be a good starting point.

But for your question about gcode, this is for now not possible, skunkworks use command line terminal for change some hal value on the fly thats all.

If you like to use Gcode Remap macro or custom gui all need to be coded !
Last edit: 03 Mar 2021 18:51 by alkabal.

Please Log in or Create an account to join the conversation.

More
17 Mar 2023 00:54 #266872 by skunkworks
an actual application ;) 

The following user(s) said Thank You: snowgoer540

Please Log in or Create an account to join the conversation.

More
17 Mar 2023 00:56 #266873 by snowgoer540
Saw this video earlier in the week.  Nice work!  I’m curious how you produce the gcode.  Among other things like how you made it do it :laugh:

Please Log in or Create an account to join the conversation.

More
17 Mar 2023 01:01 #266874 by skunkworks
currently (It has been a while since I have had time to tinker...) I set the hal component pins by gcode. I would like to do a re-map - but there are things I want to add/fix to the comp.

sam
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

More
05 Apr 2023 18:04 #268344 by ldmarsaglia
Hi Sam, that looks amazing.

I've done some experimentation with non circular turning on the lathe but nothing this cool.
Today I tried to turn a square but I don't figure how are you compensating when you're doing flat surfaces like in this video.

I'm hard coding the shape by the way, but I always end up with curved flats and I notice in the video your flats look perfect and the one on the DRO has that curved compensation.

I know I'm missing something with the tool compensaton but I don't know how to solve it.

Please Log in or Create an account to join the conversation.

More
05 Apr 2023 18:37 #268346 by andypugh
One issue is that for a square you will need > 45 degree relief angle.

The maths isn't that terrible for a polygon, you just need to consider the distance to the surface from the inscribed (or circumscribed, both ways work) circle at each angle as the work rotates.
But your HAL component does need to know the current reference (circle) diameter.

This is the component that I use, in conjunction with external_offsets:
component hexbore "A component to bore polygonal holes";

include "rtapi_math.h";

pin in float spindle-position "scaled 1.0 per rev";
pin in float radius "halui.axis.x.position-relative";
pin in unsigned facets=6 ;
pin in bit enable;

pin out signed offset "scaled x10000";
pin out float angle;

function _;

license "GPL";
author "andy pugh";

;;


double fmod(double x, double y){
return x - y * (floor(x / y));
}

FUNCTION (_){

if (! enable || facets < 3) {
    offset = 0;
    return;
}
angle = (fmod(spindle_position, 1.0 / facets) - 1.0 / (2.0 * facets)) * 6.283185307179586;

offset = 10000 * ((radius / cos(angle)) - radius);
}

Please Log in or Create an account to join the conversation.

More
07 Apr 2023 04:29 #268484 by skunkworks
Yes - tool geometry is very important..

Please Log in or Create an account to join the conversation.

More
07 Apr 2023 15:28 #268522 by ldmarsaglia
Thanks Andy, 

I think I get how your program works but I still don't understand why I got the curved planes on my rudimentary approach. By the way, one thing I don't understand in your component is the declaration of the function fmod. Isn't that function already included in rtapi_math.h library?

Please see the attached picture of the shape I'm trying to machine. The circumscribed circle has a diameter of 36 mm. What I did was divide this square with rounded corners perimeter into 512 points to ensure proper scaling with the 4096 pulsed encoder mounted on the spindle, and then I proceeded to turn the shape with an actual 36 mm diameter. Shouldn't this approach work at least with the diameter it was meant to be for?

Now I'm trying to calculate this with an actual equation for the square with rounded corners. Looking up in google I came up with this equation that should serve more or less the shape I'm intending to do: (x/18)^16+(y/18)^16=1. The exponents and denominators should be parameters so corner radius and base circle diameter can be adjusted but the idea is that. Now I need to convert that to polar and try to feed that into a component to get the proper offsets right?. I'm so rusty with maths and C programming :(

Thanks again Andy!
Attachments:

Please Log in or Create an account to join the conversation.

More
07 Apr 2023 15:42 - 07 Apr 2023 15:43 #268523 by ldmarsaglia
Correction. This should be absolute value so odd exponents don't cause problems. |x/18|^16+|y/18|^16=1
Last edit: 07 Apr 2023 15:43 by ldmarsaglia.

Please Log in or Create an account to join the conversation.

More
07 Apr 2023 16:47 #268530 by skunkworks
the component I made does allow for radius corners.. (assuming it works in all situations..) for any given polygon

Please Log in or Create an account to join the conversation.

Time to create page: 0.092 seconds
Powered by Kunena Forum