Changing MPG step rate with a switch

More
26 May 2025 23:43 #329182 by slowpoke
Changing MPG step rate with a switch was created by slowpoke
I have a MPG encoder that has 100 detents and scaled on my lathe X axis for 0.001" increments. All working great.
Once in a while I need to turn to a dimension tighter than 0.001" When I need to do this I tweak my ini file to make the MPG increments 0.0001"

I would prefer to have a toggle switch to toggle between regular(0.001") and sensitive (0.0001") mode, and be able to toggle it as required and not have to restart LinuxCNC.

Is this possible and if so how would I go about it?

Thanks,

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

More
27 May 2025 01:44 #329187 by PCW
Replied by PCW on topic Changing MPG step rate with a switch
Typically you would use a mux component for this.
In you case (only 2 increments) you could use mux2

Something like:

loadrt mux2
addf mux2.0 servo thread
setp mux2.0.in0  0.0001
setp mux2.0.in1 0.001
net jog-increment-select mux2.0.sel  some_old_input_bit
net jog-increment mux2.0.out

 (your signal names and select pin names will be different)

 
The following user(s) said Thank You: Unlogic, slowpoke

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

More
28 May 2025 02:26 - 28 May 2025 02:26 #329286 by rodw
Replied by rodw on topic Changing MPG step rate with a switch
There is actually a good MPG example in the docs with xyz axis and scale selection. It uses parallel port pins but it works on any platform.
Last edit: 28 May 2025 02:26 by rodw.
The following user(s) said Thank You: slowpoke

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

Time to create page: 0.056 seconds
Powered by Kunena Forum