Simple remapping

More
25 Mar 2017 16:41 #90253 by Diederik
Simple remapping was created by Diederik
Hi,

I need help please. I did a tool change sub routine and it works well, as follows:

o<t0101> sub
M66 E3 L0
#1 = #5399
G91
T1
G0 C[15+[60* #1]]
C-25
T1 M6
G43 H1
G43.2 H11
G90
o<t0101> endsub
M2

So I have a component that calculates how many steps it needs to move on, based on where it currently finds itself, which is linked to motion.analog-in-03. (I have 3 Proximity sensors linked to a Mux8 component,...etc, to monitor in what position it actually finds itself in. And the turret has a stepper motor linked to drive it. and I control the turret as a c-axis)
Now, In the g-code program I call the sub routine like: o<t0101> call, And it works perfect. I now want to go a step further, and I thought I could do it with remapping, but, I thought it will be simple, but after reading the documentation, I am confused as to where do I start?... I have no experience in python or .tcl programming, and from the examples, it seems like I need to add those, But I hope I'm wrong.

I'm sure this might be a simple solution for someone out there. In stead of saying o<t0101> call, I want to only command t0101(like on a Fanuc lathe control), or T1, and it must run the sub routine. Is this possible? I'm very happy with the sub routine path, but I want to explore the remapping.
Can someone maybe just point me into a direction with this? The documentation is quite difficult for me to understand as I don't know code well enough.
Is there a simple solution to this?

:) Thanks

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

More
27 Mar 2017 10:34 #90342 by andypugh
Replied by andypugh on topic Simple remapping
Have a look at the sim/axis/lathe-fanucy demo config for an example.
github.com/LinuxCNC/linuxcnc/tree/master...im/axis/lathe-fanucy

This line in the INI:
github.com/LinuxCNC/linuxcnc/blob/master...lathe-fanucy.ini#L29

Calls this G-code subroutine
github.com/LinuxCNC/linuxcnc/blob/master...anucy/toolchange.ngc

Then you need the "toplevel.py" file in the config folder (you can use it as-is without editing)
and that file loads the second Python file, remap.py. That file populates the G-code parameter #<tool> with the number that was used in the Tnnn command. Again, you can use this file as-is and then use #<tool> to get the number in your own G-code subroutine.
The following user(s) said Thank You: Diederik

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

More
27 Mar 2017 14:03 #90369 by Diederik
Replied by Diederik on topic Simple remapping
Thank you very much for your reply Andy. I really appreciate your input.
I spoke to Prof. Rudy (Rudy du Preez) regarding this, and he also suggested the same example. I had a quick look through this yesterday, but I want to take some more time to study this, and understand this fully.
I'm really excited about this, because it seems like I'm getting very close to Having my lathe control to operate the way I need it to work. Prof Rudy also assisted me with the G71, G72 roughing cycles, which also required some remapping, and now this... pretty soon This lathe control will beat any other commercial cnc control available! ;)
Thank you to all the clever people out there making and putting linuxcnc together. It's awesome! (Big applause to all! You are awesome!)
I wish to learn more about the remapping functions, It's absolutely Brilliant! ;)

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

Time to create page: 0.128 seconds
Powered by Kunena Forum