Question about matrix_kb

08 Feb 2017 14:21 #87560 by Niko
I'm using matrix_kb to decode a keyboard and the inputs are also connected to rotary switches . The button work just fine but for some reason I can't get it to work well with the rotary switches . If I turn the quickly sometimes the position is wrong . And for jog increment that is not acceptable . I played around with the user thread but that does not seem to help . Right now it's at 2ms .
Also I'll need to add multiplexed outputs. I looked at the code but with my limited knowledge I couldn't understand how to implement that .

08 Feb 2017 22:47 #87614 by k-1
what you means for rotary switch? ... similar to 0,1,2,3, ..... selector switch (these link show one )? or rotary encoder (these other show this one) .... for shure is possible a simulation of rotary encoder for jog increment use .... I think you must use first debounce comp for filtering electrical noise .... than you can use all input pin (I hope 4-6 max) for detect when you rotate to sx or dx .... after these you are able to perform an encoder counter to use for jog positioning .... but it is one thing to do if you have no other solutions. Once you have your encoder signal can follow these link ....

N.B. a rouge and nasty encoder perform 512 pulse/revolution (some old one 128ppr ... but I know some simple and plastic you can find on ebay +/- 7-16£/$) .... so you have at last 512x4 count for revolution ... more than rotary switch. ....

I hope these help
09 Feb 2017 07:49 #87635 by Niko
The inputs are from selector switches . They are wired in binary code . Two are two bit and one of them is three bits long . Axis selection, Jog increment and jog speeds . The component sometimes misses the signal from the switch . If you use it slowly it works but in practice it could be necessary to change the jog speed quickly and instead of the slowest setting it sometimes returns the signals for the fastest setting . Direct wiring would fix this all together but I'd like to keep this original . This being a selector switch I'd assume they give the correct combination for the position every time .

What does this component react to ? The state or the transition between states ?

09 Feb 2017 08:33 - 09 Feb 2017 08:46 #87638 by k-1

these is yours old post? So ArcEye explain to you real well as it work.... your post is from 2012 and i suppose you use sometime your machine .... so the suspect is your contact is a little bit dirty or worn .... you feel this would be? have you checked?

For shure there is a man for matrix_kb ... .... and you can find out the code and read it the code ...You can?

thanks I not know these comp ....but I see something of souspicius for your case :

Perform all requested functions. Should be run in a slow thread for effective debouncing.

so if slow thread is from 250ms to 20ms for example and if you rotate very quickly ... I do not think you can take advantage of debouncing ... so the result that you will not be sequential but random .... 20ms is not an amount of time so small ... it is still faintly perceptible by man ... so that human actions must also take account of this little time ....

so the best approach for jogging is use encoder ....

i hope these help.
Last Edit: 09 Feb 2017 08:46 by k-1.
09 Feb 2017 08:34 #87639 by rodw
I think you might be better off using a mux component for your rotary switches. mux4 gives you the 2 bit solution. Nothing gets triggered on an edge so it will be more reliable

Here is how I did it for encoder scale selection. Some people have liked the little tutorial I wrote as part of my build.
09 Feb 2017 08:47 - 09 Feb 2017 08:48 #87642 by k-1
@rodow: well done!

Last Edit: 09 Feb 2017 08:48 by k-1.
The following user(s) said Thank You: rodw
09 Feb 2017 11:09 #87648 by Niko
This is on a new machine, which poses new problems .
front panel This is the panel in question .
Some of these go directly to inputs on the cnc but some pas through a multiplexing board which not only takes inputs but has multiple outputs on the same strobe . It's an 8x5 configuration . The spindle and feed override and encoder go directly to the mesa cards .
The real issues now are how to get the matrix_kb component to work well with the PCB and how to get output lines from that component . The user thread is a 2ms right now . response on the keys is good .


P.S. Today I found out that the component has shifted the inputs .
All buttons are in the corresponding row but in a new column .
I'll experiment with the thread speed .
09 Feb 2017 11:40 #87651 by rodw
I might be out of line here but seeing you are using Mesa cards, have you considered using the Mesa 7i73 Pendant Interface to drive your keyboard?
09 Feb 2017 12:09 #87653 by Niko
I preffer the 7i70 and 71/72 cards as they are 24v capable . And the 7i77 has good support for the MPG .
09 Feb 2017 15:56 #87670 by k-1
I'm curious ... have you solved with matrix_kb and your switch? How?

Time to create page: 0.140 seconds
Powered by Kunena Forum