Using Standard Glue for remapping the S command

More
05 Apr 2021 14:54 #204905 by mwinterm
Hello,

The Mirkon WF41C I'm retrofitting has a mechanical gear-box providing 22 different gear ratios. This gear-box is controlled by 3 little motors.
I now try to remap the S-command to select the right gear-ratio based and the required spindle speed. In this context I tried to use Standard Glue which conveniently provides the functions:
setspeed_prolog
setspeed_epilog
I'm invoking the remap with the following command
REMAP=S prolog=setspeed_prolog python=setspeed epilog=setspeed_epilog
Unfortunately this is not working causing the following error:
PythonPlugin: Python  '2.7.16 (default, Oct 10 2019, 22:02:15) 
[GCC 8.3.0]'
is_callable(remap.setspeed) = TRUE
is_callable(remap.g886) = TRUE
is_callable(__init__) = FALSE
is_callable(oword.setspeed) = FALSE
call(remap.setspeed_prolog): 
KeyError: ('setspeed_prolog',)
If I leave the prolog out by defining
REMAP=S python=setspeed epilog=setspeed_epilog
I get no error.

I'm using LinuxCNC 2.8.1

Any help appreciated!

Best regards,

Marc

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

More
05 Apr 2021 15:08 #204906 by andypugh
call(remap.setspeed_prolog): 
KeyError: ('setspeed_prolog',)

Sounds a little like you don't have the right setup in toplevel.py and remap.py

Or, that the import of standardglue has found a version without a "setspeed_prolog" definition.

This one has no setspeed_prolog github.com/LinuxCNC/linuxcnc/blob/master...py/python/stdglue.py

This one does: github.com/LinuxCNC/linuxcnc/blob/master...n-stdglue/stdglue.py

Are you using Gmoccapy?

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

More
05 Apr 2021 15:29 #204909 by mwinterm
Hello Andy,

the version in my installation under
/usr/share/linuxcnc/ncfiles/remap_lib
has it. Would also be strange that the setspeed_prolog is missing while the setspeed_epilog there and running as in my case.
My toplevel.py only consists of
import oword
import remap
Not sure what there could be missing or wrong.

Best regards,

Marc

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

More
05 Apr 2021 19:31 #204941 by bevins

Hello Andy,

the version in my installation under
/usr/share/linuxcnc/ncfiles/remap_lib
has it. Would also be strange that the setspeed_prolog is missing while the setspeed_epilog there and running as in my case.
My toplevel.py only consists of
import oword
import remap
Not sure what there could be missing or wrong.

Best regards,

Marc


Invoking 3 python scripts in a row doesn't work in a remap. So your best bet is putting the functions you need in epilog in your python script setspeed. I did the same thing with my Biesse router and this is the only way I could get it to work in a python remap.

check my remap here: Python remap M6

I dont know what the difference would be for remapping S vice remapping M6 but to save your sanity, dont try to run 3 python scripts in a remap. I have tried and tried and the guy who wrote the remap code admitted it.

Just my 2 cents

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

More
24 Aug 2023 12:19 - 24 Aug 2023 13:37 #278853 by zmicq
Did you manage to get the gearchange working? Would you mind posting your python script for it? I got my hands on a WF3 DCM and would very much like to retrofit the right way... I saw your github  but I do not understand where I can find the gearbox positions in relevance to set spindle speed. Do you have the map of reduction ratios of gears? Or the speed ranges? Thank you
Last edit: 24 Aug 2023 13:37 by zmicq.

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

Time to create page: 0.071 seconds
Powered by Kunena Forum