First of all, how do you detect the finger pressure if the switch is bottomed out by the solenoid? If you solve that one, then I think position sensing with coils could work and would be easier from a construction perspective than pressure sensors. Maybe a 2 stage spring so it doesn't bottom out with just solenoid power, so finger pressure still adds a tiny measurable distance to the movement? I think this would be an issue unless the springs are VERY precisely made and don't get weaker with use. I think some other solution is needed.
I do not think that springs need to be precise. Moreover, we can calibrate the driving current of solenoid if changes in spring constant would be a problem. Maybe I should have written it in more detail. Notice that:
F
user(x) + F
drivingCoil(x,i
driving) = k*x + F
positionSensingElement(x,i
sensing)
Functions use capiltal letter. Variables/constants use small letter.
k - spring force constant
x - how much the switch stem is pressed (length)
F
user(x) is a function defining force the switch is going to exert on user finger when the switch is pressed x mm down. This is the force/travel diagram of the switch. The function returns different values when stem is going down and different when it is going up. This force travel diagram will be defined in firmware. This is what we want to change and experiment with.
F
drivingCoil(x,i
driving) is a function which defines the force solenoid is exerting on the ferrite core when the core is at position x and the driving coil current is i
driving. This is a proper function. It has a partial inverse function I
driving(x,F
drivingCoil) which tells us how big driving current we must feed to the driving coil to get given force on the switch stem (which is at position x). Our firmware needs to control one variable current source for as many switches as we need to drive at once. (E.g. in case of 6KRO we need 6 variable current sources and a demultiplexer to feed them to the selected switches.)
F
positionSensingElement(x,i
sensing) is the function defining what force our sensing element will exert on the switch stem at position x. i
sensing is average sensing current. We can consider only average current here since we are going to sense in the range of MHz, while the stem resonant frequency is somewhere in 200Hz range. This is well separated. Anyway this can be probably designed so that it is negligible. So lets assume F
positionSensingElement(x,i
sensing) = 0 for all x and the applicable i
sensing. But even if we could not assume this is 0, it does not change the rest fundamentally (it is not a show stopper).
Ok, so the simplified equation:
F
user(x) + F
drivingCoil(x,i
driving) = k*x
From this: F
drivingCoil(x,i
driving) = k * x - F
user(x)
Or more simpler: F
drivingCoil = k * x - F
user(x)
x is what we will sense using our sense coil
k is a constant
F
user(x) is what we read from our force/travel diagram in firmware - so is is known number for each applicable x
So we can compute required driving coil force (F
drivingCoil) for any given position x!
Now from the function I
driving(x,F
drivingCoil) we can compute the required driving current and control the current source to apply it to driving solenoid.
In other words we use I
driving(x, k * x - F
user(x))
Notice that is only a function of x which we can get from the sensing coil.
Definition of the function I
driving(x,F
drivingCoil) is defined in firmware. It can be derived analytically but it is probably just easier to define it as a table in firmware and interpolate.
So I do not see any problem with measuring user force, since we actually do not need to measure it. It is enough to measure how much the switch is pressed. Based on that we will provide the right counter force (using spring and driving coil) as required from whatever force/travel diagram user likes most.
<EDIT> If we use 100cN springs and say 60cN solenoid, we could still use position sensing to detect when to release the solenoid (actuate at any chosen position, release when the position is less than it would be for the combined solenoid force + say 20cN?), but the "tactility" will be less than if we use a stronger solenoid and bottom out the switch with it. </EDIT>
This looks like you want to drive the solenoid with either full current or nothing. I assume a variable current source. Now, micro-controller typically do not have it. But it not a big deal we probaly can simulate it with DAC & ADC (and maybe also amplifier) combo.
The forces will depend on the switch stem position AND the spring constant. Inconsistent springs = different pressure at a given position (position sensing) OR different position for a given pressure (pressure sensing). Position sensing will be like normal switches in terms of actuating at a certain position, pressure sensing would of course be based on pressure instead, so the switches could actuate in different positions based on the spring force.
Ok, it really looks like you assume only digital driving for the driving coil.
Can be a small resistive strain gauge, I found some 5.1mm x 4.2mm 350 ohm gauges for about 50 cents each.
Can you post link to the part specification?
<EDIT> Another way to do it is to mount the pressure sensor between the solenoid and keyboard case. That way all pressure measured will be due to the weight of the solenoid / keycap and finger pressure. Don't have to worry about contacts going to moving parts. </EDIT>
OK, but that means that you need to compute the pressure user exerts at the switch the same way I indicated above because solenoid force is added to the user press force. So you probably already found the answer to your first question.
<EDIT> Lots of editing, sorry... Looks like you're calculating the power based on 0.06s pulse per press... What if you hold the key down, like when playing a game? I'd assume the solenoid needs to run continuously in that case, so they may need an external supply and possibly even heat dissipation of some sort. </EDIT>
That is the reason I mentioned 6KRO only. If user presses more than 6 keys at once then any additional keys will not get the solenoid assist and user defined force/travel diagram. They will be only dump linear switches. 6KRO looks like possible almost for sure. 60KRO is not possible from USB power only.
Additional power source would be a show stopper for me. I already have enough cables around here