Move stepper motor only with push button
- hanz24
- Away
- New Member
-
Less
More
- Posts: 15
- Thank you received: 0
13 Nov 2025 07:09 #338303
by hanz24
Move stepper motor only with push button was created by hanz24
I’m working on a CNC lathe project using mesa card 7i98 where I want to add an extra stepper motor to control the chuck lock/unlock mechanism. The goal is to operate this lock only using a push button, completely independent from any G-code commands. This is to prevent accidents in case there's an error in a G-code file that could unintentionally move the chuck lock.I’ve already managed to configure the stepper so it can be moved using a push button, but the issue is that in my current configuration the motor is still connected to joint.2 and axis.a. I’m worried that if something goes wrong in the G-code, the machine could send motion commands to this stepper as if it were a normal axis, which might release the chuck during machining.What I want is a clean way to configure this stepper as a completely independent device, not tied to any axis or joint used by the motion planner, so it will only respond to the push button input.Has anyone implemented something similar or knows the proper way to configure this in LinuxCNC?
Please Log in or Create an account to join the conversation.
- Aciera
-
- Offline
- Administrator
-
Less
More
- Posts: 4563
- Thank you received: 2031
13 Nov 2025 09:25 - 13 Nov 2025 09:26 #338305
by Aciera
Replied by Aciera on topic Move stepper motor only with push button
Have a look at 'extra joints'. sim configs can be found in 'configs/sim/axis/extrajoints.
github.com/LinuxCNC/linuxcnc/tree/master...sim/axis/extrajoints
There is also some information here:
linuxcnc.org/docs/html/man/man9/motion.9.html
Discussion:
forum.linuxcnc.org/38-general-linuxcnc-q...-controller?start=20
github.com/LinuxCNC/linuxcnc/tree/master...sim/axis/extrajoints
There is also some information here:
linuxcnc.org/docs/html/man/man9/motion.9.html
Discussion:
forum.linuxcnc.org/38-general-linuxcnc-q...-controller?start=20
Last edit: 13 Nov 2025 09:26 by Aciera.
Please Log in or Create an account to join the conversation.
- hanz24
- Away
- New Member
-
Less
More
- Posts: 15
- Thank you received: 0
13 Nov 2025 09:46 #338306
by hanz24
Replied by hanz24 on topic Move stepper motor only with push button
Thanks a lot, i already find this kind of topic but never found the right one. i will read and try it.
I have tried to change the configuration on the hal file using mux4 etc like this, but my stepper motor still doesn't move, maybe because it doesn't have the stepgen.02.position-cmd parts. But i think it will be much easier with extra joint configuration.
I have tried to change the configuration on the hal file using mux4 etc like this, but my stepper motor still doesn't move, maybe because it doesn't have the stepgen.02.position-cmd parts. But i think it will be much easier with extra joint configuration.
setp hm2_7i98.0.stepgen.02.control-type 1
setp hm2_7i98.0.stepgen.02.step_type 0
setp hm2_7i98.0.stepgen.02.position-scale -400
setp hm2_7i98.0.stepgen.02.maxvel 30
setp hm2_7i98.0.stepgen.02.maxaccel 100
setp hm2_7i98.0.stepgen.02.steplen 2000
setp hm2_7i98.0.stepgen.02.stepspace 2000
setp hm2_7i98.0.stepgen.02.dirsetup 3000
setp hm2_7i98.0.stepgen.02.dirhold 3000
setp hm2_7i98.0.gpio.013.is_output 1
setp hm2_7i98.0.gpio.013.invert_output 0
net a-enable => hm2_7i98.0.gpio.013.out
loadrt mux4 count=1
addf mux4.0 servo-thread
# Set the speed value
setp mux4.0.in0 0 # stopped
setp mux4.0.in1 200 # speed forward
setp mux4.0.in2 -200 # speed reverse
# Jog with Push Button, Positif direction pin 001, Negatif direction pin 005
net jog-a-plus-raw debounce.0.0.in <= hm2_7i98.0.gpio.001.in_not
net jog-a-plus debounce.0.0.out => mux4.0.sel0
net jog-a-minus-raw debounce.0.1.in <= hm2_7i98.0.gpio.005.in_not
net jog-a-minus debounce.0.1.out => mux4.0.sel1
net chuck-speed mux4.0.out => hm2_7i98.0.stepgen.02.velocity-cmd
loadrt or2 count=1
addf or2.0 servo-thread
net jog-a-plus => or2.0.in0
net jog-a-minus => or2.0.in1
net chuck-enable or2.0.out => hm2_7i98.0.stepgen.02.enablePlease Log in or Create an account to join the conversation.
Time to create page: 0.134 seconds