on the fly config
I am thinking I can Unlink? then pins and link them to the other axis, then do the same to put them back.
So I would boot with X,Y,Z,A,V,W, then slave V to Y and W to Z. Then unslave them at will.
Of course I would need to do this without losing position information for the slaved axis.
Please Log in or Create an account to join the conversation.
www.linuxcnc.org/component/option,com_ku...tart,0/lang,italian/
It looks like that is exactly what gantrykins does, homes independently and then slaves the paired drives.
Others will be able to give you chapter and verse once you have read up on gantrykins
regards
Please Log in or Create an account to join the conversation.
So My question stands, can this be done? If I at least feel sure it can, I will chase down all the info that seems relevent and try to work this out. If not, I will continue the way I am going, which is to just address Y and V (& Z,W) with the same commands when I am in mill mode.
Please Log in or Create an account to join the conversation.
So I would boot with X,Y,Z,A,V,W, then slave V to Y and W to Z. Then unslave them at will.
That does sound like a gantry setup, so the earlier answer might work.
Yes, there are ways to do this, but I am not sure how un-slaving would work out. Would you want V to change to suit the current position, or would you want the motor to move to the V position it was at before it was slaved to Y?
This is the simplistic way that doesn't allow either of those approaches, using two user-defined G-codes.
M100
#!/bin/sh
# M100 in your G code program will link the V motor to the Y stepgen
# assuming that it is linked to p-port pins 01 and 02. and the Y-step signal is called Y-step in the HAL file.
halcmd unlinkp parport.0.pin-00-out
halcmd unlinkp parport.0.pin-01-out
halcmd linkp parport.0.pin-00-out Y-Step
halcmd linkp parport.0.pin-01-out Y-Dir
M101
#!/bin/sh
# M100 in your G code program will link the V motor to the Y stepgen
# assuming that it is linked to p-port pins 01 and 02. and the Y-step signal is called Y-step in the HAL file.
halcmd unlinkp parport.0.pin-00-out
halcmd unlinkp parport.0.pin-01-out
halcmd linkp parport.0.pin-00-out V-Step
halcmd linkp parport.0.pin-01-out V-Dir
This only does one axis, is totally untested, and assumes a parallel-port setup.
I feel that the best way might be with a HAL component that can do a bumpless transfer, inserted in the position-command signal upstream of the stepgen, and programmed to smoothly blend the output command between two possible inputs, whilst lying about the position to the V feedback pin.
Alternatively, perhaps use the HAL "offset" function to offset the V stepgen commanded position by the difference between the V axis command and the Y axis command.
Please Log in or Create an account to join the conversation.
Also calling them from the tool changes makes the most sense as that is when I would want the slave/unslave to happen.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
# Y [1] Axis - stepgen [1]
# ################################################
setp stepgen.1.position-scale [AXIS_1]SCALE
setp stepgen.1.steplen 1
setp stepgen.1.stepspace 0
setp stepgen.1.dirhold 32000
setp stepgen.1.dirsetup 32000
setp stepgen.1.maxaccel [AXIS_1]STEPGEN_MAXACCEL
net ypos-cmd axis.1.motor-pos-cmd => stepgen.1.position-cmd
net ypos-fb stepgen.1.position-fb => axis.1.motor-pos-fb
net ystep <= stepgen.1.step
net ydir <= stepgen.1.dir
net yenable axis.1.amp-enable-out => stepgen.1.enable
# V [7] Axis - stepgen [4]
# ################################################
setp stepgen.4.position-scale [AXIS_7]SCALE
setp stepgen.4.steplen 1
setp stepgen.4.stepspace 0
setp stepgen.4.dirhold 32000
setp stepgen.4.dirsetup 32000
setp stepgen.4.maxaccel [AXIS_7]STEPGEN_MAXACCEL
net vpos-cmd axis.7.motor-pos-cmd => stepgen.4.position-cmd
net vpos-fb stepgen.4.position-fb => axis.7.motor-pos-fb
net vstep <= stepgen.4.step
net vdir <= stepgen.4.dir
net venable axis.7.amp-enable-out => stepgen.4.enable
will it be as easy as :
halcmd unlinkp axis.7.motor-pos-fb
halcmd net ypos-fb stepgen.1.position-fb => axis.7.motor-pos-fb
Do I even have the correct signals? then of course I would undo that in the other M1xx.
Please Log in or Create an account to join the conversation.
Now I know the first part works because switching back give a joint following error hahah!
Please Log in or Create an account to join the conversation.
time to keep looking for that signal or pin that takes care of the position display.
Please Log in or Create an account to join the conversation.
Now I know the first part works because switching back give a joint following error hahah!
It will, because the -fb value and the -cmd value will be different, the definition of a following error.
You could set the V f-error to be wider than the machine travel, then look at the feedback rather than commanded value on screen. (toggle with the # key) and it might work. You might find that the machine is vaguely happy like that, or it might try to drive back to the original position once it gets control back.
Is this servo or stepper?
One thing that you might find useful is that
G0 V #5421
will drive the V axis to the same position as the Y axis. (#5422 for Z, etc)
When you would do that, I am not so sure.
Please Log in or Create an account to join the conversation.