[Solved] Need some help with a custom python remap

More
21 Dec 2020 17:17 - 21 Dec 2020 17:22 #192675 by Aciera
I've made this python remap "G91.2" for my robot config to add incremental moves in Toolcoordinates.

File Attachment:

File Name: remap.py
File Size:9 KB

It parses the values after the G91.2 and calculates the required coordinates (xyzabc) and sends a "G0 Xx Yy Zz Aa Bb Cc" back to LinuxCNC. This works fine in MDI but I have noticed a problem when I use it in a gcode program.

When I load the gcode program (the G91.2 command has been used once in this program) there seems to be a "dryrun" to check for errors and limit violations. During this "dryrun" my python remap produces an output that is not correct.
LOADING THE GCODE PRODUCES THIS LINE:
G0 X493.933983 Y256.066017 Z220.000000 A0.000000 B45.000000 C45.000000

This is not an immediate problem but when I now run the code the python script creates the correct line but execution fails with an error:
G0 X706.369080 Y44.238788 Z220.429828 A179.767811 B45.000000 C45.000000
USRMOT: ERROR: invalid command
Linear move on line 132 fails kinematicsInverse
ERRkineInverse(joints: 20.366170 -39.464510 -8.552037 -17.362583 90.202381 -18.050497), (iterations=100)


Running this runtime output as MDI command works just fine:
G0 X706.369080 Y44.238788 Z220.429828 A179.767811 B45.000000 C45.000000

While the output created during the loading "dryrun" fails also in MDI. So, this makes me wonder if the output of the remap is somehow still queued some where and how I might get rid of the false coordinates.

I hope this makes somewhat sense.
Thanks.
Attachments:
Last edit: 21 Dec 2020 17:22 by Aciera.

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

More
22 Dec 2020 09:33 #192791 by Aciera
This has been resolved. I got myself all tripped up with offsets and incremental vs absolute modes.
The following user(s) said Thank You: tommylight

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

Time to create page: 0.065 seconds
Powered by Kunena Forum