Jog increments using a 6 position selector switch

More
25 Jul 2012 00:45 #22425 by BigJohnT
You just have to wire the 6 position selector switch for the mux4
Position   Input 1   Input 2   Input 3
1                Off          Off          Off
2                On          Off          Off
3                Off          On          Off
4                On          On          Off
5                Off          Off           On
6                On          Off          On

and use an expanded version of my selector code.

John

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

More
25 Jul 2012 00:50 - 25 Jul 2012 00:53 #22426 by cmorley
You could use 2 mux 16, if debounce is important.

Or wire the switch to multiplex the inputs.

Just another idea :)
Last edit: 25 Jul 2012 00:53 by cmorley.

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

More
26 Jul 2012 03:16 #22473 by jmelson
cmorley wrote:

You could use 2 mux 16, if debounce is important.

Or wire the switch to multiplex the inputs.

Just another idea :)

If you have a one-pole N-position switch, you can build a simple
binary encoder with some diodes so as to get the maximum
functions from the minimum number of digital inputs.

Jon

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

More
26 Jul 2012 10:15 #22477 by andypugh
jmelson wrote:

If you have a one-pole N-position switch, you can build a simple
binary encoder with some diodes so as to get the maximum
functions from the minimum number of digital inputs.


Thinking about this, I am not sure you need the diodes. Is there any reason that a given switch-pole can't pull down several input pins? I don't see any issue with connecting DIO pins to each other.

a 3-bit gray code can encode 8 positions, (I would suggest gray-code for this, not binary)
en.wikipedia.org/wiki/Gray_code has tables for 2, 3 and 4 bits.
This also saves GPIO pins.

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

More
26 Jul 2012 15:58 #22492 by jmelson
andypugh wrote:

jmelson wrote:

If you have a one-pole N-position switch, you can build a simple
binary encoder with some diodes so as to get the maximum
functions from the minimum number of digital inputs.


Thinking about this, I am not sure you need the diodes. Is there any reason that a given switch-pole can't pull down several input pins? I don't see any issue with connecting DIO pins to each other.

Well, except that the single-pole switch contacts would short the DIO pins together,
whether that position on the switch was selected or not,
so they would all be common. That's why the diodes are needed, so that
various switch settings will be able to select different combinations of
DIO pins.

Jon

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

More
26 Jul 2012 19:20 #22497 by andypugh
jmelson wrote:[/quote]
Well, except that the single-pole switch contacts would short the DIO pins together,[/quote]

Ah. Yes. I think I must have still been asleep when I posted that.

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

More
27 Jul 2012 03:49 - 27 Jul 2012 03:52 #22504 by jmelson
jmelson wrote:[qoute]

If you have a one-pole N-position switch, you can build a simple
binary encoder with some diodes so as to get the maximum
functions from the minimum number of digital inputs.

Jon[/quote]
Here's a link to a drawing of my pendant that works this way :
pico-systems.com/images/minimill_pendant.pdf

and here's the hal code to go with it :
pico-systems.com/codes/minimill/pendant.hal

This uses my USC or UPC digital inputs, so the ppmc.0.din.##.in
are the digital input pins, those would need to be replaced with
whatever digital inputs you are using in your system.
It uses digital inputs to bring in the MPG A and B channels
since all the encoder counters were already in use.
The scale factors of 0.000025, etc. are because this is
a 100 cycle/rev encoder, so it provides 400 counts/rev.
or 4 counts per detent.

It includes feed-override and spindle-override as well as
jogging the axes.

I should mention that in this system, the digital inputs are
sourcing, ie. you ground them to indicate a signal on
that input, hence the polarity of the diodes. If your
digital inputs are sinking, meaning you supply a
positive voltage to them, the diodes should have their
polarity reversed.

Jon
Last edit: 27 Jul 2012 03:52 by jmelson. Reason: mention diode polarity

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

Time to create page: 0.081 seconds
Powered by Kunena Forum