Set Default Value for Rotary Encoder-Knob

More
19 Oct 2015 14:39 #63923 by DaPeace
Hello, I have the following problem. Ive connected 2 Rotary Encoder for Spindle-Override and Feed-Override. Both work but everytime i start the GUI i have to rotate the Encoder to "100%" before a start. Sometimes i forget that and the Spindle is only working on 50% of the Speed which can kill the bit real quick. Is there a possibility to set the encoder-value to a value before connecting it to the poti? Or any other solution for that problem?

Regards, Jan

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

More
19 Oct 2015 23:30 #63963 by andypugh
I think that default override values are set in the [DISPLAY] section of the INI file.
www.linuxcnc.org/docs/html/config/ini-config.html

DEFAULT_SPINDLE_SPEED and DEFAULT_LINEAR_VELOCITY, I think, though that isn't what the docs say.

If that doesn't work then I can imagine a way to do it in the postgui HAL file, but try the INI file first.

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

More
20 Oct 2015 17:34 #63995 by DaPeace
Hello Andy, thanks for the answer but thats not really the solution.
My problem is, that the encoder is getting value 0 when its connected to the gui on startup.
The gui (in my case gmoccapy) is showing 0 for feed-override and 50 for spindle-override when its started and i have to turn the knob to get the 100% everytime i start the machine.
I have DEFAULT_LINEAR_VELOCITY = 4.00 at the moment..
But gui shows 0 at startup when it gets the value of the encoder.

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

More
20 Oct 2015 17:49 #63996 by andypugh
Do you have the *.*. direct-value bits set by any chance?

linuxcnc.org/docs/html/man/man1/halui.1.html

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

More
20 Oct 2015 22:45 - 20 Oct 2015 22:47 #64009 by DaPeace
I have connected the to signals following way:
halfile:
loadrt encoder num_chan=4
addf encoder.update-counters base-thread
addf encoder.capture-position servo-thread
setp encoder.1.position-scale 100
setp encoder.0.position-scale 100


setp encoder.0.x4-mode 1
setp encoder.1.x4-mode 1

net feedenca encoder.0.phase-A <= arduino.digital-in-05
net feedencb encoder.0.phase-B <= arduino.digital-in-06
net spindlenca encoder.1.phase-A <= arduino.digital-in-08
net spindlencb encoder.1.phase-B <= arduino.digital-in-12


custom_postgui-file

setp gmoccapy.jog-speed.count-enable TRUE
setp gmoccapy.feed-override.count-enable TRUE
setp gmoccapy.spindle-override.analog-enable TRUE
setp gmoccapy.feed-override.analog-enable TRUE

net feedenc-counts encoder.0.position gmoccapy.feed-override.direct-value
net spindleenc-position encoder.1.position gmoccapy.spindle-override.direct-value
setp gmoccapy.jog-speed.count-enable TRUE
setp gmoccapy.jog-speed.direct-value 500
setp gmoccapy.jog-speed.counts 35
Last edit: 20 Oct 2015 22:47 by DaPeace.

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

More
20 Oct 2015 23:11 #64010 by andypugh
I don't know how to configure Gmoccapy.
However, I think that your setup looks wrong.

In the case of halui overrides you connect the encoder to the "counts" pin and disable "direct value"

The the value starts of at 100% and increases or decreases as the encoder counts change, rather than taking a direct value from the encoder (which will always start at zero).

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

More
20 Oct 2015 23:54 #64012 by DaPeace
Andy you are my hero of the day. connecting the pins to count did the trick. Im not sure why i did connect it to direct-value but i think thats because of a tutorial ive found via google..

Thank you very much.

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

Time to create page: 0.076 seconds
Powered by Kunena Forum