3-in-one (Mill/Drill/Lathe) Machine Configuration

More
16 Jan 2017 05:52 #85877 by Sparky961
Poor choice of words on my part, lest I open the proverbial can of worms. Who am I to suppose what the motivations were behind the change?

Regardless, I'm sure it's for the better and I have my questions on this subject answered for the present. Thanks to all for their input.

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

More
19 Jan 2017 00:05 #86108 by andypugh

As I understand it, this letter-number mapping is fixed. I can't tell it that axis.0 is now called "Z". Nor can I tell it that axis.1 is now "Y". Correct so far?


This is less-so with the 2.8 version of LinuxCNC. A lathe would have axis.x... and axis.z.... and those would be associated with joint.0.... and joint.1...

But, I used to have a combo machine like you describe. Mine was a stepper machine. All that really has to change is which physical motor the axis drives.

The trick is to create two INI files, one for each config, both in the same config directory. That way they can share the HAL files that are common and the params etc. (if you don't want that, then you can define different tool and param files).

You will probably find that all that really needs to change are which stepgen or pid each axis is connected to.

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

More
19 Jan 2017 02:04 #86117 by Sparky961

As I understand it, this letter-number mapping is fixed. I can't tell it that axis.0 is now called "Z". Nor can I tell it that axis.1 is now "Y". Correct so far?


This is less-so with the 2.8 version of LinuxCNC. A lathe would have axis.x... and axis.z.... and those would be associated with joint.0.... and joint.1...

But, I used to have a combo machine like you describe. Mine was a stepper machine. All that really has to change is which physical motor the axis drives.

The trick is to create two INI files, one for each config, both in the same config directory. That way they can share the HAL files that are common and the params etc. (if you don't want that, then you can define different tool and param files).

You will probably find that all that really needs to change are which stepgen or pid each axis is connected to.


This is effectively what I've done, except I made a copy and modified the working mill config to operate with lathe parameters. I wasn't sure how I'd go about doing it with the same config and although I do have a "two copy" problem now, it shouldn't be that bad since I have the majority of things I need working done now. Is there any advantage to doing it the way you suggest, and if so roughly how would you go about it?

I figure as long as I can operate as lathe or mill without switching any wires, I'm good. It isn't like I can use them both at the same time.

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

More
19 Jan 2017 20:31 #86192 by andypugh

Is there any advantage to doing it the way you suggest, and if so roughly how would you go about it?


Well, I basically did it by hand, like you did.

My current milling machine has 4 INI files in the same folder, depending on whether the machine to so be used as vertical mill, horizontal mill, hobbing machine or an (experimental) XYZBW machine with clamp-and-set B-axis for drilling angled holes along W.

It means that most of the HAL files stay the same (for example, one file for the spindle, another for the A-axis, another for the front-panel controls and Touchy) and only the differences go in unique HAL files.
For my multi-config mill this makes somewhat more sense than for your machine, as I only have one spindle motor, for example. I did have my combo machine set up that way, however.

If what you have now is working then I wouldn't suggest re-doing everything.

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

More
20 Jan 2017 02:03 #86220 by Sparky961
Yes, it does work but I'd be happier if I could have it set up so that each physical axis only had one place to set/change parameters. My solution did leave me with a two-copy problem, which I'm never comfortable with.

Do the INI file and HAL files have the ability to accept conditionals? What limitations apply to replacements with user-defined variables? Is there a way I could leverage this or something like it to consolidate the two configs I have into one place? I haven't found much information regarding this.

In my searching, I did come across the following thread that answered a bit of this. It actually got me to thinking "maybe I can have a switch on the control panel that selects MILL and LATHE". Probably not on the fly (although it _would_ be cool), Perhaps not much different than just loading a separate config from a shortcut though.

forum.linuxcnc.org/38-general-linuxcnc-q...-in-a-hal-file#70525

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

More
20 Jan 2017 10:10 #86233 by andypugh
You can have conditionals in HAL files (if you write the HAL file in the Tcl language) but I am not sure it is a huge help here.

I think that your situation becomes a lot neater in the development version of LinuxCNC.
In that version the axes (XYZABCUVW) and the joints (individual motors, effectively) are different things.

The INI file has separate sections for [AXIS_X] and [JOINT_0] and the two are mapped together through the kinematics.

In your case your "joints" never change, they have the same physical limits etc.

Also, an INI file can have "includes": linuxcnc.org/docs/2.7/html/config/ini-co....html#_include_files

So, you could have one INI file for mill and one for lathe:

mill.ini:
#INCLUDE base.inc
#INCLUDE joints.inc
[KINS]
JOINTS = 3
KINEMATICS = trivkins coordinates=xyz
[AXIS_X]
MAX_LIMIT...
...
[AXIS_Y]
...

lathe.ini:
#INCLUDE base.inc
#INCLUDE joints.inc
[KINS]
JOINTS = 2
KINEMATICS = trivkins coordinates=zx
[AXIS_X]
MAX_LIMIT...
...
[AXIS_Z]
...

In the mill mode this maps X to joint 0, Y to joint1, Z to joint 2
in the lathe mode this maps X to joint 1, Z to joint 0. Y to nothing.
(You will also need a separate [TRAJ] section for each config, as COORDINATES will be different. That setting alters what axis letters are valid in the G-code.)

Each separate INI file will need the [AXIS_*] sections to match the matching joint but this approach would mean that all but about 12 lines of the two INI files would be identical.

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

Time to create page: 0.208 seconds
Powered by Kunena Forum