Variable weighting, potentially analog switch interest check

kelvinhall05

01 Mar 2020, 03:45

Hey guys

I've been thinking about designing a switch using electromagnets to provide weighting that can be changed with, say, a potentiometer or something. Depending on how electromagnets change when a regular magnet is brought near, these switches would also have the potential to be analog in addition to the on-the-fly adjustable weighting.

Would anyone be interested in this? As a "super rough and half the idea" proof of concept, here's a switch I put together with some magnets from an old hard drive and a black Alps switch. Works great albeit with sightly reduced travel since I couldn't be bothered hand sanding more than like 1mm off the slider.

https://photos.app.goo.gl/NfV5U1prtpjTqKUN9

Would love to hear if this is worth pursuing, and would also love to hear from some "magnet experts" or whatever as I'm not exactly sure how to make or use an electromagnet for this purpose. Thanks!

EDIT: I know the switch is missing a switch plate, I had to modify the legs of it a tiny bit because they scraped the bottom magnet. I put it in later and if I were to solder it into a board it would work like a regular switch.

Aetasserenus

01 Mar 2020, 11:15

I had the same idea a couple of days ago, I haven't done any research to speak of, but it should be possible to program the tactile slope for the switch as well in a similar setup. I even think you could make a switch that would have the ability to toggle between a clicky and silent switch on the fly, enabling a mute button on the keyboard that could be pressed when there are people that might be disturbed by the noise otherwise.

squizzler

02 Mar 2020, 18:17

I have previously spent an idle moment speculating as to whether a pneumatic 'spring' could be used in keyboard switches. This would make it very easy to adjust the resistance: simply adjust the pressure until you get a spring rate that suits, just like a mountain biker will tune their bicycle suspension to their own body weight. I suspect this arrangement could take a similar arrangement to a membrane board, except that the membrane with rubber domes is replaced by a "bubble wrap" array of air chambers under each key linked by small air passages to the filling valve just like a miniaturised inflatable mattress. The Topre system shows that analogue - or at least adjustable height sensing - can work with rubber membrane and presumably also with an inflatable membrane.

User avatar
vvp

03 Mar 2020, 13:49

squizzler wrote:
02 Mar 2020, 18:17
I have previously spent an idle moment speculating as to whether a pneumatic 'spring' could be used in keyboard switches.
No, it would be too expensive. You would need precise components and good seals to avoid air leaking. And even with them you would need to add pressure from time to time. Moreover the force curve would be highly non-linear (adiabatic process). Or you would need to have big air chambers to limit non-linearity. Or you would need two chambers (positive and negative) for each switch to linearize the force curve a bit - just as bicycle shocks do it now.

User avatar
Blaise170
ALPS キーボード

06 Mar 2020, 16:33

For analog switches magnets often work the best in my experience, they have a pretty linear force curve until you bottom out the switch at which point the force curve increases dramatically. You don't need electromagnets at all, there are a huge number of magnetic switches that already exist, albeit unusable since they are so old.

kelvinhall05

06 Mar 2020, 16:56

Blaise170 wrote:
06 Mar 2020, 16:33
For analog switches magnets often work the best in my experience, they have a pretty linear force curve until you bottom out the switch at which point the force curve increases dramatically. You don't need electromagnets at all, there are a huge number of magnetic switches that already exist, albeit unusable since they are so old.
Electromagnets would allow me to change the weighting on the fly.

User avatar
XMIT
[ XMIT ]

06 Mar 2020, 19:00

Power and latency are concerns. You're not the first to have had this idea.

User avatar
vvp

07 Mar 2020, 10:50

Why latency? Lets assume that the key press time takes 10 ms. That is very on the quick side of typing. A standard 8 kHz PWM control loop will do easily. You will need at most 2 ADCs channels per key. It may be doable with one ADC per key. I'm not sure. The bigger problem will be probably the number of PWM outputs and whether to use:
  • A single driving transistor with a shotky diode per key. One can do this probably with 1 MCU per about 20 keys. The limit is the number of ADC channels. The driving can be done using multiplexing.
  • Possibly more energy efficient but much more complicated two half-bridges per key. There are MCUs with at least 3 advanced timers - that means 1 MCU per 6 keys at worst. Well, this option does not look good.
