Remap, Lost as anything

More
04 Jun 2021 10:55 #211137 by Willheg
Replied by Willheg on topic Remap, Lost as anything
So hello again all.

Well I am back, feeling defeated by having to ask for help and seeing if anyone could cast their eyes over what I have attached (sim file for testing with some of my code) to see if they can point me to where I am going wrong.

Like I said earlier I am trying to remap M6 to;

1) Store current location
2) Move to a tool change position.
3) Request a tool change, in the attached files I am just using hal_manualtoochange.
4) Move to a location and touch off the tool on a tool setter/switch to set the new tool length.
5) return to the old location and continue the next lot of tool paths.

I have tried pure python which is the way I would like to go but I am not a proficient programmer in any programming language, I am a learn as you go and make it work person.

I have managed to make it kind of work, but my issue is once the M6 is called it goes to the change tool location correctly, but once I accept the tool change it the moves to the location in space where I started the program running, then going to the tool setter location. after the touch off, it then does not back off and retouch like I have commanded, but that aside once the touch off is complete it then returns to the location in space where I started the program running before going back to the recorded M6 entry position.

I'm thinking when it enters the python script it just reads the whole file without stopping at points to do things before continuing, but if I start putting in "yield INTERP_EXECUTE_FINISH" it seems to kill the file there instead of stopping before continuing on with the next line of code.

I have also in the ini file set;
TOOL_CHANGE_AT_G30 = 0
TOOL_CHANGE_QUILL_UP = 0
and commented out tool change position i.e
#TOOL_CHANGE_POSITION = 100 100 5

I have also tried to use an *.ngc file remap to see if i can just do it that way which I was hoping not to do. This is still in the early stages but seemed to be a bit problematic as well.

If all else fails I will carry on how I currently do it which is hand edit all my files to call an oword routine after an M6 to touch off the tool, but this is why I am having a go at remapping to make it do this if I can.

So hope this all make sense, and hope someone is kind enought to take a look over my code and point me in the right direction if they have a minute or two.

In the stdglue.py file attached is my python call which is named msixtest, or the ngc file is change.ngc

Thanks everyone.

William
Attachments:

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

More
07 Jun 2021 23:49 #211463 by andypugh
Replied by andypugh on topic Remap, Lost as anything
You seem to set the tool change flag, but I am not sure if that causes the system to wait.

Have you tried programming an "M6" in the remap? (This is OK, it doesn't remap itself again)

This section of code here is where I am looking, it seems like it will just run straight through.
self.newtool = int(self.params["selected_pocket"])
            self.selected_pocket = -1
            self.selected_tool = -1
            # cause a sync()
            self.toolchange_flag = True
            self.set_tool_parameters()

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

More
08 Jun 2021 00:45 #211469 by cmorley
Replied by cmorley on topic Remap, Lost as anything

I'm thinking when it enters the python script it just reads the whole file without stopping at points to do things before continuing, but if I start putting in "yield INTERP_EXECUTE_FINISH" it seems to kill the file there instead of stopping before continuing on with the next line of code.


Probing is a queue buster (not predictable) so you must use "yield INTERP_EXECUTE_FINISH"
Or it continues to the end of the code.

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

More
08 Jun 2021 04:04 #211478 by Willheg
Replied by Willheg on topic Remap, Lost as anything
Thanks cmorley, I will try using that and see how I get on.

Andypugh, I tried that once and it hung on me, but might try again sometime to see what happens, but the way it is at the moment it stops, asks for the new tool to be inserted and the message accepted to continue the process.

Now this is where it comes unstuck, I'll run thought the issue again,

Say if I run the program from X0,Y0 the remap so far runs to the tool change point as excepted, but once accepting the tool change, it moves back to X0,Y0 before going to the toolsetter location (which to me is wasted movement) instead of going from tool change pos to toolsetter pos direct.

It then once touching the tool does the same thing so it goes back to X0,Y0 before going back to its last location to continue cutting.

Once it gets to the tool change for the next tool it seems to change its return position as mentioned above to the last "tool start location" where it returns to like above.

Just wondering how I stop the random non programmed moves as well.

Thanks all again fro your replies and information, hopefully I can get on top of this as it would be great to get it working.

William

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

More
08 Jun 2021 13:48 #211506 by cmorley
Replied by cmorley on topic Remap, Lost as anything
You don't have either of these set in the INI do you?

[EMCIO]
TOOL_CHANGE_POSITION =
TOOL_CHANGE_AT_G30 =

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

More
08 Jun 2021 20:10 #211539 by Willheg
Replied by Willheg on topic Remap, Lost as anything
No I have commented those lines out or set to 0. i.e.
TOOL_CHANGE_AT_G30 = 0
TOOL_CHANGE_QUILL_UP = 0
and commented out tool change position i.e
#TOOL_CHANGE_POSITION = 100 100 5

Is that ok or should i remove them all together.

I worked out last night the the extra moves I was getting where from the self.execute(G53 G0 Z??? ) commands being executed as "G53 X0 Y0 Z???" as for some reason after the tool change i feel it seams to maybe lose sync and resets something somewhere.

So to get round this I found I had to request all axis positions even if it was not meant to move and already in position.

As for the "yield INTERP_EXECUTE_FINISH" I tried a few different locations last night but it seemed to either break the code and give me errors or it would just finish the code where I placed it and not do anything else I requested, is there something i am missing after using the "yield INTERP_EXECUTE_FINISH" to restart the code again?

I will keep playing and asking questions and see if I can get this to work.

Thanks for all your help, information, suggestions and time so far

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

More
09 Jun 2021 00:39 #211574 by cmorley
Replied by cmorley on topic Remap, Lost as anything
We need to know the errors messages.

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

More
09 Jun 2021 01:58 #211579 by Willheg
Replied by Willheg on topic Remap, Lost as anything
Ok will record them and advise later on

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

Time to create page: 0.083 seconds
Powered by Kunena Forum