Questions about engraving on a rotary axis

More
31 Oct 2012 13:04 #26116 by michael_b
I've been tinkering with Linux CNC for a while but I'm by no means an expert, just at the dangerous stage. I hope this will make sense.

Below is a snippet of code that would engrave a number "0". What I would like to do now is engrave this on the outside of a cylinder. If it was all linear moves no problem - I would simply convert the distance of the Y axis to angular movement of the A axis. The Y axis wouldn't move, just X and A. I don't know how to handle the arcs, though, or if it's even possible. After reading through the G-code guide it doesn't seem that it is. To do it the J offset would have to be an angular measure as well and I saw nothing like that.

It's entirely possible that I missed something that is glaringly obvious in hindsight.

It seems that my other options would be to blow apart all of the letters into line segments, or use Stepconf to change the Y axis parameters - figure out how much linear distance per step at a given cylinder diameter and use that to reconfigure, then connect the Y axis drive to the rotary table.

Any suggestions, hints, or pointers?

The machine I have is a small 4 axis mill, steppers driven by a G540, and the rotary table is a Sherline to which I've added a motor.

Thanks,

Michael


G01 X0.0000 Y0.0000
G01 Z0.1000 F15.0000
G01 X0.0000 Y-0.4999
G01 Z0.0000 F10.0000
G03 X0.1252 Y-0.4653 I0.0000 J0.2438
G03 X0.2447 Y-0.3535 I-0.1987 J0.3321
G03 X0.3181 Y-0.1984 I-0.4346 J0.3008
G03 X0.3460 Y0.0000 I-0.6919 J0.1984
G03 X0.3181 Y0.1984 I-0.7198 J0.0000
G03 X0.2447 Y0.3535 I-0.5080 J-0.1456
G03 X0.1252 Y0.4653 I-0.3182 J-0.2202
G03 X0.0000 Y0.4999 I-0.1252 J-0.2092
G03 X-0.1252 Y0.4653 I0.0000 J-0.2438
G03 X-0.2447 Y0.3535 I0.1987 J-0.3321
G03 X-0.3181 Y0.1984 I0.4346 J-0.3008
G03 X-0.3460 Y0.0000 I0.6919 J-0.1984
G03 X-0.3181 Y-0.1984 I0.7198 J0.0000
G03 X-0.2447 Y-0.3535 I0.5080 J0.1456
G03 X-0.1252 Y-0.4653 I0.3182 J0.2202
G03 X0.0000 Y-0.4999 I0.1252 J0.2092
G01 Z0.1000 F15.0000
G01 X-0.3192 Y-0.4612
G01 Z0.0000 F10.0000
G01 X0.3192 Y0.4612
G01 Z0.1000 F15.0000

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

More
31 Oct 2012 18:52 #26123 by BigJohnT
I have seen a machine that used normal G code with a rotary axis defined as a linear axis. Not saying it is the way to go as you would have to change your scale to suit the diameter of your cylinder but it could work.

John

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

More
01 Nov 2012 20:44 #26183 by andypugh

I have seen a machine that used normal G code with a rotary axis defined as a linear axis. Not saying it is the way to go as you would have to change your scale to suit the diameter of your cylinder but it could work.


One way to do this would be to create a clone of the current machine config, then tweak the HAL to convert the current Y axis into V and then link the Y-axis to the rotary motor as a linear axis.
You can then perform arc moves in XA space.
As John has pointed out, the linear scaling will change with radius, which you could probably deal with at G-code generation time.

There might be a better solution using a non-cartesian kinematics file. You are basically mapping XY space onto the surface of a cylinder, and it might not be too difficult to write a kinematics file to do that. That ought to allow you to automatically compensate for radius.

There are basically 18 important lines in a kinematics file, the ones that map XYZABCUVW space into joint positions:
git.linuxcnc.org/gitweb?p=linuxcnc.git;a...a98a4062966002136fb4
Lines 47-55 and 68-76 are where the useful stuff is done. This is the Kinematics for this machine:

This also hints as to why you can't do what you want in a trivkins, arcs are computed using the "tran" structure, and only X Y and Z live in there.

How to code/install kinematics files isn't particularly well documented. In fact it might not be documented at all. Feel free to ask more questions if you think this looks like the way to go.

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

More
02 Nov 2012 14:21 #26197 by michael_b
Thank you John and Andy - it looks like the route to go (for now, at least) is to define the rotary axis as linear. I like the idea of a V axis, allowing me to move the "real" Y axis under LinuxCNC control instead of manually. I found a previous post entitled "Trying to configure XYZU 4 axis setup" that at first glance looks like it contains a lot of information pertinent to what I'll be attempting.

The initial batch of engraving I want to do is all on cylinders of the same diameter so I would only have to work out the linear scaling once. The scaling of the G-code isn't really a problem - I drew up a basic single-line font that I then made into 1" tall letters and numbers, and generated the G-code for each. I wrote a utility that takes that and scales it to whatever factor I tell it.

The idea of using kinematics is attractive, but I can see that there is a whole lot more reading and tinkering involved in that. I'll have to let some of the current brain-bruises fade before I tackle that.

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

More
02 Nov 2012 17:27 - 02 Nov 2012 17:30 #26200 by andypugh

The scaling of the G-code isn't really a problem - I drew up a basic single-line font that I then made into 1" tall letters and numbers, and generated the G-code for each. I wrote a utility that takes that and scales it to whatever factor I tell it. t.


If you want more fonts:
timeguy.com/cradek/truetype
Possibly also Inkscape with the Gcode tools extension.
Last edit: 02 Nov 2012 17:30 by andypugh.

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

Time to create page: 0.071 seconds
Powered by Kunena Forum