Move stepper from rt HAL component
15 Aug 2016 12:59 #78797
by backtime
Move stepper from rt HAL component was created by backtime
I'm writing an rt hal component to control my tool changer. During tool change i need to move Z axis up and down
and obviously rotate the carousel.
The Z axis is controlled as simple stepper without feedback so i have the standard connection in my HAL file:
The first thing I tried was to use a mux to connect hm2_5i25.0.stepgen.02.position-cmd to the pin position-cmd
exported by my component, obviously it does not work. As soon as I try to move the axis LinuxCNC raise
following error because while axis.2.motor-pos-fb value changes the value of axis.2.motor-pos-cmd remains unchanged
and the difference exceeds the FERROR value set in the INI file.
Now, for the Z moving i can use two MDI_COMMAND in [HALUI] section of INI file connected to two pin of my component
to move Z up and down at fixed position, this is ok for my needs.
But I have to rotate the carousel I configured as an axis to allow LinuxCNC to manage homing sequence, so the question is,
can i control the carousel configured as a normal angular axis or i need to disconnect the axis from axis.N.motor-pos-* pins
and implement all controls (included homing sequence) into my component?
Attached is the first (and incomplete) version of the module.
and obviously rotate the carousel.
The Z axis is controlled as simple stepper without feedback so i have the standard connection in my HAL file:
net z-pos-cmd axis.2.motor-pos-cmd => hm2_5i25.0.stepgen.02.position-cmd
net z-pos-fb hm2_5i25.0.stepgen.02.position-fb => axis.2.motor-pos-fb
The first thing I tried was to use a mux to connect hm2_5i25.0.stepgen.02.position-cmd to the pin position-cmd
exported by my component, obviously it does not work. As soon as I try to move the axis LinuxCNC raise
following error because while axis.2.motor-pos-fb value changes the value of axis.2.motor-pos-cmd remains unchanged
and the difference exceeds the FERROR value set in the INI file.
Now, for the Z moving i can use two MDI_COMMAND in [HALUI] section of INI file connected to two pin of my component
to move Z up and down at fixed position, this is ok for my needs.
But I have to rotate the carousel I configured as an axis to allow LinuxCNC to manage homing sequence, so the question is,
can i control the carousel configured as a normal angular axis or i need to disconnect the axis from axis.N.motor-pos-* pins
and implement all controls (included homing sequence) into my component?
Attached is the first (and incomplete) version of the module.
Please Log in or Create an account to join the conversation.
15 Aug 2016 20:58 - 15 Aug 2016 21:03 #78809
by BigJohnT
Replied by BigJohnT on topic Move stepper from rt HAL component
If you want to hijack the Z axis for a tool change look at the thc component to see how I lied to LinuxCNC about the Z axis position when adjusting the Z to maintain tip voltage.
On one of my machines when you home the machine the turret does a 360 to determine where it is... I think it has one prox for tool 1 position.
JT
On one of my machines when you home the machine the turret does a 360 to determine where it is... I think it has one prox for tool 1 position.
JT
Last edit: 15 Aug 2016 21:03 by BigJohnT.
Please Log in or Create an account to join the conversation.
15 Aug 2016 23:20 #78814
by backtime
ok, i see, you force pos-fb equal to pos-cmd while changing axis position, this solution may be adeguate
for my machine because the Z movement is small and change between two fixed position
sequence using home switch and encoder. Hijack this axis is more difficult because I need pos-fb for correct tool selection.
By now I'm writing another component, this time is an userspace python module, I realized that userspace component may be enough for tool change operations. In this way I can control carousel at high level with MDI command from python component and have access to machine status via linuxcnc.stat. I have almost finished writing component and now I'm running some tests on sim machine, results are quite good but i have to try in the real world.
Thanks for your reply.
Replied by backtime on topic Move stepper from rt HAL component
If you want to hijack the Z axis for a tool change look at the thc component to see how I lied to LinuxCNC about the Z axis position when adjusting the Z to maintain tip voltage.
ok, i see, you force pos-fb equal to pos-cmd while changing axis position, this solution may be adeguate
for my machine because the Z movement is small and change between two fixed position
My carousel have a stepper motor, an encoder and an home switch, is configured as an axis so the control provide homeOn one of my machines when you home the machine the turret does a 360 to determine where it is... I think it has one prox for tool 1 position.
sequence using home switch and encoder. Hijack this axis is more difficult because I need pos-fb for correct tool selection.
By now I'm writing another component, this time is an userspace python module, I realized that userspace component may be enough for tool change operations. In this way I can control carousel at high level with MDI command from python component and have access to machine status via linuxcnc.stat. I have almost finished writing component and now I'm running some tests on sim machine, results are quite good but i have to try in the real world.
Thanks for your reply.
Please Log in or Create an account to join the conversation.
17 Aug 2016 20:25 #78959
by backtime
Replied by backtime on topic Move stepper from rt HAL component
I reply to my own post, userspace component is not the answer, as discussed
in this other post
the only way to move axis, controlled by linuxcnc, during tool change is remap M6 and use O-word procedures. So the question I posed in this post does not make sense.
Sorry for that...
Sorry for that...
Please Log in or Create an account to join the conversation.
18 Aug 2016 10:09 #78982
by cncbasher
Replied by cncbasher on topic Move stepper from rt HAL component
see the triac toolchanger comp in the wiki , that includes home and tool position , it may help
Please Log in or Create an account to join the conversation.
18 Aug 2016 11:24 #78983
by backtime
Replied by backtime on topic Move stepper from rt HAL component
I already see the tool changer component. Is the first example I see to try to make my component but using remap seems more easy than write a component from scratch.
Please Log in or Create an account to join the conversation.
Time to create page: 0.070 seconds