Rotary Selector Switches & Resistors

More
11 Dec 2024 18:10 #316477 by fully_defined
Replied by fully_defined on topic Rotary Selector Switches & Resistors
I just purchased 1N4148 diodes , 0,1μF capacitors , and 12-position switches , to build some multiplexed rotary switches. I have no idea if this is going to work, but this is where I will start.

Unfortunately, the information needed to accomplish this is scattered all over the internet, with no solid how-to guide for LinuxCNC. If I am successful, and I have the patience, I may make such a thing when the time comes.

Once I have that part figured out, I will move on to rotary encoders for feed and speed overrides. And then after that, matrix keyboards. Hopefully the 7i73 has enough inputs for all of this, because I do not want any HMI inputs connected to the 7i96s board - only sensors.

I have also read about Arduinos being used for this kind of thing. I have an R4 Minima that is capable of emulating a keyboard through its type-c port, so I may use that for buttons. I don't know yet if that's a good idea or a bad idea.

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

More
12 Dec 2024 01:05 #316490 by rodw
Replied by rodw on topic Rotary Selector Switches & Resistors
Most things in LCNC are digital (on/off) inputs. Thats why we suggested you use a binary switch. Additionally, dealing with digital inputs with a MUX component uses less pins. eg MUX4 only needs 2 pins for 4 seperate states. Here is part of my build thread that deals with using binary switches and MUX4 for scale selection. The same process applies if using a MUX8 or larger
forum.linuxcnc.org/show-your-stuff/32029...build?start=20#85279
 

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

More
12 Dec 2024 01:17 #316492 by fully_defined
Replied by fully_defined on topic Rotary Selector Switches & Resistors
Rod, thanks. I get it now that digital/binary is the name of the game here.

I just need to know how to build the switch, physically. Peter recommended the diodes I linked to, offline, and I got the capacitors for debounce. I had problems in EdingCNC with the selector switch not behaving, when I wired it to the UIO-10 with one input per position. I supposed debounce caps would probably help in the transition between positions.

I found your page earlier, but your photos aren't very clear and the thread is 76 pages long. Is there a page there that is especially relevant to my goal?

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

More
12 Dec 2024 01:40 - 12 Dec 2024 01:42 #316493 by PCW
Replied by PCW on topic Rotary Selector Switches & Resistors
Here's a 4 --> 2 diode encoder with polarity adjusted
for 7I73 inputs that have built-in pullup resistors
(so read high if unconnected)

 

This browser does not support PDFs. Please download the PDF to view it: Download PDF



Note that mux_generic has built in debouncing so the capacitors should not
be needed if you use mux_generic to select jog increments etc.
Attachments:
Last edit: 12 Dec 2024 01:42 by PCW. Reason: typos

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

More
12 Dec 2024 12:16 #316511 by rodw
Replied by rodw on topic Rotary Selector Switches & Resistors

I found your page earlier, but your photos aren't very clear and the thread is 76 pages long. Is there a page there that is especially relevant to my goal?
 

I linked you to the exact post on about page 3 ot 4

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

More
12 Dec 2024 21:48 #316555 by dm17ry
Replied by dm17ry on topic Rotary Selector Switches & Resistors
if you can write a little bit in c - just make a one-liner custom component... something like

pin in float vin;
pin out float factor;
function _;
;;
if (vin < THRESH1) factor = 0.1;
else if (vin < THRESH10) factor = 1.0;
else if (vin < THRESH100) factor = 10.0;
else factor = 100.0;

select THRESH values somewhere in between values you get in corresponding switch positions.
the resistor thing should work fine. i did that for 24-pos switch, though with stm32 adc (12bit?)..
 
Attachments:
The following user(s) said Thank You: fully_defined

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

More
13 Dec 2024 01:16 #316557 by fully_defined
Replied by fully_defined on topic Rotary Selector Switches & Resistors
I knew I wasn't crazy. Thanks for posting this!

