spindle speed mode to c-axis mode (cnc-lathe)

More
25 Apr 2025 02:01 #327022 by fery15sty
I tried using two modes on the lathe spindle.

I want to be able to change the spindle speed mode to c-axis mode which can be changed by entering Mcode

Here is an example of my code:

#######################

net caxis-cc-step <= stepgen.2.up
net caxis-ccw-step <= stepgen.2.down

net mode-caxis => and2.10.in0 => and2.11.in0
net caxis-cc-step => and2.10.in1
net caxis-ccw-step => and2.11.in1
net caxis-cc-out and2.10.out => or2.6.in0
net caxis-ccw-out and2.11.out => or2.7.in0



net spindle-cw-step <= stepgen.4.up
net spindle-ccw-step <= stepgen.4.down

net mode-spindle => and2.12.in0 => and2.13.in0
net spindle-cw-step => and2.12.in1
net spindle-ccw-step => and2.13.in1
net sp-cc-out and2.12.out => or2.6.in1
net sp-ccw-out and2.13.out => or2.7.in1

net servo-cc or2.6.out => parport.0.pin-08-out
net servo-ccw or2.7.out => parport.0.pin-09-out

#######################

M198 code:
#!/bin/bash
halcmd sets mode-caxis True
halcmd sets mode-spindle False
exit 0


M199 code:
#!/bin/bash
halcmd sets mode-caxis False
halcmd sets mode-spindle True
exit 0

#######################

I have tried all the codes above. M-code works well, it can change the spindle mode to c-axis or c-axis to spindle mode. but the resulting signal is not perfect.

I assume that the stepgen signal cannot use and2 or or2 logic, so that the stepping signal is damaged?

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

More
25 Apr 2025 02:46 #327023 by PCW
I would think Logic should be possible with stepgen signals if
you addf the logic components to the base thread instead of the servo thread.
The following user(s) said Thank You: fery15sty

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

More
25 Apr 2025 03:46 #327024 by fery15sty
Replied by fery15sty on topic spindle speed mode to c-axis mode (cnc-lathe)
exactly right. all my logic changed to base-thread.. and the spindle rotation works as expected. spindle speed mode or c-axis mode.

thank you PCW
best regards

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

Time to create page: 0.056 seconds
Powered by Kunena Forum