increases / decreases spindle speed

More
24 Sep 2016 05:15 #80844 by dinkata
Configuration 5i25 + 7i77. The turnover of the spindle is adjusted by +/- 10V.
I want to use with external buttons:
halui.spindle.increase (bit, in) - increases spindle speed
halui.spindle.decrease (bit, in) - decreases spindle speed
in hal:
# --- SPNINCR ---
net Spnincr     <=  hm2_5i25.0.gpio.026.in_not => halui.spindle.increase
# --- SPNDECR ---
net Spndecr     <=  hm2_5i25.0.gpio.027.in_not => halui.spindle.decrease
but change fixed at 100 rev / min, for example : I have
M3 S200 , increase adds 100 to each press button , and I want 20 or 50.
How to set up a step change from 100 to 50 or 20 or 30 ?

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

More
24 Sep 2016 18:26 #80861 by BigJohnT
What version of LinuxCNC are you using?

JT

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

More
24 Sep 2016 19:02 #80864 by cmorley
It is not configurable - other then changing the source code.

from command.c:
	case EMCMOT_SPINDLE_INCREASE:
	    rtapi_print_msg(RTAPI_MSG_DBG, "SPINDLE_INCREASE");
	    if (emcmotStatus->spindle.speed > 0) {
		emcmotStatus->spindle.speed += 100; //FIXME - make the step a HAL parameter
	    } else if (emcmotStatus->spindle.speed < 0) {
		emcmotStatus->spindle.speed -= 100;
	    }
	    break;

	case EMCMOT_SPINDLE_DECREASE:
	    rtapi_print_msg(RTAPI_MSG_DBG, "SPINDLE_DECREASE");
	    if (emcmotStatus->spindle.speed > 100) {
		emcmotStatus->spindle.speed -= 100; //FIXME - make the step a HAL parameter
	    } else if (emcmotStatus->spindle.speed < -100) {
		emcmotStatus->spindle.speed += 100;
	    }
	    break;

Chris M
The following user(s) said Thank You: dinkata

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

More
25 Sep 2016 05:20 #80875 by dinkata

What version of LinuxCNC are you using?

LinuxCNC 2.7.7
DISPLAY=gmoccapy

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

More
25 Sep 2016 05:25 #80876 by dinkata
Chris M wrote :

from command.c:

Where is this ?
How to edit ?

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

More
25 Sep 2016 07:41 #80880 by cmorley
src/emc/motion/command.c

Most users don't compile the source code, they use the binaries.
You would need to get the source code, change the code and recompile.

this is an old explanation of how to build from source:
wiki.linuxcnc.org/cgi-bin/wiki.pl?Instal..._or_8_04_from_source
hopefully someone else could suggest a more current guide.

Chris M

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

More
25 Sep 2016 07:54 #80881 by dinkata

src/emc/motion/command.c

I have installed
www.linuxcnc.org/linuxcnc-2.7-wheezy.iso
Can I do something there ?

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

More
25 Sep 2016 10:07 - 25 Sep 2016 10:24 #80891 by dinkata
Am I wrong or is it a bug .
I use button halui.spindle-override.increase , halui.spindle-override.decrease
Spindle speed blink
Last edit: 25 Sep 2016 10:24 by dinkata.

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

More
26 Sep 2016 09:29 - 26 Sep 2016 09:30 #80924 by pippin88

It is not configurable - other then changing the source code.

from command.c:
	case EMCMOT_SPINDLE_INCREASE:
	    rtapi_print_msg(RTAPI_MSG_DBG, "SPINDLE_INCREASE");
	    if (emcmotStatus->spindle.speed > 0) {
		emcmotStatus->spindle.speed += 100; //FIXME - make the step a HAL parameter
	    } else if (emcmotStatus->spindle.speed < 0) {
		emcmotStatus->spindle.speed -= 100;
	    }
	    break;

	case EMCMOT_SPINDLE_DECREASE:
	    rtapi_print_msg(RTAPI_MSG_DBG, "SPINDLE_DECREASE");
	    if (emcmotStatus->spindle.speed > 100) {
		emcmotStatus->spindle.speed -= 100; //FIXME - make the step a HAL parameter
	    } else if (emcmotStatus->spindle.speed < -100) {
		emcmotStatus->spindle.speed += 100;
	    }
	    break;

Chris M


Could spindle-override be used, which has a scale property?
# Spindle override 
#mux allows us to choose between the two values. mux2.n.out defaults to .in0 if mux2.n.sel is not called
setp mux2.0.in0 0.1
setp mux2.0.in1 0.05
net spinshift mux2.0.sel <= hm2_7i43.0.7i76.0.0.input-02 #shift white
net spinoverride halui.spindle-override.scale <= mux2.0.out
net spinup <= hm2_7i43.0.7i76.0.0.input-00 #up orange 
net spindown <= hm2_7i43.0.7i76.0.0.input-01 #down blue
net spinup => halui.spindle-override.increase
net spindown => halui.spindle-override.decrease

I'm having issues with this at present in gmoccapy, but works in axis.
Last edit: 26 Sep 2016 09:30 by pippin88.

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

Moderators: newbynobiHansU
Time to create page: 0.113 seconds
Powered by Kunena Forum