Timing/latency will not be a problem. It is only a single PI controller per key to control the requested current depending on the key press depth. An MCU can run about 40 ADC channels, and 20 PI controllers, some table lookups and some multiplexing and PWM channel adjustments with about 8 kHz frequency. Looks doable within 125 µs.

Actually, even the power consumption may not be such a big problem. Add a weak spring to each key and then you need to power the key only when it is depressed. That means powering at most 10 keys at a time (since we have only 10 fingers). The keyboard looks doable within about 5 W.

The problem with this approach is that the keyboard would be very expensive. Nobody would buy it except a few very rich people.

Just some brainstorming :D

kelvinhall05

07 Mar 2020, 15:47

vvp wrote:
07 Mar 2020, 10:50
Why latency? Lets assume that the key press time takes 10 ms. That is very on the quick side of typing. A standard 8 kHz PWM control loop will do easily. You will need at most 2 ADCs channels per key. It may be doable with one ADC per key. I'm not sure. The bigger problem will be probably the number of PWM outputs and whether to use:
  • A single driving transistor with a shotky diode per key. One can do this probably with 1 MCU per about 20 keys. The limit is the number of ADC channels. The driving can be done using multiplexing.
  • Possibly more energy efficient but much more complicated two half-bridges per key. There are MCUs with at least 3 advanced timers - that means 1 MCU per 6 keys at worst. Well, this option does not look good.
Timing/latency will not be a problem. It is only a single PI controller per key to control the requested current depending on the key press depth. An MCU can run about 40 ADC channels, and 20 PI controllers, some table lookups and some multiplexing and PWM channel adjustments with about 8 kHz frequency. Looks doable within 125 µs.

Actually, even the power consumption may not be such a big problem. Add a weak spring to each key and then you need to power the key only when it is depressed. That means powering at most 10 keys at a time (since we have only 10 fingers). The keyboard looks doable within about 5 W.

The problem with this approach is that the keyboard would be very expensive. Nobody would buy it except a few very rich people.

Just some brainstorming :D
I dunno man, I'll give it a shot anyway. Magnets aren't *that* expensive, my only problem now is that until I can prove that it works and works well, I have to handwind all my electromagnets lmao.

I do think this has potential, I dunno.

User avatar
XMIT
[ XMIT ]

07 Mar 2020, 18:24

Sorry if I was not clear. My latency concern was for dynamically varying force on the switch while typing by, say, varying current through a solenoid. There would be on the order of a hundred to a thousand sample points in a 4mm key stroke and a desire to vary force within a very tight window. I'm not thinking milliseconds, I'm thinking microseconds.

I'm not totally convinced 125us is fast enough for consistent key feel when typing really quickly.

User avatar
vvp

07 Mar 2020, 19:34

@kelvinhall05:
Give it a try if you are going to enjoy the project. Just do not assume some kind of market for it. It is not about the price of magnets. You almost for sure can make it with springs, coils and iron cores only. It is more about how complicated the electronics and the firmware will be.

@XMIT:
OK so we differ mostly about whether 8 kHz driving loop is enough. I'm not totally convinced as well but chances are very good. I think it will be enough since 8 kHz control loop is typically used for driving three phase sinusoidal motors using e.g. space vector PWM. They do not feel vibrating at 8 kHz while turning. I think keys will feel the same. They are lighter which makes the problem more severe. But they also need much smaller forces which makes the problem less severe. You can make the PWM frequency less important by making the coils with higher inductance.
There is also problem how quick one can tune the PI controller. I think we can make it settle to about correct value in 8 cycles. That still leaves about 10 "precise"(*) points of force feedback during 4 mm travel. I wager it is good enough. Kelvinhall05 will let us know when he implements it :D

(*) This leads to force feedback being wrong by 0.4 mm. It will be probably better. The movement is analog and the PI controller will be catching up all the time. My guess is the force feedback will be positionally wrong by 0.1-0.2 mm. Also all errors will be repeatable and consistent across typing at the same speed. We can actually make up for PI slowness by anticipating it in the shape of travel-force curve (at one typing speed). Looks good enough to me.

Post Reply

Return to “Keyboards”