- Posts: 70
- Thank you received: 0
Using Standard Glue for remapping the S command
5 years 6 months ago #204905
by mwinterm
Using Standard Glue for remapping the S command was created 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:
I'm invoking the remap with the following command
Unfortunately this is not working causing the following error:
If I leave the prolog out by defining
I get no error.
I'm using LinuxCNC 2.8.1
Any help appreciated!
Best regards,
Marc
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:
Code:
setspeed_prolog
setspeed_epilog
Code:
REMAP=S prolog=setspeed_prolog python=setspeed epilog=setspeed_epilog
Code:
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',)
Code:
REMAP=S python=setspeed epilog=setspeed_epilog
I'm using LinuxCNC 2.8.1
Any help appreciated!
Best regards,
Marc
Please Log in to join the conversation.
5 years 6 months ago #204906
by andypugh
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?
Replied by andypugh on topic Using Standard Glue for remapping the S command
Code:
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 to join the conversation.
5 years 6 months ago #204909
by mwinterm
Replied by mwinterm on topic Using Standard Glue for remapping the S command
Hello Andy,
the version in my installation under
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
Not sure what there could be missing or wrong.
Best regards,
Marc
the version in my installation under
Code:
/usr/share/linuxcnc/ncfiles/remap_lib
My toplevel.py only consists of
Code:
import oword
import remap
Best regards,
Marc
Please Log in to join the conversation.
5 years 6 months ago #204941
by bevins
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
Replied by bevins on topic Using Standard Glue for remapping the S command
mwinterm wrote: Hello Andy,
the version in my installation underhas it. Would also be strange that the setspeed_prolog is missing while the setspeed_epilog there and running as in my case.Code:/usr/share/linuxcnc/ncfiles/remap_lib
My toplevel.py only consists ofNot sure what there could be missing or wrong.Code:import oword import remap
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 to join the conversation.
3 years 2 months ago #278853
by zmicq
Replied by zmicq on topic Using Standard Glue for remapping the S command
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
Please Log in to join the conversation.
Time to create page: 0.704 seconds