I am at the very beginning of my LinuxCNC experience, and I don't know what I don't know. The only thing I know for sure is it isn't well documented.

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

More
15 Dec 2024 04:11 #316690 by fully_defined
Replied by fully_defined on topic Rotary Selector Switches & Resistors

I found your page earlier, but your photos aren't very clear and the thread is 76 pages long. Is there a page there that is especially relevant to my goal?
 
I linked you to the exact post on about page 3 ot 4
 

Rod, I know your heart is in the right place, but there was one picture that could even be considered relevant, and it wasn't very informative. I just want to see a good, clear picture of a mux4 rotary switch, built to the specification described. That way I can compare a photograph of a known standard and a print (provided by PCW) and actually learn something from it.

Google has been a complete wash, with zero results using the search terms I have tried. Just for fun, I asked ChatGPT and they really came through for me. Why did I ever doubt AI?

File Attachment:

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

More
15 Dec 2024 04:30 #316691 by fully_defined
Replied by fully_defined on topic Rotary Selector Switches & Resistors

if you can write a little bit in c - just make a one-liner custom component... something like

pin in float vin;
pin out float factor;
function _;
;;
if (vin < THRESH1) factor = 0.1;
else if (vin < THRESH10) factor = 1.0;
else if (vin < THRESH100) factor = 10.0;
else factor = 100.0;

select THRESH values somewhere in between values you get in corresponding switch positions.
the resistor thing should work fine. i did that for 24-pos switch, though with stm32 adc (12bit?)..
 
 

Allow me to revisit this. Again, I appreciate your post, but I literally know nothing about LinuxCNC AT ALL, so this code means nothing to me. I need to see it in context, where it goes, what it does, etc. I need to see the entire process of implementing it. This stuff is impossible to cross reference in the limited online documentation. Where there is information, none of it is in a practical format to learn from, because I have to know what I'm looking at to understand what it says.

It's why this forum gets the same questions over and over and over. When people finally do squeeze answers out of the same 5 people, they are almost always half answers and the OP usually gives up before they got what they were looking for. Or, they are 10-year-old 80-page epics with the answer buried on page 50.

Seriously, these guys would save so much time for themselves (and others!) if they published a 3-axis mill use case and a 2-axis lathe use case, with an example each of AC servos, Clearpath, & stepper drivers. Leave the hard questions for Ethercat and weirdo setups with only one person on Earth using it.

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

More
15 Dec 2024 06:12 #316692 by fully_defined
Replied by fully_defined on topic Rotary Selector Switches & Resistors

Here's a 4 --> 2 diode encoder with polarity adjusted
for 7I73 inputs that have built-in pullup resistors
(so read high if unconnected)

 

This browser does not support PDFs. Please download the PDF to view it: Download PDF



Note that mux_generic has built in debouncing so the capacitors should not
be needed if you use mux_generic to select jog increments etc.
 

This was helpful. I got the diodes and switches and took some pictures and built a little graphic:

File Attachment:


I guess the thing that confused me was what exactly it's doing; checking for continuity? Like, "okay, I see a path through bit 0 to ground, but not through bit 1, so I recognize switch position 1, and now I will do what I am assigned to do when I see that scenario." Right? That wasn't a mystery so much as just needing to visualize it. It didn't help that there are exactly zero photographs of such a thing labelled as such in the wild, at least that I could find.

Again, thanks for the print. It was genuinely helpful.

Now I've got to figure out if Mux8 is worth taking up 4 inputs, instead of doing the resistor thing, for the mode selector switch. I just did a Google search for "LinuxCNC mode selector switch," and the pickings are slim. Here is a Fanuc-style mode selector switch taken directly from the console of the Mitsubishi M64s control I used to run on a 3-axis mill:

File Attachment:


Obviously I don't need DNC, but I want to be able to access the rest of these modes with a hardware switch. That's my goal.

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

Time to create page: 0.084 seconds
Powered by Kunena Forum